From 1761a54ee26251e1b2a97f0fe72d6fabb4061bf7 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 27 Oct 2026 15:25:19 +0900 Subject: [PATCH 1/2] Add deep cloning for vocabulary objects Copy nested vocabulary values without hydration leaking back to the source. Preserve graph aliases, defaults and historical portable referrers, while dropping cached JSON-LD and signed representations. Add regression coverage, a copy benchmark and manual guidance. Design was reviewed with Claude Code (claude-opus-5-5) and Codex (gpt-6-astra); prose was reviewed with Claude Code (claude-fable-5-1). Fixes https://github.com/fedify-dev/fedify/issues/1243 https://github.com/fedify-dev/fedify/issues/1242 https://github.com/fedify-dev/fedify/pull/1246 https://github.com/fedify-dev/hollo/issues/643 Assisted-by: Codex:gpt-6.1-sol Assisted-by: Claude Code:claude-fable-5-1 --- CHANGES.md | 7 + changes.d/vocab/deep-clone.md | 9 + claude-plugin/skills/fedify/SKILL.md | 8 + docs/manual/vocab.md | 68 +- .../src/internal/portable-dereference.test.ts | 34 + .../src/internal/portable-dereference.ts | 21 + .../src/__snapshots__/class.test.ts.deno.snap | 8179 ++++++++++++++++- .../src/__snapshots__/class.test.ts.node.snap | 8179 ++++++++++++++++- .../src/__snapshots__/class.test.ts.snap | 8179 ++++++++++++++++- packages/vocab-tools/src/class.ts | 18 +- packages/vocab-tools/src/constructor.ts | 58 +- packages/vocab-tools/src/deep-clone.ts | 160 + packages/vocab/src/deep-clone.test.ts | 347 + packages/vocab/src/gateway.test.ts | 86 +- .../vocab/src/signed-representation.test.ts | 21 + packages/vocab/src/vocab.bench.ts | 41 +- 16 files changed, 24369 insertions(+), 1046 deletions(-) create mode 100644 changes.d/vocab/deep-clone.md create mode 100644 packages/vocab-tools/src/deep-clone.ts create mode 100644 packages/vocab/src/deep-clone.test.ts diff --git a/CHANGES.md b/CHANGES.md index 2b001cae7..2667a8253 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -213,6 +213,11 @@ To be released. ### @fedify/vocab + - Added `deepClone()` to vocabulary objects to copy nested objects before + resolving their properties, keeping the source graph unchanged. Replacement + values are copied too. Use `clone()` when a shallow copy is sufficient. + [[#1243], [#1337]] + - Added vocabulary support for the [FEP-6757] draft, which marks ActivityPub content with explicit copyright license URIs. [[#1212], [#1241]] @@ -233,6 +238,8 @@ To be released. [FEP-6757]: https://w3id.org/fep/6757 [#1212]: https://github.com/fedify-dev/fedify/issues/1212 [#1241]: https://github.com/fedify-dev/fedify/pull/1241 +[#1243]: https://github.com/fedify-dev/fedify/issues/1243 +[#1337]: https://github.com/fedify-dev/fedify/pull/1337 ### @fedify/vocab-runtime diff --git a/changes.d/vocab/deep-clone.md b/changes.d/vocab/deep-clone.md new file mode 100644 index 000000000..e41ab977a --- /dev/null +++ b/changes.d/vocab/deep-clone.md @@ -0,0 +1,9 @@ +--- +links: + '#1243': https://github.com/fedify-dev/fedify/issues/1243 + '#1337': https://github.com/fedify-dev/fedify/pull/1337 +--- + - Added `deepClone()` to vocabulary objects to copy nested objects before + resolving their properties, keeping the source graph unchanged. Replacement + values are copied too. Use `clone()` when a shallow copy is sufficient. + [[#1243], [#1337]] diff --git a/claude-plugin/skills/fedify/SKILL.md b/claude-plugin/skills/fedify/SKILL.md index a6f9d121e..ec3a8ba29 100644 --- a/claude-plugin/skills/fedify/SKILL.md +++ b/claude-plugin/skills/fedify/SKILL.md @@ -265,6 +265,14 @@ in-tree *src/webfinger*. `fromJsonLd()` and `toJsonLd()` are asynchronous; always `await` them. +`clone()` is shallow: it copies property arrays but shares nested vocabulary +objects and URLs. In Fedify 2.5.0 and later, use synchronous `deepClone()` to +resolve nested properties without hydrating the source's objects. Replacement +values are copied too. Each copied node keeps its own default loaders and +verifier; second-argument options override only the root. The copy drops cached +JSON-LD and retained signed representations, so retain the received document +when its exact representation matters and sign copies again when needed. + > [!WARNING] > `crossOrigin: "trust"` on vocabulary deserialization trusts embedded > objects without re-fetching. Treat it as you would diff --git a/docs/manual/vocab.md b/docs/manual/vocab.md index 5ddced37a..0006e7ca6 100644 --- a/docs/manual/vocab.md +++ b/docs/manual/vocab.md @@ -951,31 +951,59 @@ if its cached JSON-LD contains an embedded object with its own `@context`, the accessor re-parses that object on each call. Hydrating that returned object does not update the nested instance stored in the source or clone. -If you need to preserve the received representation while resolving properties, -keep the received JSON-LD document. To resolve properties in a separate object -graph, serialize and re-parse the object before hydrating any properties rather -than using `clone()`: +### Deep copies + +*This API is available since Fedify 2.5.0.* + +Use `deepClone()` when you need to resolve properties without hydrating nested +objects held by the source. It copies the stored vocabulary graph, including +any objects you supply as replacement values. For example, you can inspect a +quote request through a copy while keeping the original to echo in a response: ~~~~ typescript twoslash -import { Create } from "@fedify/vocab"; -import type { DocumentLoader } from "@fedify/vocab-runtime"; -declare const original: Create; -declare const documentLoader: DocumentLoader; -declare const contextLoader: DocumentLoader; +import { Accept, QuoteRequest } from "@fedify/vocab"; +declare const request: QuoteRequest; // ---cut-before--- -const options = { documentLoader, contextLoader }; -const copy = await Create.fromJsonLd(await original.toJsonLd(), options); -// Resolve properties on copy while keeping original separate: -const note = await copy.getObject(options); -if (note != null) await note.getAttribution(options); +const resolving = request.deepClone(); +const instrument = await resolving.getInstrument(); +if (instrument != null) await instrument.getAttribution(); + +// The response embeds the original, whose nested objects were not hydrated: +const response = new Accept({ object: request }); ~~~~ -This round trip separates nested vocabulary objects; it does not preserve the -original JSON bytes. Pass any custom loaders again, as in the example above. -The copy also does not inherit trust in embedded objects. Under the -[origin-based security model](#origin-based-security-model), accessors may fetch -cross-origin objects again, even if the original already hydrated them. The -fetched data may have changed, or the fetch may fail. +Like `clone()`, `deepClone()` accepts constructor-compatible replacement values, +such as `request.deepClone({ summary: "Updated" })`. Nested vocabulary objects, +URLs and byte arrays are copied; immutable scalar values and opaque +cryptographic keys are shared. Repeated references to one object remain shared +within the copy. If the graph refers back to the source itself, including when +you pass the source as a replacement value, that reference becomes a separate +copy of the source's pre-update values. It does not point at the updated root. + +Each copied object retains its own default document loader, context loader, +tracer, portable-object verifier and base URL. The optional second argument +accepts the same loader and verifier options as `clone()`, but it overrides +only the root's defaults. An option left `undefined` keeps the root's existing +default for that option. By contrast, `clone()` uses only the options passed +to it. + +The copy retains embedded-object trust and the portable restrictions that +`clone()` preserves, but does not inherit positive verification evidence. +Historical portable referrers within the graph are copied without applying +replacement values; referrers outside the graph continue to point at the +original external objects. + +`deepClone()` does not fetch remote objects or serialize and re-parse JSON-LD. +It walks the entire stored graph synchronously. Prefer `clone()` when a +shallow copy is sufficient. When copying a subclass, `deepClone()` calls its +`clone()` override. Such overrides must return fresh, compatible instances +and are responsible for their own side effects. + +Cached JSON-LD and retained signed representations are discarded at every +copied node. The copy therefore reflects modeled property values, not unknown +JSON-LD properties or the original document's formatting. Sign the copy again +if it needs a valid proof. To preserve the exact received representation, +keep the received JSON-LD document and use the copy only for inspection. Looking up remote objects diff --git a/packages/vocab-runtime/src/internal/portable-dereference.test.ts b/packages/vocab-runtime/src/internal/portable-dereference.test.ts index 3dc49e647..5c2c2a0e2 100644 --- a/packages/vocab-runtime/src/internal/portable-dereference.test.ts +++ b/packages/vocab-runtime/src/internal/portable-dereference.test.ts @@ -4,15 +4,49 @@ import type { DocumentLoader } from "../docloader.ts"; import { parseIri, withGatewayHints } from "../url.ts"; import { createScopedContextLoader } from "./jsonld-cache.ts"; import { + copyPortableProvenance, createSnapshotContextLoader, getPortableGatewayCandidates, getReferrerGateways, + isInPortableChain, isPortableIri, recordPortableReferrer, + retargetPortableReferrer, } from "./portable-dereference.ts"; const hrefs = (urls: URL[]) => urls.map((url) => url.href); +test("retargetPortableReferrer() only reconnects existing provenance", () => { + const id = parseIri("ap://did:key:z6Mkabc/actor"); + const parent = { id, gateways: [new URL("https://original.example")] }; + const copiedParent = { id, gateways: [new URL("https://copy.example")] }; + const source = {}; + const copy = {}; + let calls = 0; + retargetPortableReferrer(copy, () => { + calls++; + return copiedParent; + }); + deepStrictEqual(calls, 0); + ok(!isInPortableChain(copy)); + recordPortableReferrer(parent, source, "https://example.com/property"); + copyPortableProvenance(source, copy); + retargetPortableReferrer(copy, () => undefined); + deepStrictEqual(hrefs(getReferrerGateways(copy, id)!), [ + "https://original.example/", + ]); + retargetPortableReferrer(copy, (original) => { + ok(original === parent); + return copiedParent; + }); + deepStrictEqual(hrefs(getReferrerGateways(copy, id)!), [ + "https://copy.example/", + ]); + deepStrictEqual(hrefs(getReferrerGateways(source, id)!), [ + "https://original.example/", + ]); +}); + test("isPortableIri()", () => { ok(isPortableIri(parseIri("ap://did:key:z6Mkabc/actor"))); ok(isPortableIri(parseIri("ap+ef61://did:key:z6Mkabc/actor"))); diff --git a/packages/vocab-runtime/src/internal/portable-dereference.ts b/packages/vocab-runtime/src/internal/portable-dereference.ts index 532042b3a..20d1bf866 100644 --- a/packages/vocab-runtime/src/internal/portable-dereference.ts +++ b/packages/vocab-runtime/src/internal/portable-dereference.ts @@ -198,6 +198,27 @@ export function copyPortableProvenance(from: object, to: object): void { }); } +/** + * Reconnects an existing historical referrer to its independent graph copy. + * Does not create provenance or add verification or collection-context evidence. + * An unresolved referrer remains external history. Like the other provenance + * helpers, this is for generated vocabulary code, not a public trust API. + * @internal + */ +export function retargetPortableReferrer( + copy: object, + resolve: (original: object) => object | undefined, +): void { + const provenance = provenances.get(copy); + if (provenance?.referrer == null) return; + const object = resolve(provenance.referrer.object); + if (object == null) return; + provenances.set(copy, { + ...provenance, + referrer: { ...provenance.referrer, object }, + }); +} + /** * Recognizes an FEP-ef61 compatible identifier to dereference as a portable * object. diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 36da7f438..6accbe781 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -52,6 +52,7 @@ import { parseCompatibleEf61Reference, type PortableResponseClaim, recordPortableReferrer, + retargetPortableReferrer, rejectMalformedCompatibleReference, warnUnverifiableEmbeddedObject } from \\"@fedify/vocab-runtime/internal/portable-dereference\\"; @@ -81,6 +82,99 @@ function inspectIri(iri: URL): string { try { return formatIri(iri); } catch { return iri.href; } } +interface DeepCloneContext { + value(value: T): T; +} + +interface DeepCloneDescriptor { + create(source: object): object; + copy(destination: object, context: DeepCloneContext): void; +} + +const deepCloneDescriptors = new Map(); + +function getDeepCloneDescriptor(value: object): DeepCloneDescriptor | undefined { + let prototype: object | null = globalThis.Object.getPrototypeOf(value); + while (prototype != null) { + const descriptor = deepCloneDescriptors.get(prototype); + if (descriptor != null) return descriptor; + prototype = globalThis.Object.getPrototypeOf(prototype); + } + return undefined; +} + +function deepCloneGraph(source: object, root: T): T { + const memo = new Map(); + const destinations = new Set(); + const shells: object[] = []; + let next = 0; + + function enqueue(original: object, destination: object): void { + if (destination == null || typeof destination !== \\"object\\" || + original === destination || destinations.has(destination) || + !globalThis.Object.prototype.isPrototypeOf.call( + globalThis.Object.getPrototypeOf(original), destination + ) || getDeepCloneDescriptor(destination) == null) { + throw new TypeError(\\"clone() must return a fresh, compatible instance.\\"); + } + destinations.add(destination); + shells.push(destination); + } + + const context: DeepCloneContext = { + value(value: V): V { + if (value == null || typeof value !== \\"object\\") return value; + const existing = memo.get(value); + if (existing != null) return existing as V; + if (value instanceof URL) { + const copy = new URL(value.href); + memo.set(value, copy); + return copy as V; + } + if (value instanceof Uint8Array) { + const copy = new Uint8Array(value); + memo.set(value, copy); + return copy as V; + } + const descriptor = getDeepCloneDescriptor(value); + // Other supported scalars (Temporal, LanguageString, Intl.Locale, + // CryptoKey and class constructors) are shared as immutable values. + if (descriptor == null) return value; + const copy = descriptor.create(value); + enqueue(value, copy); + memo.set(value, copy); + return copy as V; + }, + }; + + function drain(): void { + while (next < shells.length) { + const shell = shells[next++]; + getDeepCloneDescriptor(shell)!.copy(shell, context); + } + } + + // The effective root includes replacements. References to the source root + // instead receive a separate copy of its pre-update values. + enqueue(source, root); + drain(); + + // Discover historical root ancestry without substituting replacement values + // into it. The resolver deliberately returns undefined in this first pass. + const count = shells.length; + for (let i = 0; i < count; i++) { + retargetPortableReferrer(shells[i], (original) => { + if (original === source) context.value(source); + return undefined; + }); + } + drain(); + for (const shell of shells) { + retargetPortableReferrer(shell, (original) => memo.get(original)); + } + return root; +} + function isValidLanguageTag(language: string): boolean { try { new Intl.Locale(normalizeLanguageTag(language)); @@ -1343,8 +1437,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Object.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -2373,7 +2467,292 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Object { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Object; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Object; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length; i++) { + const value = node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment[i]; + if (value != null && typeof value === \\"object\\") { + node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length; i++) { + const value = node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length; i++) { + const value = node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.length; i++) { + const value = node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.length; i++) { + const value = node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator[i]; + if (value != null && typeof value === \\"object\\") { + node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length; i++) { + const value = node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[i]; + if (value != null && typeof value === \\"object\\") { + node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length; i++) { + const value = node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length; i++) { + const value = node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length; i++) { + const value = node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[i]; + if (value != null && typeof value === \\"object\\") { + node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length; i++) { + const value = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i]; + if (value != null && typeof value === \\"object\\") { + node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_7UpwM3JWcXhADcscukEehBorf6k_replies.length; i++) { + const value = node.#_7UpwM3JWcXhADcscukEehBorf6k_replies[i]; + if (value != null && typeof value === \\"object\\") { + node.#_7UpwM3JWcXhADcscukEehBorf6k_replies[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.length; i++) { + const value = node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.length; i++) { + const value = node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[i]; + if (value != null && typeof value === \\"object\\") { + node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.length; i++) { + const value = node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[i]; + if (value != null && typeof value === \\"object\\") { + node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.length; i++) { + const value = node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag[i]; + if (value != null && typeof value === \\"object\\") { + node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length; i++) { + const value = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length; i++) { + const value = node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length; i++) { + const value = node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[i]; + if (value != null && typeof value === \\"object\\") { + node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length; i++) { + const value = node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[i]; + if (value != null && typeof value === \\"object\\") { + node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length; i++) { + const value = node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.length; i++) { + const value = node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length; i++) { + const value = node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[i]; + if (value != null && typeof value === \\"object\\") { + node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.length; i++) { + const value = node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.length; i++) { + const value = node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy[i]; + if (value != null && typeof value === \\"object\\") { + node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.length; i++) { + const value = node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.length; i++) { + const value = node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.length; i++) { + const value = node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations.length; i++) { + const value = node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations[i]; + if (value != null && typeof value === \\"object\\") { + node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length; i++) { + const value = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i] = context.value(value); + } + } +} }); } + async #fetchAttachment( url: URL, options: { @@ -19267,8 +19646,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Emoji.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -19323,7 +19702,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const clone = super.clone(values, options) as unknown as Emoji; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Emoji { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -19763,8 +20206,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link ChatMessage.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -19858,7 +20301,100 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];quote?: Object | URL | null;quoteUrl?: URL | null;quoteAuthorization?: QuoteAuthorization | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): ChatMessage { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as ChatMessage; + + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === \\"object\\") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } +} }); } + async #fetchQuote( url: URL, options: { @@ -21689,8 +22225,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Activity.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -21997,7 +22533,127 @@ instruments?: (Object | URL)[];} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Activity { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Activity; + + for (let i = 0; i < node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length; i++) { + const value = node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length; i++) { + const value = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length; i++) { + const value = node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length; i++) { + const value = node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[i]; + if (value != null && typeof value === \\"object\\") { + node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length; i++) { + const value = node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[i]; + if (value != null && typeof value === \\"object\\") { + node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length; i++) { + const value = node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[i] = context.value(value); + } + } +} }); } + async #fetchActor( url: URL, options: { @@ -26617,8 +27273,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link EmojiReact.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -26679,7 +27335,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as EmojiReact; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): EmojiReact { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -27149,8 +27875,8 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link PropertyValue.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -27222,7 +27948,73 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +name?: string | LanguageString | null;value?: string | LanguageString | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): PropertyValue { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as PropertyValue; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as PropertyValue; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); +} }); } + /** The name of a property. */ get name(): (string | LanguageString | null) { @@ -27921,8 +28713,8 @@ unit?: string | null;numericalValue?: Decimal | null;} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Measure.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -27994,7 +28786,73 @@ unit?: string | null;numericalValue?: Decimal | null;} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +unit?: string | null;numericalValue?: Decimal | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Measure { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Measure; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Measure; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); +} }); } + /** The name of the unit, according to the Ontology of units of Measure * classification. The recommended unit for countable items is \`\\"one\\"\`. * @@ -28611,8 +29469,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link AnnounceAuthorization.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -28693,7 +29551,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];interactingObject?: Object | URL | null;interactionTarget?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): AnnounceAuthorization { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as AnnounceAuthorization; + + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } +} }); } + async #fetchInteractingObject( url: URL, options: { @@ -30138,8 +31082,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link AnnounceRequest.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -30200,7 +31144,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as AnnounceRequest; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): AnnounceRequest { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -30719,8 +31733,8 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link InteractionPolicy.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -30831,7 +31845,108 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: InteractionRule | null;canQuote?: InteractionRule | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): InteractionPolicy { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as InteractionPolicy; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as InteractionPolicy; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.length; i++) { + const value = node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.length; i++) { + const value = node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.length; i++) { + const value = node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.length; i++) { + const value = node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce[i]; + if (value != null && typeof value === \\"object\\") { + node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.length; i++) { + const value = node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote[i]; + if (value != null && typeof value === \\"object\\") { + node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote[i] = context.value(value); + } + } +} }); } + /** The sub-policy specifying who can feature the actor in a * {@link FeaturedCollection}. * @@ -31827,8 +32942,8 @@ manualApprovals?: (URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link InteractionRule.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -31948,7 +33063,89 @@ manualApprovals?: (URL)[];} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +automaticApproval?: URL | null; +automaticApprovals?: (URL)[];manualApproval?: URL | null; +manualApprovals?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): InteractionRule { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as InteractionRule; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as InteractionRule; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.length; i++) { + const value = node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.length; i++) { + const value = node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval[i] = context.value(value); + } + } +} }); } + /** URIs of actors or collections whose interactions are automatically * approved without requiring manual review by the post author. * @@ -32546,8 +33743,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link LikeAuthorization.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -32628,7 +33825,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];interactingObject?: Object | URL | null;interactionTarget?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): LikeAuthorization { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as LikeAuthorization; + + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } +} }); } + async #fetchInteractingObject( url: URL, options: { @@ -34072,8 +35355,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link LikeRequest.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -34134,7 +35417,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as LikeRequest; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): LikeRequest { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -34544,8 +35897,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link ReplyAuthorization.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -34626,7 +35979,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];interactingObject?: Object | URL | null;interactionTarget?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): ReplyAuthorization { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as ReplyAuthorization; + + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } +} }); } + async #fetchInteractingObject( url: URL, options: { @@ -36070,8 +37509,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link ReplyRequest.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -36132,7 +37571,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as ReplyRequest; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): ReplyRequest { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -36542,8 +38051,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link QuoteAuthorization.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -36624,7 +38133,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];interactingObject?: Object | URL | null;interactionTarget?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): QuoteAuthorization { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as QuoteAuthorization; + + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } +} }); } + async #fetchInteractingObject( url: URL, options: { @@ -38067,8 +39662,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link QuoteRequest.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -38129,7 +39724,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as QuoteRequest; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): QuoteRequest { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -38716,8 +40381,8 @@ urls?: ((URL | Link))[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Translation.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -38894,7 +40559,103 @@ urls?: ((URL | Link))[];} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +language?: Intl.Locale | null;translator?: Application | Group | Organization | Person | Service | URL | null; +translators?: (Application | Group | Organization | Person | Service | URL)[];original?: URL | null;sourceUpdated?: Temporal.Instant | null;basis?: URL | null;url?: URL | Link | null; +urls?: ((URL | Link))[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Translation { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Translation; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Translation; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.length; i++) { + const value = node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7.length; i++) { + const value = node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7[i]; + if (value != null && typeof value === \\"object\\") { + node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW.length; i++) { + const value = node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length; i++) { + const value = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i] = context.value(value); + } + } +} }); } + /** The translated language. Publishers must match a language in the * containing object's content, name, or summary map. * @@ -40629,8 +42390,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link FeatureAuthorization.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -40711,7 +42472,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];interactingObject?: Object | URL | null;interactionTarget?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): FeatureAuthorization { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as FeatureAuthorization; + + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } +} }); } + async #fetchInteractingObject( url: URL, options: { @@ -42149,8 +43996,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link FeatureRequest.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -42211,7 +44058,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as FeatureRequest; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): FeatureRequest { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -42798,8 +44715,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Collection.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -43030,7 +44947,163 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];totalItems?: number | null;current?: CollectionPage | URL | null;first?: CollectionPage | URL | null;last?: CollectionPage | URL | null;items?: (Object | Link | URL)[];likesOf?: Object | URL | null;sharesOf?: Object | URL | null;repliesOf?: Object | URL | null;inboxOf?: Object | URL | null;outboxOf?: Object | URL | null;followersOf?: Object | URL | null;followingOf?: Object | URL | null;likedOf?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Collection { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Collection; + + for (let i = 0; i < node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.length; i++) { + const value = node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.length; i++) { + const value = node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[i]; + if (value != null && typeof value === \\"object\\") { + node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.length; i++) { + const value = node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[i]; + if (value != null && typeof value === \\"object\\") { + node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { + const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.length; i++) { + const value = node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.length; i++) { + const value = node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.length; i++) { + const value = node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.length; i++) { + const value = node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.length; i++) { + const value = node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.length; i++) { + const value = node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.length; i++) { + const value = node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.length; i++) { + const value = node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[i] = context.value(value); + } + } +} }); } + /** A non-negative integer specifying the total number of objects contained by * the logical view of the collection. This number might not reflect the actual * number of items serialized within the {@link Collection} object instance. @@ -49828,8 +51901,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link OrderedCollection.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -49904,7 +51977,86 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];totalItems?: number | null;current?: CollectionPage | URL | null;first?: CollectionPage | URL | null;last?: CollectionPage | URL | null;likesOf?: Object | URL | null;sharesOf?: Object | URL | null;repliesOf?: Object | URL | null;inboxOf?: Object | URL | null;outboxOf?: Object | URL | null;followersOf?: Object | URL | null;followingOf?: Object | URL | null;likedOf?: Object | URL | null;items?: (Object | Link | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): OrderedCollection { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as OrderedCollection; + + for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { + const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + } + } +} }); } + async #fetchItem( url: URL, options: { @@ -50878,8 +53030,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link FeaturedCollection.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -50960,7 +53112,86 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];totalItems?: number | null;current?: CollectionPage | URL | null;first?: CollectionPage | URL | null;last?: CollectionPage | URL | null;likesOf?: Object | URL | null;sharesOf?: Object | URL | null;repliesOf?: Object | URL | null;inboxOf?: Object | URL | null;outboxOf?: Object | URL | null;followersOf?: Object | URL | null;followingOf?: Object | URL | null;likedOf?: Object | URL | null;items?: (Object | Link | URL)[];topic?: Hashtag | null;discoverable?: boolean | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): FeaturedCollection { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as FeaturedCollection; + + for (let i = 0; i < node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic.length; i++) { + const value = node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic[i]; + if (value != null && typeof value === \\"object\\") { + node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic[i] = context.value(value); + } + } +} }); } + /** A single {@link Hashtag} object that represents the main topic or category * of this featured collection. * @@ -51592,8 +53823,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link FeaturedItem.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -51674,7 +53905,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];featuredObject?: Object | URL | null;featureAuthorization?: FeatureAuthorization | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): FeaturedItem { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as FeaturedItem; + + for (let i = 0; i < node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.length; i++) { + const value = node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.length; i++) { + const value = node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[i] = context.value(value); + } + } +} }); } + async #fetchFeaturedObject( url: URL, options: { @@ -53215,8 +55532,8 @@ endpoints?: (URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link DidService.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -53299,7 +55616,81 @@ endpoints?: (URL)[];} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +endpoint?: URL | null; +endpoints?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): DidService { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as DidService; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as DidService; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.length; i++) { + const value = node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint[i] = context.value(value); + } + } +} }); } + /** A network address, such as an HTTP URL, at which services operate on behalf * of a DID subject. * @@ -53747,8 +56138,8 @@ endpoints?: (URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Export.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -53788,7 +56179,56 @@ endpoints?: (URL)[];} const clone = super.clone(values, options) as unknown as Export; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +endpoint?: URL | null; +endpoints?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Export { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -54295,8 +56735,8 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link DataIntegrityProof.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -54409,7 +56849,87 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | null;proofPurpose?: \\"assertionMethod\\" | \\"authentication\\" | \\"capabilityInvocation\\" | \\"capabilityDelegation\\" | \\"keyAgreement\\" | null;proofValue?: Uint8Array | null;created?: Temporal.Instant | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): DataIntegrityProof { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as DataIntegrityProof; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as DataIntegrityProof; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.length; i++) { + const value = node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue.length; i++) { + const value = node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue[i] = context.value(value); + } + } +} }); } + /** The cryptographic suite used to create the proof. * */ @@ -55690,8 +58210,8 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link CryptographicKey.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -55766,7 +58286,80 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +owner?: Application | Group | Organization | Person | Service | URL | null;publicKey?: CryptoKey | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): CryptographicKey { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as CryptographicKey; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as CryptographicKey; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length; i++) { + const value = node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[i]; + if (value != null && typeof value === \\"object\\") { + node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[i] = context.value(value); + } + } +} }); } + async #fetchOwner( url: URL, options: { @@ -56957,8 +59550,8 @@ controller?: Application | Group | Organization | Person | Service | URL | null; * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Multikey.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -57033,7 +59626,80 @@ controller?: Application | Group | Organization | Person | Service | URL | null; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +controller?: Application | Group | Organization | Person | Service | URL | null;publicKey?: CryptoKey | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Multikey { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Multikey; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Multikey; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length; i++) { + const value = node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[i] = context.value(value); + } + } +} }); } + async #fetchController( url: URL, options: { @@ -58162,8 +60828,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Agreement.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -58244,7 +60910,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];stipulates?: Commitment | null;stipulatesReciprocal?: Commitment | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Agreement { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Agreement; + + for (let i = 0; i < node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates.length; i++) { + const value = node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates[i]; + if (value != null && typeof value === \\"object\\") { + node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal.length; i++) { + const value = node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal[i] = context.value(value); + } + } +} }); } + /** The primary {@link Commitment} associated with the agreement. This * commitment satisfies the primary {@link Intent} of the corresponding * {@link Proposal}. @@ -58953,8 +61705,8 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Commitment.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -59026,7 +61778,87 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +satisfies?: URL | null;resourceQuantity?: Measure | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Commitment { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Commitment; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Commitment; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.length; i++) { + const value = node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies[i]; + if (value != null && typeof value === \\"object\\") { + node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length; i++) { + const value = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i] = context.value(value); + } + } +} }); } + /** The {@link Intent} of a {@link Proposal} that this commitment * satisfies. The value is the proposal's URI with a * [fragment](https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Fragment) @@ -59754,8 +62586,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Intent.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -59866,7 +62698,101 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measure | null;availableQuantity?: Measure | null;minimumQuantity?: Measure | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Intent { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Intent; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Intent; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.length; i++) { + const value = node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length; i++) { + const value = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.length; i++) { + const value = node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[i]; + if (value != null && typeof value === \\"object\\") { + node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.length; i++) { + const value = node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[i] = context.value(value); + } + } +} }); } + /** The type of economic transaction. The value of this property should be * either \`\\"deliverService\\"\` or \`\\"transfer\\"\`. * @@ -60824,8 +63750,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Proposal.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -60932,7 +63858,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];purpose?: string | null;publishes?: Intent | null;reciprocal?: Intent | null;unitBased?: boolean | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Proposal { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Proposal; + + for (let i = 0; i < node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.length; i++) { + const value = node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.length; i++) { + const value = node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[i]; + if (value != null && typeof value === \\"object\\") { + node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[i] = context.value(value); + } + } +} }); } + /** The type of proposal. Possible values are \`\\"offer\\"\` and \`\\"request\\"\`. * */ @@ -61743,8 +64755,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Accept.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -61805,7 +64817,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Accept; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Accept { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -62168,46 +65250,121 @@ targets?: (Object | URL)[];result?: Object | URL | null; results?: (Object | URL)[];origin?: Object | URL | null; origins?: (Object | URL)[];instrument?: Object | URL | null; instruments?: (Object | URL)[];} -, +, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + tracerProvider?: TracerProvider, + verifyPortableObject?: PortableObjectVerifier, + } = {}, + ) { + super(values, options);} + + /** + * Clones this instance, optionally updating it with the given values. + * + * This is a shallow copy: property arrays are copied, but nested objects + * and URLs are shared with this instance. Dereferencing accessors can cache + * fetched objects in the instance whose accessor is called. Hydrating a + * shared nested object through the clone can affect the original as well, + * and can change JSON-LD output when either is embedded in another + * object. Hydrating a top-level property of the clone does not update this + * instance's property. + * + * To resolve properties without sharing nested objects, use + * {@link Add.deepClone} before hydration. + * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) + * for details, including how cached JSON-LD affects serialization. + * + * A clone never inherits a signed JSON-LD representation retained by + * \`signObject()\`: the clone may differ from the document that the proof + * covers, so embedding the original secured JSON in a parent document + * would be wrong. Sign the clone again if it has to be embedded as a + * secured child. + * + * @param values The values to update the clone with. + * @param options The options to use for cloning. + * @returns The cloned instance with its own property arrays. Nested objects + * and URLs are shared with this instance. + */ + override clone( + values: + { +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} + + = {}, options: { documentLoader?: DocumentLoader, contextLoader?: DocumentLoader, - tracerProvider?: TracerProvider, verifyPortableObject?: PortableObjectVerifier, - } = {}, - ) { - super(values, options);} + } = {} + ): Add { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + // @ts-ignore: \$warning is not recognized as a property, but it is. + options = { ...options, \$warning: this._warning }; + } + const clone = super.clone(values, options) as unknown as Add; + return clone; + } /** - * Clones this instance, optionally updating it with the given values. + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. * - * This is a shallow copy: property arrays are copied, but nested objects - * and URLs are shared with this instance. Dereferencing accessors can cache - * fetched objects in the instance whose accessor is called. Hydrating a - * shared nested object through the clone can affect the original as well, - * and can change JSON-LD output when either is embedded in another - * object. Hydrating a top-level property of the clone does not update this - * instance's property. + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. - * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) - * for details, including how cached JSON-LD affects serialization. + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. * - * A clone never inherits a signed JSON-LD representation retained by - * \`signObject()\`: the clone may differ from the document that the proof - * covers, so embedding the original secured JSON in a parent document - * would be wrong. Sign the clone again if it has to be embedded as a - * secured child. + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. * - * @param values The values to update the clone with. - * @param options The options to use for cloning. - * @returns The cloned instance with its own property arrays. Nested objects - * and URLs are shared with this instance. + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 */ - override clone( - values: - { + override deepClone(values: +{ id?: URL | null; attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; @@ -62232,26 +65389,21 @@ targets?: (Object | URL)[];result?: Object | URL | null; results?: (Object | URL)[];origin?: Object | URL | null; origins?: (Object | URL)[];instrument?: Object | URL | null; instruments?: (Object | URL)[];} - - = {}, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - verifyPortableObject?: PortableObjectVerifier, - } = {} - ): Add { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - // @ts-ignore: \$warning is not recognized as a property, but it is. - options = { ...options, \$warning: this._warning }; - } - const clone = super.clone(values, options) as unknown as Add; - return clone; += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Add { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); } - + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -62630,8 +65782,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Announce.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -62692,7 +65844,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Announce; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Announce { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -63606,8 +66828,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Application.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -64158,7 +67380,204 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];preferredUsername?: string | LanguageString | null; +preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; +publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; +services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;preferredLicense?: URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Application { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Application; + + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === \\"object\\") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === \\"object\\") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } +} }); } + /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. * @@ -73961,8 +77380,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link IntransitiveActivity.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -74023,7 +77442,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as IntransitiveActivity; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): IntransitiveActivity { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -74414,8 +77903,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Arrive.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -74476,7 +77965,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Arrive; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Arrive { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -74892,8 +78451,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Article.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -74987,7 +78546,100 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];quote?: Object | URL | null;quoteUrl?: URL | null;quoteAuthorization?: QuoteAuthorization | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Article { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Article; + + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === \\"object\\") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } +} }); } + async #fetchQuote( url: URL, options: { @@ -76591,8 +80243,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Document.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -76686,7 +80338,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];width?: number | null;height?: number | null;digestMultibase?: string | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Document { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** Specifies a hint as to the rendering width in * device-independent pixels of the linked resource. * @@ -77399,8 +81115,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Audio.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -77455,7 +81171,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const clone = super.clone(values, options) as unknown as Audio; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];width?: number | null;height?: number | null;digestMultibase?: string | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Audio { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -77852,8 +81632,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Ignore.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -77914,7 +81694,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Ignore; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Ignore { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -78298,8 +82148,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Block.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -78360,7 +82210,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Block; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Block { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -78781,8 +82701,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link CollectionPage.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -78876,7 +82796,100 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];totalItems?: number | null;current?: CollectionPage | URL | null;first?: CollectionPage | URL | null;last?: CollectionPage | URL | null;items?: (Object | Link | URL)[];likesOf?: Object | URL | null;sharesOf?: Object | URL | null;repliesOf?: Object | URL | null;inboxOf?: Object | URL | null;outboxOf?: Object | URL | null;followersOf?: Object | URL | null;followingOf?: Object | URL | null;likedOf?: Object | URL | null;partOf?: Collection | URL | null;next?: CollectionPage | URL | null;prev?: CollectionPage | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): CollectionPage { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as CollectionPage; + + for (let i = 0; i < node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.length; i++) { + const value = node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.length; i++) { + const value = node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.length; i++) { + const value = node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[i] = context.value(value); + } + } +} }); } + async #fetchPartOf( url: URL, options: { @@ -80832,8 +84845,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Create.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -80894,7 +84907,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Create; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Create { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -81272,8 +85355,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Delete.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -81334,7 +85417,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Delete; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Delete { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -81710,8 +85863,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Dislike.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -81772,7 +85925,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Dislike; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Dislike { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -82312,8 +86535,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Endpoints.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -82450,7 +86673,122 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint?: URL | null;provideClientKey?: URL | null;signClientKey?: URL | null;sharedInbox?: URL | null;uploadMedia?: URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Endpoints { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Endpoints; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Endpoints; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.length; i++) { + const value = node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.length; i++) { + const value = node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint[i]; + if (value != null && typeof value === \\"object\\") { + node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.length; i++) { + const value = node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint[i]; + if (value != null && typeof value === \\"object\\") { + node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.length; i++) { + const value = node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.length; i++) { + const value = node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.length; i++) { + const value = node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia.length; i++) { + const value = node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia[i]; + if (value != null && typeof value === \\"object\\") { + node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia[i] = context.value(value); + } + } +} }); } + /** Endpoint URI so this actor's clients may access remote ActivityStreams * objects which require authentication to access. To use this endpoint, * the client posts an \`x-www-form-urlencoded\` \`id\` parameter with the value @@ -83544,8 +87882,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Event.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -83600,7 +87938,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const clone = super.clone(values, options) as unknown as Event; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Event { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -83998,8 +88400,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Flag.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -84060,7 +88462,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Flag; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Flag { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -84440,8 +88912,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Follow.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -84502,7 +88974,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Follow; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Follow { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -85416,8 +89958,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Group.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -85968,7 +90510,204 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];preferredUsername?: string | LanguageString | null; +preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; +publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; +services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;preferredLicense?: URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Group { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Group; + + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === \\"object\\") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === \\"object\\") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } +} }); } + /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. * @@ -96040,8 +100779,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Link.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -96274,7 +101013,96 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +href?: URL | null;rel?: string | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; +names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];licenses?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Link { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Link; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Link; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.length; i++) { + const value = node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href[i]; + if (value != null && typeof value === \\"object\\") { + node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length; i++) { + const value = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i]; + if (value != null && typeof value === \\"object\\") { + node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length; i++) { + const value = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i] = context.value(value); + } + } +} }); } + /** The target resource pointed to by a {@link Link}. */ get href(): (URL | null) { @@ -98171,8 +102999,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Hashtag.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -98213,7 +103041,57 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const clone = super.clone(values, options) as unknown as Hashtag; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +href?: URL | null;rel?: string | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; +names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];licenses?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Hashtag { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -98591,8 +103469,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Image.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -98647,7 +103525,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const clone = super.clone(values, options) as unknown as Image; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];width?: number | null;height?: number | null;digestMultibase?: string | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Image { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -99045,8 +103987,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Offer.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -99107,7 +104049,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Offer; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Offer { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -99489,8 +104501,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Invite.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -99551,7 +104563,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Invite; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Invite { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -99929,8 +105011,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Join.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -99991,7 +105073,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Join; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Join { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -100369,8 +105521,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Leave.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -100431,7 +105583,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Leave; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Leave { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -100809,8 +106031,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Like.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -100852,26 +106074,96 @@ targets?: (Object | URL)[];result?: Object | URL | null; results?: (Object | URL)[];origin?: Object | URL | null; origins?: (Object | URL)[];instrument?: Object | URL | null; instruments?: (Object | URL)[];} - - = {}, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - verifyPortableObject?: PortableObjectVerifier, - } = {} - ): Like { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - // @ts-ignore: \$warning is not recognized as a property, but it is. - options = { ...options, \$warning: this._warning }; - } - const clone = super.clone(values, options) as unknown as Like; - return clone; + + = {}, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {} + ): Like { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + // @ts-ignore: \$warning is not recognized as a property, but it is. + options = { ...options, \$warning: this._warning }; + } + const clone = super.clone(values, options) as unknown as Like; + return clone; + } + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Like { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); } - + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -101247,8 +106539,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Listen.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -101309,7 +106601,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Listen; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Listen { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -101665,8 +107027,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Mention.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -101707,7 +107069,57 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const clone = super.clone(values, options) as unknown as Mention; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +href?: URL | null;rel?: string | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; +names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];licenses?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Mention { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -102094,8 +107506,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Move.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -102156,7 +107568,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Move; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Move { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -102574,8 +108056,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Note.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -102669,7 +108151,100 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];quote?: Object | URL | null;quoteUrl?: URL | null;quoteAuthorization?: QuoteAuthorization | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Note { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Note; + + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === \\"object\\") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } +} }); } + async #fetchQuote( url: URL, options: { @@ -104270,8 +109845,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link OrderedCollectionPage.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -104359,7 +109934,86 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];totalItems?: number | null;current?: CollectionPage | URL | null;first?: CollectionPage | URL | null;last?: CollectionPage | URL | null;likesOf?: Object | URL | null;sharesOf?: Object | URL | null;repliesOf?: Object | URL | null;inboxOf?: Object | URL | null;outboxOf?: Object | URL | null;followersOf?: Object | URL | null;followingOf?: Object | URL | null;likedOf?: Object | URL | null;partOf?: Collection | URL | null;next?: CollectionPage | URL | null;prev?: CollectionPage | URL | null;items?: (Object | Link | URL)[];startIndex?: number | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): OrderedCollectionPage { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as OrderedCollectionPage; + + for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { + const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + } + } +} }); } + async #fetchItem( url: URL, options: { @@ -105945,8 +111599,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Organization.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -106497,7 +112151,204 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];preferredUsername?: string | LanguageString | null; +preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; +publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; +services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;preferredLicense?: URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Organization { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Organization; + + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === \\"object\\") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === \\"object\\") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } +} }); } + /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. * @@ -116291,8 +122142,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Page.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -116347,7 +122198,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const clone = super.clone(values, options) as unknown as Page; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];width?: number | null;height?: number | null;digestMultibase?: string | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Page { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -117280,8 +123195,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Person.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -117832,7 +123747,204 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];preferredUsername?: string | LanguageString | null; +preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; +publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; +services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;preferredLicense?: URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Person { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Person; + + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === \\"object\\") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === \\"object\\") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } +} }); } + /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. * @@ -127713,8 +133825,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Place.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -127847,7 +133959,86 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];accuracy?: number | null;altitude?: number | null;latitude?: number | null;longitude?: number | null;radius?: number | null;units?: \\"cm\\" | \\"feet\\" | \\"inches\\" | \\"km\\" | \\"m\\" | \\"miles\\" | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Place { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Place; + + for (let i = 0; i < node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units.length; i++) { + const value = node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units[i]; + if (value != null && typeof value === \\"object\\") { + node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units[i] = context.value(value); + } + } +} }); } + /** Indicates the accuracy of position coordinates on a {@link Place} objects. * Expressed in properties of percentage. e.g. \\"94.0\\" means \\"94.0% accurate\\". * @@ -128875,8 +135066,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Profile.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -128944,7 +135135,86 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];describes?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Profile { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Profile; + + for (let i = 0; i < node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.length; i++) { + const value = node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[i] = context.value(value); + } + } +} }); } + async #fetchDescribes( url: URL, options: { @@ -129985,8 +136255,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Question.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -130152,7 +136422,120 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOptions?: (Object | URL)[];closed?: Temporal.Instant | boolean | null;voters?: number | null;quote?: Object | URL | null;quoteUrl?: URL | null;quoteAuthorization?: QuoteAuthorization | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Question { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Question; + + for (let i = 0; i < node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.length; i++) { + const value = node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.length; i++) { + const value = node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === \\"object\\") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } +} }); } + async #fetchExclusiveOption( url: URL, options: { @@ -132836,8 +139219,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Read.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -132898,7 +139281,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Read; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Read { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -133276,8 +139729,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Reject.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -133338,7 +139791,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Reject; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Reject { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -133823,8 +140346,8 @@ relationships?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Relationship.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -133976,7 +140499,102 @@ relationships?: (Object | URL)[];} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];subject?: Object | URL | null;object?: Object | URL | null; +objects?: (Object | URL)[];relationship?: Object | URL | null; +relationships?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Relationship { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Relationship; + + for (let i = 0; i < node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.length; i++) { + const value = node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length; i++) { + const value = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length; i++) { + const value = node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[i] = context.value(value); + } + } +} }); } + async #fetchSubject( url: URL, options: { @@ -136271,8 +142889,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Remove.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -136333,7 +142951,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Remove; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Remove { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -137247,8 +143935,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Service.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -137799,7 +144487,204 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];preferredUsername?: string | LanguageString | null; +preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; +publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; +services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;preferredLicense?: URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Service { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Service; + + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === \\"object\\") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === \\"object\\") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } +} }); } + /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. * @@ -147717,8 +154602,8 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Source.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -147814,7 +154699,74 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];mediaType?: string | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Source { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Source; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Source; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); +} }); } + /** The source content. */ get content(): (string | LanguageString | null) { @@ -148418,8 +155370,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link TentativeAccept.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -148461,26 +155413,96 @@ targets?: (Object | URL)[];result?: Object | URL | null; results?: (Object | URL)[];origin?: Object | URL | null; origins?: (Object | URL)[];instrument?: Object | URL | null; instruments?: (Object | URL)[];} - - = {}, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - verifyPortableObject?: PortableObjectVerifier, - } = {} - ): TentativeAccept { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - // @ts-ignore: \$warning is not recognized as a property, but it is. - options = { ...options, \$warning: this._warning }; - } - const clone = super.clone(values, options) as unknown as TentativeAccept; - return clone; + + = {}, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {} + ): TentativeAccept { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + // @ts-ignore: \$warning is not recognized as a property, but it is. + options = { ...options, \$warning: this._warning }; + } + const clone = super.clone(values, options) as unknown as TentativeAccept; + return clone; + } + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): TentativeAccept { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); } - + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -148858,8 +155880,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link TentativeReject.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -148920,7 +155942,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as TentativeReject; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): TentativeReject { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -149345,8 +156437,8 @@ formerTypes?: (\$EntityType)[];deleted?: Temporal.Instant | null;} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Tombstone.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -149451,7 +156543,72 @@ formerTypes?: (\$EntityType)[];deleted?: Temporal.Instant | null;} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];formerType?: \$EntityType | null; +formerTypes?: (\$EntityType)[];deleted?: Temporal.Instant | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Tombstone { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** On a \`Tombstone\` object, the \`formerType\` property identifies the type of * the object that was deleted. * @@ -150089,8 +157246,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Travel.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -150151,7 +157308,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Travel; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Travel { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -150534,8 +157761,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Undo.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -150596,7 +157823,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Undo; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Undo { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -150977,8 +158274,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Update.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -151039,7 +158336,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Update; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Update { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -151409,8 +158776,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Video.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -151465,7 +158832,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const clone = super.clone(values, options) as unknown as Video; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];width?: number | null;height?: number | null;digestMultibase?: string | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Video { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -151861,8 +159292,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link View.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -151923,7 +159354,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as View; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): View { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 18a627850..3d3ccda38 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -50,6 +50,7 @@ import { parseCompatibleEf61Reference, type PortableResponseClaim, recordPortableReferrer, + retargetPortableReferrer, rejectMalformedCompatibleReference, warnUnverifiableEmbeddedObject } from \\"@fedify/vocab-runtime/internal/portable-dereference\\"; @@ -79,6 +80,99 @@ function inspectIri(iri: URL): string { try { return formatIri(iri); } catch { return iri.href; } } +interface DeepCloneContext { + value(value: T): T; +} + +interface DeepCloneDescriptor { + create(source: object): object; + copy(destination: object, context: DeepCloneContext): void; +} + +const deepCloneDescriptors = new Map(); + +function getDeepCloneDescriptor(value: object): DeepCloneDescriptor | undefined { + let prototype: object | null = globalThis.Object.getPrototypeOf(value); + while (prototype != null) { + const descriptor = deepCloneDescriptors.get(prototype); + if (descriptor != null) return descriptor; + prototype = globalThis.Object.getPrototypeOf(prototype); + } + return undefined; +} + +function deepCloneGraph(source: object, root: T): T { + const memo = new Map(); + const destinations = new Set(); + const shells: object[] = []; + let next = 0; + + function enqueue(original: object, destination: object): void { + if (destination == null || typeof destination !== \\"object\\" || + original === destination || destinations.has(destination) || + !globalThis.Object.prototype.isPrototypeOf.call( + globalThis.Object.getPrototypeOf(original), destination + ) || getDeepCloneDescriptor(destination) == null) { + throw new TypeError(\\"clone() must return a fresh, compatible instance.\\"); + } + destinations.add(destination); + shells.push(destination); + } + + const context: DeepCloneContext = { + value(value: V): V { + if (value == null || typeof value !== \\"object\\") return value; + const existing = memo.get(value); + if (existing != null) return existing as V; + if (value instanceof URL) { + const copy = new URL(value.href); + memo.set(value, copy); + return copy as V; + } + if (value instanceof Uint8Array) { + const copy = new Uint8Array(value); + memo.set(value, copy); + return copy as V; + } + const descriptor = getDeepCloneDescriptor(value); + // Other supported scalars (Temporal, LanguageString, Intl.Locale, + // CryptoKey and class constructors) are shared as immutable values. + if (descriptor == null) return value; + const copy = descriptor.create(value); + enqueue(value, copy); + memo.set(value, copy); + return copy as V; + }, + }; + + function drain(): void { + while (next < shells.length) { + const shell = shells[next++]; + getDeepCloneDescriptor(shell)!.copy(shell, context); + } + } + + // The effective root includes replacements. References to the source root + // instead receive a separate copy of its pre-update values. + enqueue(source, root); + drain(); + + // Discover historical root ancestry without substituting replacement values + // into it. The resolver deliberately returns undefined in this first pass. + const count = shells.length; + for (let i = 0; i < count; i++) { + retargetPortableReferrer(shells[i], (original) => { + if (original === source) context.value(source); + return undefined; + }); + } + drain(); + for (const shell of shells) { + retargetPortableReferrer(shell, (original) => memo.get(original)); + } + return root; +} + function isValidLanguageTag(language: string): boolean { try { new Intl.Locale(normalizeLanguageTag(language)); @@ -1341,8 +1435,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Object.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -2371,7 +2465,292 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Object { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Object; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Object; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length; i++) { + const value = node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment[i]; + if (value != null && typeof value === \\"object\\") { + node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length; i++) { + const value = node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length; i++) { + const value = node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.length; i++) { + const value = node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.length; i++) { + const value = node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator[i]; + if (value != null && typeof value === \\"object\\") { + node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length; i++) { + const value = node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[i]; + if (value != null && typeof value === \\"object\\") { + node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length; i++) { + const value = node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length; i++) { + const value = node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length; i++) { + const value = node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[i]; + if (value != null && typeof value === \\"object\\") { + node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length; i++) { + const value = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i]; + if (value != null && typeof value === \\"object\\") { + node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_7UpwM3JWcXhADcscukEehBorf6k_replies.length; i++) { + const value = node.#_7UpwM3JWcXhADcscukEehBorf6k_replies[i]; + if (value != null && typeof value === \\"object\\") { + node.#_7UpwM3JWcXhADcscukEehBorf6k_replies[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.length; i++) { + const value = node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.length; i++) { + const value = node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[i]; + if (value != null && typeof value === \\"object\\") { + node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.length; i++) { + const value = node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[i]; + if (value != null && typeof value === \\"object\\") { + node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.length; i++) { + const value = node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag[i]; + if (value != null && typeof value === \\"object\\") { + node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length; i++) { + const value = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length; i++) { + const value = node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length; i++) { + const value = node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[i]; + if (value != null && typeof value === \\"object\\") { + node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length; i++) { + const value = node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[i]; + if (value != null && typeof value === \\"object\\") { + node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length; i++) { + const value = node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.length; i++) { + const value = node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length; i++) { + const value = node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[i]; + if (value != null && typeof value === \\"object\\") { + node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.length; i++) { + const value = node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.length; i++) { + const value = node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy[i]; + if (value != null && typeof value === \\"object\\") { + node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.length; i++) { + const value = node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.length; i++) { + const value = node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.length; i++) { + const value = node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations.length; i++) { + const value = node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations[i]; + if (value != null && typeof value === \\"object\\") { + node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length; i++) { + const value = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i] = context.value(value); + } + } +} }); } + async #fetchAttachment( url: URL, options: { @@ -19265,8 +19644,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Emoji.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -19321,7 +19700,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const clone = super.clone(values, options) as unknown as Emoji; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Emoji { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -19761,8 +20204,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link ChatMessage.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -19856,7 +20299,100 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];quote?: Object | URL | null;quoteUrl?: URL | null;quoteAuthorization?: QuoteAuthorization | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): ChatMessage { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as ChatMessage; + + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === \\"object\\") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } +} }); } + async #fetchQuote( url: URL, options: { @@ -21687,8 +22223,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Activity.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -21995,7 +22531,127 @@ instruments?: (Object | URL)[];} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Activity { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Activity; + + for (let i = 0; i < node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length; i++) { + const value = node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length; i++) { + const value = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length; i++) { + const value = node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length; i++) { + const value = node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[i]; + if (value != null && typeof value === \\"object\\") { + node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length; i++) { + const value = node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[i]; + if (value != null && typeof value === \\"object\\") { + node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length; i++) { + const value = node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[i] = context.value(value); + } + } +} }); } + async #fetchActor( url: URL, options: { @@ -26615,8 +27271,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link EmojiReact.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -26677,7 +27333,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as EmojiReact; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): EmojiReact { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -27147,8 +27873,8 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link PropertyValue.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -27220,7 +27946,73 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +name?: string | LanguageString | null;value?: string | LanguageString | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): PropertyValue { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as PropertyValue; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as PropertyValue; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); +} }); } + /** The name of a property. */ get name(): (string | LanguageString | null) { @@ -27919,8 +28711,8 @@ unit?: string | null;numericalValue?: Decimal | null;} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Measure.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -27992,7 +28784,73 @@ unit?: string | null;numericalValue?: Decimal | null;} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +unit?: string | null;numericalValue?: Decimal | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Measure { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Measure; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Measure; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); +} }); } + /** The name of the unit, according to the Ontology of units of Measure * classification. The recommended unit for countable items is \`\\"one\\"\`. * @@ -28609,8 +29467,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link AnnounceAuthorization.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -28691,7 +29549,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];interactingObject?: Object | URL | null;interactionTarget?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): AnnounceAuthorization { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as AnnounceAuthorization; + + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } +} }); } + async #fetchInteractingObject( url: URL, options: { @@ -30136,8 +31080,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link AnnounceRequest.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -30198,7 +31142,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as AnnounceRequest; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): AnnounceRequest { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -30717,8 +31731,8 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link InteractionPolicy.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -30829,7 +31843,108 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: InteractionRule | null;canQuote?: InteractionRule | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): InteractionPolicy { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as InteractionPolicy; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as InteractionPolicy; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.length; i++) { + const value = node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.length; i++) { + const value = node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.length; i++) { + const value = node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.length; i++) { + const value = node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce[i]; + if (value != null && typeof value === \\"object\\") { + node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.length; i++) { + const value = node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote[i]; + if (value != null && typeof value === \\"object\\") { + node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote[i] = context.value(value); + } + } +} }); } + /** The sub-policy specifying who can feature the actor in a * {@link FeaturedCollection}. * @@ -31825,8 +32940,8 @@ manualApprovals?: (URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link InteractionRule.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -31946,7 +33061,89 @@ manualApprovals?: (URL)[];} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +automaticApproval?: URL | null; +automaticApprovals?: (URL)[];manualApproval?: URL | null; +manualApprovals?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): InteractionRule { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as InteractionRule; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as InteractionRule; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.length; i++) { + const value = node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.length; i++) { + const value = node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval[i] = context.value(value); + } + } +} }); } + /** URIs of actors or collections whose interactions are automatically * approved without requiring manual review by the post author. * @@ -32544,8 +33741,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link LikeAuthorization.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -32626,7 +33823,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];interactingObject?: Object | URL | null;interactionTarget?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): LikeAuthorization { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as LikeAuthorization; + + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } +} }); } + async #fetchInteractingObject( url: URL, options: { @@ -34070,8 +35353,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link LikeRequest.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -34132,7 +35415,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as LikeRequest; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): LikeRequest { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -34542,8 +35895,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link ReplyAuthorization.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -34624,7 +35977,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];interactingObject?: Object | URL | null;interactionTarget?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): ReplyAuthorization { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as ReplyAuthorization; + + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } +} }); } + async #fetchInteractingObject( url: URL, options: { @@ -36068,8 +37507,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link ReplyRequest.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -36130,7 +37569,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as ReplyRequest; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): ReplyRequest { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -36540,8 +38049,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link QuoteAuthorization.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -36622,7 +38131,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];interactingObject?: Object | URL | null;interactionTarget?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): QuoteAuthorization { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as QuoteAuthorization; + + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } +} }); } + async #fetchInteractingObject( url: URL, options: { @@ -38065,8 +39660,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link QuoteRequest.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -38127,7 +39722,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as QuoteRequest; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): QuoteRequest { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -38714,8 +40379,8 @@ urls?: ((URL | Link))[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Translation.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -38892,7 +40557,103 @@ urls?: ((URL | Link))[];} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +language?: Intl.Locale | null;translator?: Application | Group | Organization | Person | Service | URL | null; +translators?: (Application | Group | Organization | Person | Service | URL)[];original?: URL | null;sourceUpdated?: Temporal.Instant | null;basis?: URL | null;url?: URL | Link | null; +urls?: ((URL | Link))[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Translation { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Translation; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Translation; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.length; i++) { + const value = node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7.length; i++) { + const value = node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7[i]; + if (value != null && typeof value === \\"object\\") { + node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW.length; i++) { + const value = node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length; i++) { + const value = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i] = context.value(value); + } + } +} }); } + /** The translated language. Publishers must match a language in the * containing object's content, name, or summary map. * @@ -40627,8 +42388,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link FeatureAuthorization.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -40709,7 +42470,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];interactingObject?: Object | URL | null;interactionTarget?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): FeatureAuthorization { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as FeatureAuthorization; + + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } +} }); } + async #fetchInteractingObject( url: URL, options: { @@ -42147,8 +43994,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link FeatureRequest.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -42209,7 +44056,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as FeatureRequest; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): FeatureRequest { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -42796,8 +44713,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Collection.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -43028,7 +44945,163 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];totalItems?: number | null;current?: CollectionPage | URL | null;first?: CollectionPage | URL | null;last?: CollectionPage | URL | null;items?: (Object | Link | URL)[];likesOf?: Object | URL | null;sharesOf?: Object | URL | null;repliesOf?: Object | URL | null;inboxOf?: Object | URL | null;outboxOf?: Object | URL | null;followersOf?: Object | URL | null;followingOf?: Object | URL | null;likedOf?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Collection { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Collection; + + for (let i = 0; i < node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.length; i++) { + const value = node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.length; i++) { + const value = node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[i]; + if (value != null && typeof value === \\"object\\") { + node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.length; i++) { + const value = node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[i]; + if (value != null && typeof value === \\"object\\") { + node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { + const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.length; i++) { + const value = node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.length; i++) { + const value = node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.length; i++) { + const value = node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.length; i++) { + const value = node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.length; i++) { + const value = node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.length; i++) { + const value = node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.length; i++) { + const value = node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.length; i++) { + const value = node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[i] = context.value(value); + } + } +} }); } + /** A non-negative integer specifying the total number of objects contained by * the logical view of the collection. This number might not reflect the actual * number of items serialized within the {@link Collection} object instance. @@ -49826,8 +51899,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link OrderedCollection.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -49902,7 +51975,86 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];totalItems?: number | null;current?: CollectionPage | URL | null;first?: CollectionPage | URL | null;last?: CollectionPage | URL | null;likesOf?: Object | URL | null;sharesOf?: Object | URL | null;repliesOf?: Object | URL | null;inboxOf?: Object | URL | null;outboxOf?: Object | URL | null;followersOf?: Object | URL | null;followingOf?: Object | URL | null;likedOf?: Object | URL | null;items?: (Object | Link | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): OrderedCollection { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as OrderedCollection; + + for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { + const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + } + } +} }); } + async #fetchItem( url: URL, options: { @@ -50876,8 +53028,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link FeaturedCollection.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -50958,7 +53110,86 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];totalItems?: number | null;current?: CollectionPage | URL | null;first?: CollectionPage | URL | null;last?: CollectionPage | URL | null;likesOf?: Object | URL | null;sharesOf?: Object | URL | null;repliesOf?: Object | URL | null;inboxOf?: Object | URL | null;outboxOf?: Object | URL | null;followersOf?: Object | URL | null;followingOf?: Object | URL | null;likedOf?: Object | URL | null;items?: (Object | Link | URL)[];topic?: Hashtag | null;discoverable?: boolean | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): FeaturedCollection { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as FeaturedCollection; + + for (let i = 0; i < node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic.length; i++) { + const value = node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic[i]; + if (value != null && typeof value === \\"object\\") { + node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic[i] = context.value(value); + } + } +} }); } + /** A single {@link Hashtag} object that represents the main topic or category * of this featured collection. * @@ -51590,8 +53821,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link FeaturedItem.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -51672,7 +53903,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];featuredObject?: Object | URL | null;featureAuthorization?: FeatureAuthorization | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): FeaturedItem { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as FeaturedItem; + + for (let i = 0; i < node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.length; i++) { + const value = node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.length; i++) { + const value = node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[i] = context.value(value); + } + } +} }); } + async #fetchFeaturedObject( url: URL, options: { @@ -53213,8 +55530,8 @@ endpoints?: (URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link DidService.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -53297,7 +55614,81 @@ endpoints?: (URL)[];} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +endpoint?: URL | null; +endpoints?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): DidService { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as DidService; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as DidService; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.length; i++) { + const value = node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint[i] = context.value(value); + } + } +} }); } + /** A network address, such as an HTTP URL, at which services operate on behalf * of a DID subject. * @@ -53745,8 +56136,8 @@ endpoints?: (URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Export.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -53786,7 +56177,56 @@ endpoints?: (URL)[];} const clone = super.clone(values, options) as unknown as Export; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +endpoint?: URL | null; +endpoints?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Export { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -54293,8 +56733,8 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link DataIntegrityProof.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -54407,7 +56847,87 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | null;proofPurpose?: \\"assertionMethod\\" | \\"authentication\\" | \\"capabilityInvocation\\" | \\"capabilityDelegation\\" | \\"keyAgreement\\" | null;proofValue?: Uint8Array | null;created?: Temporal.Instant | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): DataIntegrityProof { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as DataIntegrityProof; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as DataIntegrityProof; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.length; i++) { + const value = node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue.length; i++) { + const value = node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue[i] = context.value(value); + } + } +} }); } + /** The cryptographic suite used to create the proof. * */ @@ -55688,8 +58208,8 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link CryptographicKey.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -55764,7 +58284,80 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +owner?: Application | Group | Organization | Person | Service | URL | null;publicKey?: CryptoKey | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): CryptographicKey { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as CryptographicKey; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as CryptographicKey; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length; i++) { + const value = node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[i]; + if (value != null && typeof value === \\"object\\") { + node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[i] = context.value(value); + } + } +} }); } + async #fetchOwner( url: URL, options: { @@ -56955,8 +59548,8 @@ controller?: Application | Group | Organization | Person | Service | URL | null; * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Multikey.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -57031,7 +59624,80 @@ controller?: Application | Group | Organization | Person | Service | URL | null; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +controller?: Application | Group | Organization | Person | Service | URL | null;publicKey?: CryptoKey | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Multikey { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Multikey; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Multikey; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length; i++) { + const value = node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[i] = context.value(value); + } + } +} }); } + async #fetchController( url: URL, options: { @@ -58160,8 +60826,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Agreement.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -58242,7 +60908,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];stipulates?: Commitment | null;stipulatesReciprocal?: Commitment | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Agreement { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Agreement; + + for (let i = 0; i < node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates.length; i++) { + const value = node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates[i]; + if (value != null && typeof value === \\"object\\") { + node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal.length; i++) { + const value = node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal[i] = context.value(value); + } + } +} }); } + /** The primary {@link Commitment} associated with the agreement. This * commitment satisfies the primary {@link Intent} of the corresponding * {@link Proposal}. @@ -58951,8 +61703,8 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Commitment.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -59024,7 +61776,87 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +satisfies?: URL | null;resourceQuantity?: Measure | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Commitment { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Commitment; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Commitment; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.length; i++) { + const value = node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies[i]; + if (value != null && typeof value === \\"object\\") { + node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length; i++) { + const value = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i] = context.value(value); + } + } +} }); } + /** The {@link Intent} of a {@link Proposal} that this commitment * satisfies. The value is the proposal's URI with a * [fragment](https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Fragment) @@ -59752,8 +62584,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Intent.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -59864,7 +62696,101 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measure | null;availableQuantity?: Measure | null;minimumQuantity?: Measure | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Intent { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Intent; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Intent; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.length; i++) { + const value = node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length; i++) { + const value = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.length; i++) { + const value = node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[i]; + if (value != null && typeof value === \\"object\\") { + node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.length; i++) { + const value = node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[i] = context.value(value); + } + } +} }); } + /** The type of economic transaction. The value of this property should be * either \`\\"deliverService\\"\` or \`\\"transfer\\"\`. * @@ -60822,8 +63748,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Proposal.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -60930,7 +63856,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];purpose?: string | null;publishes?: Intent | null;reciprocal?: Intent | null;unitBased?: boolean | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Proposal { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Proposal; + + for (let i = 0; i < node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.length; i++) { + const value = node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.length; i++) { + const value = node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[i]; + if (value != null && typeof value === \\"object\\") { + node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[i] = context.value(value); + } + } +} }); } + /** The type of proposal. Possible values are \`\\"offer\\"\` and \`\\"request\\"\`. * */ @@ -61741,8 +64753,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Accept.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -61803,7 +64815,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Accept; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Accept { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -62166,46 +65248,121 @@ targets?: (Object | URL)[];result?: Object | URL | null; results?: (Object | URL)[];origin?: Object | URL | null; origins?: (Object | URL)[];instrument?: Object | URL | null; instruments?: (Object | URL)[];} -, +, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + tracerProvider?: TracerProvider, + verifyPortableObject?: PortableObjectVerifier, + } = {}, + ) { + super(values, options);} + + /** + * Clones this instance, optionally updating it with the given values. + * + * This is a shallow copy: property arrays are copied, but nested objects + * and URLs are shared with this instance. Dereferencing accessors can cache + * fetched objects in the instance whose accessor is called. Hydrating a + * shared nested object through the clone can affect the original as well, + * and can change JSON-LD output when either is embedded in another + * object. Hydrating a top-level property of the clone does not update this + * instance's property. + * + * To resolve properties without sharing nested objects, use + * {@link Add.deepClone} before hydration. + * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) + * for details, including how cached JSON-LD affects serialization. + * + * A clone never inherits a signed JSON-LD representation retained by + * \`signObject()\`: the clone may differ from the document that the proof + * covers, so embedding the original secured JSON in a parent document + * would be wrong. Sign the clone again if it has to be embedded as a + * secured child. + * + * @param values The values to update the clone with. + * @param options The options to use for cloning. + * @returns The cloned instance with its own property arrays. Nested objects + * and URLs are shared with this instance. + */ + override clone( + values: + { +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} + + = {}, options: { documentLoader?: DocumentLoader, contextLoader?: DocumentLoader, - tracerProvider?: TracerProvider, verifyPortableObject?: PortableObjectVerifier, - } = {}, - ) { - super(values, options);} + } = {} + ): Add { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + // @ts-ignore: $warning is not recognized as a property, but it is. + options = { ...options, $warning: this._warning }; + } + const clone = super.clone(values, options) as unknown as Add; + return clone; + } /** - * Clones this instance, optionally updating it with the given values. + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. * - * This is a shallow copy: property arrays are copied, but nested objects - * and URLs are shared with this instance. Dereferencing accessors can cache - * fetched objects in the instance whose accessor is called. Hydrating a - * shared nested object through the clone can affect the original as well, - * and can change JSON-LD output when either is embedded in another - * object. Hydrating a top-level property of the clone does not update this - * instance's property. + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. - * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) - * for details, including how cached JSON-LD affects serialization. + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. * - * A clone never inherits a signed JSON-LD representation retained by - * \`signObject()\`: the clone may differ from the document that the proof - * covers, so embedding the original secured JSON in a parent document - * would be wrong. Sign the clone again if it has to be embedded as a - * secured child. + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. * - * @param values The values to update the clone with. - * @param options The options to use for cloning. - * @returns The cloned instance with its own property arrays. Nested objects - * and URLs are shared with this instance. + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 */ - override clone( - values: - { + override deepClone(values: +{ id?: URL | null; attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; @@ -62230,26 +65387,21 @@ targets?: (Object | URL)[];result?: Object | URL | null; results?: (Object | URL)[];origin?: Object | URL | null; origins?: (Object | URL)[];instrument?: Object | URL | null; instruments?: (Object | URL)[];} - - = {}, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - verifyPortableObject?: PortableObjectVerifier, - } = {} - ): Add { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - // @ts-ignore: $warning is not recognized as a property, but it is. - options = { ...options, $warning: this._warning }; - } - const clone = super.clone(values, options) as unknown as Add; - return clone; += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Add { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); } - + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -62628,8 +65780,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Announce.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -62690,7 +65842,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Announce; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Announce { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -63604,8 +66826,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Application.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -64156,7 +67378,204 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];preferredUsername?: string | LanguageString | null; +preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; +publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; +services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;preferredLicense?: URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Application { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Application; + + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === \\"object\\") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === \\"object\\") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } +} }); } + /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. * @@ -73959,8 +77378,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link IntransitiveActivity.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -74021,7 +77440,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as IntransitiveActivity; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): IntransitiveActivity { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -74412,8 +77901,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Arrive.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -74474,7 +77963,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Arrive; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Arrive { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -74890,8 +78449,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Article.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -74985,7 +78544,100 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];quote?: Object | URL | null;quoteUrl?: URL | null;quoteAuthorization?: QuoteAuthorization | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Article { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Article; + + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === \\"object\\") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } +} }); } + async #fetchQuote( url: URL, options: { @@ -76589,8 +80241,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Document.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -76684,7 +80336,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];width?: number | null;height?: number | null;digestMultibase?: string | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Document { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** Specifies a hint as to the rendering width in * device-independent pixels of the linked resource. * @@ -77397,8 +81113,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Audio.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -77453,7 +81169,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const clone = super.clone(values, options) as unknown as Audio; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];width?: number | null;height?: number | null;digestMultibase?: string | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Audio { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -77850,8 +81630,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Ignore.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -77912,7 +81692,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Ignore; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Ignore { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -78296,8 +82146,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Block.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -78358,7 +82208,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Block; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Block { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -78779,8 +82699,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link CollectionPage.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -78874,7 +82794,100 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];totalItems?: number | null;current?: CollectionPage | URL | null;first?: CollectionPage | URL | null;last?: CollectionPage | URL | null;items?: (Object | Link | URL)[];likesOf?: Object | URL | null;sharesOf?: Object | URL | null;repliesOf?: Object | URL | null;inboxOf?: Object | URL | null;outboxOf?: Object | URL | null;followersOf?: Object | URL | null;followingOf?: Object | URL | null;likedOf?: Object | URL | null;partOf?: Collection | URL | null;next?: CollectionPage | URL | null;prev?: CollectionPage | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): CollectionPage { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as CollectionPage; + + for (let i = 0; i < node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.length; i++) { + const value = node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.length; i++) { + const value = node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.length; i++) { + const value = node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[i] = context.value(value); + } + } +} }); } + async #fetchPartOf( url: URL, options: { @@ -80830,8 +84843,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Create.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -80892,7 +84905,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Create; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Create { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -81270,8 +85353,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Delete.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -81332,7 +85415,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Delete; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Delete { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -81708,8 +85861,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Dislike.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -81770,7 +85923,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Dislike; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Dislike { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -82310,8 +86533,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Endpoints.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -82448,7 +86671,122 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint?: URL | null;provideClientKey?: URL | null;signClientKey?: URL | null;sharedInbox?: URL | null;uploadMedia?: URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Endpoints { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Endpoints; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Endpoints; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.length; i++) { + const value = node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.length; i++) { + const value = node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint[i]; + if (value != null && typeof value === \\"object\\") { + node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.length; i++) { + const value = node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint[i]; + if (value != null && typeof value === \\"object\\") { + node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.length; i++) { + const value = node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.length; i++) { + const value = node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.length; i++) { + const value = node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia.length; i++) { + const value = node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia[i]; + if (value != null && typeof value === \\"object\\") { + node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia[i] = context.value(value); + } + } +} }); } + /** Endpoint URI so this actor's clients may access remote ActivityStreams * objects which require authentication to access. To use this endpoint, * the client posts an \`x-www-form-urlencoded\` \`id\` parameter with the value @@ -83542,8 +87880,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Event.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -83598,7 +87936,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const clone = super.clone(values, options) as unknown as Event; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Event { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -83996,8 +88398,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Flag.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -84058,7 +88460,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Flag; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Flag { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -84438,8 +88910,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Follow.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -84500,7 +88972,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Follow; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Follow { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -85414,8 +89956,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Group.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -85966,7 +90508,204 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];preferredUsername?: string | LanguageString | null; +preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; +publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; +services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;preferredLicense?: URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Group { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Group; + + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === \\"object\\") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === \\"object\\") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } +} }); } + /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. * @@ -96038,8 +100777,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Link.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -96272,7 +101011,96 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +href?: URL | null;rel?: string | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; +names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];licenses?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Link { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Link; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Link; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.length; i++) { + const value = node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href[i]; + if (value != null && typeof value === \\"object\\") { + node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length; i++) { + const value = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i]; + if (value != null && typeof value === \\"object\\") { + node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length; i++) { + const value = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i] = context.value(value); + } + } +} }); } + /** The target resource pointed to by a {@link Link}. */ get href(): (URL | null) { @@ -98169,8 +102997,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Hashtag.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -98211,7 +103039,57 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const clone = super.clone(values, options) as unknown as Hashtag; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +href?: URL | null;rel?: string | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; +names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];licenses?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Hashtag { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -98589,8 +103467,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Image.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -98645,7 +103523,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const clone = super.clone(values, options) as unknown as Image; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];width?: number | null;height?: number | null;digestMultibase?: string | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Image { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -99043,8 +103985,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Offer.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -99105,7 +104047,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Offer; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Offer { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -99487,8 +104499,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Invite.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -99549,7 +104561,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Invite; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Invite { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -99927,8 +105009,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Join.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -99989,7 +105071,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Join; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Join { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -100367,8 +105519,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Leave.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -100429,7 +105581,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Leave; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Leave { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -100807,8 +106029,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Like.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -100850,26 +106072,96 @@ targets?: (Object | URL)[];result?: Object | URL | null; results?: (Object | URL)[];origin?: Object | URL | null; origins?: (Object | URL)[];instrument?: Object | URL | null; instruments?: (Object | URL)[];} - - = {}, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - verifyPortableObject?: PortableObjectVerifier, - } = {} - ): Like { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - // @ts-ignore: $warning is not recognized as a property, but it is. - options = { ...options, $warning: this._warning }; - } - const clone = super.clone(values, options) as unknown as Like; - return clone; + + = {}, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {} + ): Like { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + // @ts-ignore: $warning is not recognized as a property, but it is. + options = { ...options, $warning: this._warning }; + } + const clone = super.clone(values, options) as unknown as Like; + return clone; + } + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Like { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); } - + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -101245,8 +106537,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Listen.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -101307,7 +106599,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Listen; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Listen { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -101663,8 +107025,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Mention.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -101705,7 +107067,57 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const clone = super.clone(values, options) as unknown as Mention; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +href?: URL | null;rel?: string | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; +names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];licenses?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Mention { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -102092,8 +107504,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Move.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -102154,7 +107566,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Move; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Move { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -102572,8 +108054,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Note.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -102667,7 +108149,100 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];quote?: Object | URL | null;quoteUrl?: URL | null;quoteAuthorization?: QuoteAuthorization | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Note { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Note; + + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === \\"object\\") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } +} }); } + async #fetchQuote( url: URL, options: { @@ -104268,8 +109843,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link OrderedCollectionPage.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -104357,7 +109932,86 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];totalItems?: number | null;current?: CollectionPage | URL | null;first?: CollectionPage | URL | null;last?: CollectionPage | URL | null;likesOf?: Object | URL | null;sharesOf?: Object | URL | null;repliesOf?: Object | URL | null;inboxOf?: Object | URL | null;outboxOf?: Object | URL | null;followersOf?: Object | URL | null;followingOf?: Object | URL | null;likedOf?: Object | URL | null;partOf?: Collection | URL | null;next?: CollectionPage | URL | null;prev?: CollectionPage | URL | null;items?: (Object | Link | URL)[];startIndex?: number | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): OrderedCollectionPage { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as OrderedCollectionPage; + + for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { + const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + } + } +} }); } + async #fetchItem( url: URL, options: { @@ -105943,8 +111597,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Organization.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -106495,7 +112149,204 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];preferredUsername?: string | LanguageString | null; +preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; +publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; +services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;preferredLicense?: URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Organization { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Organization; + + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === \\"object\\") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === \\"object\\") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } +} }); } + /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. * @@ -116289,8 +122140,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Page.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -116345,7 +122196,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const clone = super.clone(values, options) as unknown as Page; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];width?: number | null;height?: number | null;digestMultibase?: string | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Page { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -117278,8 +123193,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Person.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -117830,7 +123745,204 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];preferredUsername?: string | LanguageString | null; +preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; +publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; +services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;preferredLicense?: URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Person { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Person; + + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === \\"object\\") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === \\"object\\") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } +} }); } + /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. * @@ -127711,8 +133823,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Place.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -127845,7 +133957,86 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];accuracy?: number | null;altitude?: number | null;latitude?: number | null;longitude?: number | null;radius?: number | null;units?: \\"cm\\" | \\"feet\\" | \\"inches\\" | \\"km\\" | \\"m\\" | \\"miles\\" | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Place { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Place; + + for (let i = 0; i < node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units.length; i++) { + const value = node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units[i]; + if (value != null && typeof value === \\"object\\") { + node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units[i] = context.value(value); + } + } +} }); } + /** Indicates the accuracy of position coordinates on a {@link Place} objects. * Expressed in properties of percentage. e.g. \\"94.0\\" means \\"94.0% accurate\\". * @@ -128873,8 +135064,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Profile.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -128942,7 +135133,86 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];describes?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Profile { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Profile; + + for (let i = 0; i < node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.length; i++) { + const value = node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[i] = context.value(value); + } + } +} }); } + async #fetchDescribes( url: URL, options: { @@ -129983,8 +136253,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Question.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -130150,7 +136420,120 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOptions?: (Object | URL)[];closed?: Temporal.Instant | boolean | null;voters?: number | null;quote?: Object | URL | null;quoteUrl?: URL | null;quoteAuthorization?: QuoteAuthorization | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Question { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Question; + + for (let i = 0; i < node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.length; i++) { + const value = node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.length; i++) { + const value = node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === \\"object\\") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } +} }); } + async #fetchExclusiveOption( url: URL, options: { @@ -132834,8 +139217,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Read.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -132896,7 +139279,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Read; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Read { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -133274,8 +139727,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Reject.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -133336,7 +139789,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Reject; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Reject { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -133821,8 +140344,8 @@ relationships?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Relationship.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -133974,7 +140497,102 @@ relationships?: (Object | URL)[];} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];subject?: Object | URL | null;object?: Object | URL | null; +objects?: (Object | URL)[];relationship?: Object | URL | null; +relationships?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Relationship { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Relationship; + + for (let i = 0; i < node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.length; i++) { + const value = node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length; i++) { + const value = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length; i++) { + const value = node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[i] = context.value(value); + } + } +} }); } + async #fetchSubject( url: URL, options: { @@ -136269,8 +142887,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Remove.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -136331,7 +142949,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Remove; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Remove { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -137245,8 +143933,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Service.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -137797,7 +144485,204 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];preferredUsername?: string | LanguageString | null; +preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; +publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; +services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;preferredLicense?: URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Service { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Service; + + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === \\"object\\") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === \\"object\\") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } +} }); } + /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. * @@ -147715,8 +154600,8 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Source.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -147812,7 +154697,74 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];mediaType?: string | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Source { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Source; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Source; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); +} }); } + /** The source content. */ get content(): (string | LanguageString | null) { @@ -148416,8 +155368,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link TentativeAccept.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -148459,26 +155411,96 @@ targets?: (Object | URL)[];result?: Object | URL | null; results?: (Object | URL)[];origin?: Object | URL | null; origins?: (Object | URL)[];instrument?: Object | URL | null; instruments?: (Object | URL)[];} - - = {}, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - verifyPortableObject?: PortableObjectVerifier, - } = {} - ): TentativeAccept { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - // @ts-ignore: $warning is not recognized as a property, but it is. - options = { ...options, $warning: this._warning }; - } - const clone = super.clone(values, options) as unknown as TentativeAccept; - return clone; + + = {}, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {} + ): TentativeAccept { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + // @ts-ignore: $warning is not recognized as a property, but it is. + options = { ...options, $warning: this._warning }; + } + const clone = super.clone(values, options) as unknown as TentativeAccept; + return clone; + } + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): TentativeAccept { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); } - + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -148856,8 +155878,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link TentativeReject.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -148918,7 +155940,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as TentativeReject; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): TentativeReject { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -149343,8 +156435,8 @@ formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Tombstone.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -149449,7 +156541,72 @@ formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];formerType?: $EntityType | null; +formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Tombstone { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** On a \`Tombstone\` object, the \`formerType\` property identifies the type of * the object that was deleted. * @@ -150087,8 +157244,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Travel.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -150149,7 +157306,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Travel; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Travel { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -150532,8 +157759,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Undo.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -150594,7 +157821,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Undo; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Undo { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -150975,8 +158272,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Update.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -151037,7 +158334,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Update; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Update { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -151407,8 +158774,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Video.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -151463,7 +158830,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const clone = super.clone(values, options) as unknown as Video; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];width?: number | null;height?: number | null;digestMultibase?: string | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Video { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -151859,8 +159290,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link View.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -151921,7 +159352,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as View; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): View { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 8fd4e479d..1d722c403 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -52,6 +52,7 @@ import { parseCompatibleEf61Reference, type PortableResponseClaim, recordPortableReferrer, + retargetPortableReferrer, rejectMalformedCompatibleReference, warnUnverifiableEmbeddedObject } from "@fedify/vocab-runtime/internal/portable-dereference"; @@ -81,6 +82,99 @@ function inspectIri(iri: URL): string { try { return formatIri(iri); } catch { return iri.href; } } +interface DeepCloneContext { + value(value: T): T; +} + +interface DeepCloneDescriptor { + create(source: object): object; + copy(destination: object, context: DeepCloneContext): void; +} + +const deepCloneDescriptors = new Map(); + +function getDeepCloneDescriptor(value: object): DeepCloneDescriptor | undefined { + let prototype: object | null = globalThis.Object.getPrototypeOf(value); + while (prototype != null) { + const descriptor = deepCloneDescriptors.get(prototype); + if (descriptor != null) return descriptor; + prototype = globalThis.Object.getPrototypeOf(prototype); + } + return undefined; +} + +function deepCloneGraph(source: object, root: T): T { + const memo = new Map(); + const destinations = new Set(); + const shells: object[] = []; + let next = 0; + + function enqueue(original: object, destination: object): void { + if (destination == null || typeof destination !== "object" || + original === destination || destinations.has(destination) || + !globalThis.Object.prototype.isPrototypeOf.call( + globalThis.Object.getPrototypeOf(original), destination + ) || getDeepCloneDescriptor(destination) == null) { + throw new TypeError("clone() must return a fresh, compatible instance."); + } + destinations.add(destination); + shells.push(destination); + } + + const context: DeepCloneContext = { + value(value: V): V { + if (value == null || typeof value !== "object") return value; + const existing = memo.get(value); + if (existing != null) return existing as V; + if (value instanceof URL) { + const copy = new URL(value.href); + memo.set(value, copy); + return copy as V; + } + if (value instanceof Uint8Array) { + const copy = new Uint8Array(value); + memo.set(value, copy); + return copy as V; + } + const descriptor = getDeepCloneDescriptor(value); + // Other supported scalars (Temporal, LanguageString, Intl.Locale, + // CryptoKey and class constructors) are shared as immutable values. + if (descriptor == null) return value; + const copy = descriptor.create(value); + enqueue(value, copy); + memo.set(value, copy); + return copy as V; + }, + }; + + function drain(): void { + while (next < shells.length) { + const shell = shells[next++]; + getDeepCloneDescriptor(shell)!.copy(shell, context); + } + } + + // The effective root includes replacements. References to the source root + // instead receive a separate copy of its pre-update values. + enqueue(source, root); + drain(); + + // Discover historical root ancestry without substituting replacement values + // into it. The resolver deliberately returns undefined in this first pass. + const count = shells.length; + for (let i = 0; i < count; i++) { + retargetPortableReferrer(shells[i], (original) => { + if (original === source) context.value(source); + return undefined; + }); + } + drain(); + for (const shell of shells) { + retargetPortableReferrer(shell, (original) => memo.get(original)); + } + return root; +} + function isValidLanguageTag(language: string): boolean { try { new Intl.Locale(normalizeLanguageTag(language)); @@ -1343,8 +1437,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Object.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -2373,7 +2467,292 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Object { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Object; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Object; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length; i++) { + const value = node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment[i]; + if (value != null && typeof value === "object") { + node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length; i++) { + const value = node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[i]; + if (value != null && typeof value === "object") { + node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length; i++) { + const value = node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[i]; + if (value != null && typeof value === "object") { + node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.length; i++) { + const value = node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context[i]; + if (value != null && typeof value === "object") { + node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.length; i++) { + const value = node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator[i]; + if (value != null && typeof value === "object") { + node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length; i++) { + const value = node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[i]; + if (value != null && typeof value === "object") { + node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length; i++) { + const value = node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[i]; + if (value != null && typeof value === "object") { + node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length; i++) { + const value = node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[i]; + if (value != null && typeof value === "object") { + node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length; i++) { + const value = node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[i]; + if (value != null && typeof value === "object") { + node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length; i++) { + const value = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i]; + if (value != null && typeof value === "object") { + node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_7UpwM3JWcXhADcscukEehBorf6k_replies.length; i++) { + const value = node.#_7UpwM3JWcXhADcscukEehBorf6k_replies[i]; + if (value != null && typeof value === "object") { + node.#_7UpwM3JWcXhADcscukEehBorf6k_replies[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.length; i++) { + const value = node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[i]; + if (value != null && typeof value === "object") { + node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.length; i++) { + const value = node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[i]; + if (value != null && typeof value === "object") { + node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.length; i++) { + const value = node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[i]; + if (value != null && typeof value === "object") { + node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.length; i++) { + const value = node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag[i]; + if (value != null && typeof value === "object") { + node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length; i++) { + const value = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i]; + if (value != null && typeof value === "object") { + node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length; i++) { + const value = node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[i]; + if (value != null && typeof value === "object") { + node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length; i++) { + const value = node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[i]; + if (value != null && typeof value === "object") { + node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length; i++) { + const value = node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[i]; + if (value != null && typeof value === "object") { + node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length; i++) { + const value = node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[i]; + if (value != null && typeof value === "object") { + node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.length; i++) { + const value = node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source[i]; + if (value != null && typeof value === "object") { + node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length; i++) { + const value = node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[i]; + if (value != null && typeof value === "object") { + node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.length; i++) { + const value = node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy[i]; + if (value != null && typeof value === "object") { + node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.length; i++) { + const value = node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy[i]; + if (value != null && typeof value === "object") { + node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.length; i++) { + const value = node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[i]; + if (value != null && typeof value === "object") { + node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.length; i++) { + const value = node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[i]; + if (value != null && typeof value === "object") { + node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.length; i++) { + const value = node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[i]; + if (value != null && typeof value === "object") { + node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations.length; i++) { + const value = node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations[i]; + if (value != null && typeof value === "object") { + node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length; i++) { + const value = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i]; + if (value != null && typeof value === "object") { + node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i] = context.value(value); + } + } +} }); } + async #fetchAttachment( url: URL, options: { @@ -19267,8 +19646,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Emoji.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -19323,7 +19702,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const clone = super.clone(values, options) as unknown as Emoji; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Emoji { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -19763,8 +20206,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link ChatMessage.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -19858,7 +20301,100 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];quote?: Object | URL | null;quoteUrl?: URL | null;quoteAuthorization?: QuoteAuthorization | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): ChatMessage { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as ChatMessage; + + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === "object") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === "object") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === "object") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } +} }); } + async #fetchQuote( url: URL, options: { @@ -21689,8 +22225,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Activity.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -21997,7 +22533,127 @@ instruments?: (Object | URL)[];} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Activity { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Activity; + + for (let i = 0; i < node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length; i++) { + const value = node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[i]; + if (value != null && typeof value === "object") { + node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length; i++) { + const value = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i]; + if (value != null && typeof value === "object") { + node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length; i++) { + const value = node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[i]; + if (value != null && typeof value === "object") { + node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length; i++) { + const value = node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[i]; + if (value != null && typeof value === "object") { + node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length; i++) { + const value = node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[i]; + if (value != null && typeof value === "object") { + node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length; i++) { + const value = node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[i]; + if (value != null && typeof value === "object") { + node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[i] = context.value(value); + } + } +} }); } + async #fetchActor( url: URL, options: { @@ -26617,8 +27273,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link EmojiReact.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -26679,7 +27335,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as EmojiReact; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): EmojiReact { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -27149,8 +27875,8 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link PropertyValue.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -27222,7 +27948,73 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +name?: string | LanguageString | null;value?: string | LanguageString | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): PropertyValue { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as PropertyValue; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as PropertyValue; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); +} }); } + /** The name of a property. */ get name(): (string | LanguageString | null) { @@ -27921,8 +28713,8 @@ unit?: string | null;numericalValue?: Decimal | null;} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Measure.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -27994,7 +28786,73 @@ unit?: string | null;numericalValue?: Decimal | null;} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +unit?: string | null;numericalValue?: Decimal | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Measure { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Measure; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Measure; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); +} }); } + /** The name of the unit, according to the Ontology of units of Measure * classification. The recommended unit for countable items is \`"one"\`. * @@ -28611,8 +29469,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link AnnounceAuthorization.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -28693,7 +29551,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];interactingObject?: Object | URL | null;interactionTarget?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): AnnounceAuthorization { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as AnnounceAuthorization; + + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === "object") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === "object") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } +} }); } + async #fetchInteractingObject( url: URL, options: { @@ -30138,8 +31082,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link AnnounceRequest.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -30200,7 +31144,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as AnnounceRequest; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): AnnounceRequest { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -30719,8 +31733,8 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link InteractionPolicy.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -30831,7 +31845,108 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: InteractionRule | null;canQuote?: InteractionRule | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): InteractionPolicy { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as InteractionPolicy; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as InteractionPolicy; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.length; i++) { + const value = node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature[i]; + if (value != null && typeof value === "object") { + node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.length; i++) { + const value = node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike[i]; + if (value != null && typeof value === "object") { + node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.length; i++) { + const value = node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply[i]; + if (value != null && typeof value === "object") { + node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.length; i++) { + const value = node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce[i]; + if (value != null && typeof value === "object") { + node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.length; i++) { + const value = node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote[i]; + if (value != null && typeof value === "object") { + node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote[i] = context.value(value); + } + } +} }); } + /** The sub-policy specifying who can feature the actor in a * {@link FeaturedCollection}. * @@ -31827,8 +32942,8 @@ manualApprovals?: (URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link InteractionRule.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -31948,7 +33063,89 @@ manualApprovals?: (URL)[];} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +automaticApproval?: URL | null; +automaticApprovals?: (URL)[];manualApproval?: URL | null; +manualApprovals?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): InteractionRule { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as InteractionRule; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as InteractionRule; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.length; i++) { + const value = node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval[i]; + if (value != null && typeof value === "object") { + node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.length; i++) { + const value = node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval[i]; + if (value != null && typeof value === "object") { + node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval[i] = context.value(value); + } + } +} }); } + /** URIs of actors or collections whose interactions are automatically * approved without requiring manual review by the post author. * @@ -32546,8 +33743,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link LikeAuthorization.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -32628,7 +33825,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];interactingObject?: Object | URL | null;interactionTarget?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): LikeAuthorization { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as LikeAuthorization; + + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === "object") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === "object") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } +} }); } + async #fetchInteractingObject( url: URL, options: { @@ -34072,8 +35355,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link LikeRequest.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -34134,7 +35417,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as LikeRequest; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): LikeRequest { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -34544,8 +35897,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link ReplyAuthorization.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -34626,7 +35979,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];interactingObject?: Object | URL | null;interactionTarget?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): ReplyAuthorization { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as ReplyAuthorization; + + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === "object") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === "object") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } +} }); } + async #fetchInteractingObject( url: URL, options: { @@ -36070,8 +37509,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link ReplyRequest.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -36132,7 +37571,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as ReplyRequest; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): ReplyRequest { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -36542,8 +38051,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link QuoteAuthorization.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -36624,7 +38133,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];interactingObject?: Object | URL | null;interactionTarget?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): QuoteAuthorization { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as QuoteAuthorization; + + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === "object") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === "object") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } +} }); } + async #fetchInteractingObject( url: URL, options: { @@ -38067,8 +39662,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link QuoteRequest.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -38129,7 +39724,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as QuoteRequest; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): QuoteRequest { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -38716,8 +40381,8 @@ urls?: ((URL | Link))[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Translation.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -38894,7 +40559,103 @@ urls?: ((URL | Link))[];} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +language?: Intl.Locale | null;translator?: Application | Group | Organization | Person | Service | URL | null; +translators?: (Application | Group | Organization | Person | Service | URL)[];original?: URL | null;sourceUpdated?: Temporal.Instant | null;basis?: URL | null;url?: URL | Link | null; +urls?: ((URL | Link))[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Translation { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Translation; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Translation; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.length; i++) { + const value = node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[i]; + if (value != null && typeof value === "object") { + node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7.length; i++) { + const value = node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7[i]; + if (value != null && typeof value === "object") { + node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW.length; i++) { + const value = node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW[i]; + if (value != null && typeof value === "object") { + node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length; i++) { + const value = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i]; + if (value != null && typeof value === "object") { + node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i] = context.value(value); + } + } +} }); } + /** The translated language. Publishers must match a language in the * containing object's content, name, or summary map. * @@ -40629,8 +42390,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link FeatureAuthorization.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -40711,7 +42472,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];interactingObject?: Object | URL | null;interactionTarget?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): FeatureAuthorization { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as FeatureAuthorization; + + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === "object") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === "object") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } +} }); } + async #fetchInteractingObject( url: URL, options: { @@ -42149,8 +43996,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link FeatureRequest.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -42211,7 +44058,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as FeatureRequest; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): FeatureRequest { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -42798,8 +44715,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Collection.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -43030,7 +44947,163 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];totalItems?: number | null;current?: CollectionPage | URL | null;first?: CollectionPage | URL | null;last?: CollectionPage | URL | null;items?: (Object | Link | URL)[];likesOf?: Object | URL | null;sharesOf?: Object | URL | null;repliesOf?: Object | URL | null;inboxOf?: Object | URL | null;outboxOf?: Object | URL | null;followersOf?: Object | URL | null;followingOf?: Object | URL | null;likedOf?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Collection { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Collection; + + for (let i = 0; i < node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.length; i++) { + const value = node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[i]; + if (value != null && typeof value === "object") { + node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.length; i++) { + const value = node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[i]; + if (value != null && typeof value === "object") { + node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.length; i++) { + const value = node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[i]; + if (value != null && typeof value === "object") { + node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { + const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; + if (value != null && typeof value === "object") { + node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.length; i++) { + const value = node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[i]; + if (value != null && typeof value === "object") { + node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.length; i++) { + const value = node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[i]; + if (value != null && typeof value === "object") { + node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.length; i++) { + const value = node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[i]; + if (value != null && typeof value === "object") { + node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.length; i++) { + const value = node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[i]; + if (value != null && typeof value === "object") { + node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.length; i++) { + const value = node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[i]; + if (value != null && typeof value === "object") { + node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.length; i++) { + const value = node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[i]; + if (value != null && typeof value === "object") { + node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.length; i++) { + const value = node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[i]; + if (value != null && typeof value === "object") { + node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.length; i++) { + const value = node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[i]; + if (value != null && typeof value === "object") { + node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[i] = context.value(value); + } + } +} }); } + /** A non-negative integer specifying the total number of objects contained by * the logical view of the collection. This number might not reflect the actual * number of items serialized within the {@link Collection} object instance. @@ -49828,8 +51901,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link OrderedCollection.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -49904,7 +51977,86 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];totalItems?: number | null;current?: CollectionPage | URL | null;first?: CollectionPage | URL | null;last?: CollectionPage | URL | null;likesOf?: Object | URL | null;sharesOf?: Object | URL | null;repliesOf?: Object | URL | null;inboxOf?: Object | URL | null;outboxOf?: Object | URL | null;followersOf?: Object | URL | null;followingOf?: Object | URL | null;likedOf?: Object | URL | null;items?: (Object | Link | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): OrderedCollection { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as OrderedCollection; + + for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { + const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; + if (value != null && typeof value === "object") { + node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + } + } +} }); } + async #fetchItem( url: URL, options: { @@ -50878,8 +53030,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link FeaturedCollection.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -50960,7 +53112,86 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];totalItems?: number | null;current?: CollectionPage | URL | null;first?: CollectionPage | URL | null;last?: CollectionPage | URL | null;likesOf?: Object | URL | null;sharesOf?: Object | URL | null;repliesOf?: Object | URL | null;inboxOf?: Object | URL | null;outboxOf?: Object | URL | null;followersOf?: Object | URL | null;followingOf?: Object | URL | null;likedOf?: Object | URL | null;items?: (Object | Link | URL)[];topic?: Hashtag | null;discoverable?: boolean | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): FeaturedCollection { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as FeaturedCollection; + + for (let i = 0; i < node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic.length; i++) { + const value = node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic[i]; + if (value != null && typeof value === "object") { + node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic[i] = context.value(value); + } + } +} }); } + /** A single {@link Hashtag} object that represents the main topic or category * of this featured collection. * @@ -51592,8 +53823,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link FeaturedItem.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -51674,7 +53905,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];featuredObject?: Object | URL | null;featureAuthorization?: FeatureAuthorization | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): FeaturedItem { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as FeaturedItem; + + for (let i = 0; i < node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.length; i++) { + const value = node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[i]; + if (value != null && typeof value === "object") { + node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.length; i++) { + const value = node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[i]; + if (value != null && typeof value === "object") { + node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[i] = context.value(value); + } + } +} }); } + async #fetchFeaturedObject( url: URL, options: { @@ -53215,8 +55532,8 @@ endpoints?: (URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link DidService.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -53299,7 +55616,81 @@ endpoints?: (URL)[];} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +endpoint?: URL | null; +endpoints?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): DidService { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as DidService; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as DidService; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.length; i++) { + const value = node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint[i]; + if (value != null && typeof value === "object") { + node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint[i] = context.value(value); + } + } +} }); } + /** A network address, such as an HTTP URL, at which services operate on behalf * of a DID subject. * @@ -53747,8 +56138,8 @@ endpoints?: (URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Export.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -53788,7 +56179,56 @@ endpoints?: (URL)[];} const clone = super.clone(values, options) as unknown as Export; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +endpoint?: URL | null; +endpoints?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Export { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -54295,8 +56735,8 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link DataIntegrityProof.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -54409,7 +56849,87 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null;proofPurpose?: "assertionMethod" | "authentication" | "capabilityInvocation" | "capabilityDelegation" | "keyAgreement" | null;proofValue?: Uint8Array | null;created?: Temporal.Instant | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): DataIntegrityProof { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as DataIntegrityProof; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as DataIntegrityProof; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.length; i++) { + const value = node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[i]; + if (value != null && typeof value === "object") { + node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue.length; i++) { + const value = node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue[i]; + if (value != null && typeof value === "object") { + node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue[i] = context.value(value); + } + } +} }); } + /** The cryptographic suite used to create the proof. * */ @@ -55690,8 +58210,8 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link CryptographicKey.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -55766,7 +58286,80 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +owner?: Application | Group | Organization | Person | Service | URL | null;publicKey?: CryptoKey | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): CryptographicKey { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as CryptographicKey; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as CryptographicKey; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length; i++) { + const value = node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[i]; + if (value != null && typeof value === "object") { + node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[i] = context.value(value); + } + } +} }); } + async #fetchOwner( url: URL, options: { @@ -56957,8 +59550,8 @@ controller?: Application | Group | Organization | Person | Service | URL | null; * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Multikey.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -57033,7 +59626,80 @@ controller?: Application | Group | Organization | Person | Service | URL | null; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +controller?: Application | Group | Organization | Person | Service | URL | null;publicKey?: CryptoKey | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Multikey { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Multikey; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Multikey; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length; i++) { + const value = node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[i]; + if (value != null && typeof value === "object") { + node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[i] = context.value(value); + } + } +} }); } + async #fetchController( url: URL, options: { @@ -58162,8 +60828,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Agreement.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -58244,7 +60910,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];stipulates?: Commitment | null;stipulatesReciprocal?: Commitment | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Agreement { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Agreement; + + for (let i = 0; i < node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates.length; i++) { + const value = node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates[i]; + if (value != null && typeof value === "object") { + node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal.length; i++) { + const value = node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal[i]; + if (value != null && typeof value === "object") { + node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal[i] = context.value(value); + } + } +} }); } + /** The primary {@link Commitment} associated with the agreement. This * commitment satisfies the primary {@link Intent} of the corresponding * {@link Proposal}. @@ -58953,8 +61705,8 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Commitment.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -59026,7 +61778,87 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +satisfies?: URL | null;resourceQuantity?: Measure | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Commitment { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Commitment; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Commitment; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.length; i++) { + const value = node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies[i]; + if (value != null && typeof value === "object") { + node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length; i++) { + const value = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i]; + if (value != null && typeof value === "object") { + node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i] = context.value(value); + } + } +} }); } + /** The {@link Intent} of a {@link Proposal} that this commitment * satisfies. The value is the proposal's URI with a * [fragment](https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Fragment) @@ -59754,8 +62586,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Intent.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -59866,7 +62698,101 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measure | null;availableQuantity?: Measure | null;minimumQuantity?: Measure | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Intent { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Intent; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Intent; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.length; i++) { + const value = node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[i]; + if (value != null && typeof value === "object") { + node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length; i++) { + const value = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i]; + if (value != null && typeof value === "object") { + node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.length; i++) { + const value = node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[i]; + if (value != null && typeof value === "object") { + node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.length; i++) { + const value = node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[i]; + if (value != null && typeof value === "object") { + node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[i] = context.value(value); + } + } +} }); } + /** The type of economic transaction. The value of this property should be * either \`"deliverService"\` or \`"transfer"\`. * @@ -60824,8 +63750,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Proposal.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -60932,7 +63858,93 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];purpose?: string | null;publishes?: Intent | null;reciprocal?: Intent | null;unitBased?: boolean | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Proposal { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Proposal; + + for (let i = 0; i < node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.length; i++) { + const value = node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[i]; + if (value != null && typeof value === "object") { + node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.length; i++) { + const value = node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[i]; + if (value != null && typeof value === "object") { + node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[i] = context.value(value); + } + } +} }); } + /** The type of proposal. Possible values are \`"offer"\` and \`"request"\`. * */ @@ -61743,8 +64755,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Accept.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -61805,7 +64817,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Accept; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Accept { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -62168,46 +65250,121 @@ targets?: (Object | URL)[];result?: Object | URL | null; results?: (Object | URL)[];origin?: Object | URL | null; origins?: (Object | URL)[];instrument?: Object | URL | null; instruments?: (Object | URL)[];} -, +, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + tracerProvider?: TracerProvider, + verifyPortableObject?: PortableObjectVerifier, + } = {}, + ) { + super(values, options);} + + /** + * Clones this instance, optionally updating it with the given values. + * + * This is a shallow copy: property arrays are copied, but nested objects + * and URLs are shared with this instance. Dereferencing accessors can cache + * fetched objects in the instance whose accessor is called. Hydrating a + * shared nested object through the clone can affect the original as well, + * and can change JSON-LD output when either is embedded in another + * object. Hydrating a top-level property of the clone does not update this + * instance's property. + * + * To resolve properties without sharing nested objects, use + * {@link Add.deepClone} before hydration. + * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) + * for details, including how cached JSON-LD affects serialization. + * + * A clone never inherits a signed JSON-LD representation retained by + * \`signObject()\`: the clone may differ from the document that the proof + * covers, so embedding the original secured JSON in a parent document + * would be wrong. Sign the clone again if it has to be embedded as a + * secured child. + * + * @param values The values to update the clone with. + * @param options The options to use for cloning. + * @returns The cloned instance with its own property arrays. Nested objects + * and URLs are shared with this instance. + */ + override clone( + values: + { +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} + + = {}, options: { documentLoader?: DocumentLoader, contextLoader?: DocumentLoader, - tracerProvider?: TracerProvider, verifyPortableObject?: PortableObjectVerifier, - } = {}, - ) { - super(values, options);} + } = {} + ): Add { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + // @ts-ignore: $warning is not recognized as a property, but it is. + options = { ...options, $warning: this._warning }; + } + const clone = super.clone(values, options) as unknown as Add; + return clone; + } /** - * Clones this instance, optionally updating it with the given values. + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. * - * This is a shallow copy: property arrays are copied, but nested objects - * and URLs are shared with this instance. Dereferencing accessors can cache - * fetched objects in the instance whose accessor is called. Hydrating a - * shared nested object through the clone can affect the original as well, - * and can change JSON-LD output when either is embedded in another - * object. Hydrating a top-level property of the clone does not update this - * instance's property. + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. - * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) - * for details, including how cached JSON-LD affects serialization. + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. * - * A clone never inherits a signed JSON-LD representation retained by - * \`signObject()\`: the clone may differ from the document that the proof - * covers, so embedding the original secured JSON in a parent document - * would be wrong. Sign the clone again if it has to be embedded as a - * secured child. + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. * - * @param values The values to update the clone with. - * @param options The options to use for cloning. - * @returns The cloned instance with its own property arrays. Nested objects - * and URLs are shared with this instance. + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 */ - override clone( - values: - { + override deepClone(values: +{ id?: URL | null; attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; @@ -62232,26 +65389,21 @@ targets?: (Object | URL)[];result?: Object | URL | null; results?: (Object | URL)[];origin?: Object | URL | null; origins?: (Object | URL)[];instrument?: Object | URL | null; instruments?: (Object | URL)[];} - - = {}, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - verifyPortableObject?: PortableObjectVerifier, - } = {} - ): Add { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - // @ts-ignore: $warning is not recognized as a property, but it is. - options = { ...options, $warning: this._warning }; - } - const clone = super.clone(values, options) as unknown as Add; - return clone; += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Add { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); } - + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -62630,8 +65782,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Announce.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -62692,7 +65844,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Announce; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Announce { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -63606,8 +66828,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Application.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -64158,7 +67380,204 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];preferredUsername?: string | LanguageString | null; +preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; +publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; +services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;preferredLicense?: URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Application { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Application; + + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === "object") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === "object") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === "object") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === "object") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === "object") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === "object") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === "object") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === "object") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === "object") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === "object") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === "object") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === "object") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === "object") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === "object") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === "object") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === "object") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === "object") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } +} }); } + /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. * @@ -73961,8 +77380,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link IntransitiveActivity.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -74023,7 +77442,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as IntransitiveActivity; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): IntransitiveActivity { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -74414,8 +77903,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Arrive.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -74476,7 +77965,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Arrive; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Arrive { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -74892,8 +78451,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Article.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -74987,7 +78546,100 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];quote?: Object | URL | null;quoteUrl?: URL | null;quoteAuthorization?: QuoteAuthorization | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Article { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Article; + + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === "object") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === "object") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === "object") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } +} }); } + async #fetchQuote( url: URL, options: { @@ -76591,8 +80243,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Document.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -76686,7 +80338,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];width?: number | null;height?: number | null;digestMultibase?: string | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Document { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** Specifies a hint as to the rendering width in * device-independent pixels of the linked resource. * @@ -77399,8 +81115,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Audio.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -77455,7 +81171,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const clone = super.clone(values, options) as unknown as Audio; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];width?: number | null;height?: number | null;digestMultibase?: string | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Audio { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -77852,8 +81632,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Ignore.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -77914,7 +81694,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Ignore; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Ignore { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -78298,8 +82148,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Block.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -78360,7 +82210,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Block; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Block { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -78781,8 +82701,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link CollectionPage.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -78876,7 +82796,100 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];totalItems?: number | null;current?: CollectionPage | URL | null;first?: CollectionPage | URL | null;last?: CollectionPage | URL | null;items?: (Object | Link | URL)[];likesOf?: Object | URL | null;sharesOf?: Object | URL | null;repliesOf?: Object | URL | null;inboxOf?: Object | URL | null;outboxOf?: Object | URL | null;followersOf?: Object | URL | null;followingOf?: Object | URL | null;likedOf?: Object | URL | null;partOf?: Collection | URL | null;next?: CollectionPage | URL | null;prev?: CollectionPage | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): CollectionPage { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as CollectionPage; + + for (let i = 0; i < node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.length; i++) { + const value = node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[i]; + if (value != null && typeof value === "object") { + node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.length; i++) { + const value = node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[i]; + if (value != null && typeof value === "object") { + node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.length; i++) { + const value = node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[i]; + if (value != null && typeof value === "object") { + node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[i] = context.value(value); + } + } +} }); } + async #fetchPartOf( url: URL, options: { @@ -80832,8 +84845,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Create.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -80894,7 +84907,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Create; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Create { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -81272,8 +85355,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Delete.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -81334,7 +85417,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Delete; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Delete { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -81710,8 +85863,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Dislike.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -81772,7 +85925,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Dislike; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Dislike { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -82312,8 +86535,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Endpoints.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -82450,7 +86673,122 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint?: URL | null;provideClientKey?: URL | null;signClientKey?: URL | null;sharedInbox?: URL | null;uploadMedia?: URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Endpoints { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Endpoints; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Endpoints; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.length; i++) { + const value = node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl[i]; + if (value != null && typeof value === "object") { + node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.length; i++) { + const value = node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint[i]; + if (value != null && typeof value === "object") { + node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.length; i++) { + const value = node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint[i]; + if (value != null && typeof value === "object") { + node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.length; i++) { + const value = node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey[i]; + if (value != null && typeof value === "object") { + node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.length; i++) { + const value = node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey[i]; + if (value != null && typeof value === "object") { + node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.length; i++) { + const value = node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox[i]; + if (value != null && typeof value === "object") { + node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia.length; i++) { + const value = node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia[i]; + if (value != null && typeof value === "object") { + node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia[i] = context.value(value); + } + } +} }); } + /** Endpoint URI so this actor's clients may access remote ActivityStreams * objects which require authentication to access. To use this endpoint, * the client posts an \`x-www-form-urlencoded\` \`id\` parameter with the value @@ -83544,8 +87882,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Event.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -83600,7 +87938,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const clone = super.clone(values, options) as unknown as Event; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Event { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -83998,8 +88400,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Flag.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -84060,7 +88462,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Flag; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Flag { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -84440,8 +88912,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Follow.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -84502,7 +88974,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Follow; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Follow { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -85416,8 +89958,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Group.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -85968,7 +90510,204 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];preferredUsername?: string | LanguageString | null; +preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; +publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; +services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;preferredLicense?: URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Group { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Group; + + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === "object") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === "object") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === "object") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === "object") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === "object") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === "object") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === "object") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === "object") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === "object") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === "object") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === "object") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === "object") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === "object") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === "object") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === "object") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === "object") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === "object") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } +} }); } + /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. * @@ -96040,8 +100779,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Link.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -96274,7 +101013,96 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +href?: URL | null;rel?: string | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; +names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];licenses?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Link { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Link; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Link; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + + for (let i = 0; i < node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.length; i++) { + const value = node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href[i]; + if (value != null && typeof value === "object") { + node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length; i++) { + const value = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i]; + if (value != null && typeof value === "object") { + node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length; i++) { + const value = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i]; + if (value != null && typeof value === "object") { + node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i] = context.value(value); + } + } +} }); } + /** The target resource pointed to by a {@link Link}. */ get href(): (URL | null) { @@ -98171,8 +102999,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Hashtag.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -98213,7 +103041,57 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const clone = super.clone(values, options) as unknown as Hashtag; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +href?: URL | null;rel?: string | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; +names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];licenses?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Hashtag { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -98591,8 +103469,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Image.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -98647,7 +103525,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const clone = super.clone(values, options) as unknown as Image; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];width?: number | null;height?: number | null;digestMultibase?: string | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Image { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -99045,8 +103987,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Offer.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -99107,7 +104049,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Offer; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Offer { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -99489,8 +104501,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Invite.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -99551,7 +104563,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Invite; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Invite { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -99929,8 +105011,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Join.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -99991,7 +105073,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Join; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Join { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -100369,8 +105521,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Leave.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -100431,7 +105583,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Leave; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Leave { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -100809,8 +106031,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Like.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -100852,26 +106074,96 @@ targets?: (Object | URL)[];result?: Object | URL | null; results?: (Object | URL)[];origin?: Object | URL | null; origins?: (Object | URL)[];instrument?: Object | URL | null; instruments?: (Object | URL)[];} - - = {}, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - verifyPortableObject?: PortableObjectVerifier, - } = {} - ): Like { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - // @ts-ignore: $warning is not recognized as a property, but it is. - options = { ...options, $warning: this._warning }; - } - const clone = super.clone(values, options) as unknown as Like; - return clone; + + = {}, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {} + ): Like { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + // @ts-ignore: $warning is not recognized as a property, but it is. + options = { ...options, $warning: this._warning }; + } + const clone = super.clone(values, options) as unknown as Like; + return clone; + } + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Like { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); } - + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -101247,8 +106539,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Listen.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -101309,7 +106601,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Listen; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Listen { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -101665,8 +107027,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Mention.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -101707,7 +107069,57 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const clone = super.clone(values, options) as unknown as Mention; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +href?: URL | null;rel?: string | null; +rels?: (string)[];mediaType?: string | null;digestMultibase?: string | null;name?: string | LanguageString | null; +names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: number | null;width?: number | null;previews?: (Link | Object | URL)[];licenses?: (URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Mention { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -102094,8 +107506,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Move.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -102156,7 +107568,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Move; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Move { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -102574,8 +108056,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Note.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -102669,7 +108151,100 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];quote?: Object | URL | null;quoteUrl?: URL | null;quoteAuthorization?: QuoteAuthorization | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Note { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Note; + + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === "object") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === "object") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === "object") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } +} }); } + async #fetchQuote( url: URL, options: { @@ -104270,8 +109845,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link OrderedCollectionPage.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -104359,7 +109934,86 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];totalItems?: number | null;current?: CollectionPage | URL | null;first?: CollectionPage | URL | null;last?: CollectionPage | URL | null;likesOf?: Object | URL | null;sharesOf?: Object | URL | null;repliesOf?: Object | URL | null;inboxOf?: Object | URL | null;outboxOf?: Object | URL | null;followersOf?: Object | URL | null;followingOf?: Object | URL | null;likedOf?: Object | URL | null;partOf?: Collection | URL | null;next?: CollectionPage | URL | null;prev?: CollectionPage | URL | null;items?: (Object | Link | URL)[];startIndex?: number | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): OrderedCollectionPage { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as OrderedCollectionPage; + + for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { + const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; + if (value != null && typeof value === "object") { + node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + } + } +} }); } + async #fetchItem( url: URL, options: { @@ -105945,8 +111599,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Organization.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -106497,7 +112151,204 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];preferredUsername?: string | LanguageString | null; +preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; +publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; +services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;preferredLicense?: URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Organization { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Organization; + + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === "object") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === "object") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === "object") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === "object") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === "object") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === "object") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === "object") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === "object") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === "object") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === "object") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === "object") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === "object") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === "object") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === "object") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === "object") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === "object") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === "object") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } +} }); } + /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. * @@ -116291,8 +122142,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Page.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -116347,7 +122198,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const clone = super.clone(values, options) as unknown as Page; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];width?: number | null;height?: number | null;digestMultibase?: string | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Page { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -117280,8 +123195,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Person.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -117832,7 +123747,204 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];preferredUsername?: string | LanguageString | null; +preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; +publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; +services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;preferredLicense?: URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Person { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Person; + + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === "object") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === "object") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === "object") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === "object") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === "object") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === "object") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === "object") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === "object") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === "object") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === "object") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === "object") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === "object") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === "object") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === "object") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === "object") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === "object") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === "object") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } +} }); } + /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. * @@ -127713,8 +133825,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Place.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -127847,7 +133959,86 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];accuracy?: number | null;altitude?: number | null;latitude?: number | null;longitude?: number | null;radius?: number | null;units?: "cm" | "feet" | "inches" | "km" | "m" | "miles" | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Place { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Place; + + for (let i = 0; i < node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units.length; i++) { + const value = node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units[i]; + if (value != null && typeof value === "object") { + node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units[i] = context.value(value); + } + } +} }); } + /** Indicates the accuracy of position coordinates on a {@link Place} objects. * Expressed in properties of percentage. e.g. "94.0" means "94.0% accurate". * @@ -128875,8 +135066,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Profile.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -128944,7 +135135,86 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];describes?: Object | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Profile { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Profile; + + for (let i = 0; i < node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.length; i++) { + const value = node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[i]; + if (value != null && typeof value === "object") { + node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[i] = context.value(value); + } + } +} }); } + async #fetchDescribes( url: URL, options: { @@ -129985,8 +136255,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Question.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -130152,7 +136422,120 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOptions?: (Object | URL)[];closed?: Temporal.Instant | boolean | null;voters?: number | null;quote?: Object | URL | null;quoteUrl?: URL | null;quoteAuthorization?: QuoteAuthorization | URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Question { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Question; + + for (let i = 0; i < node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.length; i++) { + const value = node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[i]; + if (value != null && typeof value === "object") { + node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.length; i++) { + const value = node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[i]; + if (value != null && typeof value === "object") { + node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === "object") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === "object") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === "object") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } +} }); } + async #fetchExclusiveOption( url: URL, options: { @@ -132836,8 +139219,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Read.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -132898,7 +139281,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Read; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Read { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -133276,8 +139729,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Reject.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -133338,7 +139791,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Reject; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Reject { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -133823,8 +140346,8 @@ relationships?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Relationship.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -133976,7 +140499,102 @@ relationships?: (Object | URL)[];} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];subject?: Object | URL | null;object?: Object | URL | null; +objects?: (Object | URL)[];relationship?: Object | URL | null; +relationships?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Relationship { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Relationship; + + for (let i = 0; i < node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.length; i++) { + const value = node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[i]; + if (value != null && typeof value === "object") { + node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length; i++) { + const value = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i]; + if (value != null && typeof value === "object") { + node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length; i++) { + const value = node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[i]; + if (value != null && typeof value === "object") { + node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[i] = context.value(value); + } + } +} }); } + async #fetchSubject( url: URL, options: { @@ -136271,8 +142889,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Remove.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -136333,7 +142951,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Remove; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Remove { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -137247,8 +143935,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Service.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -137799,7 +144487,204 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];preferredUsername?: string | LanguageString | null; +preferredUsernames?: ((string | LanguageString))[];publicKey?: CryptographicKey | URL | null; +publicKeys?: (CryptographicKey | URL)[];assertionMethod?: Multikey | URL | null; +assertionMethods?: (Multikey | URL)[];gateway?: URL | null; +gateways?: (URL)[];manuallyApprovesFollowers?: boolean | null;inbox?: OrderedCollection | OrderedCollectionPage | URL | null;outbox?: OrderedCollection | OrderedCollectionPage | URL | null;following?: Collection | URL | null;followers?: Collection | URL | null;liked?: Collection | URL | null;featured?: Collection | URL | null;featuredTags?: Collection | URL | null;featuredCollections?: Collection | URL | null;streams?: (Collection | URL)[];endpoints?: Endpoints | null;discoverable?: boolean | null;suspended?: boolean | null;memorial?: boolean | null;indexable?: boolean | null;successor?: Application | Group | Organization | Person | Service | URL | null;alias?: Application | Group | Organization | Person | Service | URL | null; +aliases?: (Application | Group | Organization | Person | Service | URL)[];service?: DidService | URL | null; +services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | null;preferredLicense?: URL | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Service { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as Service; + + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === "object") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === "object") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === "object") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === "object") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === "object") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === "object") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === "object") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === "object") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === "object") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === "object") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === "object") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === "object") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === "object") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === "object") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === "object") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === "object") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } + + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === "object") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } +} }); } + /** A short username which may be used to refer to the actor, * with no uniqueness guarantees. * @@ -147717,8 +154602,8 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Source.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -147814,7 +154699,74 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + deepClone(values: +{ +id?: URL | null; +content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];mediaType?: string | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Source { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } +static { +deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as Source; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as Source; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); +} }); } + /** The source content. */ get content(): (string | LanguageString | null) { @@ -148418,8 +155370,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link TentativeAccept.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -148461,26 +155413,96 @@ targets?: (Object | URL)[];result?: Object | URL | null; results?: (Object | URL)[];origin?: Object | URL | null; origins?: (Object | URL)[];instrument?: Object | URL | null; instruments?: (Object | URL)[];} - - = {}, - options: { - documentLoader?: DocumentLoader, - contextLoader?: DocumentLoader, - verifyPortableObject?: PortableObjectVerifier, - } = {} - ): TentativeAccept { - if (this._warning != null) { - getLogger(this._warning.category).warn( - this._warning.message, - this._warning.values - ); - // @ts-ignore: $warning is not recognized as a property, but it is. - options = { ...options, $warning: this._warning }; - } - const clone = super.clone(values, options) as unknown as TentativeAccept; - return clone; + + = {}, + options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {} + ): TentativeAccept { + if (this._warning != null) { + getLogger(this._warning.category).warn( + this._warning.message, + this._warning.values + ); + // @ts-ignore: $warning is not recognized as a property, but it is. + options = { ...options, $warning: this._warning }; + } + const clone = super.clone(values, options) as unknown as TentativeAccept; + return clone; + } + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): TentativeAccept { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); } - + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -148858,8 +155880,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link TentativeReject.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -148920,7 +155942,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as TentativeReject; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): TentativeReject { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -149345,8 +156437,8 @@ formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Tombstone.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -149451,7 +156543,72 @@ formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];formerType?: $EntityType | null; +formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Tombstone { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** On a \`Tombstone\` object, the \`formerType\` property identifies the type of * the object that was deleted. * @@ -150089,8 +157246,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Travel.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -150151,7 +157308,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Travel; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Travel { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -150534,8 +157761,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Undo.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -150596,7 +157823,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Undo; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Undo { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -150977,8 +158274,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Update.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -151039,7 +158336,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as Update; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Update { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -151409,8 +158776,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link Video.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -151465,7 +158832,71 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const clone = super.clone(values, options) as unknown as Video; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];width?: number | null;height?: number | null;digestMultibase?: string | null;} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): Video { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. @@ -151861,8 +159292,8 @@ instruments?: (Object | URL)[];} * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link View.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -151923,7 +159354,77 @@ instruments?: (Object | URL)[];} const clone = super.clone(values, options) as unknown as View; return clone; } - + + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + override deepClone(values: +{ +id?: URL | null; +attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null; +attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null; +audiences?: (Object | URL)[];content?: string | LanguageString | null; +contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null; +names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null; +icons?: (Image | URL)[];image?: Image | URL | null; +images?: (Image | URL)[];replyTarget?: Object | Link | URL | null; +replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null; +locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null; +previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null; +summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null; +urls?: ((URL | Link))[];to?: Object | URL | null; +tos?: (Object | URL)[];bto?: Object | URL | null; +btos?: (Object | URL)[];cc?: Object | URL | null; +ccs?: (Object | URL)[];bcc?: Object | URL | null; +bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null; +proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;translations?: (Translation)[];licenses?: (URL)[];actor?: Application | Group | Organization | Person | Service | URL | null; +actors?: (Application | Group | Organization | Person | Service | URL)[];object?: Object | URL | null; +objects?: (Object | URL)[];target?: Object | URL | null; +targets?: (Object | URL)[];result?: Object | URL | null; +results?: (Object | URL)[];origin?: Object | URL | null; +origins?: (Object | URL)[];instrument?: Object | URL | null; +instruments?: (Object | URL)[];} += {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): View { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + } + /** * Converts this object to a JSON-LD structure. * @param options The options to use. diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index b363ebf89..9dbd57dae 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -1,5 +1,13 @@ import { generateDecoder, generateEncoder } from "./codec.ts"; -import { generateCloner, generateConstructor } from "./constructor.ts"; +import { + generateCloner, + generateConstructor, + generateDeepCloner, +} from "./constructor.ts"; +import { + generateDeepCloneDescriptor, + generateDeepCloneHelpers, +} from "./deep-clone.ts"; import { generateFields } from "./field.ts"; import { generateInspector, generateInspectorPostClass } from "./inspector.ts"; import { generateProperties } from "./property.ts"; @@ -36,6 +44,7 @@ const PORTABLE_DEREFERENCE_IMPORTS = [ "parseCompatibleEf61Reference", "type PortableResponseClaim", "recordPortableReferrer", + "retargetPortableReferrer", "rejectMalformedCompatibleReference", "warnUnverifiableEmbeddedObject", ].join(",\n "); @@ -192,6 +201,12 @@ async function* generateClass( for await (const code of generateFields(typeUri, types)) yield code; for await (const code of generateConstructor(typeUri, types)) yield code; for await (const code of generateCloner(typeUri, types)) yield code; + for await (const code of generateDeepCloner(typeUri, types)) { + yield code.replace(/[ \t]+$/gm, ""); + } + for await (const code of generateDeepCloneDescriptor(typeUri, types)) { + yield code.replace(/[ \t]+$/gm, ""); + } for await (const code of generateProperties(typeUri, types, moduleVarNames)) { yield code; } @@ -330,6 +345,7 @@ function inspectIri(iri: URL): string { try { return formatIri(iri); } catch { return iri.href; } } `; + yield generateDeepCloneHelpers(); yield ` function isValidLanguageTag(language: string): boolean { try { diff --git a/packages/vocab-tools/src/constructor.ts b/packages/vocab-tools/src/constructor.ts index a27a2c5f4..6aa1c21f4 100644 --- a/packages/vocab-tools/src/constructor.ts +++ b/packages/vocab-tools/src/constructor.ts @@ -219,8 +219,8 @@ export async function* generateCloner( * object. Hydrating a top-level property of the clone does not update this * instance's property. * - * To resolve properties without sharing nested objects, serialize and - * re-parse the instance before hydration rather than using this method. + * To resolve properties without sharing nested objects, use + * {@link ${type.name}.deepClone} before hydration. * See the [vocabulary manual](https://fedify.dev/manual/vocab#immutability) * for details, including how cached JSON-LD affects serialization. * @@ -360,5 +360,59 @@ export async function* generateCloner( yield ` return clone; } + `.trimEnd() + "\n"; +} + +export async function* generateDeepCloner( + typeUri: string, + types: Record, +): AsyncIterable { + const type = types[typeUri]; + yield ` + /** + * Copies this instance and its nested vocabulary objects, optionally + * replacing property values. Replacement values are copied too. + * + * Property arrays, URLs and byte arrays are independent of the source. + * Repeated references remain shared within the copy. References to this + * source in replacement values receive a separate copy of its pre-update + * values, rather than referring back to the updated root. + * Other scalar values, including opaque cryptographic keys, are shared. + * + * Each copied object retains its own default loaders, tracer, verifier + * and base URL. Options override defaults only on the root instance. + * This method does not fetch or serialize objects. Cached JSON-LD and + * retained signed representations are not copied; unknown JSON-LD + * properties and original formatting are not preserved. Sign the copy + * again if it needs a valid proof. + * + * Trust and portable provenance follow clone() rules at every level. + * Historical referrers within the graph are copied without replacements; + * referrers outside the graph still point at the original external objects. + * Custom clone() overrides must return fresh, compatible instances and + * remain responsible for their own constructor and cloning side effects. + * + * @param values The values to replace before copying the graph. + * @param options Root loader and verifier overrides. Undefined options + * retain the corresponding defaults. + * @returns An independent copy of the stored vocabulary graph. + * @since 2.5.0 + */ + ${emitOverride(typeUri, types)} deepClone(values: `; + for await (const code of generateParametersType(typeUri, types)) yield code; + yield `= {}, options: { + documentLoader?: DocumentLoader, + contextLoader?: DocumentLoader, + verifyPortableObject?: PortableObjectVerifier, + } = {}): ${type.name} { + const cloneOptions = { + documentLoader: options.documentLoader ?? this._documentLoader, + contextLoader: options.contextLoader ?? this._contextLoader, + verifyPortableObject: options.verifyPortableObject ?? this._verifyPortableObject, + tracerProvider: this._tracerProvider, + baseUrl: this._baseUrl, + }; + return deepCloneGraph(this, this.clone(values, cloneOptions)); + }\n`; } diff --git a/packages/vocab-tools/src/deep-clone.ts b/packages/vocab-tools/src/deep-clone.ts new file mode 100644 index 000000000..300cbd7ed --- /dev/null +++ b/packages/vocab-tools/src/deep-clone.ts @@ -0,0 +1,160 @@ +import { getFieldName } from "./field.ts"; +import type { PropertySchema, TypeSchema } from "./schema.ts"; +import { getTypeName } from "./type.ts"; + +function needsCopy( + property: PropertySchema, + types: Record, +): boolean { + return property.range.some((uri) => + uri in types || ["URL", "Uint8Array"].includes(getTypeName(uri, types)) + ); +} + +/** Emits module-private graph-copy support, shared by all generated classes. */ +export function generateDeepCloneHelpers(): string { + return ` +interface DeepCloneContext { + value(value: T): T; +} + +interface DeepCloneDescriptor { + create(source: object): object; + copy(destination: object, context: DeepCloneContext): void; +} + +const deepCloneDescriptors = new Map(); + +function getDeepCloneDescriptor(value: object): DeepCloneDescriptor | undefined { + let prototype: object | null = globalThis.Object.getPrototypeOf(value); + while (prototype != null) { + const descriptor = deepCloneDescriptors.get(prototype); + if (descriptor != null) return descriptor; + prototype = globalThis.Object.getPrototypeOf(prototype); + } + return undefined; +} + +function deepCloneGraph(source: object, root: T): T { + const memo = new Map(); + const destinations = new Set(); + const shells: object[] = []; + let next = 0; + + function enqueue(original: object, destination: object): void { + if (destination == null || typeof destination !== "object" || + original === destination || destinations.has(destination) || + !globalThis.Object.prototype.isPrototypeOf.call( + globalThis.Object.getPrototypeOf(original), destination + ) || getDeepCloneDescriptor(destination) == null) { + throw new TypeError("clone() must return a fresh, compatible instance."); + } + destinations.add(destination); + shells.push(destination); + } + + const context: DeepCloneContext = { + value(value: V): V { + if (value == null || typeof value !== "object") return value; + const existing = memo.get(value); + if (existing != null) return existing as V; + if (value instanceof URL) { + const copy = new URL(value.href); + memo.set(value, copy); + return copy as V; + } + if (value instanceof Uint8Array) { + const copy = new Uint8Array(value); + memo.set(value, copy); + return copy as V; + } + const descriptor = getDeepCloneDescriptor(value); + // Other supported scalars (Temporal, LanguageString, Intl.Locale, + // CryptoKey and class constructors) are shared as immutable values. + if (descriptor == null) return value; + const copy = descriptor.create(value); + enqueue(value, copy); + memo.set(value, copy); + return copy as V; + }, + }; + + function drain(): void { + while (next < shells.length) { + const shell = shells[next++]; + getDeepCloneDescriptor(shell)!.copy(shell, context); + } + } + + // The effective root includes replacements. References to the source root + // instead receive a separate copy of its pre-update values. + enqueue(source, root); + drain(); + + // Discover historical root ancestry without substituting replacement values + // into it. The resolver deliberately returns undefined in this first pass. + const count = shells.length; + for (let i = 0; i < count; i++) { + retargetPortableReferrer(shells[i], (original) => { + if (original === source) context.value(source); + return undefined; + }); + } + drain(); + for (const shell of shells) { + retargetPortableReferrer(shell, (original) => memo.get(original)); + } + return root; +} +`; +} + +/** Emits private-field copiers inside static blocks, keeping them out of d.ts. */ +export async function* generateDeepCloneDescriptor( + typeUri: string, + types: Record, +): AsyncIterable { + const type = types[typeUri]; + const properties = type.properties.filter((p) => needsCopy(p, types)); + if (type.extends != null && properties.length < 1) return; + yield `static {\n`; + if (type.extends == null) { + yield `deepCloneDescriptors.set(this.prototype, { + create(value: object): object { + const source = value as ${type.name}; + const options = { + documentLoader: source.#documentLoader, + contextLoader: source.#contextLoader, + tracerProvider: source.#tracerProvider, + verifyPortableObject: source.#verifyPortableObject, + baseUrl: source.#_baseUrl, + }; + return source.clone({}, options); + }, + copy(value: object, context: DeepCloneContext): void { + const node = value as ${type.name}; + const identified = node as { id: URL | null }; + identified.id = context.value(identified.id); + `; + } else { + yield `const base = getDeepCloneDescriptor(this.prototype)!; + deepCloneDescriptors.set(this.prototype, { + create: base.create, + copy(value: object, context: DeepCloneContext): void { + base.copy(value, context); + const node = value as ${type.name}; + `; + } + for (const property of properties) { + const field = await getFieldName(property.uri); + yield ` + for (let i = 0; i < node.${field}.length; i++) { + const value = node.${field}[i]; + if (value != null && typeof value === "object") { + node.${field}[i] = context.value(value); + } + } + `; + } + yield `} }); }\n`; +} diff --git a/packages/vocab/src/deep-clone.test.ts b/packages/vocab/src/deep-clone.test.ts new file mode 100644 index 000000000..9f07f97bd --- /dev/null +++ b/packages/vocab/src/deep-clone.test.ts @@ -0,0 +1,347 @@ +import { + createTestTracerProvider, + mockDocumentLoader, + test, +} from "@fedify/fixture"; +import { type DocumentLoader, LanguageString } from "@fedify/vocab-runtime"; +import { + deepStrictEqual, + notStrictEqual, + ok, + strictEqual, + throws, +} from "node:assert/strict"; +import { Buffer } from "node:buffer"; +import { + Accept, + Create, + DataIntegrityProof, + Endpoints, + Link, + Note, + Object as VocabularyObject, + Person, + QuoteRequest, + Reject, + Source, +} from "./vocab.ts"; + +const options = { contextLoader: mockDocumentLoader }; + +function personLoader(name: string, fetched: string[] = []): DocumentLoader { + // deno-lint-ignore require-await + return async (url) => { + fetched.push(url); + return { + contextUrl: null, + documentUrl: url, + document: { + "@context": "https://www.w3.org/ns/activitystreams", + id: url, + type: "Person", + name, + }, + }; + }; +} + +for (const hydrateOriginal of [false, true]) { + test(`deepClone() isolates embedded quote hydration (${hydrateOriginal})`, async () => { + const original = await QuoteRequest.fromJsonLd({ + "@context": ["https://www.w3.org/ns/activitystreams", { + QuoteRequest: "https://w3id.org/fep/044f#QuoteRequest", + }], + id: "https://a.example/requests/1", + type: "QuoteRequest", + instrument: { + id: "https://a.example/notes/1", + type: "Note", + attributedTo: "https://a.example/alice", + content: "Quoted", + }, + }, { ...options, documentLoader: personLoader("Alice") }); + const copy = original.deepClone(); + const sourceNote = await original.getInstrument(); + const copyNote = await copy.getInstrument(); + ok(sourceNote instanceof Note && copyNote instanceof Note); + notStrictEqual(copyNote, sourceNote); + const hydrated = hydrateOriginal ? sourceNote : copyNote; + strictEqual((await hydrated.getAttribution())?.name, "Alice"); + for (const Wrapper of [Accept, Reject]) { + const json = await new Wrapper({ + object: hydrateOriginal ? copy : original, + }).toJsonLd(options) as { + object: { instrument: { attributedTo: unknown } }; + }; + strictEqual( + json.object.instrument.attributedTo, + "https://a.example/alice", + ); + } + strictEqual(await original.getInstrument(), sourceNote); + strictEqual(await copy.getInstrument(), copyNote); + }); +} + +test("deepClone() copies replacements and preserves graph aliases", async () => { + const id = new URL("https://example.com/notes/1"); + const child = new Note({ id, url: id, content: "Child" }); + const source = new Create({ object: child, attachments: [child] }); + const copy = source.deepClone({ objects: [child, child] }); + const objects = await Array.fromAsync(copy.getObjects()); + const attachment = (await Array.fromAsync(copy.getAttachments()))[0]; + strictEqual(objects[0], objects[1]); + strictEqual(objects[0], attachment); + notStrictEqual(objects[0], child); + strictEqual(objects[0].id, objects[0].url); + notStrictEqual(objects[0].id, id); + objects[0].id!.pathname = "/changed"; + strictEqual(id.pathname, "/notes/1"); + strictEqual(await source.getObject(), child); + + const backReference = source.deepClone({ object: source }); + const snapshot = await backReference.getObject(); + ok(snapshot instanceof Create); + notStrictEqual(snapshot, source); + notStrictEqual(snapshot, backReference); + ok(await snapshot.getObject() instanceof Note); + await backReference.toJsonLd(options); +}); + +test("deepClone() copies non-entity vocabulary objects and standalone roots", () => { + const endpoint = new URL("https://example.com/inbox"); + const endpoints = new Endpoints({ sharedInbox: endpoint }); + const source = new Source({ content: "Markdown" }); + const person = new Person({ endpoints, source }); + const copy = person.deepClone(); + notStrictEqual(copy.endpoints, endpoints); + notStrictEqual(copy.source, source); + notStrictEqual(copy.endpoints!.sharedInbox, endpoint); + copy.endpoints!.sharedInbox!.pathname = "/copied"; + strictEqual(endpoint.pathname, "/inbox"); + const link = new Link({ href: endpoint }).deepClone(); + notStrictEqual(link.href, endpoint); + strictEqual(link.href!.href, endpoint.href); +}); + +test("deepClone() copies byte arrays including Buffer storage", async () => { + for (const bytes of [new Uint8Array([1, 2, 3]), Buffer.from([1, 2, 3])]) { + const proof = new DataIntegrityProof({ proofValue: bytes }); + const original = new Note({ proof }); + const copy = original.deepClone(); + const copiedProof = await copy.getProof(); + ok(copiedProof instanceof DataIntegrityProof); + notStrictEqual(copiedProof, proof); + notStrictEqual(copiedProof.proofValue, bytes); + copiedProof.proofValue![0] = 9; + strictEqual(bytes[0], 1); + bytes[1] = 8; + strictEqual(copiedProof.proofValue![1], 2); + } +}); + +test("deepClone() shares immutable scalars and preserves sparse arrays", () => { + const content = new LanguageString("Hello", "en"); + const published = Temporal.Instant.from("2026-10-27T00:00:00Z"); + const names = new Array(3); + names[2] = "Kept"; + const source = new Note({ names, content, published }); + const copy = source.deepClone(); + strictEqual(copy.content, content); + strictEqual(copy.published, published); + deepStrictEqual(copy.names, source.names); + strictEqual(0 in copy.names, false); + copy.names.push("Copy only"); + strictEqual(source.names.length, 3); +}); + +test("deepClone() retains node defaults and overrides only the root", async () => { + const fetched: string[] = []; + const [rootTracer, rootSpans] = createTestTracerProvider(); + const [childTracer, childSpans] = createTestTracerProvider(); + const child = new Note({ + attribution: new URL("https://example.com/child-actor"), + }, { + ...options, + documentLoader: personLoader("Child", fetched), + tracerProvider: childTracer, + }); + const source = new Create({ + actor: new URL("https://example.com/root-actor"), + object: child, + }, { + ...options, + documentLoader: personLoader("Root", fetched), + tracerProvider: rootTracer, + }); + const copy = source.deepClone({}, { + documentLoader: personLoader("Override"), + }); + strictEqual((await copy.getActor())?.name, "Override"); + const copiedChild = await copy.getObject(); + ok(copiedChild instanceof Note); + strictEqual((await copiedChild.getAttribution())?.name, "Child"); + strictEqual((await source.getActor())?.name, "Root"); + deepStrictEqual(fetched, [ + "https://example.com/child-actor", + "https://example.com/root-actor", + ]); + strictEqual(rootSpans.getSpans("activitypub.lookup_object").length, 2); + strictEqual(childSpans.getSpans("activitypub.lookup_object").length, 1); +}); + +test("deepClone() preserves origin checks and isolates hydrated trust", async () => { + let fetches = 0; + const original = await Create.fromJsonLd({ + "@context": "https://www.w3.org/ns/activitystreams", + id: "https://a.example/create", + type: "Create", + object: { + id: "https://b.example/note", + type: "Note", + content: "Embedded", + }, + }, { + ...options, + // deno-lint-ignore require-await + documentLoader: async (url) => { + fetches++; + return { + contextUrl: null, + documentUrl: url, + document: { + "@context": "https://www.w3.org/ns/activitystreams", + id: url, + type: "Note", + content: "Fetched", + }, + }; + }, + }); + const copy = original.deepClone(); + strictEqual((await copy.getObject())?.content, "Fetched"); + strictEqual(fetches, 1); + strictEqual( + (await original.getObject({ crossOrigin: "trust" }))?.content, + "Embedded", + ); + strictEqual((await original.getObject())?.content, "Fetched"); + strictEqual(fetches, 2); +}); + +test("deepClone() keeps base URLs and discards cached JSON-LD", async () => { + const source = await Note.fromJsonLd({ + "@context": ["https://www.w3.org/ns/activitystreams", { + extension: "https://example.com/extension", + }], + type: "Note", + id: "./note", + attributedTo: "./alice", + extension: "received only", + }, { + ...options, + baseUrl: new URL("https://example.com/posts/"), + documentLoader: personLoader("Alice"), + }); + const copy = source.deepClone({ content: "Copy" }); + strictEqual(copy.id!.href, "https://example.com/posts/note"); + strictEqual( + (await copy.getAttribution())?.id?.href, + "https://example.com/posts/alice", + ); + const json = await copy.toJsonLd(options) as Record; + strictEqual(json.content, "Copy"); + strictEqual(json.extension, undefined); + strictEqual( + (await source.toJsonLd() as Record).extension, + "received only", + ); +}); + +test("deepClone() validates replacements through clone() only", () => { + const source = new Note({ content: "Source" }); + for ( + const values of [ + { id: 42 }, + { name: "one", names: ["two"] }, + { names: [42] }, + ] + ) { + throws(() => source.deepClone(values as never), TypeError); + } + function values(counter: { reads: number }) { + return Object.create({ + get content() { + counter.reads++; + return "Inherited"; + }, + }) as { content: string }; + } + const shallowReads = { reads: 0 }; + const deepReads = { reads: 0 }; + strictEqual(source.clone(values(shallowReads)).content, "Inherited"); + strictEqual(source.deepClone(values(deepReads)).content, "Inherited"); + strictEqual(deepReads.reads, shallowReads.reads); +}); + +test("deepClone() preserves user subclasses and handles deep graphs", async () => { + class CustomNote extends Note {} + const child = new CustomNote({ content: "Child" }); + const copiedChild = await new Create({ object: child }).deepClone() + .getObject(); + ok(copiedChild instanceof CustomNote); + notStrictEqual(copiedChild, child); + let source = new Note({ content: "End" }); + for (let i = 0; i < 3000; i++) source = new Note({ replyTarget: source }); + let copy = source.deepClone(); + for (let i = 0; i < 3000; i++) { + const next = await copy.getReplyTarget(); + ok(next instanceof Note); + copy = next; + } + strictEqual(copy.content, "End"); +}); + +test("deepClone() rejects broken subclass clone results", () => { + class ReturnsSelf extends Note { + override clone(): this { + return this; + } + } + const source = new ReturnsSelf({ id: new URL("https://example.com/note") }); + const id = source.id; + throws(() => source.deepClone(), /fresh, compatible/); + strictEqual(source.id, id); + + class Incompatible extends Note { + override clone(): Note { + return new VocabularyObject({}) as Note; + } + } + throws(() => new Incompatible({}).deepClone(), /fresh, compatible/); + + class ReusesCopy extends Note { + static copy: Note | undefined; + override clone(): Note { + return ReusesCopy.copy ??= super.clone(); + } + } + const first = new ReusesCopy({ content: "First" }); + const second = new ReusesCopy({ content: "Second" }); + throws( + () => new Create({ objects: [first, second] }).deepClone(), + /fresh, compatible/, + ); + strictEqual(first.content, "First"); + strictEqual(second.content, "Second"); + + class Throws extends Note { + override clone(): never { + throw new Error("Copy failed"); + } + } + const child = new Throws({ content: "Unchanged" }); + const parent = new Create({ object: child }); + throws(() => parent.deepClone(), /Copy failed/); + strictEqual(child.content, "Unchanged"); +}); diff --git a/packages/vocab/src/gateway.test.ts b/packages/vocab/src/gateway.test.ts index 06e72acf4..f6d594679 100644 --- a/packages/vocab/src/gateway.test.ts +++ b/packages/vocab/src/gateway.test.ts @@ -6,6 +6,7 @@ import { import { type DocumentLoader, FetchError, + formatIri, getDocumentLoader, parseIri, type PortableObjectVerification, @@ -1062,6 +1063,81 @@ test("getFirst() passes the referrer chain and collection context", async () => ok(referrer?.referrer?.referrer?.referrer?.object === create); }); +test("deepClone() preserves historical ancestry independently of replacements", async () => { + const context = Object.freeze({}); + const documentLoader = createLoader({ + [gatewayUrl("https://gw.example", "/actor/outbox")]: portableCollection( + "/actor/outbox", + { + attributedTo: `ap://${did}/actor`, + first: { + id: `ap://${did}/actor/outbox?page=1`, + type: "OrderedCollectionPage", + // An existing mismatch must not be rewritten to match root overrides. + partOf: `ap://${did}/other/outbox`, + next: `ap://${did}/actor/outbox?page=2`, + }, + }, + ), + [gatewayUrl("https://gw.example", "/actor/outbox?page=2")]: { + "@context": "https://www.w3.org/ns/activitystreams", + id: `ap://${did}/actor/outbox?page=2`, + type: "OrderedCollectionPage", + }, + [gatewayUrl("https://gw.example", "/actor")]: { + "@context": "https://www.w3.org/ns/activitystreams", + id: `ap://${did}/actor`, + type: "Person", + name: "Fetched actor", + }, + }); + const verifier = createRecordingVerifier(() => ({ + verified: true, + collectionContext: context, + })); + const options = { + documentLoader, + contextLoader: mockDocumentLoader, + gateways: ["https://gw.example"], + verifyPortableObject: verifier, + }; + const actor = await Person.fromJsonLd({ + "@context": "https://www.w3.org/ns/activitystreams", + id: `ap://${did}/actor`, + type: "Person", + outbox: `ap://${did}/actor/outbox`, + }, { contextLoader: mockDocumentLoader }); + const outbox = await actor.getOutbox(options); + assertInstanceOf(outbox, OrderedCollection); + // Record first -> outbox provenance before copying. + const first = await outbox.getFirst(options); + assertInstanceOf(first, CollectionPage); + const copy = outbox.deepClone({ + id: parseIri(`ap://${did}/other/outbox`), + attribution: parseIri(`ap://${did}/different-actor`), + }); + const copiedFirst = await copy.getFirst(options); + assertInstanceOf(copiedFirst, CollectionPage); + ok(copiedFirst !== first); + await copiedFirst.getNext(options); + const referrer = verifier.calls.at(-1)!.options.referrer; + ok(referrer?.object === copiedFirst); + const history = referrer.referrer; + ok(history?.object instanceof OrderedCollection); + ok(history.object !== copy && history.object !== outbox); + deepStrictEqual(history.id, outbox.id); + deepStrictEqual(history.acceptance, undefined); + deepStrictEqual(history.collectionContext, undefined); + deepStrictEqual(history.object.attributionId, outbox.attributionId); + deepStrictEqual(copiedFirst.partOfId, first.partOfId); + ok(copiedFirst.partOfId!.href !== history.id!.href); + // External ancestry is retained, while in-graph history can hydrate safely. + ok(history.referrer?.object === actor); + await history.object.getAttribution(options); + const originalJson = await outbox.toJsonLd() as Record; + deepStrictEqual(originalJson.attributedTo, formatIri(outbox.attributionId!)); +}); + test("accessors do not trust objects embedded in unsecured collections", async () => { const itemPath = "/objects/1"; const documentLoader = createLoader({ @@ -1116,14 +1192,14 @@ test("accessors do not trust objects embedded in unsecured collections", async ( // again (and fail here, since nothing can be fetched): const outbox3 = await (await createPerson()).getOutbox(options); assertInstanceOf(outbox3, Collection); - const items3 = await Array.fromAsync( - outbox3.clone().getItems({ + for (const copy of [outbox3.clone(), outbox3.deepClone()]) { + const items3 = await Array.fromAsync(copy.getItems({ ...options, documentLoader: createLoader({}), suppressError: true, - }), - ); - deepStrictEqual(items3, []); + })); + deepStrictEqual(items3, []); + } }); function createRedirectingLoader( diff --git a/packages/vocab/src/signed-representation.test.ts b/packages/vocab/src/signed-representation.test.ts index aa8ef5af0..1ffe0f2ce 100644 --- a/packages/vocab/src/signed-representation.test.ts +++ b/packages/vocab/src/signed-representation.test.ts @@ -193,6 +193,27 @@ test("a clone does not inherit a retained signed representation", async () => { deepStrictEqual(embedded.content, "Changed"); }); +test("deepClone() drops retained signed representations at every level", async () => { + const note = retainedNote(); + const original = new Create({ object: note }); + retainSignedRepresentation(original, { + "@context": "https://www.w3.org/ns/activitystreams", + type: "Create", + content: "Retained root only", + }); + const copied = original.deepClone(); + const json = await new Create({ object: copied }).toJsonLd(options) as { + object: { content?: unknown; object: Record }; + }; + deepStrictEqual(json.object.content, undefined); + deepStrictEqual(json.object.object.content, "Hello"); + deepStrictEqual(json.object.object.proof, undefined); + const originalJson = await new Create({ object: note }).toJsonLd(options) as { + object: unknown; + }; + deepStrictEqual(originalJson.object, securedNote); +}); + test("every generated default context keeps placeholders recoverable", async () => { interface VocabClass { new (values: { id?: URL | null }): { toJsonLd(): Promise }; diff --git a/packages/vocab/src/vocab.bench.ts b/packages/vocab/src/vocab.bench.ts index d8d1d6336..c68355cc5 100644 --- a/packages/vocab/src/vocab.bench.ts +++ b/packages/vocab/src/vocab.bench.ts @@ -1,4 +1,4 @@ -import { Collection, Object } from "./vocab.ts"; +import { Collection, Create, Note, Object, Person } from "./vocab.ts"; const jsonLd = { "@context": [ @@ -202,3 +202,42 @@ Deno.bench("Collection.toJsonLd()", async (b) => { await collection.toJsonLd(); b.end(); }); + +const actor = new Person({ + id: new URL("https://example.com/alice"), + name: "Alice", +}); +const activity = new Create({ + id: new URL("https://example.com/activities/1"), + actor, + object: new Note({ + id: new URL("https://example.com/notes/1"), + content: "Hello, world!", + attribution: actor, + published: Temporal.Instant.from("2026-10-27T00:00:00Z"), + to: new URL("https://www.w3.org/ns/activitystreams#Public"), + }), +}); + +Deno.bench({ + name: "Create.clone()", + group: "activity copy", + baseline: true, + fn() { + activity.clone(); + }, +}); +Deno.bench({ + name: "Create.deepClone()", + group: "activity copy", + fn() { + activity.deepClone(); + }, +}); +Deno.bench({ + name: "Create JSON-LD round trip", + group: "activity copy", + async fn() { + await Create.fromJsonLd(await activity.toJsonLd()); + }, +}); From b58a264169b56f7c28ebb6b59af8e79e8905f09f Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 29 Oct 2026 23:15:26 +0900 Subject: [PATCH 2/2] Copy sparse vocabulary arrays efficiently Keep sparse property-array length and holes while copying stored indices, and replace per-slot trust bookkeeping with a prefix on private sets. Reuse only clean constructor-created sets to retain independent trust without redundant allocations. Keep native array handling for detectable exotic inputs and validate each value stored by sparse input copying. Cover mutation, aliases and subclass constructor defaults, and document the snapshot behavior. https://github.com/fedify-dev/fedify/pull/1337#discussion_r4410718651 Assisted-by: Codex:gpt-6.1-sol Assisted-by: Codex:gpt-6-astra Assisted-by: Claude Code:claude-opus-5-5 --- CHANGES.md | 5 +- changes.d/vocab/deep-clone.md | 5 +- claude-plugin/skills/fedify/SKILL.md | 4 + docs/manual/vocab.md | 14 + .../src/__snapshots__/class.test.ts.deno.snap | 14018 +++++++++++++--- .../src/__snapshots__/class.test.ts.node.snap | 14018 +++++++++++++--- .../src/__snapshots__/class.test.ts.snap | 14018 +++++++++++++--- packages/vocab-tools/src/class.ts | 2 + packages/vocab-tools/src/constructor.ts | 76 +- packages/vocab-tools/src/deep-clone.ts | 23 +- packages/vocab-tools/src/field.ts | 2 +- packages/vocab-tools/src/property-array.ts | 198 + packages/vocab-tools/src/property.ts | 24 +- packages/vocab/src/sparse-arrays.test.ts | 507 + packages/vocab/src/vocab.bench.ts | 23 + 15 files changed, 34700 insertions(+), 8237 deletions(-) create mode 100644 packages/vocab-tools/src/property-array.ts create mode 100644 packages/vocab/src/sparse-arrays.test.ts diff --git a/CHANGES.md b/CHANGES.md index 2667a8253..aab79557a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -216,7 +216,10 @@ To be released. - Added `deepClone()` to vocabulary objects to copy nested objects before resolving their properties, keeping the source graph unchanged. Replacement values are copied too. Use `clone()` when a shallow copy is sufficient. - [[#1243], [#1337]] + Large sparse property arrays retain their length and holes without creating + per-slot trust bookkeeping. Keep arrays stable while copying; newly added + entries may not be visited. Accessor and serialization traversal costs are + unchanged. [[#1243], [#1337]] - Added vocabulary support for the [FEP-6757] draft, which marks ActivityPub content with explicit copyright license URIs. diff --git a/changes.d/vocab/deep-clone.md b/changes.d/vocab/deep-clone.md index e41ab977a..ea4773757 100644 --- a/changes.d/vocab/deep-clone.md +++ b/changes.d/vocab/deep-clone.md @@ -6,4 +6,7 @@ links: - Added `deepClone()` to vocabulary objects to copy nested objects before resolving their properties, keeping the source graph unchanged. Replacement values are copied too. Use `clone()` when a shallow copy is sufficient. - [[#1243], [#1337]] + Large sparse property arrays retain their length and holes without creating + per-slot trust bookkeeping. Keep arrays stable while copying; newly added + entries may not be visited. Accessor and serialization traversal costs are + unchanged. [[#1243], [#1337]] diff --git a/claude-plugin/skills/fedify/SKILL.md b/claude-plugin/skills/fedify/SKILL.md index ec3a8ba29..f8420b508 100644 --- a/claude-plugin/skills/fedify/SKILL.md +++ b/claude-plugin/skills/fedify/SKILL.md @@ -272,6 +272,10 @@ values are copied too. Each copied node keeps its own default loaders and verifier; second-argument options override only the root. The copy drops cached JSON-LD and retained signed representations, so retain the received document when its exact representation matters and sign copies again when needed. +Keep property arrays stable during copying, including inside custom `clone()` +overrides: `deepClone()` snapshots the existing indices of large sparse arrays. +Entries added during copying are not visited, so their nested objects may +remain shared. Copying preserves array length and holes. > [!WARNING] > `crossOrigin: "trust"` on vocabulary deserialization trusts embedded diff --git a/docs/manual/vocab.md b/docs/manual/vocab.md index 0006e7ca6..b244425c1 100644 --- a/docs/manual/vocab.md +++ b/docs/manual/vocab.md @@ -999,6 +999,20 @@ shallow copy is sufficient. When copying a subclass, `deepClone()` calls its `clone()` override. Such overrides must return fresh, compatible instances and are responsible for their own side effects. +Property arrays keep their length and holes when copied. Large sparse +arrays with ordinary data entries use a snapshot of their existing indices. +Entries added after that snapshot are not visited, while deleted entries are +skipped. Keep property arrays stable during copying, including inside custom +`clone()` overrides, to preserve isolation of the copied graph. Indexed +getters, array subclasses and custom species use the existing array operations +when detected; Proxy traps can observe different reads and reflection +operations. + +Trust for constructor-supplied objects follows the length of the stored +array. Building that trust does not read non-scalar plural input getters once +per slot. Sparse arrays can still be expensive to traverse through accessors +or to serialize. + Cached JSON-LD and retained signed representations are discarded at every copied node. The copy therefore reflects modeled property values, not unknown JSON-LD properties or the original document's formatting. Sign the copy again diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 6accbe781..67a576d05 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -82,6 +82,200 @@ function inspectIri(iri: URL): string { try { return formatIri(iri); } catch { return iri.href; } } +interface VocabSparseArraySnapshot { + length: number; + indices: number[]; +} + +interface VocabArrayValidation { + valid: boolean; + sparse: boolean; +} + +type VocabArrayCopy = { ok: true; array: T[] } | { ok: false }; + +// Most fields have no trusted prefix. Keep that metadata on the existing Set +// so empty fields need neither another object nor another instance slot. +const vocabTrustPrefix: unique symbol = Symbol(\\"vocabulary trust prefix\\"); +type VocabTrustSet = Set & { [vocabTrustPrefix]?: number }; + +function vocabSetTrustPrefix(trust: VocabTrustSet, prefix: number): void { + if (prefix > 0) trust[vocabTrustPrefix] = prefix; +} + +function vocabCopyTrustSet( + trust: VocabTrustSet, + destination: VocabTrustSet, +): VocabTrustSet { + // clone() already constructed the destination. Reuse its empty Set only + // when constructor defaults cannot contribute trust to the copied field. + const copy: VocabTrustSet = trust !== destination && trust.size === 0 && + destination.size === 0 && destination[vocabTrustPrefix] == null + ? destination : new Set(trust); + const prefix = trust[vocabTrustPrefix]; + if (prefix != null && prefix > 0) copy[vocabTrustPrefix] = prefix; + return copy; +} + +// These thresholds select an optimization, not a limit on property arrays. +const vocabSparseArrayMinimumLength = 4096; +const vocabSparseArrayProbeCount = 8; +const vocabSparseArrayPresentProbeLimit = 4; +const vocabArrayPrototype = Array.prototype; +const vocabObjectPrototype = globalThis.Object.prototype; +const vocabArrayDescriptors = [\\"constructor\\", \\"every\\", \\"slice\\"].map( + key => globalThis.Object.getOwnPropertyDescriptor(vocabArrayPrototype, key), +); +const vocabArraySpeciesDescriptor = globalThis.Object.getOwnPropertyDescriptor( + Array, Symbol.species, +); + +function vocabSameArrayDescriptor( + actual: PropertyDescriptor | undefined, + expected: PropertyDescriptor | undefined, +): boolean { + return actual?.value === expected?.value && actual?.get === expected?.get && + actual?.set === expected?.set && actual?.writable === expected?.writable && + actual?.enumerable === expected?.enumerable && + actual?.configurable === expected?.configurable; +} + +function vocabArrayIndex(key: string): number | undefined { + const index = Number(key); + return Number.isInteger(index) && index >= 0 && index < 0xffffffff && + String(index) === key + ? index + : undefined; +} + +function vocabSparseArraySnapshot( + array: unknown[], +): VocabSparseArraySnapshot | undefined { + if (!Array.isArray(array)) return undefined; + const length = array.length; + // Small dense fields take no prototype or key-enumeration overhead. + if (length < vocabSparseArrayMinimumLength) return undefined; + if (!Number.isInteger(length) || length > 0xffffffff || + globalThis.Object.getPrototypeOf(array) !== vocabArrayPrototype || + globalThis.Object.getPrototypeOf(vocabArrayPrototype) !== + vocabObjectPrototype || + globalThis.Object.getPrototypeOf(vocabObjectPrototype) !== null) { + return undefined; + } + const methods = [\\"constructor\\", \\"every\\", \\"slice\\"]; + for (let i = 0; i < methods.length; i++) { + const key = methods[i]; + if (globalThis.Object.hasOwn(array, key) || + !vocabSameArrayDescriptor( + globalThis.Object.getOwnPropertyDescriptor(vocabArrayPrototype, key), + vocabArrayDescriptors[i], + )) return undefined; + } + if (!vocabSameArrayDescriptor( + globalThis.Object.getOwnPropertyDescriptor(Array, Symbol.species), + vocabArraySpeciesDescriptor, + )) return undefined; + + // Descriptor probes do not invoke element getters. Plainly dense arrays + // keep native iteration without enumerating all their keys. + let present = 0; + for (let i = 0; i < vocabSparseArrayProbeCount; i++) { + const index = Math.floor(i * (length - 1) / (vocabSparseArrayProbeCount - 1)); + if (globalThis.Object.getOwnPropertyDescriptor(array, index) != null && + ++present >= vocabSparseArrayPresentProbeLimit) return undefined; + } + for (const prototype of [vocabArrayPrototype, vocabObjectPrototype]) { + for (const key of globalThis.Object.getOwnPropertyNames(prototype)) { + if (vocabArrayIndex(key) != null) return undefined; + } + } + const indices: number[] = []; + for (const key of globalThis.Object.getOwnPropertyNames(array)) { + const index = vocabArrayIndex(key); + if (index != null && index < length) indices.push(index); + } + if (indices.length >= length / 2) return undefined; + for (const index of indices) { + const descriptor = globalThis.Object.getOwnPropertyDescriptor(array, index); + if (descriptor == null || !(\\"value\\" in descriptor)) return undefined; + } + // Ordinary array keys already have canonical index order. This guard is + // not a Proxy detector; reflection traps and errors remain observable. + return { length, indices }; +} + +function vocabValidatePropertyArray( + array: T[], + test: (value: T) => boolean, +): VocabArrayValidation { + const snapshot = vocabSparseArraySnapshot(array); + if (snapshot == null) return { valid: array.every(test), sparse: false }; + for (const index of snapshot.indices) { + if (globalThis.Object.hasOwn(array, index) && !test(array[index])) { + return { valid: false, sparse: true }; + } + } + return { valid: true, sparse: true }; +} + +function vocabDefineArrayEntry(array: T[], index: number, value: T): void { + globalThis.Object.defineProperty(array, index, { + value, writable: true, enumerable: true, configurable: true, + }); +} + +function vocabCopySparsePropertyArray( + array: T[], + snapshot: VocabSparseArraySnapshot, + test?: (value: T) => boolean, +): VocabArrayCopy { + const copy: T[] = []; + // Seed dictionary storage before low indices or the final length can + // allocate storage for every hole. The temporary entry stays private. + if (snapshot.indices[snapshot.indices.length - 1] !== snapshot.length - 1) { + globalThis.Object.defineProperty(copy, snapshot.length - 1, { + value: undefined, writable: true, enumerable: true, configurable: true, + }); + delete copy[snapshot.length - 1]; + } + for (const index of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, index)) continue; + const value = array[index]; + if (test != null && !test(value)) return { ok: false }; + vocabDefineArrayEntry(copy, index, value); + } + // A validation callback may have deleted the last snapshot entry. + if (copy.length < snapshot.length) { + globalThis.Object.defineProperty(copy, snapshot.length - 1, { + value: undefined, writable: true, enumerable: true, configurable: true, + }); + delete copy[snapshot.length - 1]; + } + copy.length = snapshot.length; + return { ok: true, array: copy }; +} + +function vocabCopyPropertyArray(array: T[]): T[] { + const snapshot = vocabSparseArraySnapshot(array); + if (snapshot == null) return array.slice(); + const copied = vocabCopySparsePropertyArray(array, snapshot); + // Without a predicate the private copy cannot fail validation. + return (copied as { ok: true; array: T[] }).array; +} + +function vocabCopyValidatedPropertyArray( + array: T[], + test: (value: T) => boolean, + previous: VocabArrayValidation, +): VocabArrayCopy { + const snapshot = vocabSparseArraySnapshot(array); + if (snapshot != null) return vocabCopySparsePropertyArray(array, snapshot, test); + // Sparse validation may have changed the next input's density, descriptors + // or prototype. Validate that native-copy input before falling back. + if (previous.sparse && !array.every(test)) return { ok: false }; + return { ok: true, array: array.slice() }; +} + interface DeepCloneContext { value(value: T): T; } @@ -336,87 +530,87 @@ export class Object { } #_49BipA5dq9eoH8LX8xdsVumveTca_attachment: (Object | Link | PropertyValue | URL)[] = []; - #_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment: Set = new Set(); + #_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment: VocabTrustSet = new Set(); #_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo: Set = new Set(); + #_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo: VocabTrustSet = new Set(); #_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience: (Object | URL)[] = []; - #_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience: Set = new Set(); + #_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience: VocabTrustSet = new Set(); #_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content: ((string | LanguageString))[] = []; #_3mhZzGXSpQ431mBSz2kvych22v4e_context: (Object | Link | URL)[] = []; - #_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context: Set = new Set(); + #_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context: VocabTrustSet = new Set(); #_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name: ((string | LanguageString))[] = []; #_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime: (Temporal.Instant)[] = []; #_86xFhmgBapoMvYqjbjRuDPayTrS_generator: (Object | Link | URL)[] = []; - #_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator: Set = new Set(); + #_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator: VocabTrustSet = new Set(); #_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon: (Image | URL)[] = []; - #_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon: Set = new Set(); + #_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon: VocabTrustSet = new Set(); #_3dXrUdkARxwyJLtJcYi1AJ92H41U_image: (Image | URL)[] = []; - #_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image: Set = new Set(); + #_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image: VocabTrustSet = new Set(); #_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo: (Object | Link | URL)[] = []; - #_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo: Set = new Set(); + #_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo: VocabTrustSet = new Set(); #_31k5MUZJsnsPNg8dQQJieWaXTFnR_location: (Object | Link | URL)[] = []; - #_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location: Set = new Set(); + #_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location: VocabTrustSet = new Set(); #_gCVTegXxWWCw6wWRxa1QF65zusg_preview: (Link | Object | URL)[] = []; - #_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: Set = new Set(); + #_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: VocabTrustSet = new Set(); #_5e258TDXtuhaFRPZiGoDfEpjdMr_published: (Temporal.Instant)[] = []; #_7UpwM3JWcXhADcscukEehBorf6k_replies: (Collection | URL)[] = []; - #_trust_7UpwM3JWcXhADcscukEehBorf6k_replies: Set = new Set(); + #_trust_7UpwM3JWcXhADcscukEehBorf6k_replies: VocabTrustSet = new Set(); #_3kAfck9PcEYt2L7xug5y99YPbANs_shares: (Collection | URL)[] = []; - #_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares: Set = new Set(); + #_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares: VocabTrustSet = new Set(); #_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes: (Collection | URL)[] = []; - #_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes: Set = new Set(); + #_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes: VocabTrustSet = new Set(); #_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions: (Collection | URL)[] = []; - #_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions: Set = new Set(); + #_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions: VocabTrustSet = new Set(); #_2w3Jmue4up8iVDUA51WZqomEF438_startTime: (Temporal.Instant)[] = []; #_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary: ((string | LanguageString))[] = []; #_5chuqj6s95p5gg2sk1HntGfarRf_tag: (Object | Link | URL)[] = []; - #_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag: Set = new Set(); + #_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag: VocabTrustSet = new Set(); #_385aB7ySixcf5Un6z3VsWmThgCzQ_updated: (Temporal.Instant)[] = []; #_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url: ((URL | Link))[] = []; #_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to: (Object | URL)[] = []; - #_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to: Set = new Set(); + #_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to: VocabTrustSet = new Set(); #_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto: (Object | URL)[] = []; - #_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto: Set = new Set(); + #_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto: VocabTrustSet = new Set(); #_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc: (Object | URL)[] = []; - #_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc: Set = new Set(); + #_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc: VocabTrustSet = new Set(); #_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc: (Object | URL)[] = []; - #_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc: Set = new Set(); + #_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc: VocabTrustSet = new Set(); #_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType: (string)[] = []; #_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration: (Temporal.Duration)[] = []; #_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive: (boolean)[] = []; #_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source: (Source)[] = []; #_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof: (DataIntegrityProof | URL)[] = []; - #_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof: Set = new Set(); + #_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof: VocabTrustSet = new Set(); #_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy: (InteractionPolicy)[] = []; #_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy: (URL)[] = []; #_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization: (LikeAuthorization | URL)[] = []; - #_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization: Set = new Set(); + #_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization: VocabTrustSet = new Set(); #_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization: (ReplyAuthorization | URL)[] = []; - #_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization: Set = new Set(); + #_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization: VocabTrustSet = new Set(); #_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization: (AnnounceAuthorization | URL)[] = []; - #_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization: Set = new Set(); + #_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization: VocabTrustSet = new Set(); #_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations: (Translation)[] = []; #_2rzkBRS4gNPrkJk9DohHAMUAxA2d: (URL)[] = []; @@ -476,14 +670,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (\\"attachments\\" in values && values.attachments != null) { - if (Array.isArray(values.attachments) && - values.attachments.every(v => v instanceof Object || v instanceof Link || v instanceof PropertyValue || v instanceof URL)) { + let copied!: (Object | Link | PropertyValue | URL)[]; + let valid = false; + if (Array.isArray(values.attachments)) { + const array = values.attachments; + const test = (v: Object | Link | PropertyValue | URL): boolean => v instanceof Object || v instanceof Link || v instanceof PropertyValue || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.attachments; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = values.attachments.slice(); + this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = copied; - for (let i = 0; i < values.attachments.length; i++) { - this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.add(i); - } + vocabSetTrustPrefix(this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment, this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length); } else { throw new TypeError( @@ -516,14 +732,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.attributions) && - values.attributions.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.attributions)) { + const array = values.attributions; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.attributions; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = values.attributions.slice(); + this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = copied; - for (let i = 0; i < values.attributions.length; i++) { - this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.add(i); - } + vocabSetTrustPrefix(this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo, this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length); } else { throw new TypeError( @@ -556,14 +794,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.audiences) && - values.audiences.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.audiences)) { + const array = values.audiences; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.audiences; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = values.audiences.slice(); + this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = copied; - for (let i = 0; i < values.audiences.length; i++) { - this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.add(i); - } + vocabSetTrustPrefix(this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience, this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length); } else { throw new TypeError( @@ -596,10 +856,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.contents) && - values.contents.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.contents)) { + const array = values.contents; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.contents; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = values.contents.slice(); + this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = copied; } else { throw new TypeError( @@ -611,14 +895,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (\\"contexts\\" in values && values.contexts != null) { - if (Array.isArray(values.contexts) && - values.contexts.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.contexts)) { + const array = values.contexts; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.contexts; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context = values.contexts.slice(); + this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context = copied; - for (let i = 0; i < values.contexts.length; i++) { - this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.add(i); - } + vocabSetTrustPrefix(this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context, this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.length); } else { throw new TypeError( @@ -651,10 +957,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.names) && - values.names.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.names)) { + const array = values.names; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.names; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = values.names.slice(); + this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = copied; } else { throw new TypeError( @@ -679,14 +1009,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (\\"generators\\" in values && values.generators != null) { - if (Array.isArray(values.generators) && - values.generators.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.generators)) { + const array = values.generators; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.generators; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = values.generators.slice(); + this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = copied; - for (let i = 0; i < values.generators.length; i++) { - this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.add(i); - } + vocabSetTrustPrefix(this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator, this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.length); } else { throw new TypeError( @@ -719,14 +1071,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.icons) && - values.icons.every(v => v instanceof Image || v instanceof URL)) { + let copied!: (Image | URL)[]; + let valid = false; + if (Array.isArray(values.icons)) { + const array = values.icons; + const test = (v: Image | URL): boolean => v instanceof Image || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.icons; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = values.icons.slice(); + this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = copied; - for (let i = 0; i < values.icons.length; i++) { - this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.add(i); - } + vocabSetTrustPrefix(this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon, this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length); } else { throw new TypeError( @@ -759,14 +1133,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.images) && - values.images.every(v => v instanceof Image || v instanceof URL)) { + let copied!: (Image | URL)[]; + let valid = false; + if (Array.isArray(values.images)) { + const array = values.images; + const test = (v: Image | URL): boolean => v instanceof Image || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.images; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = values.images.slice(); + this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = copied; - for (let i = 0; i < values.images.length; i++) { - this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.add(i); - } + vocabSetTrustPrefix(this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image, this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length); } else { throw new TypeError( @@ -799,14 +1195,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.replyTargets) && - values.replyTargets.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.replyTargets)) { + const array = values.replyTargets; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.replyTargets; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = values.replyTargets.slice(); + this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = copied; - for (let i = 0; i < values.replyTargets.length; i++) { - this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.add(i); - } + vocabSetTrustPrefix(this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo, this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length); } else { throw new TypeError( @@ -839,14 +1257,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.locations) && - values.locations.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.locations)) { + const array = values.locations; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.locations; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = values.locations.slice(); + this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = copied; - for (let i = 0; i < values.locations.length; i++) { - this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.add(i); - } + vocabSetTrustPrefix(this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location, this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length); } else { throw new TypeError( @@ -879,14 +1319,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.previews) && - values.previews.every(v => v instanceof Link || v instanceof Object || v instanceof URL)) { + let copied!: (Link | Object | URL)[]; + let valid = false; + if (Array.isArray(values.previews)) { + const array = values.previews; + const test = (v: Link | Object | URL): boolean => v instanceof Link || v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.previews; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = values.previews.slice(); + this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = copied; - for (let i = 0; i < values.previews.length; i++) { - this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.add(i); - } + vocabSetTrustPrefix(this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length); } else { throw new TypeError( @@ -997,10 +1459,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.summaries) && - values.summaries.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.summaries)) { + const array = values.summaries; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.summaries; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = values.summaries.slice(); + this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = copied; } else { throw new TypeError( @@ -1012,14 +1498,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (\\"tags\\" in values && values.tags != null) { - if (Array.isArray(values.tags) && - values.tags.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.tags)) { + const array = values.tags; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.tags; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = values.tags.slice(); + this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = copied; - for (let i = 0; i < values.tags.length; i++) { - this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.add(i); - } + vocabSetTrustPrefix(this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag, this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.length); } else { throw new TypeError( @@ -1065,10 +1573,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.urls) && - values.urls.every(v => v instanceof URL || v instanceof Link)) { + let copied!: (URL | Link)[]; + let valid = false; + if (Array.isArray(values.urls)) { + const array = values.urls; + const test = (v: URL | Link): boolean => v instanceof URL || v instanceof Link; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.urls; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = values.urls.slice(); + this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = copied; } else { throw new TypeError( @@ -1101,14 +1633,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.tos) && - values.tos.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.tos)) { + const array = values.tos; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.tos; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = values.tos.slice(); + this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = copied; - for (let i = 0; i < values.tos.length; i++) { - this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.add(i); - } + vocabSetTrustPrefix(this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to, this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length); } else { throw new TypeError( @@ -1141,14 +1695,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.btos) && - values.btos.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.btos)) { + const array = values.btos; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.btos; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = values.btos.slice(); + this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = copied; - for (let i = 0; i < values.btos.length; i++) { - this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.add(i); - } + vocabSetTrustPrefix(this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto, this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length); } else { throw new TypeError( @@ -1181,14 +1757,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.ccs) && - values.ccs.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.ccs)) { + const array = values.ccs; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.ccs; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = values.ccs.slice(); + this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = copied; - for (let i = 0; i < values.ccs.length; i++) { - this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.add(i); - } + vocabSetTrustPrefix(this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc, this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length); } else { throw new TypeError( @@ -1221,14 +1819,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.bccs) && - values.bccs.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.bccs)) { + const array = values.bccs; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.bccs; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = values.bccs.slice(); + this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = copied; - for (let i = 0; i < values.bccs.length; i++) { - this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.add(i); - } + vocabSetTrustPrefix(this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc, this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length); } else { throw new TypeError( @@ -1313,14 +1933,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.proofs) && - values.proofs.every(v => v instanceof DataIntegrityProof || v instanceof URL)) { + let copied!: (DataIntegrityProof | URL)[]; + let valid = false; + if (Array.isArray(values.proofs)) { + const array = values.proofs; + const test = (v: DataIntegrityProof | URL): boolean => v instanceof DataIntegrityProof || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.proofs; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = values.proofs.slice(); + this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = copied; - for (let i = 0; i < values.proofs.length; i++) { - this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.add(i); - } + vocabSetTrustPrefix(this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof, this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length); } else { throw new TypeError( @@ -1397,10 +2039,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (\\"translations\\" in values && values.translations != null) { - if (Array.isArray(values.translations) && - values.translations.every(v => v instanceof Translation)) { + let copied!: (Translation)[]; + let valid = false; + if (Array.isArray(values.translations)) { + const array = values.translations; + const test = (v: Translation): boolean => v instanceof Translation; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.translations; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations = values.translations.slice(); + this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations = copied; } else { throw new TypeError( @@ -1412,10 +2078,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (\\"licenses\\" in values && values.licenses != null) { - if (Array.isArray(values.licenses) && - values.licenses.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.licenses)) { + const array = values.licenses; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.licenses; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = values.licenses.slice(); + this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = copied; } else { throw new TypeError( @@ -1497,18 +2187,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu options ); copyPortableProvenance(this, clone); - clone.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.slice();clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment = new Set(this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment); + clone.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length < vocabSparseArrayMinimumLength + ? this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.slice() : vocabCopyPropertyArray(this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment);clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment = vocabCopyTrustSet( + this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment, clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment, + ); if (\\"attachments\\" in values && values.attachments != null) { - if (Array.isArray(values.attachments) && - values.attachments.every(v => v instanceof Object || v instanceof Link || v instanceof PropertyValue || v instanceof URL)) { + let copied!: (Object | Link | PropertyValue | URL)[]; + let valid = false; + if (Array.isArray(values.attachments)) { + const array = values.attachments; + const test = (v: Object | Link | PropertyValue | URL): boolean => v instanceof Object || v instanceof Link || v instanceof PropertyValue || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.attachments; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = values.attachments.slice(); + clone.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = copied; clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment = new Set(); - for (let i = 0; i < values.attachments.length; i++) { - clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.add(i); - } + vocabSetTrustPrefix(clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment, clone.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length); } else { throw new TypeError( @@ -1517,12 +2232,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.slice();clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = new Set(this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo); + clone.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length < vocabSparseArrayMinimumLength + ? this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.slice() : vocabCopyPropertyArray(this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo);clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = vocabCopyTrustSet( + this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo, clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo, + ); if (\\"attribution\\" in values && values.attribution != null) { if (values.attribution instanceof Application || values.attribution instanceof Group || values.attribution instanceof Organization || values.attribution instanceof Person || values.attribution instanceof Service || values.attribution instanceof URL) { // @ts-ignore: type is checked above. clone.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = [values.attribution]; - clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = new Set([0]); + clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = new Set(); + clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The attribution must be of type \\" + @@ -1541,15 +2260,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.attributions) && - values.attributions.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.attributions)) { + const array = values.attributions; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.attributions; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = values.attributions.slice(); + clone.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = copied; clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = new Set(); - for (let i = 0; i < values.attributions.length; i++) { - clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.add(i); - } + vocabSetTrustPrefix(clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo, clone.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length); } else { throw new TypeError( @@ -1558,12 +2299,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.slice();clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = new Set(this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience); + clone.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length < vocabSparseArrayMinimumLength + ? this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.slice() : vocabCopyPropertyArray(this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience);clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = vocabCopyTrustSet( + this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience, clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience, + ); if (\\"audience\\" in values && values.audience != null) { if (values.audience instanceof Object || values.audience instanceof URL) { // @ts-ignore: type is checked above. clone.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = [values.audience]; - clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = new Set([0]); + clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = new Set(); + clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The audience must be of type \\" + @@ -1582,15 +2327,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.audiences) && - values.audiences.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.audiences)) { + const array = values.audiences; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.audiences; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = values.audiences.slice(); + clone.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = copied; clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = new Set(); - for (let i = 0; i < values.audiences.length; i++) { - clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience, clone.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length); } else { throw new TypeError( @@ -1599,7 +2366,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.slice(); + clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.length < vocabSparseArrayMinimumLength + ? this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.slice() : vocabCopyPropertyArray(this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content); if (\\"content\\" in values && values.content != null) { if (typeof values.content === \\"string\\" || values.content instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -1623,10 +2391,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.contents) && - values.contents.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.contents)) { + const array = values.contents; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.contents; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = values.contents.slice(); + clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = copied; } else { throw new TypeError( @@ -1635,18 +2427,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3mhZzGXSpQ431mBSz2kvych22v4e_context = this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.slice();clone.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context = new Set(this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context); + clone.#_3mhZzGXSpQ431mBSz2kvych22v4e_context = this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.length < vocabSparseArrayMinimumLength + ? this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.slice() : vocabCopyPropertyArray(this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context);clone.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context = vocabCopyTrustSet( + this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context, clone.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context, + ); if (\\"contexts\\" in values && values.contexts != null) { - if (Array.isArray(values.contexts) && - values.contexts.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.contexts)) { + const array = values.contexts; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.contexts; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3mhZzGXSpQ431mBSz2kvych22v4e_context = values.contexts.slice(); + clone.#_3mhZzGXSpQ431mBSz2kvych22v4e_context = copied; clone.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context = new Set(); - for (let i = 0; i < values.contexts.length; i++) { - clone.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context, clone.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.length); } else { throw new TypeError( @@ -1655,7 +2472,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice(); + clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.length < vocabSparseArrayMinimumLength + ? this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice() : vocabCopyPropertyArray(this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name); if (\\"name\\" in values && values.name != null) { if (typeof values.name === \\"string\\" || values.name instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -1679,10 +2497,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.names) && - values.names.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.names)) { + const array = values.names; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.names; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = values.names.slice(); + clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = copied; } else { throw new TypeError( @@ -1691,7 +2533,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime = this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime.slice(); + clone.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime = this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime.length < vocabSparseArrayMinimumLength + ? this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime.slice() : vocabCopyPropertyArray(this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime); if (\\"endTime\\" in values && values.endTime != null) { if (isTemporalInstant(values.endTime)) { // @ts-ignore: type is checked above. @@ -1704,18 +2547,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.slice();clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator = new Set(this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator); + clone.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.length < vocabSparseArrayMinimumLength + ? this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.slice() : vocabCopyPropertyArray(this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator);clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator = vocabCopyTrustSet( + this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator, clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator, + ); if (\\"generators\\" in values && values.generators != null) { - if (Array.isArray(values.generators) && - values.generators.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.generators)) { + const array = values.generators; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.generators; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = values.generators.slice(); + clone.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = copied; clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator = new Set(); - for (let i = 0; i < values.generators.length; i++) { - clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.add(i); - } + vocabSetTrustPrefix(clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator, clone.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.length); } else { throw new TypeError( @@ -1724,12 +2592,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.slice();clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = new Set(this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon); + clone.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length < vocabSparseArrayMinimumLength + ? this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.slice() : vocabCopyPropertyArray(this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon);clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = vocabCopyTrustSet( + this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon, clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon, + ); if (\\"icon\\" in values && values.icon != null) { if (values.icon instanceof Image || values.icon instanceof URL) { // @ts-ignore: type is checked above. clone.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = [values.icon]; - clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = new Set([0]); + clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = new Set(); + clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The icon must be of type \\" + @@ -1748,15 +2620,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.icons) && - values.icons.every(v => v instanceof Image || v instanceof URL)) { + let copied!: (Image | URL)[]; + let valid = false; + if (Array.isArray(values.icons)) { + const array = values.icons; + const test = (v: Image | URL): boolean => v instanceof Image || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.icons; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = values.icons.slice(); + clone.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = copied; clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = new Set(); - for (let i = 0; i < values.icons.length; i++) { - clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.add(i); - } + vocabSetTrustPrefix(clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon, clone.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length); } else { throw new TypeError( @@ -1765,12 +2659,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.slice();clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = new Set(this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image); + clone.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length < vocabSparseArrayMinimumLength + ? this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.slice() : vocabCopyPropertyArray(this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image);clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = vocabCopyTrustSet( + this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image, clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image, + ); if (\\"image\\" in values && values.image != null) { if (values.image instanceof Image || values.image instanceof URL) { // @ts-ignore: type is checked above. clone.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = [values.image]; - clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = new Set([0]); + clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = new Set(); + clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The image must be of type \\" + @@ -1789,15 +2687,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.images) && - values.images.every(v => v instanceof Image || v instanceof URL)) { + let copied!: (Image | URL)[]; + let valid = false; + if (Array.isArray(values.images)) { + const array = values.images; + const test = (v: Image | URL): boolean => v instanceof Image || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.images; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = values.images.slice(); + clone.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = copied; clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = new Set(); - for (let i = 0; i < values.images.length; i++) { - clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image, clone.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length); } else { throw new TypeError( @@ -1806,12 +2726,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.slice();clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = new Set(this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo); + clone.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length < vocabSparseArrayMinimumLength + ? this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.slice() : vocabCopyPropertyArray(this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo);clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = vocabCopyTrustSet( + this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo, clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo, + ); if (\\"replyTarget\\" in values && values.replyTarget != null) { if (values.replyTarget instanceof Object || values.replyTarget instanceof Link || values.replyTarget instanceof URL) { // @ts-ignore: type is checked above. clone.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = [values.replyTarget]; - clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = new Set([0]); + clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = new Set(); + clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The replyTarget must be of type \\" + @@ -1830,15 +2754,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.replyTargets) && - values.replyTargets.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.replyTargets)) { + const array = values.replyTargets; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.replyTargets; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = values.replyTargets.slice(); + clone.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = copied; clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = new Set(); - for (let i = 0; i < values.replyTargets.length; i++) { - clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo, clone.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length); } else { throw new TypeError( @@ -1847,12 +2793,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.slice();clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = new Set(this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location); + clone.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length < vocabSparseArrayMinimumLength + ? this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.slice() : vocabCopyPropertyArray(this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location);clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = vocabCopyTrustSet( + this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location, clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location, + ); if (\\"location\\" in values && values.location != null) { if (values.location instanceof Object || values.location instanceof Link || values.location instanceof URL) { // @ts-ignore: type is checked above. clone.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = [values.location]; - clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = new Set([0]); + clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = new Set(); + clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The location must be of type \\" + @@ -1871,15 +2821,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.locations) && - values.locations.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.locations)) { + const array = values.locations; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.locations; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = values.locations.slice(); + clone.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = copied; clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = new Set(); - for (let i = 0; i < values.locations.length; i++) { - clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.add(i); - } + vocabSetTrustPrefix(clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location, clone.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length); } else { throw new TypeError( @@ -1888,12 +2860,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.slice();clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = new Set(this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview); + clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length < vocabSparseArrayMinimumLength + ? this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.slice() : vocabCopyPropertyArray(this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview);clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = vocabCopyTrustSet( + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, + ); if (\\"preview\\" in values && values.preview != null) { if (values.preview instanceof Link || values.preview instanceof Object || values.preview instanceof URL) { // @ts-ignore: type is checked above. clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = [values.preview]; - clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = new Set([0]); + clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = new Set(); + clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The preview must be of type \\" + @@ -1912,15 +2888,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.previews) && - values.previews.every(v => v instanceof Link || v instanceof Object || v instanceof URL)) { + let copied!: (Link | Object | URL)[]; + let valid = false; + if (Array.isArray(values.previews)) { + const array = values.previews; + const test = (v: Link | Object | URL): boolean => v instanceof Link || v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.previews; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = values.previews.slice(); + clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = copied; clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = new Set(); - for (let i = 0; i < values.previews.length; i++) { - clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.add(i); - } + vocabSetTrustPrefix(clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length); } else { throw new TypeError( @@ -1929,7 +2927,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published = this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published.slice(); + clone.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published = this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published.length < vocabSparseArrayMinimumLength + ? this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published.slice() : vocabCopyPropertyArray(this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published); if (\\"published\\" in values && values.published != null) { if (isTemporalInstant(values.published)) { // @ts-ignore: type is checked above. @@ -1942,12 +2941,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_7UpwM3JWcXhADcscukEehBorf6k_replies = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies.slice();clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies = new Set(this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies); + clone.#_7UpwM3JWcXhADcscukEehBorf6k_replies = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies.length < vocabSparseArrayMinimumLength + ? this.#_7UpwM3JWcXhADcscukEehBorf6k_replies.slice() : vocabCopyPropertyArray(this.#_7UpwM3JWcXhADcscukEehBorf6k_replies);clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies = vocabCopyTrustSet( + this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies, clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies, + ); if (\\"replies\\" in values && values.replies != null) { if (values.replies instanceof Collection || values.replies instanceof URL) { // @ts-ignore: type is checked above. clone.#_7UpwM3JWcXhADcscukEehBorf6k_replies = [values.replies]; - clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies = new Set([0]); + clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies = new Set(); + clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The replies must be of type \\" + @@ -1955,12 +2958,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.slice();clone.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares = new Set(this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares); + clone.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.length < vocabSparseArrayMinimumLength + ? this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.slice() : vocabCopyPropertyArray(this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares);clone.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares = vocabCopyTrustSet( + this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares, clone.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares, + ); if (\\"shares\\" in values && values.shares != null) { if (values.shares instanceof Collection || values.shares instanceof URL) { // @ts-ignore: type is checked above. clone.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares = [values.shares]; - clone.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares = new Set([0]); + clone.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares = new Set(); + clone.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The shares must be of type \\" + @@ -1968,12 +2975,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.slice();clone.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = new Set(this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes); + clone.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.length < vocabSparseArrayMinimumLength + ? this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.slice() : vocabCopyPropertyArray(this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes);clone.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = vocabCopyTrustSet( + this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes, clone.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes, + ); if (\\"likes\\" in values && values.likes != null) { if (values.likes instanceof Collection || values.likes instanceof URL) { // @ts-ignore: type is checked above. clone.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = [values.likes]; - clone.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = new Set([0]); + clone.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = new Set(); + clone.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The likes must be of type \\" + @@ -1981,12 +2992,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.slice();clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = new Set(this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions); + clone.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.length < vocabSparseArrayMinimumLength + ? this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.slice() : vocabCopyPropertyArray(this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions);clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = vocabCopyTrustSet( + this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions, clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions, + ); if (\\"emojiReactions\\" in values && values.emojiReactions != null) { if (values.emojiReactions instanceof Collection || values.emojiReactions instanceof URL) { // @ts-ignore: type is checked above. clone.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = [values.emojiReactions]; - clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = new Set([0]); + clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = new Set(); + clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The emojiReactions must be of type \\" + @@ -1994,7 +3009,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime = this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime.slice(); + clone.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime = this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime.length < vocabSparseArrayMinimumLength + ? this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime.slice() : vocabCopyPropertyArray(this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime); if (\\"startTime\\" in values && values.startTime != null) { if (isTemporalInstant(values.startTime)) { // @ts-ignore: type is checked above. @@ -2007,7 +3023,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary.slice(); + clone.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary.length < vocabSparseArrayMinimumLength + ? this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary.slice() : vocabCopyPropertyArray(this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary); if (\\"summary\\" in values && values.summary != null) { if (typeof values.summary === \\"string\\" || values.summary instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -2031,10 +3048,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.summaries) && - values.summaries.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.summaries)) { + const array = values.summaries; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.summaries; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = values.summaries.slice(); + clone.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = copied; } else { throw new TypeError( @@ -2043,18 +3084,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.slice();clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag = new Set(this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag); + clone.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.length < vocabSparseArrayMinimumLength + ? this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.slice() : vocabCopyPropertyArray(this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag);clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag = vocabCopyTrustSet( + this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag, clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag, + ); if (\\"tags\\" in values && values.tags != null) { - if (Array.isArray(values.tags) && - values.tags.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.tags)) { + const array = values.tags; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.tags; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = values.tags.slice(); + clone.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = copied; clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag = new Set(); - for (let i = 0; i < values.tags.length; i++) { - clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.add(i); - } + vocabSetTrustPrefix(clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag, clone.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.length); } else { throw new TypeError( @@ -2063,7 +3129,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated = this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated.slice(); + clone.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated = this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated.length < vocabSparseArrayMinimumLength + ? this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated.slice() : vocabCopyPropertyArray(this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated); if (\\"updated\\" in values && values.updated != null) { if (isTemporalInstant(values.updated)) { // @ts-ignore: type is checked above. @@ -2076,7 +3143,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.slice(); + clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length < vocabSparseArrayMinimumLength + ? this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.slice() : vocabCopyPropertyArray(this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url); if (\\"url\\" in values && values.url != null) { if (values.url instanceof URL || values.url instanceof Link) { // @ts-ignore: type is checked above. @@ -2100,10 +3168,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.urls) && - values.urls.every(v => v instanceof URL || v instanceof Link)) { + let copied!: (URL | Link)[]; + let valid = false; + if (Array.isArray(values.urls)) { + const array = values.urls; + const test = (v: URL | Link): boolean => v instanceof URL || v instanceof Link; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.urls; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = values.urls.slice(); + clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = copied; } else { throw new TypeError( @@ -2112,12 +3204,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.slice();clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = new Set(this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to); + clone.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length < vocabSparseArrayMinimumLength + ? this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.slice() : vocabCopyPropertyArray(this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to);clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = vocabCopyTrustSet( + this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to, clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to, + ); if (\\"to\\" in values && values.to != null) { if (values.to instanceof Object || values.to instanceof URL) { // @ts-ignore: type is checked above. clone.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = [values.to]; - clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = new Set([0]); + clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = new Set(); + clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The to must be of type \\" + @@ -2136,15 +3232,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.tos) && - values.tos.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.tos)) { + const array = values.tos; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.tos; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = values.tos.slice(); + clone.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = copied; clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = new Set(); - for (let i = 0; i < values.tos.length; i++) { - clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to, clone.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length); } else { throw new TypeError( @@ -2153,12 +3271,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.slice();clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = new Set(this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto); + clone.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length < vocabSparseArrayMinimumLength + ? this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.slice() : vocabCopyPropertyArray(this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto);clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = vocabCopyTrustSet( + this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto, clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto, + ); if (\\"bto\\" in values && values.bto != null) { if (values.bto instanceof Object || values.bto instanceof URL) { // @ts-ignore: type is checked above. clone.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = [values.bto]; - clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = new Set([0]); + clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = new Set(); + clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The bto must be of type \\" + @@ -2177,15 +3299,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.btos) && - values.btos.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.btos)) { + const array = values.btos; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.btos; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = values.btos.slice(); + clone.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = copied; clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = new Set(); - for (let i = 0; i < values.btos.length; i++) { - clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.add(i); - } + vocabSetTrustPrefix(clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto, clone.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length); } else { throw new TypeError( @@ -2194,12 +3338,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.slice();clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = new Set(this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc); + clone.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length < vocabSparseArrayMinimumLength + ? this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.slice() : vocabCopyPropertyArray(this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc);clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = vocabCopyTrustSet( + this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc, clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc, + ); if (\\"cc\\" in values && values.cc != null) { if (values.cc instanceof Object || values.cc instanceof URL) { // @ts-ignore: type is checked above. clone.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = [values.cc]; - clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = new Set([0]); + clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = new Set(); + clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The cc must be of type \\" + @@ -2218,15 +3366,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.ccs) && - values.ccs.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.ccs)) { + const array = values.ccs; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.ccs; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = values.ccs.slice(); + clone.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = copied; clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = new Set(); - for (let i = 0; i < values.ccs.length; i++) { - clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.add(i); - } + vocabSetTrustPrefix(clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc, clone.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length); } else { throw new TypeError( @@ -2235,12 +3405,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.slice();clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = new Set(this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc); + clone.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length < vocabSparseArrayMinimumLength + ? this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.slice() : vocabCopyPropertyArray(this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc);clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = vocabCopyTrustSet( + this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc, clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc, + ); if (\\"bcc\\" in values && values.bcc != null) { if (values.bcc instanceof Object || values.bcc instanceof URL) { // @ts-ignore: type is checked above. clone.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = [values.bcc]; - clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = new Set([0]); + clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = new Set(); + clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The bcc must be of type \\" + @@ -2259,15 +3433,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.bccs) && - values.bccs.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.bccs)) { + const array = values.bccs; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.bccs; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = values.bccs.slice(); + clone.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = copied; clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = new Set(); - for (let i = 0; i < values.bccs.length; i++) { - clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc, clone.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length); } else { throw new TypeError( @@ -2276,7 +3472,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.slice(); + clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.length < vocabSparseArrayMinimumLength + ? this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.slice() : vocabCopyPropertyArray(this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType); if (\\"mediaType\\" in values && values.mediaType != null) { if (typeof values.mediaType === \\"string\\") { // @ts-ignore: type is checked above. @@ -2289,7 +3486,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration = this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration.slice(); + clone.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration = this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration.length < vocabSparseArrayMinimumLength + ? this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration.slice() : vocabCopyPropertyArray(this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration); if (\\"duration\\" in values && values.duration != null) { if (isTemporalDuration(values.duration)) { // @ts-ignore: type is checked above. @@ -2302,7 +3500,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive = this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive.slice(); + clone.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive = this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive.length < vocabSparseArrayMinimumLength + ? this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive.slice() : vocabCopyPropertyArray(this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive); if (\\"sensitive\\" in values && values.sensitive != null) { if (typeof values.sensitive === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -2315,7 +3514,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source = this.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.slice(); + clone.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source = this.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.length < vocabSparseArrayMinimumLength + ? this.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.slice() : vocabCopyPropertyArray(this.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source); if (\\"source\\" in values && values.source != null) { if (values.source instanceof Source) { // @ts-ignore: type is checked above. @@ -2328,12 +3528,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.slice();clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = new Set(this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof); + clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length < vocabSparseArrayMinimumLength + ? this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.slice() : vocabCopyPropertyArray(this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof);clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = vocabCopyTrustSet( + this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof, clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof, + ); if (\\"proof\\" in values && values.proof != null) { if (values.proof instanceof DataIntegrityProof || values.proof instanceof URL) { // @ts-ignore: type is checked above. clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = [values.proof]; - clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = new Set([0]); + clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = new Set(); + clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The proof must be of type \\" + @@ -2352,15 +3556,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.proofs) && - values.proofs.every(v => v instanceof DataIntegrityProof || v instanceof URL)) { + let copied!: (DataIntegrityProof | URL)[]; + let valid = false; + if (Array.isArray(values.proofs)) { + const array = values.proofs; + const test = (v: DataIntegrityProof | URL): boolean => v instanceof DataIntegrityProof || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.proofs; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = values.proofs.slice(); + clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = copied; clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = new Set(); - for (let i = 0; i < values.proofs.length; i++) { - clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.add(i); - } + vocabSetTrustPrefix(clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof, clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length); } else { throw new TypeError( @@ -2369,7 +3595,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy = this.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.slice(); + clone.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy = this.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.length < vocabSparseArrayMinimumLength + ? this.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.slice() : vocabCopyPropertyArray(this.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy); if (\\"interactionPolicy\\" in values && values.interactionPolicy != null) { if (values.interactionPolicy instanceof InteractionPolicy) { // @ts-ignore: type is checked above. @@ -2382,7 +3609,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy = this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.slice(); + clone.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy = this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.length < vocabSparseArrayMinimumLength + ? this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.slice() : vocabCopyPropertyArray(this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy); if (\\"approvedBy\\" in values && values.approvedBy != null) { if (values.approvedBy instanceof URL) { // @ts-ignore: type is checked above. @@ -2395,12 +3623,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.slice();clone.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = new Set(this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization); + clone.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.slice() : vocabCopyPropertyArray(this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization);clone.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = vocabCopyTrustSet( + this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization, clone.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization, + ); if (\\"likeAuthorization\\" in values && values.likeAuthorization != null) { if (values.likeAuthorization instanceof LikeAuthorization || values.likeAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = [values.likeAuthorization]; - clone.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = new Set([0]); + clone.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = new Set(); + clone.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The likeAuthorization must be of type \\" + @@ -2408,12 +3640,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.slice();clone.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = new Set(this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization); + clone.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.slice() : vocabCopyPropertyArray(this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization);clone.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = vocabCopyTrustSet( + this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization, clone.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization, + ); if (\\"replyAuthorization\\" in values && values.replyAuthorization != null) { if (values.replyAuthorization instanceof ReplyAuthorization || values.replyAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = [values.replyAuthorization]; - clone.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = new Set([0]); + clone.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = new Set(); + clone.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The replyAuthorization must be of type \\" + @@ -2421,12 +3657,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.slice();clone.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = new Set(this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization); + clone.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.slice() : vocabCopyPropertyArray(this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization);clone.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = vocabCopyTrustSet( + this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization, clone.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization, + ); if (\\"announceAuthorization\\" in values && values.announceAuthorization != null) { if (values.announceAuthorization instanceof AnnounceAuthorization || values.announceAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = [values.announceAuthorization]; - clone.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = new Set([0]); + clone.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = new Set(); + clone.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The announceAuthorization must be of type \\" + @@ -2434,13 +3674,38 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations = this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations.slice(); + clone.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations = this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations.length < vocabSparseArrayMinimumLength + ? this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations.slice() : vocabCopyPropertyArray(this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations); if (\\"translations\\" in values && values.translations != null) { - if (Array.isArray(values.translations) && - values.translations.every(v => v instanceof Translation)) { + let copied!: (Translation)[]; + let valid = false; + if (Array.isArray(values.translations)) { + const array = values.translations; + const test = (v: Translation): boolean => v instanceof Translation; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.translations; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations = values.translations.slice(); + clone.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations = copied; } else { throw new TypeError( @@ -2449,13 +3714,38 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.slice(); + clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length < vocabSparseArrayMinimumLength + ? this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.slice() : vocabCopyPropertyArray(this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d); if (\\"licenses\\" in values && values.licenses != null) { - if (Array.isArray(values.licenses) && - values.licenses.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.licenses)) { + const array = values.licenses; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.licenses; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = values.licenses.slice(); + clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = copied; } else { throw new TypeError( @@ -2490,6 +3780,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -2549,206 +3845,641 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length; i++) { - const value = node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment[i]; - if (value != null && typeof value === \\"object\\") { - node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment[i] = context.value(value); + { + const array = node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length; i++) { + const value = node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment[i]; + if (value != null && typeof value === \\"object\\") { + node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length; i++) { - const value = node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[i]; - if (value != null && typeof value === \\"object\\") { - node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[i] = context.value(value); + { + const array = node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length; i++) { + const value = node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length; i++) { - const value = node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[i] = context.value(value); + { + const array = node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length; i++) { + const value = node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.length; i++) { - const value = node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context[i] = context.value(value); + { + const array = node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.length; i++) { + const value = node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.length; i++) { - const value = node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator[i]; - if (value != null && typeof value === \\"object\\") { - node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator[i] = context.value(value); + { + const array = node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.length; i++) { + const value = node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator[i]; + if (value != null && typeof value === \\"object\\") { + node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length; i++) { - const value = node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[i]; - if (value != null && typeof value === \\"object\\") { - node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[i] = context.value(value); + { + const array = node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length; i++) { + const value = node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[i]; + if (value != null && typeof value === \\"object\\") { + node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length; i++) { - const value = node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[i] = context.value(value); + { + const array = node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length; i++) { + const value = node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length; i++) { - const value = node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[i] = context.value(value); + { + const array = node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length; i++) { + const value = node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length; i++) { - const value = node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[i]; - if (value != null && typeof value === \\"object\\") { - node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[i] = context.value(value); + { + const array = node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length; i++) { + const value = node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[i]; + if (value != null && typeof value === \\"object\\") { + node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length; i++) { - const value = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i]; - if (value != null && typeof value === \\"object\\") { - node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i] = context.value(value); + { + const array = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length; i++) { + const value = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i]; + if (value != null && typeof value === \\"object\\") { + node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_7UpwM3JWcXhADcscukEehBorf6k_replies.length; i++) { - const value = node.#_7UpwM3JWcXhADcscukEehBorf6k_replies[i]; - if (value != null && typeof value === \\"object\\") { - node.#_7UpwM3JWcXhADcscukEehBorf6k_replies[i] = context.value(value); + { + const array = node.#_7UpwM3JWcXhADcscukEehBorf6k_replies; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_7UpwM3JWcXhADcscukEehBorf6k_replies.length; i++) { + const value = node.#_7UpwM3JWcXhADcscukEehBorf6k_replies[i]; + if (value != null && typeof value === \\"object\\") { + node.#_7UpwM3JWcXhADcscukEehBorf6k_replies[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.length; i++) { - const value = node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[i] = context.value(value); + { + const array = node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.length; i++) { + const value = node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.length; i++) { - const value = node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[i]; - if (value != null && typeof value === \\"object\\") { - node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[i] = context.value(value); + { + const array = node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.length; i++) { + const value = node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[i]; + if (value != null && typeof value === \\"object\\") { + node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.length; i++) { - const value = node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[i]; - if (value != null && typeof value === \\"object\\") { - node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[i] = context.value(value); + { + const array = node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.length; i++) { + const value = node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[i]; + if (value != null && typeof value === \\"object\\") { + node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.length; i++) { - const value = node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag[i]; - if (value != null && typeof value === \\"object\\") { - node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag[i] = context.value(value); + { + const array = node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.length; i++) { + const value = node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag[i]; + if (value != null && typeof value === \\"object\\") { + node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length; i++) { - const value = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i] = context.value(value); + { + const array = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length; i++) { + const value = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length; i++) { - const value = node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[i] = context.value(value); + { + const array = node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length; i++) { + const value = node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length; i++) { - const value = node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[i]; - if (value != null && typeof value === \\"object\\") { - node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[i] = context.value(value); + { + const array = node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length; i++) { + const value = node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[i]; + if (value != null && typeof value === \\"object\\") { + node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length; i++) { - const value = node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[i]; - if (value != null && typeof value === \\"object\\") { - node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[i] = context.value(value); + { + const array = node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length; i++) { + const value = node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[i]; + if (value != null && typeof value === \\"object\\") { + node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length; i++) { - const value = node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[i] = context.value(value); + { + const array = node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length; i++) { + const value = node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.length; i++) { - const value = node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source[i] = context.value(value); + { + const array = node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.length; i++) { + const value = node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length; i++) { - const value = node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[i]; - if (value != null && typeof value === \\"object\\") { - node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[i] = context.value(value); + { + const array = node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length; i++) { + const value = node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[i]; + if (value != null && typeof value === \\"object\\") { + node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.length; i++) { - const value = node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy[i] = context.value(value); + { + const array = node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.length; i++) { + const value = node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.length; i++) { - const value = node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy[i]; - if (value != null && typeof value === \\"object\\") { - node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy[i] = context.value(value); + { + const array = node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.length; i++) { + const value = node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy[i]; + if (value != null && typeof value === \\"object\\") { + node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.length; i++) { - const value = node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[i] = context.value(value); + { + const array = node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.length; i++) { + const value = node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.length; i++) { - const value = node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[i]; - if (value != null && typeof value === \\"object\\") { - node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[i] = context.value(value); + { + const array = node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.length; i++) { + const value = node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.length; i++) { - const value = node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[i]; - if (value != null && typeof value === \\"object\\") { - node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[i] = context.value(value); + { + const array = node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.length; i++) { + const value = node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations.length; i++) { - const value = node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations[i]; - if (value != null && typeof value === \\"object\\") { - node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations[i] = context.value(value); + { + const array = node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations.length; i++) { + const value = node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations[i]; + if (value != null && typeof value === \\"object\\") { + node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length; i++) { - const value = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i] = context.value(value); + { + const array = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length; i++) { + const value = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i] = context.value(value); + } + } } } } }); } @@ -3111,7 +4842,8 @@ deepCloneDescriptors.set(this.prototype, { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { + !(i < (this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment[vocabTrustPrefix] ?? 0) || + this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#attachment\\"); @@ -3183,7 +4915,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { + !(i < (this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment[vocabTrustPrefix] ?? 0) || + this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -3596,7 +5329,8 @@ deepCloneDescriptors.set(this.prototype, { } let v = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[0]; if (!(v instanceof URL) && - !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { + !(0 < (this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#attributedTo\\"); @@ -3664,7 +5398,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { + !(0 < (this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -3754,7 +5489,8 @@ deepCloneDescriptors.set(this.prototype, { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { + !(i < (this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#attributedTo\\"); @@ -3826,7 +5562,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { + !(i < (this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -4178,7 +5915,8 @@ deepCloneDescriptors.set(this.prototype, { } let v = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[0]; if (!(v instanceof URL) && - !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { + !(0 < (this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[vocabTrustPrefix] ?? 0) || + this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#audience\\"); @@ -4246,7 +5984,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { + !(0 < (this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[vocabTrustPrefix] ?? 0) || + this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -4335,7 +6074,8 @@ deepCloneDescriptors.set(this.prototype, { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { + !(i < (this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[vocabTrustPrefix] ?? 0) || + this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#audience\\"); @@ -4407,7 +6147,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { + !(i < (this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[vocabTrustPrefix] ?? 0) || + this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -4808,7 +6549,8 @@ get contents(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { + !(i < (this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context[vocabTrustPrefix] ?? 0) || + this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#context\\"); @@ -4880,7 +6622,8 @@ get contents(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { + !(i < (this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context[vocabTrustPrefix] ?? 0) || + this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -5288,7 +7031,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { + !(i < (this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator[vocabTrustPrefix] ?? 0) || + this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#generator\\"); @@ -5360,7 +7104,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { + !(i < (this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator[vocabTrustPrefix] ?? 0) || + this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -5735,7 +7480,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[0]; if (!(v instanceof URL) && - !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { + !(0 < (this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[vocabTrustPrefix] ?? 0) || + this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#icon\\"); @@ -5803,7 +7549,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { + !(0 < (this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[vocabTrustPrefix] ?? 0) || + this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -5893,7 +7640,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { + !(i < (this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[vocabTrustPrefix] ?? 0) || + this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#icon\\"); @@ -5965,7 +7713,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { + !(i < (this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[vocabTrustPrefix] ?? 0) || + this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -6340,7 +8089,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[0]; if (!(v instanceof URL) && - !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { + !(0 < (this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[vocabTrustPrefix] ?? 0) || + this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#image\\"); @@ -6408,7 +8158,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { + !(0 < (this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[vocabTrustPrefix] ?? 0) || + this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -6498,7 +8249,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { + !(i < (this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[vocabTrustPrefix] ?? 0) || + this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#image\\"); @@ -6570,7 +8322,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { + !(i < (this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[vocabTrustPrefix] ?? 0) || + this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -6937,7 +8690,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[0]; if (!(v instanceof URL) && - !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { + !(0 < (this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[vocabTrustPrefix] ?? 0) || + this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#inReplyTo\\"); @@ -7005,7 +8759,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { + !(0 < (this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[vocabTrustPrefix] ?? 0) || + this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -7094,7 +8849,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { + !(i < (this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[vocabTrustPrefix] ?? 0) || + this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#inReplyTo\\"); @@ -7166,7 +8922,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { + !(i < (this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[vocabTrustPrefix] ?? 0) || + this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -7533,7 +9290,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[0]; if (!(v instanceof URL) && - !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { + !(0 < (this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[vocabTrustPrefix] ?? 0) || + this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#location\\"); @@ -7601,7 +9359,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { + !(0 < (this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[vocabTrustPrefix] ?? 0) || + this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -7690,7 +9449,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { + !(i < (this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[vocabTrustPrefix] ?? 0) || + this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#location\\"); @@ -7762,7 +9522,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { + !(i < (this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[vocabTrustPrefix] ?? 0) || + this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -8128,7 +9889,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[0]; if (!(v instanceof URL) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { + !(0 < (this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] ?? 0) || + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#preview\\"); @@ -8196,7 +9958,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { + !(0 < (this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] ?? 0) || + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -8284,7 +10047,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { + !(i < (this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] ?? 0) || + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#preview\\"); @@ -8356,7 +10120,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { + !(i < (this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] ?? 0) || + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -8721,7 +10486,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies[0]; if (!(v instanceof URL) && - !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { + !(0 < (this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies[vocabTrustPrefix] ?? 0) || + this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#replies\\"); @@ -8789,7 +10555,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { + !(0 < (this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies[vocabTrustPrefix] ?? 0) || + this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -9146,7 +10913,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[0]; if (!(v instanceof URL) && - !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { + !(0 < (this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares[vocabTrustPrefix] ?? 0) || + this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#shares\\"); @@ -9214,7 +10982,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { + !(0 < (this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares[vocabTrustPrefix] ?? 0) || + this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -9571,7 +11340,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[0]; if (!(v instanceof URL) && - !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { + !(0 < (this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[vocabTrustPrefix] ?? 0) || + this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#likes\\"); @@ -9639,7 +11409,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { + !(0 < (this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[vocabTrustPrefix] ?? 0) || + this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -9990,7 +11761,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[0]; if (!(v instanceof URL) && - !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { + !(0 < (this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[vocabTrustPrefix] ?? 0) || + this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://fedibird.com/ns#emojiReactions\\"); @@ -10058,7 +11830,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { + !(0 < (this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[vocabTrustPrefix] ?? 0) || + this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -10466,7 +12239,8 @@ get summaries(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { + !(i < (this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag[vocabTrustPrefix] ?? 0) || + this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#tag\\"); @@ -10538,7 +12312,8 @@ get summaries(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { + !(i < (this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag[vocabTrustPrefix] ?? 0) || + this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -10924,7 +12699,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[0]; if (!(v instanceof URL) && - !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { + !(0 < (this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[vocabTrustPrefix] ?? 0) || + this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#to\\"); @@ -10992,7 +12768,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { + !(0 < (this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[vocabTrustPrefix] ?? 0) || + this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -11081,7 +12858,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { + !(i < (this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[vocabTrustPrefix] ?? 0) || + this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#to\\"); @@ -11153,7 +12931,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { + !(i < (this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[vocabTrustPrefix] ?? 0) || + this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -11505,7 +13284,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[0]; if (!(v instanceof URL) && - !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { + !(0 < (this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[vocabTrustPrefix] ?? 0) || + this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#bto\\"); @@ -11573,7 +13353,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { + !(0 < (this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[vocabTrustPrefix] ?? 0) || + this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -11662,7 +13443,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { + !(i < (this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[vocabTrustPrefix] ?? 0) || + this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#bto\\"); @@ -11734,7 +13516,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { + !(i < (this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[vocabTrustPrefix] ?? 0) || + this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -12086,7 +13869,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[0]; if (!(v instanceof URL) && - !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { + !(0 < (this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[vocabTrustPrefix] ?? 0) || + this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#cc\\"); @@ -12154,7 +13938,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { + !(0 < (this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[vocabTrustPrefix] ?? 0) || + this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -12243,7 +14028,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { + !(i < (this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[vocabTrustPrefix] ?? 0) || + this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#cc\\"); @@ -12315,7 +14101,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { + !(i < (this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[vocabTrustPrefix] ?? 0) || + this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -12667,7 +14454,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[0]; if (!(v instanceof URL) && - !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { + !(0 < (this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[vocabTrustPrefix] ?? 0) || + this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#bcc\\"); @@ -12735,7 +14523,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { + !(0 < (this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[vocabTrustPrefix] ?? 0) || + this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -12824,7 +14613,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { + !(i < (this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[vocabTrustPrefix] ?? 0) || + this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#bcc\\"); @@ -12896,7 +14686,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { + !(i < (this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[vocabTrustPrefix] ?? 0) || + this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -13311,7 +15102,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[0]; if (!(v instanceof URL) && - !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { + !(0 < (this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[vocabTrustPrefix] ?? 0) || + this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#proof\\"); @@ -13379,7 +15171,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { + !(0 < (this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[vocabTrustPrefix] ?? 0) || + this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -13467,7 +15260,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { + !(i < (this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[vocabTrustPrefix] ?? 0) || + this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#proof\\"); @@ -13539,7 +15333,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { + !(i < (this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[vocabTrustPrefix] ?? 0) || + this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -13930,7 +15725,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { + !(0 < (this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#likeAuthorization\\"); @@ -13998,7 +15794,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { + !(0 < (this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -14349,7 +16146,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { + !(0 < (this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#replyAuthorization\\"); @@ -14417,7 +16215,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { + !(0 < (this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -14768,7 +16567,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { + !(0 < (this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#announceAuthorization\\"); @@ -14836,7 +16636,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { + !(0 < (this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -17048,7 +18849,7 @@ get licenses(): (URL)[] { let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _49BipA5dq9eoH8LX8xdsVumveTca_attachment: (Object | Link | PropertyValue | URL)[] = []; - const _trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment: Set = new Set(); + const _trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment: VocabTrustSet = new Set(); let _49BipA5dq9eoH8LX8xdsVumveTca_attachment__array = values[\\"https://www.w3.org/ns/activitystreams#attachment\\"]; @@ -17100,7 +18901,7 @@ get licenses(): (URL)[] { instance.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = _49BipA5dq9eoH8LX8xdsVumveTca_attachment; const _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo: Set = new Set(); + const _trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo: VocabTrustSet = new Set(); let _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo__array = values[\\"https://www.w3.org/ns/activitystreams#attributedTo\\"]; @@ -17158,7 +18959,7 @@ get licenses(): (URL)[] { instance.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo; const _3ocC3VVi88cEd5sPWL8djkZsvTN6_audience: (Object | URL)[] = []; - const _trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience: Set = new Set(); + const _trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience: VocabTrustSet = new Set(); let _3ocC3VVi88cEd5sPWL8djkZsvTN6_audience__array = values[\\"https://www.w3.org/ns/activitystreams#audience\\"]; @@ -17232,7 +19033,7 @@ get licenses(): (URL)[] { instance.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content; const _3mhZzGXSpQ431mBSz2kvych22v4e_context: (Object | Link | URL)[] = []; - const _trust_3mhZzGXSpQ431mBSz2kvych22v4e_context: Set = new Set(); + const _trust_3mhZzGXSpQ431mBSz2kvych22v4e_context: VocabTrustSet = new Set(); let _3mhZzGXSpQ431mBSz2kvych22v4e_context__array = values[\\"https://www.w3.org/ns/activitystreams#context\\"]; @@ -17346,7 +19147,7 @@ get licenses(): (URL)[] { instance.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime = _219RwDanjScTv5tYCjwGZVCM7KZ9_endTime; const _86xFhmgBapoMvYqjbjRuDPayTrS_generator: (Object | Link | URL)[] = []; - const _trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator: Set = new Set(); + const _trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator: VocabTrustSet = new Set(); let _86xFhmgBapoMvYqjbjRuDPayTrS_generator__array = values[\\"https://www.w3.org/ns/activitystreams#generator\\"]; @@ -17394,7 +19195,7 @@ get licenses(): (URL)[] { instance.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = _86xFhmgBapoMvYqjbjRuDPayTrS_generator; const _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon: (Image | URL)[] = []; - const _trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon: Set = new Set(); + const _trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon: VocabTrustSet = new Set(); let _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon__array = values[\\"https://www.w3.org/ns/activitystreams#icon\\"]; @@ -17458,7 +19259,7 @@ get licenses(): (URL)[] { instance.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon; const _3dXrUdkARxwyJLtJcYi1AJ92H41U_image: (Image | URL)[] = []; - const _trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image: Set = new Set(); + const _trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image: VocabTrustSet = new Set(); let _3dXrUdkARxwyJLtJcYi1AJ92H41U_image__array = values[\\"https://www.w3.org/ns/activitystreams#image\\"]; @@ -17522,7 +19323,7 @@ get licenses(): (URL)[] { instance.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = _3dXrUdkARxwyJLtJcYi1AJ92H41U_image; const _3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo: (Object | Link | URL)[] = []; - const _trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo: Set = new Set(); + const _trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo: VocabTrustSet = new Set(); let _3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo__array = values[\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"]; @@ -17570,7 +19371,7 @@ get licenses(): (URL)[] { instance.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = _3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo; const _31k5MUZJsnsPNg8dQQJieWaXTFnR_location: (Object | Link | URL)[] = []; - const _trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location: Set = new Set(); + const _trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location: VocabTrustSet = new Set(); let _31k5MUZJsnsPNg8dQQJieWaXTFnR_location__array = values[\\"https://www.w3.org/ns/activitystreams#location\\"]; @@ -17618,7 +19419,7 @@ get licenses(): (URL)[] { instance.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = _31k5MUZJsnsPNg8dQQJieWaXTFnR_location; const _gCVTegXxWWCw6wWRxa1QF65zusg_preview: (Link | Object | URL)[] = []; - const _trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: Set = new Set(); + const _trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: VocabTrustSet = new Set(); let _gCVTegXxWWCw6wWRxa1QF65zusg_preview__array = values[\\"https://www.w3.org/ns/activitystreams#preview\\"]; @@ -17699,7 +19500,7 @@ get licenses(): (URL)[] { instance.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published = _5e258TDXtuhaFRPZiGoDfEpjdMr_published; const _7UpwM3JWcXhADcscukEehBorf6k_replies: (Collection | URL)[] = []; - const _trust_7UpwM3JWcXhADcscukEehBorf6k_replies: Set = new Set(); + const _trust_7UpwM3JWcXhADcscukEehBorf6k_replies: VocabTrustSet = new Set(); let _7UpwM3JWcXhADcscukEehBorf6k_replies__array = values[\\"https://www.w3.org/ns/activitystreams#replies\\"]; @@ -17740,7 +19541,7 @@ get licenses(): (URL)[] { instance.#_7UpwM3JWcXhADcscukEehBorf6k_replies = _7UpwM3JWcXhADcscukEehBorf6k_replies; const _3kAfck9PcEYt2L7xug5y99YPbANs_shares: (Collection | URL)[] = []; - const _trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares: Set = new Set(); + const _trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares: VocabTrustSet = new Set(); let _3kAfck9PcEYt2L7xug5y99YPbANs_shares__array = values[\\"https://www.w3.org/ns/activitystreams#shares\\"]; @@ -17781,7 +19582,7 @@ get licenses(): (URL)[] { instance.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares = _3kAfck9PcEYt2L7xug5y99YPbANs_shares; const _S3ceDnpMdzoTRCccB9FkJWrEzYW_likes: (Collection | URL)[] = []; - const _trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes: Set = new Set(); + const _trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes: VocabTrustSet = new Set(); let _S3ceDnpMdzoTRCccB9FkJWrEzYW_likes__array = values[\\"https://www.w3.org/ns/activitystreams#likes\\"]; @@ -17822,7 +19623,7 @@ get licenses(): (URL)[] { instance.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = _S3ceDnpMdzoTRCccB9FkJWrEzYW_likes; const _kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions: (Collection | URL)[] = []; - const _trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions: Set = new Set(); + const _trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions: VocabTrustSet = new Set(); let _kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions__array = values[\\"http://fedibird.com/ns#emojiReactions\\"]; @@ -17929,7 +19730,7 @@ get licenses(): (URL)[] { instance.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = _4LqirZspQbFWWQEbFcXAxm7tTDN1_summary; const _5chuqj6s95p5gg2sk1HntGfarRf_tag: (Object | Link | URL)[] = []; - const _trust_5chuqj6s95p5gg2sk1HntGfarRf_tag: Set = new Set(); + const _trust_5chuqj6s95p5gg2sk1HntGfarRf_tag: VocabTrustSet = new Set(); let _5chuqj6s95p5gg2sk1HntGfarRf_tag__array = values[\\"https://www.w3.org/ns/activitystreams#tag\\"]; @@ -18046,7 +19847,7 @@ get licenses(): (URL)[] { instance.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = _2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; const _3hFbw7DTpHhq3cvVhkY8njhcsXbd_to: (Object | URL)[] = []; - const _trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to: Set = new Set(); + const _trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to: VocabTrustSet = new Set(); let _3hFbw7DTpHhq3cvVhkY8njhcsXbd_to__array = values[\\"https://www.w3.org/ns/activitystreams#to\\"]; @@ -18087,7 +19888,7 @@ get licenses(): (URL)[] { instance.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = _3hFbw7DTpHhq3cvVhkY8njhcsXbd_to; const _aLZupjwL8XB7tzdLgCMXdjZ6qej_bto: (Object | URL)[] = []; - const _trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto: Set = new Set(); + const _trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto: VocabTrustSet = new Set(); let _aLZupjwL8XB7tzdLgCMXdjZ6qej_bto__array = values[\\"https://www.w3.org/ns/activitystreams#bto\\"]; @@ -18128,7 +19929,7 @@ get licenses(): (URL)[] { instance.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = _aLZupjwL8XB7tzdLgCMXdjZ6qej_bto; const _42a1SvBs24QSLzKcfjCyNTjW5a1g_cc: (Object | URL)[] = []; - const _trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc: Set = new Set(); + const _trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc: VocabTrustSet = new Set(); let _42a1SvBs24QSLzKcfjCyNTjW5a1g_cc__array = values[\\"https://www.w3.org/ns/activitystreams#cc\\"]; @@ -18169,7 +19970,7 @@ get licenses(): (URL)[] { instance.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = _42a1SvBs24QSLzKcfjCyNTjW5a1g_cc; const _3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc: (Object | URL)[] = []; - const _trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc: Set = new Set(); + const _trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc: VocabTrustSet = new Set(); let _3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc__array = values[\\"https://www.w3.org/ns/activitystreams#bcc\\"]; @@ -18329,7 +20130,7 @@ get licenses(): (URL)[] { instance.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source = _2ZwCFoS787v8y8bXKjMoE6MAbrEB_source; const _42rPnotok1ivQ2RNCKNbeFJgx8b8_proof: (DataIntegrityProof | URL)[] = []; - const _trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof: Set = new Set(); + const _trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof: VocabTrustSet = new Set(); let _42rPnotok1ivQ2RNCKNbeFJgx8b8_proof__array = values[\\"https://w3id.org/security#proof\\"]; @@ -18436,7 +20237,7 @@ get licenses(): (URL)[] { instance.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy = _23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy; const _3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization: (LikeAuthorization | URL)[] = []; - const _trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization: Set = new Set(); + const _trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization: VocabTrustSet = new Set(); let _3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization__array = values[\\"https://gotosocial.org/ns#likeAuthorization\\"]; @@ -18477,7 +20278,7 @@ get licenses(): (URL)[] { instance.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = _3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization; const _YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization: (ReplyAuthorization | URL)[] = []; - const _trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization: Set = new Set(); + const _trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization: VocabTrustSet = new Set(); let _YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization__array = values[\\"https://gotosocial.org/ns#replyAuthorization\\"]; @@ -18518,7 +20319,7 @@ get licenses(): (URL)[] { instance.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = _YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization; const _446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization: (AnnounceAuthorization | URL)[] = []; - const _trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization: Set = new Set(); + const _trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization: VocabTrustSet = new Set(); let _446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization__array = values[\\"https://gotosocial.org/ns#announceAuthorization\\"]; @@ -19725,6 +21526,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -20114,11 +21921,11 @@ export class ChatMessage extends Object { } #_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); #_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl: (URL)[] = []; #_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); /** * Constructs a new instance of ChatMessage with the given values. @@ -20259,12 +22066,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as ChatMessage;clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice();clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote); + const clone = super.clone(values, options) as unknown as ChatMessage;clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < vocabSparseArrayMinimumLength + ? this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice() : vocabCopyPropertyArray(this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote);clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = vocabCopyTrustSet( + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, + ); if (\\"quote\\" in values && values.quote != null) { if (values.quote instanceof Object || values.quote instanceof URL) { // @ts-ignore: type is checked above. clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = [values.quote]; - clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set([0]); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The quote must be of type \\" + @@ -20272,7 +22083,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice(); + clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length < vocabSparseArrayMinimumLength + ? this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice() : vocabCopyPropertyArray(this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl); if (\\"quoteUrl\\" in values && values.quoteUrl != null) { if (values.quoteUrl instanceof URL) { // @ts-ignore: type is checked above. @@ -20285,12 +22097,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice();clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization); + clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice() : vocabCopyPropertyArray(this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization);clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = vocabCopyTrustSet( + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, + ); if (\\"quoteAuthorization\\" in values && values.quoteAuthorization != null) { if (values.quoteAuthorization instanceof QuoteAuthorization || values.quoteAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = [values.quoteAuthorization]; - clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set([0]); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The quoteAuthorization must be of type \\" + @@ -20324,6 +22140,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -20373,24 +22195,69 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as ChatMessage; - for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { - const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + { + const array = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { - const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; - if (value != null && typeof value === \\"object\\") { - node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + { + const array = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === \\"object\\") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { - const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; - if (value != null && typeof value === \\"object\\") { - node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + { + const array = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } } } } }); } @@ -20723,7 +22590,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/044f#quote\\"); @@ -20791,7 +22659,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -21165,7 +23034,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/044f#quoteAuthorization\\"); @@ -21233,7 +23103,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -21660,7 +23531,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); let _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote__array = values[\\"https://w3id.org/fep/044f#quote\\"]; @@ -21740,7 +23611,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; const _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); let _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization__array = values[\\"https://w3id.org/fep/044f#quoteAuthorization\\"]; @@ -21915,22 +23786,22 @@ export class Activity extends Object { } #_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor: Set = new Set(); + #_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor: VocabTrustSet = new Set(); #_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: (Object | URL)[] = []; - #_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: Set = new Set(); + #_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: VocabTrustSet = new Set(); #_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target: (Object | URL)[] = []; - #_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target: Set = new Set(); + #_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target: VocabTrustSet = new Set(); #_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result: (Object | URL)[] = []; - #_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result: Set = new Set(); + #_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result: VocabTrustSet = new Set(); #_25zu2s3VxVujgEKqrDycjE284XQR_origin: (Object | URL)[] = []; - #_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin: Set = new Set(); + #_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin: VocabTrustSet = new Set(); #_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument: (Object | URL)[] = []; - #_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument: Set = new Set(); + #_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument: VocabTrustSet = new Set(); /** * Constructs a new instance of Activity with the given values. @@ -21996,14 +23867,36 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.actors) && - values.actors.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.actors)) { + const array = values.actors; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.actors; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = values.actors.slice(); + this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = copied; - for (let i = 0; i < values.actors.length; i++) { - this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.add(i); - } + vocabSetTrustPrefix(this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor, this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length); } else { throw new TypeError( @@ -22036,14 +23929,36 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.objects) && - values.objects.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.objects)) { + const array = values.objects; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.objects; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = values.objects.slice(); + this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = copied; - for (let i = 0; i < values.objects.length; i++) { - this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.add(i); - } + vocabSetTrustPrefix(this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length); } else { throw new TypeError( @@ -22076,14 +23991,36 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.targets) && - values.targets.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.targets)) { + const array = values.targets; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.targets; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = values.targets.slice(); + this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = copied; - for (let i = 0; i < values.targets.length; i++) { - this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.add(i); - } + vocabSetTrustPrefix(this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target, this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length); } else { throw new TypeError( @@ -22116,14 +24053,36 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.results) && - values.results.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.results)) { + const array = values.results; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.results; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = values.results.slice(); + this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = copied; - for (let i = 0; i < values.results.length; i++) { - this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.add(i); - } + vocabSetTrustPrefix(this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result, this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length); } else { throw new TypeError( @@ -22156,14 +24115,36 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.origins) && - values.origins.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.origins)) { + const array = values.origins; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.origins; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = values.origins.slice(); + this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = copied; - for (let i = 0; i < values.origins.length; i++) { - this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.add(i); - } + vocabSetTrustPrefix(this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin, this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length); } else { throw new TypeError( @@ -22196,14 +24177,36 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.instruments) && - values.instruments.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.instruments)) { + const array = values.instruments; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.instruments; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = values.instruments.slice(); + this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = copied; - for (let i = 0; i < values.instruments.length; i++) { - this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.add(i); - } + vocabSetTrustPrefix(this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument, this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length); } else { throw new TypeError( @@ -22284,12 +24287,16 @@ instruments?: (Object | URL)[];} // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Activity;clone.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.slice();clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = new Set(this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor); + const clone = super.clone(values, options) as unknown as Activity;clone.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length < vocabSparseArrayMinimumLength + ? this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.slice() : vocabCopyPropertyArray(this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor);clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = vocabCopyTrustSet( + this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor, clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor, + ); if (\\"actor\\" in values && values.actor != null) { if (values.actor instanceof Application || values.actor instanceof Group || values.actor instanceof Organization || values.actor instanceof Person || values.actor instanceof Service || values.actor instanceof URL) { // @ts-ignore: type is checked above. clone.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = [values.actor]; - clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = new Set([0]); + clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = new Set(); + clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The actor must be of type \\" + @@ -22308,15 +24315,37 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.actors) && - values.actors.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.actors)) { + const array = values.actors; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.actors; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = values.actors.slice(); + clone.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = copied; clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = new Set(); - for (let i = 0; i < values.actors.length; i++) { - clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor, clone.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length); } else { throw new TypeError( @@ -22325,12 +24354,16 @@ instruments?: (Object | URL)[];} ); } } - clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.slice();clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set(this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object); + clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length < vocabSparseArrayMinimumLength + ? this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.slice() : vocabCopyPropertyArray(this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object);clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = vocabCopyTrustSet( + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, + ); if (\\"object\\" in values && values.object != null) { if (values.object instanceof Object || values.object instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = [values.object]; - clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set([0]); + clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set(); + clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The object must be of type \\" + @@ -22349,15 +24382,37 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.objects) && - values.objects.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.objects)) { + const array = values.objects; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.objects; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = values.objects.slice(); + clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = copied; clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set(); - for (let i = 0; i < values.objects.length; i++) { - clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length); } else { throw new TypeError( @@ -22366,12 +24421,16 @@ instruments?: (Object | URL)[];} ); } } - clone.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.slice();clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = new Set(this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target); + clone.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length < vocabSparseArrayMinimumLength + ? this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.slice() : vocabCopyPropertyArray(this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target);clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = vocabCopyTrustSet( + this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target, clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target, + ); if (\\"target\\" in values && values.target != null) { if (values.target instanceof Object || values.target instanceof URL) { // @ts-ignore: type is checked above. clone.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = [values.target]; - clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = new Set([0]); + clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = new Set(); + clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The target must be of type \\" + @@ -22390,15 +24449,37 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.targets) && - values.targets.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.targets)) { + const array = values.targets; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.targets; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = values.targets.slice(); + clone.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = copied; clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = new Set(); - for (let i = 0; i < values.targets.length; i++) { - clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target, clone.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length); } else { throw new TypeError( @@ -22407,12 +24488,16 @@ instruments?: (Object | URL)[];} ); } } - clone.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.slice();clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = new Set(this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result); + clone.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length < vocabSparseArrayMinimumLength + ? this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.slice() : vocabCopyPropertyArray(this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result);clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = vocabCopyTrustSet( + this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result, clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result, + ); if (\\"result\\" in values && values.result != null) { if (values.result instanceof Object || values.result instanceof URL) { // @ts-ignore: type is checked above. clone.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = [values.result]; - clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = new Set([0]); + clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = new Set(); + clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The result must be of type \\" + @@ -22431,15 +24516,37 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.results) && - values.results.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.results)) { + const array = values.results; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.results; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = values.results.slice(); + clone.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = copied; clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = new Set(); - for (let i = 0; i < values.results.length; i++) { - clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.add(i); - } + vocabSetTrustPrefix(clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result, clone.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length); } else { throw new TypeError( @@ -22448,12 +24555,16 @@ instruments?: (Object | URL)[];} ); } } - clone.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.slice();clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin = new Set(this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin); + clone.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length < vocabSparseArrayMinimumLength + ? this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.slice() : vocabCopyPropertyArray(this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin);clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin = vocabCopyTrustSet( + this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin, clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin, + ); if (\\"origin\\" in values && values.origin != null) { if (values.origin instanceof Object || values.origin instanceof URL) { // @ts-ignore: type is checked above. clone.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = [values.origin]; - clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin = new Set([0]); + clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin = new Set(); + clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The origin must be of type \\" + @@ -22472,15 +24583,37 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.origins) && - values.origins.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.origins)) { + const array = values.origins; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.origins; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = values.origins.slice(); + clone.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = copied; clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin = new Set(); - for (let i = 0; i < values.origins.length; i++) { - clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.add(i); - } + vocabSetTrustPrefix(clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin, clone.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length); } else { throw new TypeError( @@ -22489,12 +24622,16 @@ instruments?: (Object | URL)[];} ); } } - clone.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.slice();clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = new Set(this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument); + clone.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length < vocabSparseArrayMinimumLength + ? this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.slice() : vocabCopyPropertyArray(this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument);clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = vocabCopyTrustSet( + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument, clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument, + ); if (\\"instrument\\" in values && values.instrument != null) { if (values.instrument instanceof Object || values.instrument instanceof URL) { // @ts-ignore: type is checked above. clone.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = [values.instrument]; - clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = new Set([0]); + clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = new Set(); + clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The instrument must be of type \\" + @@ -22513,15 +24650,37 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.instruments) && - values.instruments.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.instruments)) { + const array = values.instruments; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.instruments; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = values.instruments.slice(); + clone.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = copied; clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = new Set(); - for (let i = 0; i < values.instruments.length; i++) { - clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument, clone.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length); } else { throw new TypeError( @@ -22556,6 +24715,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -22611,45 +24776,135 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Activity; - for (let i = 0; i < node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length; i++) { - const value = node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[i] = context.value(value); + { + const array = node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length; i++) { + const value = node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length; i++) { - const value = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i] = context.value(value); + { + const array = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length; i++) { + const value = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length; i++) { - const value = node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[i] = context.value(value); + { + const array = node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length; i++) { + const value = node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length; i++) { - const value = node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[i]; - if (value != null && typeof value === \\"object\\") { - node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[i] = context.value(value); + { + const array = node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length; i++) { + const value = node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[i]; + if (value != null && typeof value === \\"object\\") { + node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length; i++) { - const value = node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[i]; - if (value != null && typeof value === \\"object\\") { - node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[i] = context.value(value); + { + const array = node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length; i++) { + const value = node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[i]; + if (value != null && typeof value === \\"object\\") { + node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length; i++) { - const value = node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[i] = context.value(value); + { + const array = node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length; i++) { + const value = node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[i] = context.value(value); + } + } } } } }); } @@ -23042,7 +25297,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[0]; if (!(v instanceof URL) && - !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { + !(0 < (this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[vocabTrustPrefix] ?? 0) || + this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#actor\\"); @@ -23110,7 +25366,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { + !(0 < (this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[vocabTrustPrefix] ?? 0) || + this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -23200,7 +25457,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { + !(i < (this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[vocabTrustPrefix] ?? 0) || + this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#actor\\"); @@ -23272,7 +25530,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { + !(i < (this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[vocabTrustPrefix] ?? 0) || + this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -23625,7 +25884,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (!(v instanceof URL) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { + !(0 < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#object\\"); @@ -23693,7 +25953,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { + !(0 < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -23783,7 +26044,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { + !(i < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#object\\"); @@ -23855,7 +26117,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { + !(i < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -24211,7 +26474,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[0]; if (!(v instanceof URL) && - !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { + !(0 < (this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[vocabTrustPrefix] ?? 0) || + this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#target\\"); @@ -24279,7 +26543,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { + !(0 < (this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[vocabTrustPrefix] ?? 0) || + this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -24372,7 +26637,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { + !(i < (this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[vocabTrustPrefix] ?? 0) || + this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#target\\"); @@ -24444,7 +26710,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { + !(i < (this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[vocabTrustPrefix] ?? 0) || + this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -24797,7 +27064,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[0]; if (!(v instanceof URL) && - !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { + !(0 < (this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[vocabTrustPrefix] ?? 0) || + this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#result\\"); @@ -24865,7 +27133,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { + !(0 < (this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[vocabTrustPrefix] ?? 0) || + this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -24955,7 +27224,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { + !(i < (this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[vocabTrustPrefix] ?? 0) || + this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#result\\"); @@ -25027,7 +27297,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { + !(i < (this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[vocabTrustPrefix] ?? 0) || + this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -25381,7 +27652,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[0]; if (!(v instanceof URL) && - !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { + !(0 < (this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin[vocabTrustPrefix] ?? 0) || + this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#origin\\"); @@ -25449,7 +27721,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { + !(0 < (this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin[vocabTrustPrefix] ?? 0) || + this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -25540,7 +27813,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { + !(i < (this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin[vocabTrustPrefix] ?? 0) || + this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#origin\\"); @@ -25612,7 +27886,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { + !(i < (this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin[vocabTrustPrefix] ?? 0) || + this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -25964,7 +28239,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[0]; if (!(v instanceof URL) && - !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { + !(0 < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#instrument\\"); @@ -26032,7 +28308,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { + !(0 < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -26121,7 +28398,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { + !(i < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#instrument\\"); @@ -26193,7 +28471,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { + !(i < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -26732,7 +29011,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor: Set = new Set(); + const _trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor: VocabTrustSet = new Set(); let _2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor__array = values[\\"https://www.w3.org/ns/activitystreams#actor\\"]; @@ -26790,7 +29069,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = _2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor; const _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: (Object | URL)[] = []; - const _trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: Set = new Set(); + const _trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: VocabTrustSet = new Set(); let _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object__array = values[\\"https://www.w3.org/ns/activitystreams#object\\"]; @@ -26831,7 +29110,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; const _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target: (Object | URL)[] = []; - const _trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target: Set = new Set(); + const _trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target: VocabTrustSet = new Set(); let _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target__array = values[\\"https://www.w3.org/ns/activitystreams#target\\"]; @@ -26872,7 +29151,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target; const _u4QGFbRFcYmPEKGbPv1hpBR9r5G_result: (Object | URL)[] = []; - const _trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result: Set = new Set(); + const _trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result: VocabTrustSet = new Set(); let _u4QGFbRFcYmPEKGbPv1hpBR9r5G_result__array = values[\\"https://www.w3.org/ns/activitystreams#result\\"]; @@ -26913,7 +29192,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = _u4QGFbRFcYmPEKGbPv1hpBR9r5G_result; const _25zu2s3VxVujgEKqrDycjE284XQR_origin: (Object | URL)[] = []; - const _trust_25zu2s3VxVujgEKqrDycjE284XQR_origin: Set = new Set(); + const _trust_25zu2s3VxVujgEKqrDycjE284XQR_origin: VocabTrustSet = new Set(); let _25zu2s3VxVujgEKqrDycjE284XQR_origin__array = values[\\"https://www.w3.org/ns/activitystreams#origin\\"]; @@ -26954,7 +29233,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = _25zu2s3VxVujgEKqrDycjE284XQR_origin; const _3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument: (Object | URL)[] = []; - const _trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument: Set = new Set(); + const _trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument: VocabTrustSet = new Set(); let _3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument__array = values[\\"https://www.w3.org/ns/activitystreams#instrument\\"]; @@ -27358,6 +29637,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -27919,7 +30204,8 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} options ); copyPortableProvenance(this, clone); - clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice(); + clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.length < vocabSparseArrayMinimumLength + ? this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice() : vocabCopyPropertyArray(this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name); if (\\"name\\" in values && values.name != null) { if (typeof values.name === \\"string\\" || values.name instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -27932,7 +30218,8 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} ); } } - clone.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value = this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value.slice(); + clone.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value = this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value.length < vocabSparseArrayMinimumLength + ? this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value.slice() : vocabCopyPropertyArray(this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value); if (\\"value\\" in values && values.value != null) { if (typeof values.value === \\"string\\" || values.value instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -27971,6 +30258,12 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -28757,7 +31050,8 @@ unit?: string | null;numericalValue?: Decimal | null;} options ); copyPortableProvenance(this, clone); - clone.#_27fgyFbosTtMAhuepJH8K3ZGURT6 = this.#_27fgyFbosTtMAhuepJH8K3ZGURT6.slice(); + clone.#_27fgyFbosTtMAhuepJH8K3ZGURT6 = this.#_27fgyFbosTtMAhuepJH8K3ZGURT6.length < vocabSparseArrayMinimumLength + ? this.#_27fgyFbosTtMAhuepJH8K3ZGURT6.slice() : vocabCopyPropertyArray(this.#_27fgyFbosTtMAhuepJH8K3ZGURT6); if (\\"unit\\" in values && values.unit != null) { if (typeof values.unit === \\"string\\") { // @ts-ignore: type is checked above. @@ -28770,7 +31064,8 @@ unit?: string | null;numericalValue?: Decimal | null;} ); } } - clone.#_1GQx8o2RgxRs4x9G5uT39XYBv7D = this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D.slice(); + clone.#_1GQx8o2RgxRs4x9G5uT39XYBv7D = this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D.length < vocabSparseArrayMinimumLength + ? this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D.slice() : vocabCopyPropertyArray(this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D); if (\\"numericalValue\\" in values && values.numericalValue != null) { if (typeof values.numericalValue === \\"string\\" && isDecimal(values.numericalValue)) { // @ts-ignore: type is checked above. @@ -28809,6 +31104,12 @@ unit?: string | null;numericalValue?: Decimal | null;} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -29391,10 +31692,10 @@ export class AnnounceAuthorization extends Object { } #_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); #_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); /** * Constructs a new instance of AnnounceAuthorization with the given values. @@ -29522,12 +31823,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as AnnounceAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice();clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject); + const clone = super.clone(values, options) as unknown as AnnounceAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < vocabSparseArrayMinimumLength + ? this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice() : vocabCopyPropertyArray(this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject);clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = vocabCopyTrustSet( + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, + ); if (\\"interactingObject\\" in values && values.interactingObject != null) { if (values.interactingObject instanceof Object || values.interactingObject instanceof URL) { // @ts-ignore: type is checked above. clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = [values.interactingObject]; - clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set([0]); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The interactingObject must be of type \\" + @@ -29535,12 +31840,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice();clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget); + clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < vocabSparseArrayMinimumLength + ? this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice() : vocabCopyPropertyArray(this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget);clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = vocabCopyTrustSet( + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, + ); if (\\"interactionTarget\\" in values && values.interactionTarget != null) { if (values.interactionTarget instanceof Object || values.interactionTarget instanceof URL) { // @ts-ignore: type is checked above. clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = [values.interactionTarget]; - clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set([0]); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The interactionTarget must be of type \\" + @@ -29574,6 +31883,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -29623,17 +31938,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as AnnounceAuthorization; - for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { - const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + { + const array = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { - const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + { + const array = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } } } } }); } @@ -29965,7 +32310,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#interactingObject\\"); @@ -30033,7 +32379,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -30383,7 +32730,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#interactionTarget\\"); @@ -30451,7 +32799,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -30828,7 +33177,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); let _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject__array = values[\\"https://gotosocial.org/ns#interactingObject\\"]; @@ -30869,7 +33218,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; const _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); let _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget__array = values[\\"https://gotosocial.org/ns#interactionTarget\\"]; @@ -31167,6 +33516,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -31777,7 +34132,8 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: options ); copyPortableProvenance(this, clone); - clone.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature = this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.slice(); + clone.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature = this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.length < vocabSparseArrayMinimumLength + ? this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.slice() : vocabCopyPropertyArray(this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature); if (\\"canFeature\\" in values && values.canFeature != null) { if (values.canFeature instanceof InteractionRule) { // @ts-ignore: type is checked above. @@ -31790,7 +34146,8 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: ); } } - clone.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike = this.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.slice(); + clone.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike = this.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.length < vocabSparseArrayMinimumLength + ? this.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.slice() : vocabCopyPropertyArray(this.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike); if (\\"canLike\\" in values && values.canLike != null) { if (values.canLike instanceof InteractionRule) { // @ts-ignore: type is checked above. @@ -31803,7 +34160,8 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: ); } } - clone.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply = this.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.slice(); + clone.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply = this.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.length < vocabSparseArrayMinimumLength + ? this.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.slice() : vocabCopyPropertyArray(this.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply); if (\\"canReply\\" in values && values.canReply != null) { if (values.canReply instanceof InteractionRule) { // @ts-ignore: type is checked above. @@ -31816,7 +34174,8 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: ); } } - clone.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce = this.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.slice(); + clone.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce = this.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.length < vocabSparseArrayMinimumLength + ? this.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.slice() : vocabCopyPropertyArray(this.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce); if (\\"canAnnounce\\" in values && values.canAnnounce != null) { if (values.canAnnounce instanceof InteractionRule) { // @ts-ignore: type is checked above. @@ -31829,7 +34188,8 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: ); } } - clone.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote = this.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.slice(); + clone.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote = this.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.length < vocabSparseArrayMinimumLength + ? this.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.slice() : vocabCopyPropertyArray(this.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote); if (\\"canQuote\\" in values && values.canQuote != null) { if (values.canQuote instanceof InteractionRule) { // @ts-ignore: type is checked above. @@ -31868,6 +34228,12 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -31911,38 +34277,113 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.length; i++) { - const value = node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature[i] = context.value(value); + { + const array = node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.length; i++) { + const value = node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.length; i++) { - const value = node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike[i] = context.value(value); + { + const array = node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.length; i++) { + const value = node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.length; i++) { - const value = node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply[i] = context.value(value); + { + const array = node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.length; i++) { + const value = node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.length; i++) { - const value = node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce[i]; - if (value != null && typeof value === \\"object\\") { - node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce[i] = context.value(value); + { + const array = node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.length; i++) { + const value = node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce[i]; + if (value != null && typeof value === \\"object\\") { + node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.length; i++) { - const value = node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote[i]; - if (value != null && typeof value === \\"object\\") { - node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote[i] = context.value(value); + { + const array = node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.length; i++) { + const value = node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote[i]; + if (value != null && typeof value === \\"object\\") { + node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote[i] = context.value(value); + } + } } } } }); } @@ -32881,10 +35322,34 @@ manualApprovals?: (URL)[];} ); } - if (Array.isArray(values.automaticApprovals) && - values.automaticApprovals.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.automaticApprovals)) { + const array = values.automaticApprovals; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.automaticApprovals; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = values.automaticApprovals.slice(); + this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = copied; } else { throw new TypeError( @@ -32917,10 +35382,34 @@ manualApprovals?: (URL)[];} ); } - if (Array.isArray(values.manualApprovals) && - values.manualApprovals.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.manualApprovals)) { + const array = values.manualApprovals; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.manualApprovals; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = values.manualApprovals.slice(); + this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = copied; } else { throw new TypeError( @@ -32988,7 +35477,8 @@ manualApprovals?: (URL)[];} options ); copyPortableProvenance(this, clone); - clone.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.slice(); + clone.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.length < vocabSparseArrayMinimumLength + ? this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.slice() : vocabCopyPropertyArray(this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval); if (\\"automaticApproval\\" in values && values.automaticApproval != null) { if (values.automaticApproval instanceof URL) { // @ts-ignore: type is checked above. @@ -33012,10 +35502,34 @@ manualApprovals?: (URL)[];} ); } - if (Array.isArray(values.automaticApprovals) && - values.automaticApprovals.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.automaticApprovals)) { + const array = values.automaticApprovals; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.automaticApprovals; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = values.automaticApprovals.slice(); + clone.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = copied; } else { throw new TypeError( @@ -33024,7 +35538,8 @@ manualApprovals?: (URL)[];} ); } } - clone.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.slice(); + clone.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.length < vocabSparseArrayMinimumLength + ? this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.slice() : vocabCopyPropertyArray(this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval); if (\\"manualApproval\\" in values && values.manualApproval != null) { if (values.manualApproval instanceof URL) { // @ts-ignore: type is checked above. @@ -33048,10 +35563,34 @@ manualApprovals?: (URL)[];} ); } - if (Array.isArray(values.manualApprovals) && - values.manualApprovals.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.manualApprovals)) { + const array = values.manualApprovals; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.manualApprovals; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = values.manualApprovals.slice(); + clone.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = copied; } else { throw new TypeError( @@ -33086,6 +35625,12 @@ manualApprovals?: (URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -33131,17 +35676,47 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.length; i++) { - const value = node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval[i] = context.value(value); + { + const array = node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.length; i++) { + const value = node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.length; i++) { - const value = node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval[i]; - if (value != null && typeof value === \\"object\\") { - node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval[i] = context.value(value); + { + const array = node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.length; i++) { + const value = node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval[i] = context.value(value); + } + } } } } }); } @@ -33665,10 +36240,10 @@ export class LikeAuthorization extends Object { } #_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); #_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); /** * Constructs a new instance of LikeAuthorization with the given values. @@ -33796,12 +36371,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as LikeAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice();clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject); + const clone = super.clone(values, options) as unknown as LikeAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < vocabSparseArrayMinimumLength + ? this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice() : vocabCopyPropertyArray(this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject);clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = vocabCopyTrustSet( + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, + ); if (\\"interactingObject\\" in values && values.interactingObject != null) { if (values.interactingObject instanceof Object || values.interactingObject instanceof URL) { // @ts-ignore: type is checked above. clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = [values.interactingObject]; - clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set([0]); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The interactingObject must be of type \\" + @@ -33809,12 +36388,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice();clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget); + clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < vocabSparseArrayMinimumLength + ? this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice() : vocabCopyPropertyArray(this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget);clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = vocabCopyTrustSet( + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, + ); if (\\"interactionTarget\\" in values && values.interactionTarget != null) { if (values.interactionTarget instanceof Object || values.interactionTarget instanceof URL) { // @ts-ignore: type is checked above. clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = [values.interactionTarget]; - clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set([0]); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The interactionTarget must be of type \\" + @@ -33848,6 +36431,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -33897,17 +36486,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as LikeAuthorization; - for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { - const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + { + const array = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { - const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + { + const array = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } } } } }); } @@ -34239,7 +36858,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#interactingObject\\"); @@ -34307,7 +36927,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -34657,7 +37278,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#interactionTarget\\"); @@ -34725,7 +37347,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -35102,7 +37725,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); let _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject__array = values[\\"https://gotosocial.org/ns#interactingObject\\"]; @@ -35143,7 +37766,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; const _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); let _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget__array = values[\\"https://gotosocial.org/ns#interactionTarget\\"]; @@ -35440,6 +38063,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -35819,10 +38448,10 @@ export class ReplyAuthorization extends Object { } #_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); #_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); /** * Constructs a new instance of ReplyAuthorization with the given values. @@ -35950,12 +38579,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as ReplyAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice();clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject); + const clone = super.clone(values, options) as unknown as ReplyAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < vocabSparseArrayMinimumLength + ? this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice() : vocabCopyPropertyArray(this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject);clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = vocabCopyTrustSet( + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, + ); if (\\"interactingObject\\" in values && values.interactingObject != null) { if (values.interactingObject instanceof Object || values.interactingObject instanceof URL) { // @ts-ignore: type is checked above. clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = [values.interactingObject]; - clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set([0]); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The interactingObject must be of type \\" + @@ -35963,12 +38596,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice();clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget); + clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < vocabSparseArrayMinimumLength + ? this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice() : vocabCopyPropertyArray(this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget);clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = vocabCopyTrustSet( + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, + ); if (\\"interactionTarget\\" in values && values.interactionTarget != null) { if (values.interactionTarget instanceof Object || values.interactionTarget instanceof URL) { // @ts-ignore: type is checked above. clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = [values.interactionTarget]; - clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set([0]); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The interactionTarget must be of type \\" + @@ -36002,6 +38639,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -36051,17 +38694,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as ReplyAuthorization; - for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { - const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + { + const array = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { - const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + { + const array = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } } } } }); } @@ -36393,7 +39066,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#interactingObject\\"); @@ -36461,7 +39135,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -36811,7 +39486,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#interactionTarget\\"); @@ -36879,7 +39555,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -37256,7 +39933,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); let _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject__array = values[\\"https://gotosocial.org/ns#interactingObject\\"]; @@ -37297,7 +39974,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; const _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); let _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget__array = values[\\"https://gotosocial.org/ns#interactionTarget\\"]; @@ -37594,6 +40271,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -37973,10 +40656,10 @@ export class QuoteAuthorization extends Object { } #_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); #_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); /** * Constructs a new instance of QuoteAuthorization with the given values. @@ -38104,12 +40787,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as QuoteAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice();clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject); + const clone = super.clone(values, options) as unknown as QuoteAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < vocabSparseArrayMinimumLength + ? this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice() : vocabCopyPropertyArray(this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject);clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = vocabCopyTrustSet( + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, + ); if (\\"interactingObject\\" in values && values.interactingObject != null) { if (values.interactingObject instanceof Object || values.interactingObject instanceof URL) { // @ts-ignore: type is checked above. clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = [values.interactingObject]; - clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set([0]); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The interactingObject must be of type \\" + @@ -38117,12 +40804,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice();clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget); + clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < vocabSparseArrayMinimumLength + ? this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice() : vocabCopyPropertyArray(this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget);clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = vocabCopyTrustSet( + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, + ); if (\\"interactionTarget\\" in values && values.interactionTarget != null) { if (values.interactionTarget instanceof Object || values.interactionTarget instanceof URL) { // @ts-ignore: type is checked above. clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = [values.interactionTarget]; - clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set([0]); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The interactionTarget must be of type \\" + @@ -38156,6 +40847,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -38205,17 +40902,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as QuoteAuthorization; - for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { - const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + { + const array = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { - const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + { + const array = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } } } } }); } @@ -38546,7 +41273,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#interactingObject\\"); @@ -38614,7 +41342,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -38964,7 +41693,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#interactionTarget\\"); @@ -39032,7 +41762,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -39409,7 +42140,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); let _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject__array = values[\\"https://gotosocial.org/ns#interactingObject\\"]; @@ -39450,7 +42181,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; const _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); let _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget__array = values[\\"https://gotosocial.org/ns#interactionTarget\\"]; @@ -39747,6 +42478,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -40195,7 +42932,7 @@ export class Translation { #_diXuPmFWiEqfLPhhrxg6Xc7ixZG: (Intl.Locale)[] = []; #_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR: Set = new Set(); + #_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR: VocabTrustSet = new Set(); #_Msz9PwRg7cWkiXPL4ixyQLtuuH7: (URL)[] = []; #_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated: (Temporal.Instant)[] = []; #_4KvkQNz1JjGs8S7iJDcGrUYETbUW: (URL)[] = []; @@ -40277,14 +43014,36 @@ urls?: ((URL | Link))[];} ); } - if (Array.isArray(values.translators) && - values.translators.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.translators)) { + const array = values.translators; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.translators; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = values.translators.slice(); + this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = copied; - for (let i = 0; i < values.translators.length; i++) { - this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.add(i); - } + vocabSetTrustPrefix(this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR, this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.length); } else { throw new TypeError( @@ -40356,10 +43115,34 @@ urls?: ((URL | Link))[];} ); } - if (Array.isArray(values.urls) && - values.urls.every(v => v instanceof URL || v instanceof Link)) { + let copied!: (URL | Link)[]; + let valid = false; + if (Array.isArray(values.urls)) { + const array = values.urls; + const test = (v: URL | Link): boolean => v instanceof URL || v instanceof Link; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.urls; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = values.urls.slice(); + this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = copied; } else { throw new TypeError( @@ -40427,7 +43210,8 @@ urls?: ((URL | Link))[];} options ); copyPortableProvenance(this, clone); - clone.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG = this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG.slice(); + clone.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG = this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG.length < vocabSparseArrayMinimumLength + ? this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG.slice() : vocabCopyPropertyArray(this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG); if (\\"language\\" in values && values.language != null) { if (values.language instanceof Intl.Locale) { // @ts-ignore: type is checked above. @@ -40440,12 +43224,16 @@ urls?: ((URL | Link))[];} ); } } - clone.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.slice();clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = new Set(this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR); + clone.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.length < vocabSparseArrayMinimumLength + ? this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.slice() : vocabCopyPropertyArray(this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR);clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = vocabCopyTrustSet( + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR, clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR, + ); if (\\"translator\\" in values && values.translator != null) { if (values.translator instanceof Application || values.translator instanceof Group || values.translator instanceof Organization || values.translator instanceof Person || values.translator instanceof Service || values.translator instanceof URL) { // @ts-ignore: type is checked above. clone.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = [values.translator]; - clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = new Set([0]); + clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = new Set(); + clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The translator must be of type \\" + @@ -40464,15 +43252,37 @@ urls?: ((URL | Link))[];} ); } - if (Array.isArray(values.translators) && - values.translators.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.translators)) { + const array = values.translators; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.translators; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = values.translators.slice(); + clone.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = copied; clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = new Set(); - for (let i = 0; i < values.translators.length; i++) { - clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.add(i); - } + vocabSetTrustPrefix(clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR, clone.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.length); } else { throw new TypeError( @@ -40481,7 +43291,8 @@ urls?: ((URL | Link))[];} ); } } - clone.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7 = this.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7.slice(); + clone.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7 = this.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7.length < vocabSparseArrayMinimumLength + ? this.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7.slice() : vocabCopyPropertyArray(this.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7); if (\\"original\\" in values && values.original != null) { if (values.original instanceof URL) { // @ts-ignore: type is checked above. @@ -40494,7 +43305,8 @@ urls?: ((URL | Link))[];} ); } } - clone.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated = this.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated.slice(); + clone.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated = this.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated.length < vocabSparseArrayMinimumLength + ? this.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated.slice() : vocabCopyPropertyArray(this.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated); if (\\"sourceUpdated\\" in values && values.sourceUpdated != null) { if (isTemporalInstant(values.sourceUpdated)) { // @ts-ignore: type is checked above. @@ -40507,7 +43319,8 @@ urls?: ((URL | Link))[];} ); } } - clone.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW = this.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW.slice(); + clone.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW = this.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW.length < vocabSparseArrayMinimumLength + ? this.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW.slice() : vocabCopyPropertyArray(this.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW); if (\\"basis\\" in values && values.basis != null) { if (values.basis instanceof URL) { // @ts-ignore: type is checked above. @@ -40520,7 +43333,8 @@ urls?: ((URL | Link))[];} ); } } - clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.slice(); + clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length < vocabSparseArrayMinimumLength + ? this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.slice() : vocabCopyPropertyArray(this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url); if (\\"url\\" in values && values.url != null) { if (values.url instanceof URL || values.url instanceof Link) { // @ts-ignore: type is checked above. @@ -40544,10 +43358,34 @@ urls?: ((URL | Link))[];} ); } - if (Array.isArray(values.urls) && - values.urls.every(v => v instanceof URL || v instanceof Link)) { + let copied!: (URL | Link)[]; + let valid = false; + if (Array.isArray(values.urls)) { + const array = values.urls; + const test = (v: URL | Link): boolean => v instanceof URL || v instanceof Link; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.urls; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = values.urls.slice(); + clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = copied; } else { throw new TypeError( @@ -40582,6 +43420,12 @@ urls?: ((URL | Link))[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -40627,31 +43471,91 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.length; i++) { - const value = node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[i]; - if (value != null && typeof value === \\"object\\") { - node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[i] = context.value(value); + { + const array = node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.length; i++) { + const value = node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7.length; i++) { - const value = node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7[i]; - if (value != null && typeof value === \\"object\\") { - node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7[i] = context.value(value); + { + const array = node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7.length; i++) { + const value = node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7[i]; + if (value != null && typeof value === \\"object\\") { + node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW.length; i++) { - const value = node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW[i] = context.value(value); + { + const array = node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW.length; i++) { + const value = node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length; i++) { - const value = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i] = context.value(value); + { + const array = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length; i++) { + const value = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i] = context.value(value); + } + } } } } }); } @@ -41062,7 +43966,8 @@ deepCloneDescriptors.set(this.prototype, { } let v = this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[0]; if (!(v instanceof URL) && - !this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(0)) { + !(0 < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://schema.org/translator\\"); @@ -41130,7 +44035,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, null, v.id, options, )) && - !this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(0)) { + !(0 < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -41223,7 +44129,8 @@ deepCloneDescriptors.set(this.prototype, { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(i)) { + !(i < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://schema.org/translator\\"); @@ -41295,7 +44202,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, null, v.id, options, )) && - !this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(i)) { + !(i < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -41907,7 +44815,7 @@ get urls(): ((URL | Link))[] { instance.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG = _diXuPmFWiEqfLPhhrxg6Xc7ixZG; const _hQqsdZa1zG8Ra1bQ3MBVsnmGnBR: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR: Set = new Set(); + const _trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR: VocabTrustSet = new Set(); let _hQqsdZa1zG8Ra1bQ3MBVsnmGnBR__array = values[\\"https://schema.org/translator\\"]; @@ -42312,10 +45220,10 @@ export class FeatureAuthorization extends Object { } #_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); #_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); /** * Constructs a new instance of FeatureAuthorization with the given values. @@ -42443,12 +45351,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as FeatureAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice();clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject); + const clone = super.clone(values, options) as unknown as FeatureAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < vocabSparseArrayMinimumLength + ? this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice() : vocabCopyPropertyArray(this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject);clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = vocabCopyTrustSet( + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, + ); if (\\"interactingObject\\" in values && values.interactingObject != null) { if (values.interactingObject instanceof Object || values.interactingObject instanceof URL) { // @ts-ignore: type is checked above. clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = [values.interactingObject]; - clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set([0]); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The interactingObject must be of type \\" + @@ -42456,12 +45368,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice();clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget); + clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < vocabSparseArrayMinimumLength + ? this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice() : vocabCopyPropertyArray(this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget);clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = vocabCopyTrustSet( + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, + ); if (\\"interactionTarget\\" in values && values.interactionTarget != null) { if (values.interactionTarget instanceof Object || values.interactionTarget instanceof URL) { // @ts-ignore: type is checked above. clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = [values.interactionTarget]; - clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set([0]); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The interactionTarget must be of type \\" + @@ -42495,6 +45411,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -42544,17 +45466,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as FeatureAuthorization; - for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { - const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + { + const array = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { - const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + { + const array = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } } } } }); } @@ -42884,7 +45836,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#interactingObject\\"); @@ -42952,7 +45905,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -43301,7 +46255,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#interactionTarget\\"); @@ -43369,7 +46324,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -43746,7 +46702,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); let _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject__array = values[\\"https://gotosocial.org/ns#interactingObject\\"]; @@ -43787,7 +46743,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; const _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); let _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget__array = values[\\"https://gotosocial.org/ns#interactionTarget\\"]; @@ -44081,6 +47037,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -44458,40 +47420,40 @@ export class Collection extends Object { #_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems: (number)[] = []; #_3UyUdxnyn6cDn53QKrh4MBiearma_current: (CollectionPage | URL)[] = []; - #_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current: Set = new Set(); + #_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current: VocabTrustSet = new Set(); #_J52RqweMe6hhv7RnLJMC8BExTE5_first: (CollectionPage | URL)[] = []; - #_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first: Set = new Set(); + #_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first: VocabTrustSet = new Set(); #_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last: (CollectionPage | URL)[] = []; - #_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last: Set = new Set(); + #_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last: VocabTrustSet = new Set(); #_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: (Object | Link | URL)[] = []; - #_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: Set = new Set(); + #_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: VocabTrustSet = new Set(); #_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf: (Object | URL)[] = []; - #_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf: Set = new Set(); + #_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf: VocabTrustSet = new Set(); #_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf: (Object | URL)[] = []; - #_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf: Set = new Set(); + #_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf: VocabTrustSet = new Set(); #_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf: (Object | URL)[] = []; - #_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf: Set = new Set(); + #_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf: VocabTrustSet = new Set(); #_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf: (Object | URL)[] = []; - #_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf: Set = new Set(); + #_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf: VocabTrustSet = new Set(); #_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf: (Object | URL)[] = []; - #_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf: Set = new Set(); + #_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf: VocabTrustSet = new Set(); #_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf: (Object | URL)[] = []; - #_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf: Set = new Set(); + #_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf: VocabTrustSet = new Set(); #_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf: (Object | URL)[] = []; - #_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf: Set = new Set(); + #_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf: VocabTrustSet = new Set(); #_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf: (Object | URL)[] = []; - #_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf: Set = new Set(); + #_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf: VocabTrustSet = new Set(); /** * Constructs a new instance of Collection with the given values. @@ -44582,14 +47544,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (\\"items\\" in values && values.items != null) { - if (Array.isArray(values.items) && - values.items.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.items)) { + const array = values.items; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.items; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = values.items.slice(); + this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = copied; - for (let i = 0; i < values.items.length; i++) { - this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.add(i); - } + vocabSetTrustPrefix(this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length); } else { throw new TypeError( @@ -44768,7 +47752,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Collection;clone.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems = this.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems.slice(); + const clone = super.clone(values, options) as unknown as Collection;clone.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems = this.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems.length < vocabSparseArrayMinimumLength + ? this.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems.slice() : vocabCopyPropertyArray(this.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems); if (\\"totalItems\\" in values && values.totalItems != null) { if (typeof values.totalItems === \\"number\\" && Number.isInteger(values.totalItems) && values.totalItems >= 0) { // @ts-ignore: type is checked above. @@ -44781,12 +47766,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3UyUdxnyn6cDn53QKrh4MBiearma_current = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.slice();clone.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current = new Set(this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current); + clone.#_3UyUdxnyn6cDn53QKrh4MBiearma_current = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.length < vocabSparseArrayMinimumLength + ? this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.slice() : vocabCopyPropertyArray(this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current);clone.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current = vocabCopyTrustSet( + this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current, clone.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current, + ); if (\\"current\\" in values && values.current != null) { if (values.current instanceof CollectionPage || values.current instanceof URL) { // @ts-ignore: type is checked above. clone.#_3UyUdxnyn6cDn53QKrh4MBiearma_current = [values.current]; - clone.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current = new Set([0]); + clone.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current = new Set(); + clone.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The current must be of type \\" + @@ -44794,12 +47783,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_J52RqweMe6hhv7RnLJMC8BExTE5_first = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.slice();clone.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first = new Set(this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first); + clone.#_J52RqweMe6hhv7RnLJMC8BExTE5_first = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.length < vocabSparseArrayMinimumLength + ? this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.slice() : vocabCopyPropertyArray(this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first);clone.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first = vocabCopyTrustSet( + this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first, clone.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first, + ); if (\\"first\\" in values && values.first != null) { if (values.first instanceof CollectionPage || values.first instanceof URL) { // @ts-ignore: type is checked above. clone.#_J52RqweMe6hhv7RnLJMC8BExTE5_first = [values.first]; - clone.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first = new Set([0]); + clone.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first = new Set(); + clone.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The first must be of type \\" + @@ -44807,12 +47800,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.slice();clone.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = new Set(this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last); + clone.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.length < vocabSparseArrayMinimumLength + ? this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.slice() : vocabCopyPropertyArray(this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last);clone.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = vocabCopyTrustSet( + this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last, clone.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last, + ); if (\\"last\\" in values && values.last != null) { if (values.last instanceof CollectionPage || values.last instanceof URL) { // @ts-ignore: type is checked above. clone.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = [values.last]; - clone.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = new Set([0]); + clone.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = new Set(); + clone.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The last must be of type \\" + @@ -44820,18 +47817,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.slice();clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = new Set(this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items); + clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length < vocabSparseArrayMinimumLength + ? this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.slice() : vocabCopyPropertyArray(this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items);clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = vocabCopyTrustSet( + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, + ); if (\\"items\\" in values && values.items != null) { - if (Array.isArray(values.items) && - values.items.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.items)) { + const array = values.items; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.items; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = values.items.slice(); + clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = copied; clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = new Set(); - for (let i = 0; i < values.items.length; i++) { - clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length); } else { throw new TypeError( @@ -44840,12 +47862,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.slice();clone.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = new Set(this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf); + clone.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.length < vocabSparseArrayMinimumLength + ? this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.slice() : vocabCopyPropertyArray(this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf);clone.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = vocabCopyTrustSet( + this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf, clone.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf, + ); if (\\"likesOf\\" in values && values.likesOf != null) { if (values.likesOf instanceof Object || values.likesOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = [values.likesOf]; - clone.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = new Set([0]); + clone.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = new Set(); + clone.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The likesOf must be of type \\" + @@ -44853,12 +47879,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.slice();clone.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = new Set(this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf); + clone.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.length < vocabSparseArrayMinimumLength + ? this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.slice() : vocabCopyPropertyArray(this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf);clone.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = vocabCopyTrustSet( + this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf, clone.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf, + ); if (\\"sharesOf\\" in values && values.sharesOf != null) { if (values.sharesOf instanceof Object || values.sharesOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = [values.sharesOf]; - clone.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = new Set([0]); + clone.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = new Set(); + clone.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The sharesOf must be of type \\" + @@ -44866,12 +47896,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.slice();clone.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = new Set(this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf); + clone.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.length < vocabSparseArrayMinimumLength + ? this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.slice() : vocabCopyPropertyArray(this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf);clone.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = vocabCopyTrustSet( + this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf, clone.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf, + ); if (\\"repliesOf\\" in values && values.repliesOf != null) { if (values.repliesOf instanceof Object || values.repliesOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = [values.repliesOf]; - clone.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = new Set([0]); + clone.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = new Set(); + clone.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The repliesOf must be of type \\" + @@ -44879,12 +47913,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.slice();clone.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = new Set(this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf); + clone.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.length < vocabSparseArrayMinimumLength + ? this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.slice() : vocabCopyPropertyArray(this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf);clone.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = vocabCopyTrustSet( + this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf, clone.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf, + ); if (\\"inboxOf\\" in values && values.inboxOf != null) { if (values.inboxOf instanceof Object || values.inboxOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = [values.inboxOf]; - clone.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = new Set([0]); + clone.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = new Set(); + clone.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The inboxOf must be of type \\" + @@ -44892,12 +47930,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.slice();clone.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = new Set(this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf); + clone.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.length < vocabSparseArrayMinimumLength + ? this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.slice() : vocabCopyPropertyArray(this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf);clone.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = vocabCopyTrustSet( + this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf, clone.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf, + ); if (\\"outboxOf\\" in values && values.outboxOf != null) { if (values.outboxOf instanceof Object || values.outboxOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = [values.outboxOf]; - clone.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = new Set([0]); + clone.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = new Set(); + clone.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The outboxOf must be of type \\" + @@ -44905,12 +47947,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.slice();clone.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = new Set(this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf); + clone.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.length < vocabSparseArrayMinimumLength + ? this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.slice() : vocabCopyPropertyArray(this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf);clone.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = vocabCopyTrustSet( + this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf, clone.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf, + ); if (\\"followersOf\\" in values && values.followersOf != null) { if (values.followersOf instanceof Object || values.followersOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = [values.followersOf]; - clone.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = new Set([0]); + clone.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = new Set(); + clone.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The followersOf must be of type \\" + @@ -44918,12 +47964,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.slice();clone.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = new Set(this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf); + clone.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.length < vocabSparseArrayMinimumLength + ? this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.slice() : vocabCopyPropertyArray(this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf);clone.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = vocabCopyTrustSet( + this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf, clone.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf, + ); if (\\"followingOf\\" in values && values.followingOf != null) { if (values.followingOf instanceof Object || values.followingOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = [values.followingOf]; - clone.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = new Set([0]); + clone.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = new Set(); + clone.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The followingOf must be of type \\" + @@ -44931,12 +47981,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.slice();clone.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = new Set(this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf); + clone.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.length < vocabSparseArrayMinimumLength + ? this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.slice() : vocabCopyPropertyArray(this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf);clone.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = vocabCopyTrustSet( + this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf, clone.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf, + ); if (\\"likedOf\\" in values && values.likedOf != null) { if (values.likedOf instanceof Object || values.likedOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = [values.likedOf]; - clone.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = new Set([0]); + clone.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = new Set(); + clone.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The likedOf must be of type \\" + @@ -44970,6 +48024,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -45019,87 +48079,267 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Collection; - for (let i = 0; i < node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.length; i++) { - const value = node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[i] = context.value(value); + { + const array = node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.length; i++) { + const value = node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.length; i++) { - const value = node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[i]; - if (value != null && typeof value === \\"object\\") { - node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[i] = context.value(value); + { + const array = node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.length; i++) { + const value = node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[i]; + if (value != null && typeof value === \\"object\\") { + node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.length; i++) { - const value = node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[i]; - if (value != null && typeof value === \\"object\\") { - node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[i] = context.value(value); + { + const array = node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.length; i++) { + const value = node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[i]; + if (value != null && typeof value === \\"object\\") { + node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { - const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + { + const array = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { + const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.length; i++) { - const value = node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[i] = context.value(value); + { + const array = node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.length; i++) { + const value = node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.length; i++) { - const value = node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[i] = context.value(value); + { + const array = node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.length; i++) { + const value = node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.length; i++) { - const value = node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[i] = context.value(value); + { + const array = node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.length; i++) { + const value = node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.length; i++) { - const value = node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[i] = context.value(value); + { + const array = node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.length; i++) { + const value = node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.length; i++) { - const value = node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[i] = context.value(value); + { + const array = node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.length; i++) { + const value = node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.length; i++) { - const value = node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[i] = context.value(value); + { + const array = node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.length; i++) { + const value = node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.length; i++) { - const value = node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[i] = context.value(value); + { + const array = node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.length; i++) { + const value = node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.length; i++) { - const value = node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[i] = context.value(value); + { + const array = node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.length; i++) { + const value = node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[i] = context.value(value); + } + } } } } }); } @@ -45447,7 +48687,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[0]; if (!(v instanceof URL) && - !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { + !(0 < (this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current[vocabTrustPrefix] ?? 0) || + this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#current\\"); @@ -45515,7 +48756,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { + !(0 < (this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current[vocabTrustPrefix] ?? 0) || + this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -45866,7 +49108,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[0]; if (!(v instanceof URL) && - !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { + !(0 < (this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first[vocabTrustPrefix] ?? 0) || + this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#first\\"); @@ -45934,7 +49177,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { + !(0 < (this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first[vocabTrustPrefix] ?? 0) || + this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -46285,7 +49529,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[0]; if (!(v instanceof URL) && - !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { + !(0 < (this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[vocabTrustPrefix] ?? 0) || + this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#last\\"); @@ -46353,7 +49598,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { + !(0 < (this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[vocabTrustPrefix] ?? 0) || + this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -46719,7 +49965,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { + !(i < (this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[vocabTrustPrefix] ?? 0) || + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#items\\"); @@ -46791,7 +50038,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { + !(i < (this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[vocabTrustPrefix] ?? 0) || + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -47142,7 +50390,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[0]; if (!(v instanceof URL) && - !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { + !(0 < (this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[vocabTrustPrefix] ?? 0) || + this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/5711#likesOf\\"); @@ -47210,7 +50459,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { + !(0 < (this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[vocabTrustPrefix] ?? 0) || + this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -47560,7 +50810,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[0]; if (!(v instanceof URL) && - !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { + !(0 < (this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[vocabTrustPrefix] ?? 0) || + this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/5711#sharesOf\\"); @@ -47628,7 +50879,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { + !(0 < (this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[vocabTrustPrefix] ?? 0) || + this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -47978,7 +51230,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[0]; if (!(v instanceof URL) && - !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { + !(0 < (this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[vocabTrustPrefix] ?? 0) || + this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/5711#repliesOf\\"); @@ -48046,7 +51299,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { + !(0 < (this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[vocabTrustPrefix] ?? 0) || + this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -48396,7 +51650,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[0]; if (!(v instanceof URL) && - !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { + !(0 < (this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/5711#inboxOf\\"); @@ -48464,7 +51719,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { + !(0 < (this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -48814,7 +52070,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[0]; if (!(v instanceof URL) && - !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { + !(0 < (this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[vocabTrustPrefix] ?? 0) || + this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/5711#outboxOf\\"); @@ -48882,7 +52139,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { + !(0 < (this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[vocabTrustPrefix] ?? 0) || + this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -49232,7 +52490,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[0]; if (!(v instanceof URL) && - !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { + !(0 < (this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[vocabTrustPrefix] ?? 0) || + this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/5711#followersOf\\"); @@ -49300,7 +52559,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { + !(0 < (this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[vocabTrustPrefix] ?? 0) || + this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -49650,7 +52910,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[0]; if (!(v instanceof URL) && - !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { + !(0 < (this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/5711#followingOf\\"); @@ -49718,7 +52979,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { + !(0 < (this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -50068,7 +53330,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[0]; if (!(v instanceof URL) && - !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { + !(0 < (this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/5711#likedOf\\"); @@ -50136,7 +53399,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { + !(0 < (this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -51001,7 +54265,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems = _XDbmNDuWHmrhqH712zqtecdbv1V_totalItems; const _3UyUdxnyn6cDn53QKrh4MBiearma_current: (CollectionPage | URL)[] = []; - const _trust_3UyUdxnyn6cDn53QKrh4MBiearma_current: Set = new Set(); + const _trust_3UyUdxnyn6cDn53QKrh4MBiearma_current: VocabTrustSet = new Set(); let _3UyUdxnyn6cDn53QKrh4MBiearma_current__array = values[\\"https://www.w3.org/ns/activitystreams#current\\"]; @@ -51042,7 +54306,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_3UyUdxnyn6cDn53QKrh4MBiearma_current = _3UyUdxnyn6cDn53QKrh4MBiearma_current; const _J52RqweMe6hhv7RnLJMC8BExTE5_first: (CollectionPage | URL)[] = []; - const _trust_J52RqweMe6hhv7RnLJMC8BExTE5_first: Set = new Set(); + const _trust_J52RqweMe6hhv7RnLJMC8BExTE5_first: VocabTrustSet = new Set(); let _J52RqweMe6hhv7RnLJMC8BExTE5_first__array = values[\\"https://www.w3.org/ns/activitystreams#first\\"]; @@ -51083,7 +54347,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_J52RqweMe6hhv7RnLJMC8BExTE5_first = _J52RqweMe6hhv7RnLJMC8BExTE5_first; const _gyJJnyEFnuNVi1HFZKfAn3Hfn26_last: (CollectionPage | URL)[] = []; - const _trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last: Set = new Set(); + const _trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last: VocabTrustSet = new Set(); let _gyJJnyEFnuNVi1HFZKfAn3Hfn26_last__array = values[\\"https://www.w3.org/ns/activitystreams#last\\"]; @@ -51124,7 +54388,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = _gyJJnyEFnuNVi1HFZKfAn3Hfn26_last; const _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: (Object | Link | URL)[] = []; - const _trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: Set = new Set(); + const _trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: VocabTrustSet = new Set(); let _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items__array = values[\\"https://www.w3.org/ns/activitystreams#items\\"]; @@ -51172,7 +54436,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; const _4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf: (Object | URL)[] = []; - const _trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf: Set = new Set(); + const _trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf: VocabTrustSet = new Set(); let _4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf__array = values[\\"https://w3id.org/fep/5711#likesOf\\"]; @@ -51213,7 +54477,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = _4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf; const _3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf: (Object | URL)[] = []; - const _trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf: Set = new Set(); + const _trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf: VocabTrustSet = new Set(); let _3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf__array = values[\\"https://w3id.org/fep/5711#sharesOf\\"]; @@ -51254,7 +54518,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = _3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf; const _3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf: (Object | URL)[] = []; - const _trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf: Set = new Set(); + const _trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf: VocabTrustSet = new Set(); let _3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf__array = values[\\"https://w3id.org/fep/5711#repliesOf\\"]; @@ -51295,7 +54559,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = _3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf; const _2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf: (Object | URL)[] = []; - const _trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf: Set = new Set(); + const _trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf: VocabTrustSet = new Set(); let _2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf__array = values[\\"https://w3id.org/fep/5711#inboxOf\\"]; @@ -51336,7 +54600,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = _2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf; const _4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf: (Object | URL)[] = []; - const _trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf: Set = new Set(); + const _trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf: VocabTrustSet = new Set(); let _4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf__array = values[\\"https://w3id.org/fep/5711#outboxOf\\"]; @@ -51377,7 +54641,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = _4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf; const _41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf: (Object | URL)[] = []; - const _trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf: Set = new Set(); + const _trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf: VocabTrustSet = new Set(); let _41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf__array = values[\\"https://w3id.org/fep/5711#followersOf\\"]; @@ -51418,7 +54682,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = _41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf; const _2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf: (Object | URL)[] = []; - const _trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf: Set = new Set(); + const _trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf: VocabTrustSet = new Set(); let _2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf__array = values[\\"https://w3id.org/fep/5711#followingOf\\"]; @@ -51459,7 +54723,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = _2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf; const _2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf: (Object | URL)[] = []; - const _trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf: Set = new Set(); + const _trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf: VocabTrustSet = new Set(); let _2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf__array = values[\\"https://w3id.org/fep/5711#likedOf\\"]; @@ -51833,7 +55097,7 @@ export class OrderedCollection extends Collection { } #_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: (Object | Link | URL)[] = []; - #_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: Set = new Set(); + #_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: VocabTrustSet = new Set(); /** * Constructs a new instance of OrderedCollection with the given values. @@ -51872,14 +55136,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu super(values, options); if (\\"items\\" in values && values.items != null) { - if (Array.isArray(values.items) && - values.items.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.items)) { + const array = values.items; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.items; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = values.items.slice(); + this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = copied; - for (let i = 0; i < values.items.length; i++) { - this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.add(i); - } + vocabSetTrustPrefix(this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length); } else { throw new TypeError( @@ -51954,18 +55240,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as OrderedCollection;clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.slice();clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = new Set(this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items); + const clone = super.clone(values, options) as unknown as OrderedCollection;clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length < vocabSparseArrayMinimumLength + ? this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.slice() : vocabCopyPropertyArray(this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items);clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = vocabCopyTrustSet( + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, + ); if (\\"items\\" in values && values.items != null) { - if (Array.isArray(values.items) && - values.items.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.items)) { + const array = values.items; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.items; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = values.items.slice(); + clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = copied; clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = new Set(); - for (let i = 0; i < values.items.length; i++) { - clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length); } else { throw new TypeError( @@ -52000,6 +55311,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -52049,10 +55366,25 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as OrderedCollection; - for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { - const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + { + const array = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { + const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + } + } } } } }); } @@ -52399,7 +55731,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { + !(i < (this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[vocabTrustPrefix] ?? 0) || + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#items\\"); @@ -52471,7 +55804,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { + !(i < (this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[vocabTrustPrefix] ?? 0) || + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -52814,7 +56148,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: (Object | Link | URL)[] = []; - const _trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: Set = new Set(); + const _trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: VocabTrustSet = new Set(); let _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items__array = values[\\"https://www.w3.org/ns/activitystreams#items\\"]; @@ -53083,7 +56417,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as FeaturedCollection;clone.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic = this.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic.slice(); + const clone = super.clone(values, options) as unknown as FeaturedCollection;clone.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic = this.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic.length < vocabSparseArrayMinimumLength + ? this.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic.slice() : vocabCopyPropertyArray(this.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic); if (\\"topic\\" in values && values.topic != null) { if (values.topic instanceof Hashtag) { // @ts-ignore: type is checked above. @@ -53096,7 +56431,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice(); + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.length < vocabSparseArrayMinimumLength + ? this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice() : vocabCopyPropertyArray(this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable); if (\\"discoverable\\" in values && values.discoverable != null) { if (typeof values.discoverable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -53135,6 +56471,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -53184,10 +56526,25 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as FeaturedCollection; - for (let i = 0; i < node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic.length; i++) { - const value = node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic[i]; - if (value != null && typeof value === \\"object\\") { - node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic[i] = context.value(value); + { + const array = node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic.length; i++) { + const value = node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic[i]; + if (value != null && typeof value === \\"object\\") { + node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic[i] = context.value(value); + } + } } } } }); } @@ -53745,10 +57102,10 @@ export class FeaturedItem extends Object { } #_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject: (Object | URL)[] = []; - #_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject: Set = new Set(); + #_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject: VocabTrustSet = new Set(); #_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization: (FeatureAuthorization | URL)[] = []; - #_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization: Set = new Set(); + #_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization: VocabTrustSet = new Set(); /** * Constructs a new instance of FeaturedItem with the given values. @@ -53876,12 +57233,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as FeaturedItem;clone.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = this.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.slice();clone.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = new Set(this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject); + const clone = super.clone(values, options) as unknown as FeaturedItem;clone.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = this.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.length < vocabSparseArrayMinimumLength + ? this.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.slice() : vocabCopyPropertyArray(this.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject);clone.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = vocabCopyTrustSet( + this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject, clone.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject, + ); if (\\"featuredObject\\" in values && values.featuredObject != null) { if (values.featuredObject instanceof Object || values.featuredObject instanceof URL) { // @ts-ignore: type is checked above. clone.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = [values.featuredObject]; - clone.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = new Set([0]); + clone.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = new Set(); + clone.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredObject must be of type \\" + @@ -53889,12 +57250,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = this.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.slice();clone.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = new Set(this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization); + clone.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = this.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.slice() : vocabCopyPropertyArray(this.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization);clone.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = vocabCopyTrustSet( + this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization, clone.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization, + ); if (\\"featureAuthorization\\" in values && values.featureAuthorization != null) { if (values.featureAuthorization instanceof FeatureAuthorization || values.featureAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = [values.featureAuthorization]; - clone.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = new Set([0]); + clone.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = new Set(); + clone.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featureAuthorization must be of type \\" + @@ -53928,6 +57293,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -53977,17 +57348,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as FeaturedItem; - for (let i = 0; i < node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.length; i++) { - const value = node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[i]; - if (value != null && typeof value === \\"object\\") { - node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[i] = context.value(value); + { + const array = node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.length; i++) { + const value = node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.length; i++) { - const value = node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[i] = context.value(value); + { + const array = node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.length; i++) { + const value = node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[i] = context.value(value); + } + } } } } }); } @@ -54317,7 +57718,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[0]; if (!(v instanceof URL) && - !this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.has(0)) { + !(0 < (this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[vocabTrustPrefix] ?? 0) || + this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/7aa9#featuredObject\\"); @@ -54385,7 +57787,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.has(0)) { + !(0 < (this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[vocabTrustPrefix] ?? 0) || + this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -54736,7 +58139,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.has(0)) { + !(0 < (this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/7aa9#featureAuthorization\\"); @@ -54804,7 +58208,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.has(0)) { + !(0 < (this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -55181,7 +58586,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject: (Object | URL)[] = []; - const _trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject: Set = new Set(); + const _trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject: VocabTrustSet = new Set(); let _Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject__array = values[\\"https://w3id.org/fep/7aa9#featuredObject\\"]; @@ -55222,7 +58627,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = _Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject; const _2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization: (FeatureAuthorization | URL)[] = []; - const _trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization: Set = new Set(); + const _trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization: VocabTrustSet = new Set(); let _2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization__array = values[\\"https://w3id.org/fep/7aa9#featureAuthorization\\"]; @@ -55507,10 +58912,34 @@ endpoints?: (URL)[];} ); } - if (Array.isArray(values.endpoints) && - values.endpoints.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.endpoints)) { + const array = values.endpoints; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.endpoints; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = values.endpoints.slice(); + this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = copied; } else { throw new TypeError( @@ -55577,7 +59006,8 @@ endpoints?: (URL)[];} options ); copyPortableProvenance(this, clone); - clone.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.slice(); + clone.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.length < vocabSparseArrayMinimumLength + ? this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.slice() : vocabCopyPropertyArray(this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint); if (\\"endpoint\\" in values && values.endpoint != null) { if (values.endpoint instanceof URL) { // @ts-ignore: type is checked above. @@ -55601,10 +59031,34 @@ endpoints?: (URL)[];} ); } - if (Array.isArray(values.endpoints) && - values.endpoints.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.endpoints)) { + const array = values.endpoints; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.endpoints; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = values.endpoints.slice(); + clone.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = copied; } else { throw new TypeError( @@ -55639,6 +59093,12 @@ endpoints?: (URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -55683,10 +59143,25 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.length; i++) { - const value = node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint[i] = context.value(value); + { + const array = node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.length; i++) { + const value = node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint[i] = context.value(value); + } + } } } } }); } @@ -56202,6 +59677,12 @@ endpoints?: (URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -56613,7 +60094,7 @@ export class DataIntegrityProof { #_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite: (\\"eddsa-jcs-2022\\")[] = []; #_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod: (Multikey | URL)[] = []; - #_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod: Set = new Set(); + #_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod: VocabTrustSet = new Set(); #_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose: (\\"assertionMethod\\" | \\"authentication\\" | \\"capabilityInvocation\\" | \\"capabilityDelegation\\" | \\"keyAgreement\\")[] = []; #_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue: (Uint8Array)[] = []; #_3qzP3ukEZoUziK5FEiA1RhU4aqac: (Temporal.Instant)[] = []; @@ -56779,7 +60260,8 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | options ); copyPortableProvenance(this, clone); - clone.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite = this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite.slice(); + clone.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite = this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite.length < vocabSparseArrayMinimumLength + ? this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite.slice() : vocabCopyPropertyArray(this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite); if (\\"cryptosuite\\" in values && values.cryptosuite != null) { if (values.cryptosuite == \\"eddsa-jcs-2022\\") { // @ts-ignore: type is checked above. @@ -56792,12 +60274,16 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | ); } } - clone.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.slice();clone.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = new Set(this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod); + clone.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.length < vocabSparseArrayMinimumLength + ? this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.slice() : vocabCopyPropertyArray(this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod);clone.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = vocabCopyTrustSet( + this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod, clone.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod, + ); if (\\"verificationMethod\\" in values && values.verificationMethod != null) { if (values.verificationMethod instanceof Multikey || values.verificationMethod instanceof URL) { // @ts-ignore: type is checked above. clone.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = [values.verificationMethod]; - clone.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = new Set([0]); + clone.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = new Set(); + clone.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The verificationMethod must be of type \\" + @@ -56805,7 +60291,8 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | ); } } - clone.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose = this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose.slice(); + clone.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose = this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose.length < vocabSparseArrayMinimumLength + ? this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose.slice() : vocabCopyPropertyArray(this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose); if (\\"proofPurpose\\" in values && values.proofPurpose != null) { if (values.proofPurpose === \\"assertionMethod\\" || values.proofPurpose === \\"authentication\\" || values.proofPurpose === \\"capabilityInvocation\\" || values.proofPurpose === \\"capabilityDelegation\\" || @@ -56820,7 +60307,8 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | ); } } - clone.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue = this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue.slice(); + clone.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue = this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue.length < vocabSparseArrayMinimumLength + ? this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue.slice() : vocabCopyPropertyArray(this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue); if (\\"proofValue\\" in values && values.proofValue != null) { if (values.proofValue instanceof Uint8Array) { // @ts-ignore: type is checked above. @@ -56833,7 +60321,8 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | ); } } - clone.#_3qzP3ukEZoUziK5FEiA1RhU4aqac = this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac.slice(); + clone.#_3qzP3ukEZoUziK5FEiA1RhU4aqac = this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac.length < vocabSparseArrayMinimumLength + ? this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac.slice() : vocabCopyPropertyArray(this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac); if (\\"created\\" in values && values.created != null) { if (isTemporalInstant(values.created)) { // @ts-ignore: type is checked above. @@ -56872,6 +60361,12 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -56915,17 +60410,47 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.length; i++) { - const value = node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[i] = context.value(value); + { + const array = node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.length; i++) { + const value = node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue.length; i++) { - const value = node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue[i] = context.value(value); + { + const array = node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue.length; i++) { + const value = node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue[i] = context.value(value); + } + } } } } }); } @@ -57273,7 +60798,8 @@ deepCloneDescriptors.set(this.prototype, { } let v = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[0]; if (!(v instanceof URL) && - !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { + !(0 < (this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#verificationMethod\\"); @@ -57307,7 +60833,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { + !(0 < (this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -57743,7 +61270,7 @@ deepCloneDescriptors.set(this.prototype, { instance.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite = _3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite; const _2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod: (Multikey | URL)[] = []; - const _trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod: Set = new Set(); + const _trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod: VocabTrustSet = new Set(); let _2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod__array = values[\\"https://w3id.org/security#verificationMethod\\"]; @@ -58128,7 +61655,7 @@ export class CryptographicKey { } #_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner: Set = new Set(); + #_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner: VocabTrustSet = new Set(); #_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem: (CryptoKey)[] = []; /** @@ -58254,12 +61781,16 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi options ); copyPortableProvenance(this, clone); - clone.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.slice();clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = new Set(this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner); + clone.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length < vocabSparseArrayMinimumLength + ? this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.slice() : vocabCopyPropertyArray(this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner);clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = vocabCopyTrustSet( + this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner, clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner, + ); if (\\"owner\\" in values && values.owner != null) { if (values.owner instanceof Application || values.owner instanceof Group || values.owner instanceof Organization || values.owner instanceof Person || values.owner instanceof Service || values.owner instanceof URL) { // @ts-ignore: type is checked above. clone.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = [values.owner]; - clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = new Set([0]); + clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = new Set(); + clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The owner must be of type \\" + @@ -58267,7 +61798,8 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi ); } } - clone.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem = this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem.slice(); + clone.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem = this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem.length < vocabSparseArrayMinimumLength + ? this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem.slice() : vocabCopyPropertyArray(this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem); if (\\"publicKey\\" in values && values.publicKey != null) { if ( // @ts-ignore: CryptoKey exists in the global scope. @@ -58309,6 +61841,12 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -58352,10 +61890,25 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length; i++) { - const value = node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[i]; - if (value != null && typeof value === \\"object\\") { - node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[i] = context.value(value); + { + const array = node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length; i++) { + const value = node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[i]; + if (value != null && typeof value === \\"object\\") { + node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[i] = context.value(value); + } + } } } } }); } @@ -58745,7 +62298,8 @@ deepCloneDescriptors.set(this.prototype, { } let v = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[0]; if (!(v instanceof URL) && - !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { + !(0 < (this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[vocabTrustPrefix] ?? 0) || + this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#owner\\"); @@ -58813,7 +62367,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { + !(0 < (this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[vocabTrustPrefix] ?? 0) || + this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -59184,7 +62739,7 @@ deepCloneDescriptors.set(this.prototype, { let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner: Set = new Set(); + const _trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner: VocabTrustSet = new Set(); let _5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner__array = values[\\"https://w3id.org/security#owner\\"]; @@ -59468,7 +63023,7 @@ export class Multikey { } #_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller: Set = new Set(); + #_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller: VocabTrustSet = new Set(); #_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase: (CryptoKey)[] = []; /** @@ -59594,12 +63149,16 @@ controller?: Application | Group | Organization | Person | Service | URL | null; options ); copyPortableProvenance(this, clone); - clone.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.slice();clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = new Set(this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller); + clone.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length < vocabSparseArrayMinimumLength + ? this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.slice() : vocabCopyPropertyArray(this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller);clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = vocabCopyTrustSet( + this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller, clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller, + ); if (\\"controller\\" in values && values.controller != null) { if (values.controller instanceof Application || values.controller instanceof Group || values.controller instanceof Organization || values.controller instanceof Person || values.controller instanceof Service || values.controller instanceof URL) { // @ts-ignore: type is checked above. clone.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = [values.controller]; - clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = new Set([0]); + clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = new Set(); + clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The controller must be of type \\" + @@ -59607,7 +63166,8 @@ controller?: Application | Group | Organization | Person | Service | URL | null; ); } } - clone.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase = this.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase.slice(); + clone.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase = this.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase.length < vocabSparseArrayMinimumLength + ? this.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase.slice() : vocabCopyPropertyArray(this.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase); if (\\"publicKey\\" in values && values.publicKey != null) { if ( // @ts-ignore: CryptoKey exists in the global scope. @@ -59649,6 +63209,12 @@ controller?: Application | Group | Organization | Person | Service | URL | null; * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -59692,10 +63258,25 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length; i++) { - const value = node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[i] = context.value(value); + { + const array = node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length; i++) { + const value = node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[i] = context.value(value); + } + } } } } }); } @@ -60085,7 +63666,8 @@ deepCloneDescriptors.set(this.prototype, { } let v = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[0]; if (!(v instanceof URL) && - !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { + !(0 < (this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[vocabTrustPrefix] ?? 0) || + this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#controller\\"); @@ -60153,7 +63735,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { + !(0 < (this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[vocabTrustPrefix] ?? 0) || + this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -60531,7 +64114,7 @@ deepCloneDescriptors.set(this.prototype, { let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller: Set = new Set(); + const _trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller: VocabTrustSet = new Set(); let _2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller__array = values[\\"https://w3id.org/security#controller\\"]; @@ -60881,7 +64464,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Agreement;clone.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates = this.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates.slice(); + const clone = super.clone(values, options) as unknown as Agreement;clone.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates = this.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates.length < vocabSparseArrayMinimumLength + ? this.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates.slice() : vocabCopyPropertyArray(this.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates); if (\\"stipulates\\" in values && values.stipulates != null) { if (values.stipulates instanceof Commitment) { // @ts-ignore: type is checked above. @@ -60894,7 +64478,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal = this.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal.slice(); + clone.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal = this.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal.length < vocabSparseArrayMinimumLength + ? this.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal.slice() : vocabCopyPropertyArray(this.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal); if (\\"stipulatesReciprocal\\" in values && values.stipulatesReciprocal != null) { if (values.stipulatesReciprocal instanceof Commitment) { // @ts-ignore: type is checked above. @@ -60933,6 +64518,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -60982,17 +64573,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Agreement; - for (let i = 0; i < node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates.length; i++) { - const value = node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates[i]; - if (value != null && typeof value === \\"object\\") { - node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates[i] = context.value(value); + { + const array = node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates.length; i++) { + const value = node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates[i]; + if (value != null && typeof value === \\"object\\") { + node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal.length; i++) { - const value = node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal[i] = context.value(value); + { + const array = node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal.length; i++) { + const value = node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal[i] = context.value(value); + } + } } } } }); } @@ -61749,7 +65370,8 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} options ); copyPortableProvenance(this, clone); - clone.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies = this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.slice(); + clone.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies = this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.length < vocabSparseArrayMinimumLength + ? this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.slice() : vocabCopyPropertyArray(this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies); if (\\"satisfies\\" in values && values.satisfies != null) { if (values.satisfies instanceof URL) { // @ts-ignore: type is checked above. @@ -61762,7 +65384,8 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} ); } } - clone.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.slice(); + clone.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length < vocabSparseArrayMinimumLength + ? this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.slice() : vocabCopyPropertyArray(this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity); if (\\"resourceQuantity\\" in values && values.resourceQuantity != null) { if (values.resourceQuantity instanceof Measure) { // @ts-ignore: type is checked above. @@ -61801,6 +65424,12 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -61844,17 +65473,47 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.length; i++) { - const value = node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies[i]; - if (value != null && typeof value === \\"object\\") { - node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies[i] = context.value(value); + { + const array = node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.length; i++) { + const value = node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies[i]; + if (value != null && typeof value === \\"object\\") { + node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length; i++) { - const value = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i] = context.value(value); + { + const array = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length; i++) { + const value = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i] = context.value(value); + } + } } } } }); } @@ -62630,7 +66289,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur options ); copyPortableProvenance(this, clone); - clone.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action = this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.slice(); + clone.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action = this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.length < vocabSparseArrayMinimumLength + ? this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.slice() : vocabCopyPropertyArray(this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action); if (\\"action\\" in values && values.action != null) { if (typeof values.action === \\"string\\") { // @ts-ignore: type is checked above. @@ -62643,7 +66303,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur ); } } - clone.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo = this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.slice(); + clone.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo = this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.length < vocabSparseArrayMinimumLength + ? this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.slice() : vocabCopyPropertyArray(this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo); if (\\"resourceConformsTo\\" in values && values.resourceConformsTo != null) { if (values.resourceConformsTo instanceof URL) { // @ts-ignore: type is checked above. @@ -62656,7 +66317,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur ); } } - clone.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.slice(); + clone.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length < vocabSparseArrayMinimumLength + ? this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.slice() : vocabCopyPropertyArray(this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity); if (\\"resourceQuantity\\" in values && values.resourceQuantity != null) { if (values.resourceQuantity instanceof Measure) { // @ts-ignore: type is checked above. @@ -62669,7 +66331,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur ); } } - clone.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity = this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.slice(); + clone.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity = this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.length < vocabSparseArrayMinimumLength + ? this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.slice() : vocabCopyPropertyArray(this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity); if (\\"availableQuantity\\" in values && values.availableQuantity != null) { if (values.availableQuantity instanceof Measure) { // @ts-ignore: type is checked above. @@ -62682,7 +66345,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur ); } } - clone.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.slice(); + clone.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.length < vocabSparseArrayMinimumLength + ? this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.slice() : vocabCopyPropertyArray(this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity); if (\\"minimumQuantity\\" in values && values.minimumQuantity != null) { if (values.minimumQuantity instanceof Measure) { // @ts-ignore: type is checked above. @@ -62721,6 +66385,12 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -62764,31 +66434,91 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.length; i++) { - const value = node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[i]; - if (value != null && typeof value === \\"object\\") { - node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[i] = context.value(value); + { + const array = node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.length; i++) { + const value = node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length; i++) { - const value = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i] = context.value(value); + { + const array = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length; i++) { + const value = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.length; i++) { - const value = node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[i]; - if (value != null && typeof value === \\"object\\") { - node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[i] = context.value(value); + { + const array = node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.length; i++) { + const value = node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[i]; + if (value != null && typeof value === \\"object\\") { + node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.length; i++) { - const value = node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[i] = context.value(value); + { + const array = node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.length; i++) { + const value = node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[i] = context.value(value); + } + } } } } }); } @@ -63803,7 +67533,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Proposal;clone.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose = this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose.slice(); + const clone = super.clone(values, options) as unknown as Proposal;clone.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose = this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose.length < vocabSparseArrayMinimumLength + ? this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose.slice() : vocabCopyPropertyArray(this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose); if (\\"purpose\\" in values && values.purpose != null) { if (typeof values.purpose === \\"string\\") { // @ts-ignore: type is checked above. @@ -63816,7 +67547,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes = this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.slice(); + clone.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes = this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.length < vocabSparseArrayMinimumLength + ? this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.slice() : vocabCopyPropertyArray(this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes); if (\\"publishes\\" in values && values.publishes != null) { if (values.publishes instanceof Intent) { // @ts-ignore: type is checked above. @@ -63829,7 +67561,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal = this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.slice(); + clone.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal = this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.length < vocabSparseArrayMinimumLength + ? this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.slice() : vocabCopyPropertyArray(this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal); if (\\"reciprocal\\" in values && values.reciprocal != null) { if (values.reciprocal instanceof Intent) { // @ts-ignore: type is checked above. @@ -63842,7 +67575,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased.slice(); + clone.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased.length < vocabSparseArrayMinimumLength + ? this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased.slice() : vocabCopyPropertyArray(this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased); if (\\"unitBased\\" in values && values.unitBased != null) { if (typeof values.unitBased === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -63881,6 +67615,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -63930,17 +67670,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Proposal; - for (let i = 0; i < node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.length; i++) { - const value = node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[i]; - if (value != null && typeof value === \\"object\\") { - node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[i] = context.value(value); + { + const array = node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.length; i++) { + const value = node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.length; i++) { - const value = node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[i]; - if (value != null && typeof value === \\"object\\") { - node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[i] = context.value(value); + { + const array = node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.length; i++) { + const value = node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[i]; + if (value != null && typeof value === \\"object\\") { + node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[i] = context.value(value); + } + } } } } }); } @@ -64840,6 +68610,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -65356,6 +69132,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -65867,6 +69649,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -66239,39 +70027,39 @@ export class Application extends Object { #_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername: ((string | LanguageString))[] = []; #_axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); #_41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); #_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); #_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); #_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); #_4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); #_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); #_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints: (Endpoints)[] = []; #_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable: (boolean)[] = []; #_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended: (boolean)[] = []; @@ -66279,13 +70067,13 @@ export class Application extends Object { #_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable: (boolean)[] = []; #_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); #_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); #_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); #_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage: (string)[] = []; #_2xEU4QtkC53RAun67T81Egqt9vmL_isCat: (boolean)[] = []; #_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense: (URL)[] = []; @@ -66354,10 +70142,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -66390,14 +70202,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; - for (let i = 0; i < values.publicKeys.length; i++) { - this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -66430,14 +70264,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; - for (let i = 0; i < values.assertionMethods.length; i++) { - this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -66470,10 +70326,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -66602,14 +70482,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | if (\\"streams\\" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; - for (let i = 0; i < values.streams.length; i++) { - this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -66720,14 +70622,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; - for (let i = 0; i < values.aliases.length; i++) { - this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -66760,14 +70684,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; - for (let i = 0; i < values.services.length; i++) { - this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -66887,7 +70833,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Application;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice(); + const clone = super.clone(values, options) as unknown as Application;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.length < vocabSparseArrayMinimumLength + ? this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice() : vocabCopyPropertyArray(this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername); if (\\"preferredUsername\\" in values && values.preferredUsername != null) { if (typeof values.preferredUsername === \\"string\\" || values.preferredUsername instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -66911,10 +70858,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -66923,12 +70894,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice();clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < vocabSparseArrayMinimumLength + ? this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice() : vocabCopyPropertyArray(this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey);clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = vocabCopyTrustSet( + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, + ); if (\\"publicKey\\" in values && values.publicKey != null) { if (values.publicKey instanceof CryptographicKey || values.publicKey instanceof URL) { // @ts-ignore: type is checked above. clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = [values.publicKey]; - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set([0]); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The publicKey must be of type \\" + @@ -66947,15 +70922,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); - for (let i = 0; i < values.publicKeys.length; i++) { - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -66964,12 +70961,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice();clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < vocabSparseArrayMinimumLength + ? this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice() : vocabCopyPropertyArray(this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod);clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = vocabCopyTrustSet( + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, + ); if (\\"assertionMethod\\" in values && values.assertionMethod != null) { if (values.assertionMethod instanceof Multikey || values.assertionMethod instanceof URL) { // @ts-ignore: type is checked above. clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = [values.assertionMethod]; - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set([0]); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The assertionMethod must be of type \\" + @@ -66988,15 +70989,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); - for (let i = 0; i < values.assertionMethods.length; i++) { - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -67005,7 +71028,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < vocabSparseArrayMinimumLength + ? this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice() : vocabCopyPropertyArray(this.#_hQiaHhZP8hqxckxTBrpsGNs57E3); if (\\"gateway\\" in values && values.gateway != null) { if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { // @ts-ignore: type is checked above. @@ -67029,10 +71053,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -67041,7 +71089,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice(); + clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.length < vocabSparseArrayMinimumLength + ? this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice() : vocabCopyPropertyArray(this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers); if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -67054,12 +71103,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice();clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox); + clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < vocabSparseArrayMinimumLength + ? this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice() : vocabCopyPropertyArray(this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox);clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = vocabCopyTrustSet( + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, + ); if (\\"inbox\\" in values && values.inbox != null) { if (values.inbox instanceof OrderedCollection || values.inbox instanceof OrderedCollectionPage || values.inbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox]; - clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set([0]); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The inbox must be of type \\" + @@ -67067,12 +71120,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice();clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox); + clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < vocabSparseArrayMinimumLength + ? this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice() : vocabCopyPropertyArray(this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox);clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = vocabCopyTrustSet( + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, + ); if (\\"outbox\\" in values && values.outbox != null) { if (values.outbox instanceof OrderedCollection || values.outbox instanceof OrderedCollectionPage || values.outbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox]; - clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set([0]); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The outbox must be of type \\" + @@ -67080,12 +71137,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice();clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following); + clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < vocabSparseArrayMinimumLength + ? this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice() : vocabCopyPropertyArray(this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following);clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = vocabCopyTrustSet( + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, + ); if (\\"following\\" in values && values.following != null) { if (values.following instanceof Collection || values.following instanceof URL) { // @ts-ignore: type is checked above. clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = [values.following]; - clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set([0]); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The following must be of type \\" + @@ -67093,12 +71154,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice();clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers); + clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < vocabSparseArrayMinimumLength + ? this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice() : vocabCopyPropertyArray(this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers);clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = vocabCopyTrustSet( + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, + ); if (\\"followers\\" in values && values.followers != null) { if (values.followers instanceof Collection || values.followers instanceof URL) { // @ts-ignore: type is checked above. clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = [values.followers]; - clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set([0]); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The followers must be of type \\" + @@ -67106,12 +71171,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice();clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked); + clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < vocabSparseArrayMinimumLength + ? this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice() : vocabCopyPropertyArray(this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked);clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = vocabCopyTrustSet( + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, + ); if (\\"liked\\" in values && values.liked != null) { if (values.liked instanceof Collection || values.liked instanceof URL) { // @ts-ignore: type is checked above. clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = [values.liked]; - clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set([0]); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The liked must be of type \\" + @@ -67119,12 +71188,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice();clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured); + clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < vocabSparseArrayMinimumLength + ? this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice() : vocabCopyPropertyArray(this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured);clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = vocabCopyTrustSet( + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, + ); if (\\"featured\\" in values && values.featured != null) { if (values.featured instanceof Collection || values.featured instanceof URL) { // @ts-ignore: type is checked above. clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = [values.featured]; - clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set([0]); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featured must be of type \\" + @@ -67132,12 +71205,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice();clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags); + clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < vocabSparseArrayMinimumLength + ? this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice() : vocabCopyPropertyArray(this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags);clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = vocabCopyTrustSet( + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, + ); if (\\"featuredTags\\" in values && values.featuredTags != null) { if (values.featuredTags instanceof Collection || values.featuredTags instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = [values.featuredTags]; - clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set([0]); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredTags must be of type \\" + @@ -67145,12 +71222,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice();clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections); + clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length < vocabSparseArrayMinimumLength + ? this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice() : vocabCopyPropertyArray(this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections);clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = vocabCopyTrustSet( + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, + ); if (\\"featuredCollections\\" in values && values.featuredCollections != null) { if (values.featuredCollections instanceof Collection || values.featuredCollections instanceof URL) { // @ts-ignore: type is checked above. clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = [values.featuredCollections]; - clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set([0]); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredCollections must be of type \\" + @@ -67158,18 +71239,43 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice();clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length < vocabSparseArrayMinimumLength + ? this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice() : vocabCopyPropertyArray(this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams);clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = vocabCopyTrustSet( + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, + ); if (\\"streams\\" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(); - for (let i = 0; i < values.streams.length; i++) { - clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -67178,7 +71284,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice(); + clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length < vocabSparseArrayMinimumLength + ? this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice() : vocabCopyPropertyArray(this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints); if (\\"endpoints\\" in values && values.endpoints != null) { if (values.endpoints instanceof Endpoints) { // @ts-ignore: type is checked above. @@ -67191,7 +71298,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice(); + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.length < vocabSparseArrayMinimumLength + ? this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice() : vocabCopyPropertyArray(this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable); if (\\"discoverable\\" in values && values.discoverable != null) { if (typeof values.discoverable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -67204,7 +71312,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice(); + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.length < vocabSparseArrayMinimumLength + ? this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice() : vocabCopyPropertyArray(this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended); if (\\"suspended\\" in values && values.suspended != null) { if (typeof values.suspended === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -67217,7 +71326,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice(); + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.length < vocabSparseArrayMinimumLength + ? this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice() : vocabCopyPropertyArray(this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial); if (\\"memorial\\" in values && values.memorial != null) { if (typeof values.memorial === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -67230,7 +71340,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice(); + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.length < vocabSparseArrayMinimumLength + ? this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice() : vocabCopyPropertyArray(this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable); if (\\"indexable\\" in values && values.indexable != null) { if (typeof values.indexable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -67243,12 +71354,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice();clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo); + clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < vocabSparseArrayMinimumLength + ? this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice() : vocabCopyPropertyArray(this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo);clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = vocabCopyTrustSet( + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, + ); if (\\"successor\\" in values && values.successor != null) { if (values.successor instanceof Application || values.successor instanceof Group || values.successor instanceof Organization || values.successor instanceof Person || values.successor instanceof Service || values.successor instanceof URL) { // @ts-ignore: type is checked above. clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor]; - clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set([0]); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The successor must be of type \\" + @@ -67256,12 +71371,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice();clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < vocabSparseArrayMinimumLength + ? this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice() : vocabCopyPropertyArray(this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs);clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = vocabCopyTrustSet( + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, + ); if (\\"alias\\" in values && values.alias != null) { if (values.alias instanceof Application || values.alias instanceof Group || values.alias instanceof Organization || values.alias instanceof Person || values.alias instanceof Service || values.alias instanceof URL) { // @ts-ignore: type is checked above. clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [values.alias]; - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set([0]); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The alias must be of type \\" + @@ -67280,15 +71399,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); - for (let i = 0; i < values.aliases.length; i++) { - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -67297,12 +71438,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice();clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < vocabSparseArrayMinimumLength + ? this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice() : vocabCopyPropertyArray(this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service);clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = vocabCopyTrustSet( + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, + ); if (\\"service\\" in values && values.service != null) { if (values.service instanceof DidService || values.service instanceof URL) { // @ts-ignore: type is checked above. clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = [values.service]; - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set([0]); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The service must be of type \\" + @@ -67321,15 +71466,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); - for (let i = 0; i < values.services.length; i++) { - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -67338,7 +71505,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice(); + clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.length < vocabSparseArrayMinimumLength + ? this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice() : vocabCopyPropertyArray(this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage); if (\\"followedMessage\\" in values && values.followedMessage != null) { if (typeof values.followedMessage === \\"string\\") { // @ts-ignore: type is checked above. @@ -67351,7 +71519,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice(); + clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.length < vocabSparseArrayMinimumLength + ? this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice() : vocabCopyPropertyArray(this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat); if (\\"cat\\" in values && values.cat != null) { if (typeof values.cat === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -67364,7 +71533,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice(); + clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length < vocabSparseArrayMinimumLength + ? this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice() : vocabCopyPropertyArray(this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense); if (\\"preferredLicense\\" in values && values.preferredLicense != null) { if (values.preferredLicense instanceof URL) { // @ts-ignore: type is checked above. @@ -67403,6 +71573,12 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -67458,122 +71634,377 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Application; - for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { - const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; - if (value != null && typeof value === \\"object\\") { - node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + { + const array = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { - const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + { + const array = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { - const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; - if (value != null && typeof value === \\"object\\") { - node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + { + const array = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { - const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + { + const array = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { - const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + { + const array = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { - const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + { + const array = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { - const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; - if (value != null && typeof value === \\"object\\") { - node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + { + const array = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { - const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + { + const array = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { - const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + { + const array = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { - const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + { + const array = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { - const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; - if (value != null && typeof value === \\"object\\") { - node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + { + const array = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === \\"object\\") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { - const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + { + const array = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { - const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; - if (value != null && typeof value === \\"object\\") { - node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + { + const array = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { - const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + { + const array = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { - const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + { + const array = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { - const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + { + const array = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { - const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; - if (value != null && typeof value === \\"object\\") { - node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + { + const array = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === \\"object\\") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } } } } }); } @@ -67926,7 +72357,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#publicKey\\"); @@ -67994,7 +72426,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -68081,7 +72514,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#publicKey\\"); @@ -68153,7 +72587,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -68507,7 +72942,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#assertionMethod\\"); @@ -68575,7 +73011,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -68666,7 +73103,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#assertionMethod\\"); @@ -68738,7 +73176,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -69162,7 +73601,8 @@ get gateways(): (URL)[] { } let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://www.w3.org/ns/ldp#inbox\\"); @@ -69230,7 +73670,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -69604,7 +74045,8 @@ get gateways(): (URL)[] { } let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#outbox\\"); @@ -69672,7 +74114,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -70026,7 +74469,8 @@ get gateways(): (URL)[] { } let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#following\\"); @@ -70094,7 +74538,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -70451,7 +74896,8 @@ get gateways(): (URL)[] { } let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#followers\\"); @@ -70519,7 +74965,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -70874,7 +75321,8 @@ get gateways(): (URL)[] { } let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#liked\\"); @@ -70942,7 +75390,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -71295,7 +75744,8 @@ get gateways(): (URL)[] { } let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://joinmastodon.org/ns#featured\\"); @@ -71363,7 +75813,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -71716,7 +76167,8 @@ get gateways(): (URL)[] { } let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://joinmastodon.org/ns#featuredTags\\"); @@ -71784,7 +76236,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -72134,7 +76587,8 @@ get gateways(): (URL)[] { } let v = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[0]; if (!(v instanceof URL) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/7aa9#featuredCollections\\"); @@ -72202,7 +76656,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -72552,7 +77007,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#streams\\"); @@ -72624,7 +77080,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -73109,7 +77566,8 @@ get gateways(): (URL)[] { } let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#movedTo\\"); @@ -73177,7 +77635,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -73590,7 +78049,8 @@ get gateways(): (URL)[] { } let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"); @@ -73658,7 +78118,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -73749,7 +78210,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"); @@ -73821,7 +78283,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -74175,7 +78638,8 @@ get gateways(): (URL)[] { } let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/did#service\\"); @@ -74243,7 +78707,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -74334,7 +78799,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/did#service\\"); @@ -74406,7 +78872,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -75805,7 +80272,7 @@ get gateways(): (URL)[] { instance.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = _3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; const _axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); let _axq166E2eZADq34V4MYUc8KMZdC_publicKey__array = values[\\"https://w3id.org/security#publicKey\\"]; @@ -75846,7 +80313,7 @@ get gateways(): (URL)[] { instance.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = _axq166E2eZADq34V4MYUc8KMZdC_publicKey; const _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); let _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod__array = values[\\"https://w3id.org/security#assertionMethod\\"]; @@ -75945,7 +80412,7 @@ get gateways(): (URL)[] { instance.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); let _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox__array = values[\\"http://www.w3.org/ns/ldp#inbox\\"]; @@ -75992,7 +80459,7 @@ get gateways(): (URL)[] { instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; const _41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); let _41QwhqJouoLg3h8dRPKat21brynC_outbox__array = values[\\"https://www.w3.org/ns/activitystreams#outbox\\"]; @@ -76039,7 +80506,7 @@ get gateways(): (URL)[] { instance.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = _41QwhqJouoLg3h8dRPKat21brynC_outbox; const _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); let _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following__array = values[\\"https://www.w3.org/ns/activitystreams#following\\"]; @@ -76080,7 +80547,7 @@ get gateways(): (URL)[] { instance.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; const _BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); let _BBCTgfphhsFzpVfKTykGSpBNwoA_followers__array = values[\\"https://www.w3.org/ns/activitystreams#followers\\"]; @@ -76121,7 +80588,7 @@ get gateways(): (URL)[] { instance.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = _BBCTgfphhsFzpVfKTykGSpBNwoA_followers; const _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); let _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked__array = values[\\"https://www.w3.org/ns/activitystreams#liked\\"]; @@ -76162,7 +80629,7 @@ get gateways(): (URL)[] { instance.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; const _4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); let _4N1vBJzXDf8NbBumeECQMFvKetja_featured__array = values[\\"http://joinmastodon.org/ns#featured\\"]; @@ -76203,7 +80670,7 @@ get gateways(): (URL)[] { instance.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = _4N1vBJzXDf8NbBumeECQMFvKetja_featured; const _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); let _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags__array = values[\\"http://joinmastodon.org/ns#featuredTags\\"]; @@ -76244,7 +80711,7 @@ get gateways(): (URL)[] { instance.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; const _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); let _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections__array = values[\\"https://w3id.org/fep/7aa9#featuredCollections\\"]; @@ -76285,7 +80752,7 @@ get gateways(): (URL)[] { instance.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); let _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams__array = values[\\"https://www.w3.org/ns/activitystreams#streams\\"]; @@ -76474,7 +80941,7 @@ get gateways(): (URL)[] { instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); let _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array = values[\\"https://www.w3.org/ns/activitystreams#movedTo\\"]; @@ -76532,7 +80999,7 @@ get gateways(): (URL)[] { instance.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); let _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array = values[\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"]; @@ -76590,7 +81057,7 @@ get gateways(): (URL)[] { instance.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; const _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); let _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service__array = values[\\"https://www.w3.org/ns/did#service\\"]; @@ -77465,6 +81932,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -77988,6 +82461,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -78359,11 +82838,11 @@ export class Article extends Object { } #_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); #_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl: (URL)[] = []; #_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); /** * Constructs a new instance of Article with the given values. @@ -78504,12 +82983,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Article;clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice();clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote); + const clone = super.clone(values, options) as unknown as Article;clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < vocabSparseArrayMinimumLength + ? this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice() : vocabCopyPropertyArray(this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote);clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = vocabCopyTrustSet( + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, + ); if (\\"quote\\" in values && values.quote != null) { if (values.quote instanceof Object || values.quote instanceof URL) { // @ts-ignore: type is checked above. clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = [values.quote]; - clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set([0]); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The quote must be of type \\" + @@ -78517,7 +83000,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice(); + clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length < vocabSparseArrayMinimumLength + ? this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice() : vocabCopyPropertyArray(this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl); if (\\"quoteUrl\\" in values && values.quoteUrl != null) { if (values.quoteUrl instanceof URL) { // @ts-ignore: type is checked above. @@ -78530,12 +83014,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice();clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization); + clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice() : vocabCopyPropertyArray(this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization);clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = vocabCopyTrustSet( + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, + ); if (\\"quoteAuthorization\\" in values && values.quoteAuthorization != null) { if (values.quoteAuthorization instanceof QuoteAuthorization || values.quoteAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = [values.quoteAuthorization]; - clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set([0]); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The quoteAuthorization must be of type \\" + @@ -78569,6 +83057,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -78618,24 +83112,69 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Article; - for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { - const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + { + const array = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { - const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; - if (value != null && typeof value === \\"object\\") { - node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + { + const array = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === \\"object\\") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { - const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; - if (value != null && typeof value === \\"object\\") { - node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + { + const array = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } } } } }); } @@ -78968,7 +83507,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/044f#quote\\"); @@ -79036,7 +83576,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -79410,7 +83951,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/044f#quoteAuthorization\\"); @@ -79478,7 +84020,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -79905,7 +84448,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); let _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote__array = values[\\"https://w3id.org/fep/044f#quote\\"]; @@ -79985,7 +84528,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; const _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); let _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization__array = values[\\"https://w3id.org/fep/044f#quoteAuthorization\\"]; @@ -80296,7 +84839,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Document;clone.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width = this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width.slice(); + const clone = super.clone(values, options) as unknown as Document;clone.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width = this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width.length < vocabSparseArrayMinimumLength + ? this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width.slice() : vocabCopyPropertyArray(this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width); if (\\"width\\" in values && values.width != null) { if (typeof values.width === \\"number\\" && Number.isInteger(values.width) && values.width >= 0) { // @ts-ignore: type is checked above. @@ -80309,7 +84853,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height = this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.slice(); + clone.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height = this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.length < vocabSparseArrayMinimumLength + ? this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.slice() : vocabCopyPropertyArray(this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height); if (\\"height\\" in values && values.height != null) { if (typeof values.height === \\"number\\" && Number.isInteger(values.height) && values.height >= 0) { // @ts-ignore: type is checked above. @@ -80322,7 +84867,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.slice(); + clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.length < vocabSparseArrayMinimumLength + ? this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.slice() : vocabCopyPropertyArray(this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase); if (\\"digestMultibase\\" in values && values.digestMultibase != null) { if (typeof values.digestMultibase === \\"string\\") { // @ts-ignore: type is checked above. @@ -80361,6 +84907,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -81194,6 +85746,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -81717,6 +86275,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -82233,6 +86797,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -82607,13 +87177,13 @@ export class CollectionPage extends Collection { } #_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf: (Collection | URL)[] = []; - #_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf: Set = new Set(); + #_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf: VocabTrustSet = new Set(); #_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next: (CollectionPage | URL)[] = []; - #_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next: Set = new Set(); + #_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next: VocabTrustSet = new Set(); #_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev: (CollectionPage | URL)[] = []; - #_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev: Set = new Set(); + #_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev: VocabTrustSet = new Set(); /** * Constructs a new instance of CollectionPage with the given values. @@ -82754,12 +87324,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as CollectionPage;clone.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.slice();clone.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = new Set(this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf); + const clone = super.clone(values, options) as unknown as CollectionPage;clone.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.length < vocabSparseArrayMinimumLength + ? this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.slice() : vocabCopyPropertyArray(this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf);clone.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = vocabCopyTrustSet( + this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf, clone.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf, + ); if (\\"partOf\\" in values && values.partOf != null) { if (values.partOf instanceof Collection || values.partOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = [values.partOf]; - clone.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = new Set([0]); + clone.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = new Set(); + clone.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The partOf must be of type \\" + @@ -82767,12 +87341,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.slice();clone.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = new Set(this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next); + clone.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.length < vocabSparseArrayMinimumLength + ? this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.slice() : vocabCopyPropertyArray(this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next);clone.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = vocabCopyTrustSet( + this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next, clone.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next, + ); if (\\"next\\" in values && values.next != null) { if (values.next instanceof CollectionPage || values.next instanceof URL) { // @ts-ignore: type is checked above. clone.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = [values.next]; - clone.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = new Set([0]); + clone.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = new Set(); + clone.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The next must be of type \\" + @@ -82780,12 +87358,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.slice();clone.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = new Set(this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev); + clone.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.length < vocabSparseArrayMinimumLength + ? this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.slice() : vocabCopyPropertyArray(this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev);clone.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = vocabCopyTrustSet( + this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev, clone.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev, + ); if (\\"prev\\" in values && values.prev != null) { if (values.prev instanceof CollectionPage || values.prev instanceof URL) { // @ts-ignore: type is checked above. clone.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = [values.prev]; - clone.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = new Set([0]); + clone.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = new Set(); + clone.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The prev must be of type \\" + @@ -82819,6 +87401,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -82868,24 +87456,69 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as CollectionPage; - for (let i = 0; i < node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.length; i++) { - const value = node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[i] = context.value(value); + { + const array = node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.length; i++) { + const value = node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.length; i++) { - const value = node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[i] = context.value(value); + { + const array = node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.length; i++) { + const value = node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.length; i++) { - const value = node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[i] = context.value(value); + { + const array = node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.length; i++) { + const value = node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[i] = context.value(value); + } + } } } } }); } @@ -83217,7 +87850,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[0]; if (!(v instanceof URL) && - !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { + !(0 < (this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#partOf\\"); @@ -83285,7 +87919,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { + !(0 < (this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -83634,7 +88269,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[0]; if (!(v instanceof URL) && - !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { + !(0 < (this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[vocabTrustPrefix] ?? 0) || + this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#next\\"); @@ -83702,7 +88338,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { + !(0 < (this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[vocabTrustPrefix] ?? 0) || + this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -84052,7 +88689,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[0]; if (!(v instanceof URL) && - !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { + !(0 < (this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[vocabTrustPrefix] ?? 0) || + this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#prev\\"); @@ -84120,7 +88758,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { + !(0 < (this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[vocabTrustPrefix] ?? 0) || + this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -84541,7 +89180,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf: (Collection | URL)[] = []; - const _trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf: Set = new Set(); + const _trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf: VocabTrustSet = new Set(); let _2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf__array = values[\\"https://www.w3.org/ns/activitystreams#partOf\\"]; @@ -84582,7 +89221,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = _2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf; const _3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next: (CollectionPage | URL)[] = []; - const _trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next: Set = new Set(); + const _trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next: VocabTrustSet = new Set(); let _3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next__array = values[\\"https://www.w3.org/ns/activitystreams#next\\"]; @@ -84623,7 +89262,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = _3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next; const _3b8yG8tDNzQFFEnWhCc13G8eHooA_prev: (CollectionPage | URL)[] = []; - const _trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev: Set = new Set(); + const _trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev: VocabTrustSet = new Set(); let _3b8yG8tDNzQFFEnWhCc13G8eHooA_prev__array = values[\\"https://www.w3.org/ns/activitystreams#prev\\"]; @@ -84930,6 +89569,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -85440,6 +90085,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -85948,6 +90599,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -86579,7 +91236,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint options ); copyPortableProvenance(this, clone); - clone.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl = this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.slice(); + clone.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl = this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.length < vocabSparseArrayMinimumLength + ? this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.slice() : vocabCopyPropertyArray(this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl); if (\\"proxyUrl\\" in values && values.proxyUrl != null) { if (values.proxyUrl instanceof URL) { // @ts-ignore: type is checked above. @@ -86592,7 +91250,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ); } } - clone.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint = this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.slice(); + clone.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint = this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.length < vocabSparseArrayMinimumLength + ? this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.slice() : vocabCopyPropertyArray(this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint); if (\\"oauthAuthorizationEndpoint\\" in values && values.oauthAuthorizationEndpoint != null) { if (values.oauthAuthorizationEndpoint instanceof URL) { // @ts-ignore: type is checked above. @@ -86605,7 +91264,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ); } } - clone.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint = this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.slice(); + clone.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint = this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.length < vocabSparseArrayMinimumLength + ? this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.slice() : vocabCopyPropertyArray(this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint); if (\\"oauthTokenEndpoint\\" in values && values.oauthTokenEndpoint != null) { if (values.oauthTokenEndpoint instanceof URL) { // @ts-ignore: type is checked above. @@ -86618,7 +91278,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ); } } - clone.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey = this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.slice(); + clone.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey = this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.length < vocabSparseArrayMinimumLength + ? this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.slice() : vocabCopyPropertyArray(this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey); if (\\"provideClientKey\\" in values && values.provideClientKey != null) { if (values.provideClientKey instanceof URL) { // @ts-ignore: type is checked above. @@ -86631,7 +91292,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ); } } - clone.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey = this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.slice(); + clone.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey = this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.length < vocabSparseArrayMinimumLength + ? this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.slice() : vocabCopyPropertyArray(this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey); if (\\"signClientKey\\" in values && values.signClientKey != null) { if (values.signClientKey instanceof URL) { // @ts-ignore: type is checked above. @@ -86644,7 +91306,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ); } } - clone.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox = this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.slice(); + clone.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox = this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.length < vocabSparseArrayMinimumLength + ? this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.slice() : vocabCopyPropertyArray(this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox); if (\\"sharedInbox\\" in values && values.sharedInbox != null) { if (values.sharedInbox instanceof URL) { // @ts-ignore: type is checked above. @@ -86657,7 +91320,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ); } } - clone.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia = this.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia.slice(); + clone.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia = this.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia.length < vocabSparseArrayMinimumLength + ? this.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia.slice() : vocabCopyPropertyArray(this.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia); if (\\"uploadMedia\\" in values && values.uploadMedia != null) { if (values.uploadMedia instanceof URL) { // @ts-ignore: type is checked above. @@ -86696,6 +91360,12 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -86739,52 +91409,157 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.length; i++) { - const value = node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl[i] = context.value(value); + { + const array = node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.length; i++) { + const value = node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.length; i++) { - const value = node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint[i]; - if (value != null && typeof value === \\"object\\") { - node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint[i] = context.value(value); + { + const array = node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.length; i++) { + const value = node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint[i]; + if (value != null && typeof value === \\"object\\") { + node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.length; i++) { - const value = node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint[i]; - if (value != null && typeof value === \\"object\\") { - node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint[i] = context.value(value); + { + const array = node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.length; i++) { + const value = node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint[i]; + if (value != null && typeof value === \\"object\\") { + node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.length; i++) { - const value = node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey[i]; - if (value != null && typeof value === \\"object\\") { - node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey[i] = context.value(value); + { + const array = node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.length; i++) { + const value = node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.length; i++) { - const value = node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey[i] = context.value(value); + { + const array = node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.length; i++) { + const value = node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.length; i++) { - const value = node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox[i] = context.value(value); + { + const array = node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.length; i++) { + const value = node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia.length; i++) { - const value = node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia[i]; - if (value != null && typeof value === \\"object\\") { - node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia[i] = context.value(value); + { + const array = node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia.length; i++) { + const value = node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia[i]; + if (value != null && typeof value === \\"object\\") { + node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia[i] = context.value(value); + } + } } } } }); } @@ -87961,6 +92736,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -88485,6 +93266,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -88997,6 +93784,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -89369,39 +94162,39 @@ export class Group extends Object { #_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername: ((string | LanguageString))[] = []; #_axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); #_41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); #_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); #_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); #_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); #_4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); #_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); #_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints: (Endpoints)[] = []; #_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable: (boolean)[] = []; #_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended: (boolean)[] = []; @@ -89409,13 +94202,13 @@ export class Group extends Object { #_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable: (boolean)[] = []; #_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); #_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); #_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); #_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage: (string)[] = []; #_2xEU4QtkC53RAun67T81Egqt9vmL_isCat: (boolean)[] = []; #_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense: (URL)[] = []; @@ -89484,10 +94277,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -89520,14 +94337,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; - for (let i = 0; i < values.publicKeys.length; i++) { - this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -89560,14 +94399,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; - for (let i = 0; i < values.assertionMethods.length; i++) { - this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -89600,10 +94461,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -89732,14 +94617,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | if (\\"streams\\" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; - for (let i = 0; i < values.streams.length; i++) { - this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -89850,14 +94757,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; - for (let i = 0; i < values.aliases.length; i++) { - this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -89890,14 +94819,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; - for (let i = 0; i < values.services.length; i++) { - this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -90017,7 +94968,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Group;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice(); + const clone = super.clone(values, options) as unknown as Group;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.length < vocabSparseArrayMinimumLength + ? this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice() : vocabCopyPropertyArray(this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername); if (\\"preferredUsername\\" in values && values.preferredUsername != null) { if (typeof values.preferredUsername === \\"string\\" || values.preferredUsername instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -90041,10 +94993,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -90053,12 +95029,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice();clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < vocabSparseArrayMinimumLength + ? this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice() : vocabCopyPropertyArray(this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey);clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = vocabCopyTrustSet( + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, + ); if (\\"publicKey\\" in values && values.publicKey != null) { if (values.publicKey instanceof CryptographicKey || values.publicKey instanceof URL) { // @ts-ignore: type is checked above. clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = [values.publicKey]; - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set([0]); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The publicKey must be of type \\" + @@ -90077,15 +95057,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); - for (let i = 0; i < values.publicKeys.length; i++) { - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -90094,12 +95096,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice();clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < vocabSparseArrayMinimumLength + ? this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice() : vocabCopyPropertyArray(this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod);clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = vocabCopyTrustSet( + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, + ); if (\\"assertionMethod\\" in values && values.assertionMethod != null) { if (values.assertionMethod instanceof Multikey || values.assertionMethod instanceof URL) { // @ts-ignore: type is checked above. clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = [values.assertionMethod]; - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set([0]); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The assertionMethod must be of type \\" + @@ -90118,15 +95124,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); - for (let i = 0; i < values.assertionMethods.length; i++) { - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -90135,7 +95163,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < vocabSparseArrayMinimumLength + ? this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice() : vocabCopyPropertyArray(this.#_hQiaHhZP8hqxckxTBrpsGNs57E3); if (\\"gateway\\" in values && values.gateway != null) { if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { // @ts-ignore: type is checked above. @@ -90159,10 +95188,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -90171,7 +95224,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice(); + clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.length < vocabSparseArrayMinimumLength + ? this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice() : vocabCopyPropertyArray(this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers); if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -90184,12 +95238,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice();clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox); + clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < vocabSparseArrayMinimumLength + ? this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice() : vocabCopyPropertyArray(this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox);clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = vocabCopyTrustSet( + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, + ); if (\\"inbox\\" in values && values.inbox != null) { if (values.inbox instanceof OrderedCollection || values.inbox instanceof OrderedCollectionPage || values.inbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox]; - clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set([0]); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The inbox must be of type \\" + @@ -90197,12 +95255,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice();clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox); + clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < vocabSparseArrayMinimumLength + ? this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice() : vocabCopyPropertyArray(this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox);clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = vocabCopyTrustSet( + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, + ); if (\\"outbox\\" in values && values.outbox != null) { if (values.outbox instanceof OrderedCollection || values.outbox instanceof OrderedCollectionPage || values.outbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox]; - clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set([0]); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The outbox must be of type \\" + @@ -90210,12 +95272,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice();clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following); + clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < vocabSparseArrayMinimumLength + ? this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice() : vocabCopyPropertyArray(this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following);clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = vocabCopyTrustSet( + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, + ); if (\\"following\\" in values && values.following != null) { if (values.following instanceof Collection || values.following instanceof URL) { // @ts-ignore: type is checked above. clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = [values.following]; - clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set([0]); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The following must be of type \\" + @@ -90223,12 +95289,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice();clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers); + clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < vocabSparseArrayMinimumLength + ? this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice() : vocabCopyPropertyArray(this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers);clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = vocabCopyTrustSet( + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, + ); if (\\"followers\\" in values && values.followers != null) { if (values.followers instanceof Collection || values.followers instanceof URL) { // @ts-ignore: type is checked above. clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = [values.followers]; - clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set([0]); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The followers must be of type \\" + @@ -90236,12 +95306,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice();clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked); + clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < vocabSparseArrayMinimumLength + ? this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice() : vocabCopyPropertyArray(this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked);clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = vocabCopyTrustSet( + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, + ); if (\\"liked\\" in values && values.liked != null) { if (values.liked instanceof Collection || values.liked instanceof URL) { // @ts-ignore: type is checked above. clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = [values.liked]; - clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set([0]); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The liked must be of type \\" + @@ -90249,12 +95323,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice();clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured); + clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < vocabSparseArrayMinimumLength + ? this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice() : vocabCopyPropertyArray(this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured);clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = vocabCopyTrustSet( + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, + ); if (\\"featured\\" in values && values.featured != null) { if (values.featured instanceof Collection || values.featured instanceof URL) { // @ts-ignore: type is checked above. clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = [values.featured]; - clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set([0]); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featured must be of type \\" + @@ -90262,12 +95340,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice();clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags); + clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < vocabSparseArrayMinimumLength + ? this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice() : vocabCopyPropertyArray(this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags);clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = vocabCopyTrustSet( + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, + ); if (\\"featuredTags\\" in values && values.featuredTags != null) { if (values.featuredTags instanceof Collection || values.featuredTags instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = [values.featuredTags]; - clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set([0]); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredTags must be of type \\" + @@ -90275,12 +95357,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice();clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections); + clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length < vocabSparseArrayMinimumLength + ? this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice() : vocabCopyPropertyArray(this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections);clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = vocabCopyTrustSet( + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, + ); if (\\"featuredCollections\\" in values && values.featuredCollections != null) { if (values.featuredCollections instanceof Collection || values.featuredCollections instanceof URL) { // @ts-ignore: type is checked above. clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = [values.featuredCollections]; - clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set([0]); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredCollections must be of type \\" + @@ -90288,18 +95374,43 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice();clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length < vocabSparseArrayMinimumLength + ? this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice() : vocabCopyPropertyArray(this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams);clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = vocabCopyTrustSet( + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, + ); if (\\"streams\\" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(); - for (let i = 0; i < values.streams.length; i++) { - clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -90308,7 +95419,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice(); + clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length < vocabSparseArrayMinimumLength + ? this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice() : vocabCopyPropertyArray(this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints); if (\\"endpoints\\" in values && values.endpoints != null) { if (values.endpoints instanceof Endpoints) { // @ts-ignore: type is checked above. @@ -90321,7 +95433,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice(); + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.length < vocabSparseArrayMinimumLength + ? this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice() : vocabCopyPropertyArray(this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable); if (\\"discoverable\\" in values && values.discoverable != null) { if (typeof values.discoverable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -90334,7 +95447,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice(); + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.length < vocabSparseArrayMinimumLength + ? this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice() : vocabCopyPropertyArray(this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended); if (\\"suspended\\" in values && values.suspended != null) { if (typeof values.suspended === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -90347,7 +95461,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice(); + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.length < vocabSparseArrayMinimumLength + ? this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice() : vocabCopyPropertyArray(this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial); if (\\"memorial\\" in values && values.memorial != null) { if (typeof values.memorial === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -90360,7 +95475,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice(); + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.length < vocabSparseArrayMinimumLength + ? this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice() : vocabCopyPropertyArray(this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable); if (\\"indexable\\" in values && values.indexable != null) { if (typeof values.indexable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -90373,12 +95489,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice();clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo); + clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < vocabSparseArrayMinimumLength + ? this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice() : vocabCopyPropertyArray(this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo);clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = vocabCopyTrustSet( + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, + ); if (\\"successor\\" in values && values.successor != null) { if (values.successor instanceof Application || values.successor instanceof Group || values.successor instanceof Organization || values.successor instanceof Person || values.successor instanceof Service || values.successor instanceof URL) { // @ts-ignore: type is checked above. clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor]; - clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set([0]); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The successor must be of type \\" + @@ -90386,12 +95506,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice();clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < vocabSparseArrayMinimumLength + ? this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice() : vocabCopyPropertyArray(this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs);clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = vocabCopyTrustSet( + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, + ); if (\\"alias\\" in values && values.alias != null) { if (values.alias instanceof Application || values.alias instanceof Group || values.alias instanceof Organization || values.alias instanceof Person || values.alias instanceof Service || values.alias instanceof URL) { // @ts-ignore: type is checked above. clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [values.alias]; - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set([0]); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The alias must be of type \\" + @@ -90410,15 +95534,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); - for (let i = 0; i < values.aliases.length; i++) { - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -90427,12 +95573,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice();clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < vocabSparseArrayMinimumLength + ? this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice() : vocabCopyPropertyArray(this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service);clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = vocabCopyTrustSet( + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, + ); if (\\"service\\" in values && values.service != null) { if (values.service instanceof DidService || values.service instanceof URL) { // @ts-ignore: type is checked above. clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = [values.service]; - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set([0]); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The service must be of type \\" + @@ -90451,15 +95601,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); - for (let i = 0; i < values.services.length; i++) { - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -90468,7 +95640,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice(); + clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.length < vocabSparseArrayMinimumLength + ? this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice() : vocabCopyPropertyArray(this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage); if (\\"followedMessage\\" in values && values.followedMessage != null) { if (typeof values.followedMessage === \\"string\\") { // @ts-ignore: type is checked above. @@ -90481,7 +95654,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice(); + clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.length < vocabSparseArrayMinimumLength + ? this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice() : vocabCopyPropertyArray(this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat); if (\\"cat\\" in values && values.cat != null) { if (typeof values.cat === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -90494,7 +95668,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice(); + clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length < vocabSparseArrayMinimumLength + ? this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice() : vocabCopyPropertyArray(this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense); if (\\"preferredLicense\\" in values && values.preferredLicense != null) { if (values.preferredLicense instanceof URL) { // @ts-ignore: type is checked above. @@ -90533,6 +95708,12 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -90588,122 +95769,377 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Group; - for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { - const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; - if (value != null && typeof value === \\"object\\") { - node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + { + const array = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { - const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + { + const array = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { - const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; - if (value != null && typeof value === \\"object\\") { - node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + { + const array = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { - const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + { + const array = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { - const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + { + const array = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { - const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + { + const array = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { - const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; - if (value != null && typeof value === \\"object\\") { - node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + { + const array = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { - const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + { + const array = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { - const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + { + const array = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { - const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + { + const array = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { - const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; - if (value != null && typeof value === \\"object\\") { - node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + { + const array = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === \\"object\\") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { - const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + { + const array = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { - const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; - if (value != null && typeof value === \\"object\\") { - node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + { + const array = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { - const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + { + const array = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { - const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + { + const array = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { - const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + { + const array = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { - const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; - if (value != null && typeof value === \\"object\\") { - node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + { + const array = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === \\"object\\") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } } } } }); } @@ -91056,7 +96492,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#publicKey\\"); @@ -91124,7 +96561,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -91211,7 +96649,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#publicKey\\"); @@ -91283,7 +96722,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -91637,7 +97077,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#assertionMethod\\"); @@ -91705,7 +97146,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -91796,7 +97238,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#assertionMethod\\"); @@ -91868,7 +97311,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -92292,7 +97736,8 @@ get gateways(): (URL)[] { } let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://www.w3.org/ns/ldp#inbox\\"); @@ -92360,7 +97805,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -92734,7 +98180,8 @@ get gateways(): (URL)[] { } let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#outbox\\"); @@ -92802,7 +98249,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -93156,7 +98604,8 @@ get gateways(): (URL)[] { } let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#following\\"); @@ -93224,7 +98673,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -93581,7 +99031,8 @@ get gateways(): (URL)[] { } let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#followers\\"); @@ -93649,7 +99100,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -94004,7 +99456,8 @@ get gateways(): (URL)[] { } let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#liked\\"); @@ -94072,7 +99525,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -94425,7 +99879,8 @@ get gateways(): (URL)[] { } let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://joinmastodon.org/ns#featured\\"); @@ -94493,7 +99948,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -94846,7 +100302,8 @@ get gateways(): (URL)[] { } let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://joinmastodon.org/ns#featuredTags\\"); @@ -94914,7 +100371,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -95264,7 +100722,8 @@ get gateways(): (URL)[] { } let v = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[0]; if (!(v instanceof URL) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/7aa9#featuredCollections\\"); @@ -95332,7 +100791,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -95682,7 +101142,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#streams\\"); @@ -95754,7 +101215,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -96239,7 +101701,8 @@ get gateways(): (URL)[] { } let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#movedTo\\"); @@ -96307,7 +101770,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -96720,7 +102184,8 @@ get gateways(): (URL)[] { } let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"); @@ -96788,7 +102253,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -96879,7 +102345,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"); @@ -96951,7 +102418,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -97305,7 +102773,8 @@ get gateways(): (URL)[] { } let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/did#service\\"); @@ -97373,7 +102842,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -97464,7 +102934,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/did#service\\"); @@ -97536,7 +103007,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -98935,7 +104407,7 @@ get gateways(): (URL)[] { instance.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = _3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; const _axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); let _axq166E2eZADq34V4MYUc8KMZdC_publicKey__array = values[\\"https://w3id.org/security#publicKey\\"]; @@ -98976,7 +104448,7 @@ get gateways(): (URL)[] { instance.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = _axq166E2eZADq34V4MYUc8KMZdC_publicKey; const _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); let _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod__array = values[\\"https://w3id.org/security#assertionMethod\\"]; @@ -99075,7 +104547,7 @@ get gateways(): (URL)[] { instance.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); let _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox__array = values[\\"http://www.w3.org/ns/ldp#inbox\\"]; @@ -99122,7 +104594,7 @@ get gateways(): (URL)[] { instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; const _41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); let _41QwhqJouoLg3h8dRPKat21brynC_outbox__array = values[\\"https://www.w3.org/ns/activitystreams#outbox\\"]; @@ -99169,7 +104641,7 @@ get gateways(): (URL)[] { instance.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = _41QwhqJouoLg3h8dRPKat21brynC_outbox; const _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); let _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following__array = values[\\"https://www.w3.org/ns/activitystreams#following\\"]; @@ -99210,7 +104682,7 @@ get gateways(): (URL)[] { instance.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; const _BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); let _BBCTgfphhsFzpVfKTykGSpBNwoA_followers__array = values[\\"https://www.w3.org/ns/activitystreams#followers\\"]; @@ -99251,7 +104723,7 @@ get gateways(): (URL)[] { instance.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = _BBCTgfphhsFzpVfKTykGSpBNwoA_followers; const _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); let _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked__array = values[\\"https://www.w3.org/ns/activitystreams#liked\\"]; @@ -99292,7 +104764,7 @@ get gateways(): (URL)[] { instance.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; const _4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); let _4N1vBJzXDf8NbBumeECQMFvKetja_featured__array = values[\\"http://joinmastodon.org/ns#featured\\"]; @@ -99333,7 +104805,7 @@ get gateways(): (URL)[] { instance.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = _4N1vBJzXDf8NbBumeECQMFvKetja_featured; const _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); let _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags__array = values[\\"http://joinmastodon.org/ns#featuredTags\\"]; @@ -99374,7 +104846,7 @@ get gateways(): (URL)[] { instance.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; const _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); let _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections__array = values[\\"https://w3id.org/fep/7aa9#featuredCollections\\"]; @@ -99415,7 +104887,7 @@ get gateways(): (URL)[] { instance.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); let _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams__array = values[\\"https://www.w3.org/ns/activitystreams#streams\\"]; @@ -99604,7 +105076,7 @@ get gateways(): (URL)[] { instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); let _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array = values[\\"https://www.w3.org/ns/activitystreams#movedTo\\"]; @@ -99662,7 +105134,7 @@ get gateways(): (URL)[] { instance.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); let _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array = values[\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"]; @@ -99720,7 +105192,7 @@ get gateways(): (URL)[] { instance.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; const _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); let _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service__array = values[\\"https://www.w3.org/ns/did#service\\"]; @@ -100540,7 +106012,7 @@ export class Link { #_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width: (number)[] = []; #_gCVTegXxWWCw6wWRxa1QF65zusg_preview: (Link | Object | URL)[] = []; - #_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: Set = new Set(); + #_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: VocabTrustSet = new Set(); #_2rzkBRS4gNPrkJk9DohHAMUAxA2d: (URL)[] = []; /** @@ -100619,10 +106091,34 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } - if (Array.isArray(values.rels) && - values.rels.every(v => typeof v === \\"string\\")) { + let copied!: (string)[]; + let valid = false; + if (Array.isArray(values.rels)) { + const array = values.rels; + const test = (v: string): boolean => typeof v === \\"string\\"; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.rels; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel = values.rels.slice(); + this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel = copied; } else { throw new TypeError( @@ -100681,10 +106177,34 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } - if (Array.isArray(values.names) && - values.names.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.names)) { + const array = values.names; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.names; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = values.names.slice(); + this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = copied; } else { throw new TypeError( @@ -100735,14 +106255,36 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (\\"previews\\" in values && values.previews != null) { - if (Array.isArray(values.previews) && - values.previews.every(v => v instanceof Link || v instanceof Object || v instanceof URL)) { + let copied!: (Link | Object | URL)[]; + let valid = false; + if (Array.isArray(values.previews)) { + const array = values.previews; + const test = (v: Link | Object | URL): boolean => v instanceof Link || v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.previews; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = values.previews.slice(); + this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = copied; - for (let i = 0; i < values.previews.length; i++) { - this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.add(i); - } + vocabSetTrustPrefix(this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length); } else { throw new TypeError( @@ -100754,10 +106296,34 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (\\"licenses\\" in values && values.licenses != null) { - if (Array.isArray(values.licenses) && - values.licenses.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.licenses)) { + const array = values.licenses; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.licenses; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = values.licenses.slice(); + this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = copied; } else { throw new TypeError( @@ -100825,7 +106391,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num options ); copyPortableProvenance(this, clone); - clone.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href = this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.slice(); + clone.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href = this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.length < vocabSparseArrayMinimumLength + ? this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.slice() : vocabCopyPropertyArray(this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href); if (\\"href\\" in values && values.href != null) { if (values.href instanceof URL) { // @ts-ignore: type is checked above. @@ -100838,7 +106405,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel = this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel.slice(); + clone.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel = this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel.length < vocabSparseArrayMinimumLength + ? this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel.slice() : vocabCopyPropertyArray(this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel); if (\\"rel\\" in values && values.rel != null) { if (typeof values.rel === \\"string\\") { // @ts-ignore: type is checked above. @@ -100862,10 +106430,34 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } - if (Array.isArray(values.rels) && - values.rels.every(v => typeof v === \\"string\\")) { + let copied!: (string)[]; + let valid = false; + if (Array.isArray(values.rels)) { + const array = values.rels; + const test = (v: string): boolean => typeof v === \\"string\\"; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.rels; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel = values.rels.slice(); + clone.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel = copied; } else { throw new TypeError( @@ -100874,7 +106466,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.slice(); + clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.length < vocabSparseArrayMinimumLength + ? this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.slice() : vocabCopyPropertyArray(this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType); if (\\"mediaType\\" in values && values.mediaType != null) { if (typeof values.mediaType === \\"string\\") { // @ts-ignore: type is checked above. @@ -100887,7 +106480,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.slice(); + clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.length < vocabSparseArrayMinimumLength + ? this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.slice() : vocabCopyPropertyArray(this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase); if (\\"digestMultibase\\" in values && values.digestMultibase != null) { if (typeof values.digestMultibase === \\"string\\") { // @ts-ignore: type is checked above. @@ -100900,7 +106494,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice(); + clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.length < vocabSparseArrayMinimumLength + ? this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice() : vocabCopyPropertyArray(this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name); if (\\"name\\" in values && values.name != null) { if (typeof values.name === \\"string\\" || values.name instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -100924,10 +106519,34 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } - if (Array.isArray(values.names) && - values.names.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.names)) { + const array = values.names; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.names; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = values.names.slice(); + clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = copied; } else { throw new TypeError( @@ -100936,7 +106555,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang = this.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang.slice(); + clone.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang = this.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang.length < vocabSparseArrayMinimumLength + ? this.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang.slice() : vocabCopyPropertyArray(this.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang); if (\\"language\\" in values && values.language != null) { if (values.language instanceof Intl.Locale) { // @ts-ignore: type is checked above. @@ -100949,7 +106569,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height = this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.slice(); + clone.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height = this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.length < vocabSparseArrayMinimumLength + ? this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.slice() : vocabCopyPropertyArray(this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height); if (\\"height\\" in values && values.height != null) { if (typeof values.height === \\"number\\" && Number.isInteger(values.height) && values.height >= 0) { // @ts-ignore: type is checked above. @@ -100962,7 +106583,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width = this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width.slice(); + clone.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width = this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width.length < vocabSparseArrayMinimumLength + ? this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width.slice() : vocabCopyPropertyArray(this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width); if (\\"width\\" in values && values.width != null) { if (typeof values.width === \\"number\\" && Number.isInteger(values.width) && values.width >= 0) { // @ts-ignore: type is checked above. @@ -100975,18 +106597,43 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.slice();clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = new Set(this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview); + clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length < vocabSparseArrayMinimumLength + ? this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.slice() : vocabCopyPropertyArray(this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview);clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = vocabCopyTrustSet( + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, + ); if (\\"previews\\" in values && values.previews != null) { - if (Array.isArray(values.previews) && - values.previews.every(v => v instanceof Link || v instanceof Object || v instanceof URL)) { + let copied!: (Link | Object | URL)[]; + let valid = false; + if (Array.isArray(values.previews)) { + const array = values.previews; + const test = (v: Link | Object | URL): boolean => v instanceof Link || v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.previews; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = values.previews.slice(); + clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = copied; clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = new Set(); - for (let i = 0; i < values.previews.length; i++) { - clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.add(i); - } + vocabSetTrustPrefix(clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length); } else { throw new TypeError( @@ -100995,13 +106642,38 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.slice(); + clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length < vocabSparseArrayMinimumLength + ? this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.slice() : vocabCopyPropertyArray(this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d); if (\\"licenses\\" in values && values.licenses != null) { - if (Array.isArray(values.licenses) && - values.licenses.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.licenses)) { + const array = values.licenses; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.licenses; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = values.licenses.slice(); + clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = copied; } else { throw new TypeError( @@ -101036,6 +106708,12 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -101081,24 +106759,69 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.length; i++) { - const value = node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href[i]; - if (value != null && typeof value === \\"object\\") { - node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href[i] = context.value(value); + { + const array = node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.length; i++) { + const value = node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href[i]; + if (value != null && typeof value === \\"object\\") { + node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length; i++) { - const value = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i]; - if (value != null && typeof value === \\"object\\") { - node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i] = context.value(value); + { + const array = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length; i++) { + const value = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i]; + if (value != null && typeof value === \\"object\\") { + node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length; i++) { - const value = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i] = context.value(value); + { + const array = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length; i++) { + const value = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i] = context.value(value); + } + } } } } }); } @@ -101588,7 +107311,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { + !(i < (this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] ?? 0) || + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#preview\\"); @@ -101660,7 +107384,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { + !(i < (this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] ?? 0) || + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -102579,7 +108304,7 @@ get licenses(): (URL)[] { instance.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width = _2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width; const _gCVTegXxWWCw6wWRxa1QF65zusg_preview: (Link | Object | URL)[] = []; - const _trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: Set = new Set(); + const _trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: VocabTrustSet = new Set(); let _gCVTegXxWWCw6wWRxa1QF65zusg_preview__array = values[\\"https://www.w3.org/ns/activitystreams#preview\\"]; @@ -103064,6 +108789,12 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -103548,6 +109279,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -104072,6 +109809,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -104586,6 +110329,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -105096,6 +110845,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -105606,6 +111361,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -106116,6 +111877,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -106624,6 +112391,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -107092,6 +112865,12 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -107591,6 +113370,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -107964,11 +113749,11 @@ export class Note extends Object { } #_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); #_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl: (URL)[] = []; #_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); /** * Constructs a new instance of Note with the given values. @@ -108109,12 +113894,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Note;clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice();clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote); + const clone = super.clone(values, options) as unknown as Note;clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < vocabSparseArrayMinimumLength + ? this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice() : vocabCopyPropertyArray(this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote);clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = vocabCopyTrustSet( + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, + ); if (\\"quote\\" in values && values.quote != null) { if (values.quote instanceof Object || values.quote instanceof URL) { // @ts-ignore: type is checked above. clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = [values.quote]; - clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set([0]); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The quote must be of type \\" + @@ -108122,7 +113911,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice(); + clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length < vocabSparseArrayMinimumLength + ? this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice() : vocabCopyPropertyArray(this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl); if (\\"quoteUrl\\" in values && values.quoteUrl != null) { if (values.quoteUrl instanceof URL) { // @ts-ignore: type is checked above. @@ -108135,12 +113925,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice();clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization); + clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice() : vocabCopyPropertyArray(this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization);clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = vocabCopyTrustSet( + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, + ); if (\\"quoteAuthorization\\" in values && values.quoteAuthorization != null) { if (values.quoteAuthorization instanceof QuoteAuthorization || values.quoteAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = [values.quoteAuthorization]; - clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set([0]); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The quoteAuthorization must be of type \\" + @@ -108174,6 +113968,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -108223,24 +114023,69 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Note; - for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { - const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + { + const array = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { - const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; - if (value != null && typeof value === \\"object\\") { - node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + { + const array = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === \\"object\\") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { - const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; - if (value != null && typeof value === \\"object\\") { - node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + { + const array = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } } } } }); } @@ -108573,7 +114418,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/044f#quote\\"); @@ -108641,7 +114487,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -109015,7 +114862,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/044f#quoteAuthorization\\"); @@ -109083,7 +114931,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -109510,7 +115359,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); let _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote__array = values[\\"https://w3id.org/fep/044f#quote\\"]; @@ -109590,7 +115439,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; const _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); let _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization__array = values[\\"https://w3id.org/fep/044f#quoteAuthorization\\"]; @@ -109763,7 +115612,7 @@ export class OrderedCollectionPage extends CollectionPage { } #_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: (Object | Link | URL)[] = []; - #_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: Set = new Set(); + #_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: VocabTrustSet = new Set(); #_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex: (number)[] = []; /** @@ -109803,14 +115652,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu super(values, options); if (\\"items\\" in values && values.items != null) { - if (Array.isArray(values.items) && - values.items.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.items)) { + const array = values.items; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.items; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = values.items.slice(); + this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = copied; - for (let i = 0; i < values.items.length; i++) { - this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.add(i); - } + vocabSetTrustPrefix(this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length); } else { throw new TypeError( @@ -109898,18 +115769,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as OrderedCollectionPage;clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.slice();clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = new Set(this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items); + const clone = super.clone(values, options) as unknown as OrderedCollectionPage;clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length < vocabSparseArrayMinimumLength + ? this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.slice() : vocabCopyPropertyArray(this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items);clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = vocabCopyTrustSet( + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, + ); if (\\"items\\" in values && values.items != null) { - if (Array.isArray(values.items) && - values.items.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.items)) { + const array = values.items; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.items; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = values.items.slice(); + clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = copied; clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = new Set(); - for (let i = 0; i < values.items.length; i++) { - clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length); } else { throw new TypeError( @@ -109918,7 +115814,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex = this.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex.slice(); + clone.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex = this.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex.length < vocabSparseArrayMinimumLength + ? this.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex.slice() : vocabCopyPropertyArray(this.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex); if (\\"startIndex\\" in values && values.startIndex != null) { if (typeof values.startIndex === \\"number\\" && Number.isInteger(values.startIndex) && values.startIndex >= 0) { // @ts-ignore: type is checked above. @@ -109957,6 +115854,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -110006,10 +115909,25 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as OrderedCollectionPage; - for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { - const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + { + const array = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { + const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + } + } } } } }); } @@ -110356,7 +116274,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { + !(i < (this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[vocabTrustPrefix] ?? 0) || + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#items\\"); @@ -110428,7 +116347,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { + !(i < (this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[vocabTrustPrefix] ?? 0) || + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -110821,7 +116741,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: (Object | Link | URL)[] = []; - const _trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: Set = new Set(); + const _trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: VocabTrustSet = new Set(); let _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items__array = values[\\"https://www.w3.org/ns/activitystreams#items\\"]; @@ -111010,39 +116930,39 @@ export class Organization extends Object { #_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername: ((string | LanguageString))[] = []; #_axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); #_41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); #_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); #_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); #_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); #_4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); #_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); #_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints: (Endpoints)[] = []; #_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable: (boolean)[] = []; #_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended: (boolean)[] = []; @@ -111050,13 +116970,13 @@ export class Organization extends Object { #_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable: (boolean)[] = []; #_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); #_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); #_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); #_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage: (string)[] = []; #_2xEU4QtkC53RAun67T81Egqt9vmL_isCat: (boolean)[] = []; #_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense: (URL)[] = []; @@ -111125,10 +117045,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -111161,14 +117105,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; - for (let i = 0; i < values.publicKeys.length; i++) { - this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -111201,14 +117167,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; - for (let i = 0; i < values.assertionMethods.length; i++) { - this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -111241,10 +117229,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -111373,14 +117385,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | if (\\"streams\\" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; - for (let i = 0; i < values.streams.length; i++) { - this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -111491,14 +117525,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; - for (let i = 0; i < values.aliases.length; i++) { - this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -111531,14 +117587,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; - for (let i = 0; i < values.services.length; i++) { - this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -111658,7 +117736,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Organization;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice(); + const clone = super.clone(values, options) as unknown as Organization;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.length < vocabSparseArrayMinimumLength + ? this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice() : vocabCopyPropertyArray(this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername); if (\\"preferredUsername\\" in values && values.preferredUsername != null) { if (typeof values.preferredUsername === \\"string\\" || values.preferredUsername instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -111682,10 +117761,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -111694,12 +117797,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice();clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < vocabSparseArrayMinimumLength + ? this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice() : vocabCopyPropertyArray(this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey);clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = vocabCopyTrustSet( + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, + ); if (\\"publicKey\\" in values && values.publicKey != null) { if (values.publicKey instanceof CryptographicKey || values.publicKey instanceof URL) { // @ts-ignore: type is checked above. clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = [values.publicKey]; - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set([0]); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The publicKey must be of type \\" + @@ -111718,15 +117825,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); - for (let i = 0; i < values.publicKeys.length; i++) { - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -111735,12 +117864,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice();clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < vocabSparseArrayMinimumLength + ? this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice() : vocabCopyPropertyArray(this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod);clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = vocabCopyTrustSet( + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, + ); if (\\"assertionMethod\\" in values && values.assertionMethod != null) { if (values.assertionMethod instanceof Multikey || values.assertionMethod instanceof URL) { // @ts-ignore: type is checked above. clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = [values.assertionMethod]; - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set([0]); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The assertionMethod must be of type \\" + @@ -111759,15 +117892,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); - for (let i = 0; i < values.assertionMethods.length; i++) { - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -111776,7 +117931,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < vocabSparseArrayMinimumLength + ? this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice() : vocabCopyPropertyArray(this.#_hQiaHhZP8hqxckxTBrpsGNs57E3); if (\\"gateway\\" in values && values.gateway != null) { if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { // @ts-ignore: type is checked above. @@ -111800,10 +117956,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -111812,7 +117992,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice(); + clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.length < vocabSparseArrayMinimumLength + ? this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice() : vocabCopyPropertyArray(this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers); if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -111825,12 +118006,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice();clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox); + clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < vocabSparseArrayMinimumLength + ? this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice() : vocabCopyPropertyArray(this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox);clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = vocabCopyTrustSet( + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, + ); if (\\"inbox\\" in values && values.inbox != null) { if (values.inbox instanceof OrderedCollection || values.inbox instanceof OrderedCollectionPage || values.inbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox]; - clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set([0]); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The inbox must be of type \\" + @@ -111838,12 +118023,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice();clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox); + clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < vocabSparseArrayMinimumLength + ? this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice() : vocabCopyPropertyArray(this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox);clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = vocabCopyTrustSet( + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, + ); if (\\"outbox\\" in values && values.outbox != null) { if (values.outbox instanceof OrderedCollection || values.outbox instanceof OrderedCollectionPage || values.outbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox]; - clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set([0]); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The outbox must be of type \\" + @@ -111851,12 +118040,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice();clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following); + clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < vocabSparseArrayMinimumLength + ? this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice() : vocabCopyPropertyArray(this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following);clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = vocabCopyTrustSet( + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, + ); if (\\"following\\" in values && values.following != null) { if (values.following instanceof Collection || values.following instanceof URL) { // @ts-ignore: type is checked above. clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = [values.following]; - clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set([0]); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The following must be of type \\" + @@ -111864,12 +118057,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice();clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers); + clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < vocabSparseArrayMinimumLength + ? this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice() : vocabCopyPropertyArray(this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers);clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = vocabCopyTrustSet( + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, + ); if (\\"followers\\" in values && values.followers != null) { if (values.followers instanceof Collection || values.followers instanceof URL) { // @ts-ignore: type is checked above. clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = [values.followers]; - clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set([0]); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The followers must be of type \\" + @@ -111877,12 +118074,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice();clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked); + clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < vocabSparseArrayMinimumLength + ? this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice() : vocabCopyPropertyArray(this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked);clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = vocabCopyTrustSet( + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, + ); if (\\"liked\\" in values && values.liked != null) { if (values.liked instanceof Collection || values.liked instanceof URL) { // @ts-ignore: type is checked above. clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = [values.liked]; - clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set([0]); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The liked must be of type \\" + @@ -111890,12 +118091,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice();clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured); + clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < vocabSparseArrayMinimumLength + ? this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice() : vocabCopyPropertyArray(this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured);clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = vocabCopyTrustSet( + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, + ); if (\\"featured\\" in values && values.featured != null) { if (values.featured instanceof Collection || values.featured instanceof URL) { // @ts-ignore: type is checked above. clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = [values.featured]; - clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set([0]); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featured must be of type \\" + @@ -111903,12 +118108,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice();clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags); + clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < vocabSparseArrayMinimumLength + ? this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice() : vocabCopyPropertyArray(this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags);clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = vocabCopyTrustSet( + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, + ); if (\\"featuredTags\\" in values && values.featuredTags != null) { if (values.featuredTags instanceof Collection || values.featuredTags instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = [values.featuredTags]; - clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set([0]); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredTags must be of type \\" + @@ -111916,12 +118125,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice();clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections); + clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length < vocabSparseArrayMinimumLength + ? this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice() : vocabCopyPropertyArray(this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections);clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = vocabCopyTrustSet( + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, + ); if (\\"featuredCollections\\" in values && values.featuredCollections != null) { if (values.featuredCollections instanceof Collection || values.featuredCollections instanceof URL) { // @ts-ignore: type is checked above. clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = [values.featuredCollections]; - clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set([0]); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredCollections must be of type \\" + @@ -111929,18 +118142,43 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice();clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length < vocabSparseArrayMinimumLength + ? this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice() : vocabCopyPropertyArray(this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams);clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = vocabCopyTrustSet( + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, + ); if (\\"streams\\" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(); - for (let i = 0; i < values.streams.length; i++) { - clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -111949,7 +118187,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice(); + clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length < vocabSparseArrayMinimumLength + ? this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice() : vocabCopyPropertyArray(this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints); if (\\"endpoints\\" in values && values.endpoints != null) { if (values.endpoints instanceof Endpoints) { // @ts-ignore: type is checked above. @@ -111962,7 +118201,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice(); + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.length < vocabSparseArrayMinimumLength + ? this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice() : vocabCopyPropertyArray(this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable); if (\\"discoverable\\" in values && values.discoverable != null) { if (typeof values.discoverable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -111975,7 +118215,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice(); + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.length < vocabSparseArrayMinimumLength + ? this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice() : vocabCopyPropertyArray(this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended); if (\\"suspended\\" in values && values.suspended != null) { if (typeof values.suspended === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -111988,7 +118229,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice(); + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.length < vocabSparseArrayMinimumLength + ? this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice() : vocabCopyPropertyArray(this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial); if (\\"memorial\\" in values && values.memorial != null) { if (typeof values.memorial === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -112001,7 +118243,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice(); + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.length < vocabSparseArrayMinimumLength + ? this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice() : vocabCopyPropertyArray(this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable); if (\\"indexable\\" in values && values.indexable != null) { if (typeof values.indexable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -112014,12 +118257,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice();clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo); + clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < vocabSparseArrayMinimumLength + ? this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice() : vocabCopyPropertyArray(this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo);clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = vocabCopyTrustSet( + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, + ); if (\\"successor\\" in values && values.successor != null) { if (values.successor instanceof Application || values.successor instanceof Group || values.successor instanceof Organization || values.successor instanceof Person || values.successor instanceof Service || values.successor instanceof URL) { // @ts-ignore: type is checked above. clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor]; - clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set([0]); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The successor must be of type \\" + @@ -112027,12 +118274,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice();clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < vocabSparseArrayMinimumLength + ? this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice() : vocabCopyPropertyArray(this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs);clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = vocabCopyTrustSet( + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, + ); if (\\"alias\\" in values && values.alias != null) { if (values.alias instanceof Application || values.alias instanceof Group || values.alias instanceof Organization || values.alias instanceof Person || values.alias instanceof Service || values.alias instanceof URL) { // @ts-ignore: type is checked above. clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [values.alias]; - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set([0]); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The alias must be of type \\" + @@ -112051,15 +118302,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); - for (let i = 0; i < values.aliases.length; i++) { - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -112068,12 +118341,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice();clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < vocabSparseArrayMinimumLength + ? this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice() : vocabCopyPropertyArray(this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service);clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = vocabCopyTrustSet( + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, + ); if (\\"service\\" in values && values.service != null) { if (values.service instanceof DidService || values.service instanceof URL) { // @ts-ignore: type is checked above. clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = [values.service]; - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set([0]); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The service must be of type \\" + @@ -112092,15 +118369,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); - for (let i = 0; i < values.services.length; i++) { - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -112109,7 +118408,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice(); + clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.length < vocabSparseArrayMinimumLength + ? this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice() : vocabCopyPropertyArray(this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage); if (\\"followedMessage\\" in values && values.followedMessage != null) { if (typeof values.followedMessage === \\"string\\") { // @ts-ignore: type is checked above. @@ -112122,7 +118422,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice(); + clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.length < vocabSparseArrayMinimumLength + ? this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice() : vocabCopyPropertyArray(this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat); if (\\"cat\\" in values && values.cat != null) { if (typeof values.cat === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -112135,7 +118436,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice(); + clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length < vocabSparseArrayMinimumLength + ? this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice() : vocabCopyPropertyArray(this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense); if (\\"preferredLicense\\" in values && values.preferredLicense != null) { if (values.preferredLicense instanceof URL) { // @ts-ignore: type is checked above. @@ -112174,6 +118476,12 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -112229,122 +118537,377 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Organization; - for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { - const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; - if (value != null && typeof value === \\"object\\") { - node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + { + const array = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { - const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + { + const array = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { - const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; - if (value != null && typeof value === \\"object\\") { - node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + { + const array = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { - const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + { + const array = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { - const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + { + const array = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { - const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + { + const array = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { - const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; - if (value != null && typeof value === \\"object\\") { - node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + { + const array = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { - const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + { + const array = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { - const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + { + const array = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { - const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + { + const array = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { - const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; - if (value != null && typeof value === \\"object\\") { - node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + { + const array = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === \\"object\\") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { - const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + { + const array = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { - const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; - if (value != null && typeof value === \\"object\\") { - node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + { + const array = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { - const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + { + const array = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { - const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + { + const array = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { - const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + { + const array = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { - const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; - if (value != null && typeof value === \\"object\\") { - node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + { + const array = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === \\"object\\") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } } } } }); } @@ -112697,7 +119260,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#publicKey\\"); @@ -112765,7 +119329,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -112852,7 +119417,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#publicKey\\"); @@ -112924,7 +119490,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -113278,7 +119845,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#assertionMethod\\"); @@ -113346,7 +119914,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -113437,7 +120006,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#assertionMethod\\"); @@ -113509,7 +120079,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -113933,7 +120504,8 @@ get gateways(): (URL)[] { } let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://www.w3.org/ns/ldp#inbox\\"); @@ -114001,7 +120573,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -114375,7 +120948,8 @@ get gateways(): (URL)[] { } let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#outbox\\"); @@ -114443,7 +121017,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -114797,7 +121372,8 @@ get gateways(): (URL)[] { } let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#following\\"); @@ -114865,7 +121441,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -115222,7 +121799,8 @@ get gateways(): (URL)[] { } let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#followers\\"); @@ -115290,7 +121868,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -115645,7 +122224,8 @@ get gateways(): (URL)[] { } let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#liked\\"); @@ -115713,7 +122293,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -116066,7 +122647,8 @@ get gateways(): (URL)[] { } let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://joinmastodon.org/ns#featured\\"); @@ -116134,7 +122716,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -116487,7 +123070,8 @@ get gateways(): (URL)[] { } let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://joinmastodon.org/ns#featuredTags\\"); @@ -116555,7 +123139,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -116905,7 +123490,8 @@ get gateways(): (URL)[] { } let v = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[0]; if (!(v instanceof URL) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/7aa9#featuredCollections\\"); @@ -116973,7 +123559,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -117323,7 +123910,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#streams\\"); @@ -117395,7 +123983,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -117880,7 +124469,8 @@ get gateways(): (URL)[] { } let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#movedTo\\"); @@ -117948,7 +124538,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -118361,7 +124952,8 @@ get gateways(): (URL)[] { } let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"); @@ -118429,7 +125021,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -118520,7 +125113,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"); @@ -118592,7 +125186,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -118946,7 +125541,8 @@ get gateways(): (URL)[] { } let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/did#service\\"); @@ -119014,7 +125610,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -119105,7 +125702,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/did#service\\"); @@ -119177,7 +125775,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -120576,7 +127175,7 @@ get gateways(): (URL)[] { instance.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = _3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; const _axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); let _axq166E2eZADq34V4MYUc8KMZdC_publicKey__array = values[\\"https://w3id.org/security#publicKey\\"]; @@ -120617,7 +127216,7 @@ get gateways(): (URL)[] { instance.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = _axq166E2eZADq34V4MYUc8KMZdC_publicKey; const _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); let _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod__array = values[\\"https://w3id.org/security#assertionMethod\\"]; @@ -120716,7 +127315,7 @@ get gateways(): (URL)[] { instance.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); let _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox__array = values[\\"http://www.w3.org/ns/ldp#inbox\\"]; @@ -120763,7 +127362,7 @@ get gateways(): (URL)[] { instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; const _41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); let _41QwhqJouoLg3h8dRPKat21brynC_outbox__array = values[\\"https://www.w3.org/ns/activitystreams#outbox\\"]; @@ -120810,7 +127409,7 @@ get gateways(): (URL)[] { instance.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = _41QwhqJouoLg3h8dRPKat21brynC_outbox; const _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); let _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following__array = values[\\"https://www.w3.org/ns/activitystreams#following\\"]; @@ -120851,7 +127450,7 @@ get gateways(): (URL)[] { instance.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; const _BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); let _BBCTgfphhsFzpVfKTykGSpBNwoA_followers__array = values[\\"https://www.w3.org/ns/activitystreams#followers\\"]; @@ -120892,7 +127491,7 @@ get gateways(): (URL)[] { instance.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = _BBCTgfphhsFzpVfKTykGSpBNwoA_followers; const _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); let _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked__array = values[\\"https://www.w3.org/ns/activitystreams#liked\\"]; @@ -120933,7 +127532,7 @@ get gateways(): (URL)[] { instance.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; const _4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); let _4N1vBJzXDf8NbBumeECQMFvKetja_featured__array = values[\\"http://joinmastodon.org/ns#featured\\"]; @@ -120974,7 +127573,7 @@ get gateways(): (URL)[] { instance.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = _4N1vBJzXDf8NbBumeECQMFvKetja_featured; const _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); let _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags__array = values[\\"http://joinmastodon.org/ns#featuredTags\\"]; @@ -121015,7 +127614,7 @@ get gateways(): (URL)[] { instance.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; const _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); let _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections__array = values[\\"https://w3id.org/fep/7aa9#featuredCollections\\"]; @@ -121056,7 +127655,7 @@ get gateways(): (URL)[] { instance.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); let _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams__array = values[\\"https://www.w3.org/ns/activitystreams#streams\\"]; @@ -121245,7 +127844,7 @@ get gateways(): (URL)[] { instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); let _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array = values[\\"https://www.w3.org/ns/activitystreams#movedTo\\"]; @@ -121303,7 +127902,7 @@ get gateways(): (URL)[] { instance.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); let _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array = values[\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"]; @@ -121361,7 +127960,7 @@ get gateways(): (URL)[] { instance.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; const _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); let _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service__array = values[\\"https://www.w3.org/ns/did#service\\"]; @@ -122221,6 +128820,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -122606,39 +129211,39 @@ export class Person extends Object { #_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername: ((string | LanguageString))[] = []; #_axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); #_41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); #_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); #_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); #_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); #_4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); #_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); #_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints: (Endpoints)[] = []; #_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable: (boolean)[] = []; #_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended: (boolean)[] = []; @@ -122646,13 +129251,13 @@ export class Person extends Object { #_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable: (boolean)[] = []; #_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); #_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); #_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); #_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage: (string)[] = []; #_2xEU4QtkC53RAun67T81Egqt9vmL_isCat: (boolean)[] = []; #_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense: (URL)[] = []; @@ -122721,10 +129326,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -122757,14 +129386,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; - for (let i = 0; i < values.publicKeys.length; i++) { - this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -122797,14 +129448,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; - for (let i = 0; i < values.assertionMethods.length; i++) { - this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -122837,10 +129510,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -122969,14 +129666,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | if (\\"streams\\" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; - for (let i = 0; i < values.streams.length; i++) { - this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -123087,14 +129806,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; - for (let i = 0; i < values.aliases.length; i++) { - this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -123127,14 +129868,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; - for (let i = 0; i < values.services.length; i++) { - this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -123254,7 +130017,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Person;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice(); + const clone = super.clone(values, options) as unknown as Person;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.length < vocabSparseArrayMinimumLength + ? this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice() : vocabCopyPropertyArray(this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername); if (\\"preferredUsername\\" in values && values.preferredUsername != null) { if (typeof values.preferredUsername === \\"string\\" || values.preferredUsername instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -123278,10 +130042,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -123290,12 +130078,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice();clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < vocabSparseArrayMinimumLength + ? this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice() : vocabCopyPropertyArray(this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey);clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = vocabCopyTrustSet( + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, + ); if (\\"publicKey\\" in values && values.publicKey != null) { if (values.publicKey instanceof CryptographicKey || values.publicKey instanceof URL) { // @ts-ignore: type is checked above. clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = [values.publicKey]; - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set([0]); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The publicKey must be of type \\" + @@ -123314,15 +130106,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); - for (let i = 0; i < values.publicKeys.length; i++) { - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -123331,12 +130145,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice();clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < vocabSparseArrayMinimumLength + ? this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice() : vocabCopyPropertyArray(this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod);clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = vocabCopyTrustSet( + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, + ); if (\\"assertionMethod\\" in values && values.assertionMethod != null) { if (values.assertionMethod instanceof Multikey || values.assertionMethod instanceof URL) { // @ts-ignore: type is checked above. clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = [values.assertionMethod]; - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set([0]); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The assertionMethod must be of type \\" + @@ -123355,15 +130173,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); - for (let i = 0; i < values.assertionMethods.length; i++) { - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -123372,7 +130212,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < vocabSparseArrayMinimumLength + ? this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice() : vocabCopyPropertyArray(this.#_hQiaHhZP8hqxckxTBrpsGNs57E3); if (\\"gateway\\" in values && values.gateway != null) { if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { // @ts-ignore: type is checked above. @@ -123396,10 +130237,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -123408,7 +130273,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice(); + clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.length < vocabSparseArrayMinimumLength + ? this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice() : vocabCopyPropertyArray(this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers); if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -123421,12 +130287,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice();clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox); + clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < vocabSparseArrayMinimumLength + ? this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice() : vocabCopyPropertyArray(this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox);clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = vocabCopyTrustSet( + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, + ); if (\\"inbox\\" in values && values.inbox != null) { if (values.inbox instanceof OrderedCollection || values.inbox instanceof OrderedCollectionPage || values.inbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox]; - clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set([0]); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The inbox must be of type \\" + @@ -123434,12 +130304,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice();clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox); + clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < vocabSparseArrayMinimumLength + ? this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice() : vocabCopyPropertyArray(this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox);clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = vocabCopyTrustSet( + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, + ); if (\\"outbox\\" in values && values.outbox != null) { if (values.outbox instanceof OrderedCollection || values.outbox instanceof OrderedCollectionPage || values.outbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox]; - clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set([0]); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The outbox must be of type \\" + @@ -123447,12 +130321,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice();clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following); + clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < vocabSparseArrayMinimumLength + ? this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice() : vocabCopyPropertyArray(this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following);clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = vocabCopyTrustSet( + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, + ); if (\\"following\\" in values && values.following != null) { if (values.following instanceof Collection || values.following instanceof URL) { // @ts-ignore: type is checked above. clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = [values.following]; - clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set([0]); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The following must be of type \\" + @@ -123460,12 +130338,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice();clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers); + clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < vocabSparseArrayMinimumLength + ? this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice() : vocabCopyPropertyArray(this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers);clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = vocabCopyTrustSet( + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, + ); if (\\"followers\\" in values && values.followers != null) { if (values.followers instanceof Collection || values.followers instanceof URL) { // @ts-ignore: type is checked above. clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = [values.followers]; - clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set([0]); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The followers must be of type \\" + @@ -123473,12 +130355,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice();clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked); + clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < vocabSparseArrayMinimumLength + ? this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice() : vocabCopyPropertyArray(this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked);clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = vocabCopyTrustSet( + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, + ); if (\\"liked\\" in values && values.liked != null) { if (values.liked instanceof Collection || values.liked instanceof URL) { // @ts-ignore: type is checked above. clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = [values.liked]; - clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set([0]); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The liked must be of type \\" + @@ -123486,12 +130372,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice();clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured); + clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < vocabSparseArrayMinimumLength + ? this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice() : vocabCopyPropertyArray(this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured);clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = vocabCopyTrustSet( + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, + ); if (\\"featured\\" in values && values.featured != null) { if (values.featured instanceof Collection || values.featured instanceof URL) { // @ts-ignore: type is checked above. clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = [values.featured]; - clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set([0]); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featured must be of type \\" + @@ -123499,12 +130389,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice();clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags); + clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < vocabSparseArrayMinimumLength + ? this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice() : vocabCopyPropertyArray(this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags);clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = vocabCopyTrustSet( + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, + ); if (\\"featuredTags\\" in values && values.featuredTags != null) { if (values.featuredTags instanceof Collection || values.featuredTags instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = [values.featuredTags]; - clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set([0]); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredTags must be of type \\" + @@ -123512,12 +130406,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice();clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections); + clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length < vocabSparseArrayMinimumLength + ? this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice() : vocabCopyPropertyArray(this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections);clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = vocabCopyTrustSet( + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, + ); if (\\"featuredCollections\\" in values && values.featuredCollections != null) { if (values.featuredCollections instanceof Collection || values.featuredCollections instanceof URL) { // @ts-ignore: type is checked above. clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = [values.featuredCollections]; - clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set([0]); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredCollections must be of type \\" + @@ -123525,18 +130423,43 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice();clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length < vocabSparseArrayMinimumLength + ? this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice() : vocabCopyPropertyArray(this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams);clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = vocabCopyTrustSet( + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, + ); if (\\"streams\\" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(); - for (let i = 0; i < values.streams.length; i++) { - clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -123545,7 +130468,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice(); + clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length < vocabSparseArrayMinimumLength + ? this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice() : vocabCopyPropertyArray(this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints); if (\\"endpoints\\" in values && values.endpoints != null) { if (values.endpoints instanceof Endpoints) { // @ts-ignore: type is checked above. @@ -123558,7 +130482,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice(); + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.length < vocabSparseArrayMinimumLength + ? this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice() : vocabCopyPropertyArray(this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable); if (\\"discoverable\\" in values && values.discoverable != null) { if (typeof values.discoverable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -123571,7 +130496,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice(); + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.length < vocabSparseArrayMinimumLength + ? this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice() : vocabCopyPropertyArray(this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended); if (\\"suspended\\" in values && values.suspended != null) { if (typeof values.suspended === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -123584,7 +130510,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice(); + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.length < vocabSparseArrayMinimumLength + ? this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice() : vocabCopyPropertyArray(this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial); if (\\"memorial\\" in values && values.memorial != null) { if (typeof values.memorial === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -123597,7 +130524,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice(); + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.length < vocabSparseArrayMinimumLength + ? this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice() : vocabCopyPropertyArray(this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable); if (\\"indexable\\" in values && values.indexable != null) { if (typeof values.indexable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -123610,12 +130538,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice();clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo); + clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < vocabSparseArrayMinimumLength + ? this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice() : vocabCopyPropertyArray(this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo);clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = vocabCopyTrustSet( + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, + ); if (\\"successor\\" in values && values.successor != null) { if (values.successor instanceof Application || values.successor instanceof Group || values.successor instanceof Organization || values.successor instanceof Person || values.successor instanceof Service || values.successor instanceof URL) { // @ts-ignore: type is checked above. clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor]; - clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set([0]); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The successor must be of type \\" + @@ -123623,12 +130555,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice();clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < vocabSparseArrayMinimumLength + ? this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice() : vocabCopyPropertyArray(this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs);clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = vocabCopyTrustSet( + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, + ); if (\\"alias\\" in values && values.alias != null) { if (values.alias instanceof Application || values.alias instanceof Group || values.alias instanceof Organization || values.alias instanceof Person || values.alias instanceof Service || values.alias instanceof URL) { // @ts-ignore: type is checked above. clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [values.alias]; - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set([0]); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The alias must be of type \\" + @@ -123647,15 +130583,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); - for (let i = 0; i < values.aliases.length; i++) { - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -123664,12 +130622,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice();clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < vocabSparseArrayMinimumLength + ? this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice() : vocabCopyPropertyArray(this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service);clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = vocabCopyTrustSet( + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, + ); if (\\"service\\" in values && values.service != null) { if (values.service instanceof DidService || values.service instanceof URL) { // @ts-ignore: type is checked above. clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = [values.service]; - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set([0]); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The service must be of type \\" + @@ -123688,15 +130650,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); - for (let i = 0; i < values.services.length; i++) { - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -123705,7 +130689,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice(); + clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.length < vocabSparseArrayMinimumLength + ? this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice() : vocabCopyPropertyArray(this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage); if (\\"followedMessage\\" in values && values.followedMessage != null) { if (typeof values.followedMessage === \\"string\\") { // @ts-ignore: type is checked above. @@ -123718,7 +130703,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice(); + clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.length < vocabSparseArrayMinimumLength + ? this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice() : vocabCopyPropertyArray(this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat); if (\\"cat\\" in values && values.cat != null) { if (typeof values.cat === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -123731,7 +130717,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice(); + clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length < vocabSparseArrayMinimumLength + ? this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice() : vocabCopyPropertyArray(this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense); if (\\"preferredLicense\\" in values && values.preferredLicense != null) { if (values.preferredLicense instanceof URL) { // @ts-ignore: type is checked above. @@ -123770,6 +130757,12 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -123825,122 +130818,377 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Person; - for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { - const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; - if (value != null && typeof value === \\"object\\") { - node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + { + const array = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { - const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + { + const array = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { - const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; - if (value != null && typeof value === \\"object\\") { - node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + { + const array = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { - const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + { + const array = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { - const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + { + const array = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { - const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + { + const array = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { - const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; - if (value != null && typeof value === \\"object\\") { - node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + { + const array = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { - const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + { + const array = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { - const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + { + const array = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { - const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + { + const array = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { - const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; - if (value != null && typeof value === \\"object\\") { - node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + { + const array = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === \\"object\\") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { - const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + { + const array = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { - const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; - if (value != null && typeof value === \\"object\\") { - node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + { + const array = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { - const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + { + const array = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { - const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + { + const array = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { - const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + { + const array = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { - const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; - if (value != null && typeof value === \\"object\\") { - node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + { + const array = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === \\"object\\") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } } } } }); } @@ -124293,7 +131541,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#publicKey\\"); @@ -124361,7 +131610,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -124448,7 +131698,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#publicKey\\"); @@ -124520,7 +131771,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -124874,7 +132126,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#assertionMethod\\"); @@ -124942,7 +132195,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -125033,7 +132287,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#assertionMethod\\"); @@ -125105,7 +132360,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -125529,7 +132785,8 @@ get gateways(): (URL)[] { } let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://www.w3.org/ns/ldp#inbox\\"); @@ -125597,7 +132854,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -125971,7 +133229,8 @@ get gateways(): (URL)[] { } let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#outbox\\"); @@ -126039,7 +133298,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -126393,7 +133653,8 @@ get gateways(): (URL)[] { } let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#following\\"); @@ -126461,7 +133722,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -126818,7 +134080,8 @@ get gateways(): (URL)[] { } let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#followers\\"); @@ -126886,7 +134149,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -127241,7 +134505,8 @@ get gateways(): (URL)[] { } let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#liked\\"); @@ -127309,7 +134574,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -127662,7 +134928,8 @@ get gateways(): (URL)[] { } let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://joinmastodon.org/ns#featured\\"); @@ -127730,7 +134997,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -128083,7 +135351,8 @@ get gateways(): (URL)[] { } let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://joinmastodon.org/ns#featuredTags\\"); @@ -128151,7 +135420,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -128501,7 +135771,8 @@ get gateways(): (URL)[] { } let v = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[0]; if (!(v instanceof URL) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/7aa9#featuredCollections\\"); @@ -128569,7 +135840,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -128919,7 +136191,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#streams\\"); @@ -128991,7 +136264,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -129476,7 +136750,8 @@ get gateways(): (URL)[] { } let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#movedTo\\"); @@ -129544,7 +136819,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -129957,7 +137233,8 @@ get gateways(): (URL)[] { } let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"); @@ -130025,7 +137302,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -130116,7 +137394,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"); @@ -130188,7 +137467,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -130542,7 +137822,8 @@ get gateways(): (URL)[] { } let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/did#service\\"); @@ -130610,7 +137891,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -130701,7 +137983,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/did#service\\"); @@ -130773,7 +138056,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -132172,7 +139456,7 @@ get gateways(): (URL)[] { instance.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = _3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; const _axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); let _axq166E2eZADq34V4MYUc8KMZdC_publicKey__array = values[\\"https://w3id.org/security#publicKey\\"]; @@ -132213,7 +139497,7 @@ get gateways(): (URL)[] { instance.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = _axq166E2eZADq34V4MYUc8KMZdC_publicKey; const _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); let _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod__array = values[\\"https://w3id.org/security#assertionMethod\\"]; @@ -132312,7 +139596,7 @@ get gateways(): (URL)[] { instance.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); let _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox__array = values[\\"http://www.w3.org/ns/ldp#inbox\\"]; @@ -132359,7 +139643,7 @@ get gateways(): (URL)[] { instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; const _41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); let _41QwhqJouoLg3h8dRPKat21brynC_outbox__array = values[\\"https://www.w3.org/ns/activitystreams#outbox\\"]; @@ -132406,7 +139690,7 @@ get gateways(): (URL)[] { instance.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = _41QwhqJouoLg3h8dRPKat21brynC_outbox; const _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); let _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following__array = values[\\"https://www.w3.org/ns/activitystreams#following\\"]; @@ -132447,7 +139731,7 @@ get gateways(): (URL)[] { instance.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; const _BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); let _BBCTgfphhsFzpVfKTykGSpBNwoA_followers__array = values[\\"https://www.w3.org/ns/activitystreams#followers\\"]; @@ -132488,7 +139772,7 @@ get gateways(): (URL)[] { instance.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = _BBCTgfphhsFzpVfKTykGSpBNwoA_followers; const _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); let _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked__array = values[\\"https://www.w3.org/ns/activitystreams#liked\\"]; @@ -132529,7 +139813,7 @@ get gateways(): (URL)[] { instance.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; const _4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); let _4N1vBJzXDf8NbBumeECQMFvKetja_featured__array = values[\\"http://joinmastodon.org/ns#featured\\"]; @@ -132570,7 +139854,7 @@ get gateways(): (URL)[] { instance.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = _4N1vBJzXDf8NbBumeECQMFvKetja_featured; const _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); let _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags__array = values[\\"http://joinmastodon.org/ns#featuredTags\\"]; @@ -132611,7 +139895,7 @@ get gateways(): (URL)[] { instance.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; const _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); let _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections__array = values[\\"https://w3id.org/fep/7aa9#featuredCollections\\"]; @@ -132652,7 +139936,7 @@ get gateways(): (URL)[] { instance.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); let _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams__array = values[\\"https://www.w3.org/ns/activitystreams#streams\\"]; @@ -132841,7 +140125,7 @@ get gateways(): (URL)[] { instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); let _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array = values[\\"https://www.w3.org/ns/activitystreams#movedTo\\"]; @@ -132899,7 +140183,7 @@ get gateways(): (URL)[] { instance.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); let _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array = values[\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"]; @@ -132957,7 +140241,7 @@ get gateways(): (URL)[] { instance.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; const _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); let _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service__array = values[\\"https://www.w3.org/ns/did#service\\"]; @@ -133878,7 +141162,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Place;clone.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy = this.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy.slice(); + const clone = super.clone(values, options) as unknown as Place;clone.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy = this.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy.length < vocabSparseArrayMinimumLength + ? this.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy.slice() : vocabCopyPropertyArray(this.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy); if (\\"accuracy\\" in values && values.accuracy != null) { if (typeof values.accuracy === \\"number\\" && !Number.isNaN(values.accuracy)) { // @ts-ignore: type is checked above. @@ -133891,7 +141176,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude = this.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude.slice(); + clone.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude = this.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude.length < vocabSparseArrayMinimumLength + ? this.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude.slice() : vocabCopyPropertyArray(this.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude); if (\\"altitude\\" in values && values.altitude != null) { if (typeof values.altitude === \\"number\\" && !Number.isNaN(values.altitude)) { // @ts-ignore: type is checked above. @@ -133904,7 +141190,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude = this.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude.slice(); + clone.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude = this.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude.length < vocabSparseArrayMinimumLength + ? this.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude.slice() : vocabCopyPropertyArray(this.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude); if (\\"latitude\\" in values && values.latitude != null) { if (typeof values.latitude === \\"number\\" && !Number.isNaN(values.latitude)) { // @ts-ignore: type is checked above. @@ -133917,7 +141204,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude = this.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude.slice(); + clone.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude = this.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude.length < vocabSparseArrayMinimumLength + ? this.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude.slice() : vocabCopyPropertyArray(this.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude); if (\\"longitude\\" in values && values.longitude != null) { if (typeof values.longitude === \\"number\\" && !Number.isNaN(values.longitude)) { // @ts-ignore: type is checked above. @@ -133930,7 +141218,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius = this.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius.slice(); + clone.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius = this.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius.length < vocabSparseArrayMinimumLength + ? this.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius.slice() : vocabCopyPropertyArray(this.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius); if (\\"radius\\" in values && values.radius != null) { if (typeof values.radius === \\"number\\" && !Number.isNaN(values.radius)) { // @ts-ignore: type is checked above. @@ -133943,7 +141232,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units = this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units.slice(); + clone.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units = this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units.length < vocabSparseArrayMinimumLength + ? this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units.slice() : vocabCopyPropertyArray(this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units); if (\\"units\\" in values && values.units != null) { if (values.units == \\"cm\\" || values.units == \\"feet\\" || values.units == \\"inches\\" || values.units == \\"km\\" || values.units == \\"m\\" || values.units == \\"miles\\" || values.units instanceof URL) { // @ts-ignore: type is checked above. @@ -133982,6 +141272,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -134031,10 +141327,25 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Place; - for (let i = 0; i < node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units.length; i++) { - const value = node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units[i]; - if (value != null && typeof value === \\"object\\") { - node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units[i] = context.value(value); + { + const array = node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units.length; i++) { + const value = node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units[i]; + if (value != null && typeof value === \\"object\\") { + node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units[i] = context.value(value); + } + } } } } }); } @@ -135004,7 +142315,7 @@ export class Profile extends Object { } #_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes: (Object | URL)[] = []; - #_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes: Set = new Set(); + #_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes: VocabTrustSet = new Set(); /** * Constructs a new instance of Profile with the given values. @@ -135119,12 +142430,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Profile;clone.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.slice();clone.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = new Set(this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes); + const clone = super.clone(values, options) as unknown as Profile;clone.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.length < vocabSparseArrayMinimumLength + ? this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.slice() : vocabCopyPropertyArray(this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes);clone.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = vocabCopyTrustSet( + this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes, clone.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes, + ); if (\\"describes\\" in values && values.describes != null) { if (values.describes instanceof Object || values.describes instanceof URL) { // @ts-ignore: type is checked above. clone.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = [values.describes]; - clone.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = new Set([0]); + clone.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = new Set(); + clone.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The describes must be of type \\" + @@ -135158,6 +142473,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -135207,10 +142528,25 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Profile; - for (let i = 0; i < node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.length; i++) { - const value = node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[i] = context.value(value); + { + const array = node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.length; i++) { + const value = node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[i] = context.value(value); + } + } } } } }); } @@ -135542,7 +142878,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[0]; if (!(v instanceof URL) && - !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { + !(0 < (this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[vocabTrustPrefix] ?? 0) || + this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#describes\\"); @@ -135610,7 +142947,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { + !(0 < (this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[vocabTrustPrefix] ?? 0) || + this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -135947,7 +143285,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes: (Object | URL)[] = []; - const _trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes: Set = new Set(); + const _trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes: VocabTrustSet = new Set(); let _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes__array = values[\\"https://www.w3.org/ns/activitystreams#describes\\"]; @@ -136085,19 +143423,19 @@ export class Question extends IntransitiveActivity { } #_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf: (Object | URL)[] = []; - #_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf: Set = new Set(); + #_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf: VocabTrustSet = new Set(); #_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf: (Object | URL)[] = []; - #_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf: Set = new Set(); + #_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf: VocabTrustSet = new Set(); #_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed: ((Temporal.Instant | boolean))[] = []; #_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount: (number)[] = []; #_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); #_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl: (URL)[] = []; #_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); /** * Constructs a new instance of Question with the given values. @@ -136142,14 +143480,36 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti super(values, options); if (\\"exclusiveOptions\\" in values && values.exclusiveOptions != null) { - if (Array.isArray(values.exclusiveOptions) && - values.exclusiveOptions.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.exclusiveOptions)) { + const array = values.exclusiveOptions; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.exclusiveOptions; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = values.exclusiveOptions.slice(); + this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = copied; - for (let i = 0; i < values.exclusiveOptions.length; i++) { - this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.add(i); - } + vocabSetTrustPrefix(this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf, this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.length); } else { throw new TypeError( @@ -136161,14 +143521,36 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (\\"inclusiveOptions\\" in values && values.inclusiveOptions != null) { - if (Array.isArray(values.inclusiveOptions) && - values.inclusiveOptions.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.inclusiveOptions)) { + const array = values.inclusiveOptions; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.inclusiveOptions; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = values.inclusiveOptions.slice(); + this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = copied; - for (let i = 0; i < values.inclusiveOptions.length; i++) { - this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.add(i); - } + vocabSetTrustPrefix(this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf, this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.length); } else { throw new TypeError( @@ -136314,18 +143696,43 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Question;clone.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.slice();clone.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = new Set(this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf); + const clone = super.clone(values, options) as unknown as Question;clone.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.length < vocabSparseArrayMinimumLength + ? this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.slice() : vocabCopyPropertyArray(this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf);clone.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = vocabCopyTrustSet( + this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf, clone.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf, + ); if (\\"exclusiveOptions\\" in values && values.exclusiveOptions != null) { - if (Array.isArray(values.exclusiveOptions) && - values.exclusiveOptions.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.exclusiveOptions)) { + const array = values.exclusiveOptions; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.exclusiveOptions; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = values.exclusiveOptions.slice(); + clone.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = copied; clone.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = new Set(); - for (let i = 0; i < values.exclusiveOptions.length; i++) { - clone.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf, clone.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.length); } else { throw new TypeError( @@ -136334,18 +143741,43 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ); } } - clone.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.slice();clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = new Set(this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf); + clone.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.length < vocabSparseArrayMinimumLength + ? this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.slice() : vocabCopyPropertyArray(this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf);clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = vocabCopyTrustSet( + this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf, clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf, + ); if (\\"inclusiveOptions\\" in values && values.inclusiveOptions != null) { - if (Array.isArray(values.inclusiveOptions) && - values.inclusiveOptions.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.inclusiveOptions)) { + const array = values.inclusiveOptions; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.inclusiveOptions; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = values.inclusiveOptions.slice(); + clone.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = copied; clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = new Set(); - for (let i = 0; i < values.inclusiveOptions.length; i++) { - clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf, clone.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.length); } else { throw new TypeError( @@ -136354,7 +143786,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ); } } - clone.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed = this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed.slice(); + clone.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed = this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed.length < vocabSparseArrayMinimumLength + ? this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed.slice() : vocabCopyPropertyArray(this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed); if (\\"closed\\" in values && values.closed != null) { if (isTemporalInstant(values.closed) || typeof values.closed === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -136367,7 +143800,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ); } } - clone.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount = this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount.slice(); + clone.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount = this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount.length < vocabSparseArrayMinimumLength + ? this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount.slice() : vocabCopyPropertyArray(this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount); if (\\"voters\\" in values && values.voters != null) { if (typeof values.voters === \\"number\\" && Number.isInteger(values.voters) && values.voters >= 0) { // @ts-ignore: type is checked above. @@ -136380,12 +143814,16 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ); } } - clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice();clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote); + clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < vocabSparseArrayMinimumLength + ? this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice() : vocabCopyPropertyArray(this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote);clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = vocabCopyTrustSet( + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, + ); if (\\"quote\\" in values && values.quote != null) { if (values.quote instanceof Object || values.quote instanceof URL) { // @ts-ignore: type is checked above. clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = [values.quote]; - clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set([0]); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The quote must be of type \\" + @@ -136393,7 +143831,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ); } } - clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice(); + clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length < vocabSparseArrayMinimumLength + ? this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice() : vocabCopyPropertyArray(this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl); if (\\"quoteUrl\\" in values && values.quoteUrl != null) { if (values.quoteUrl instanceof URL) { // @ts-ignore: type is checked above. @@ -136406,12 +143845,16 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ); } } - clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice();clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization); + clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice() : vocabCopyPropertyArray(this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization);clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = vocabCopyTrustSet( + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, + ); if (\\"quoteAuthorization\\" in values && values.quoteAuthorization != null) { if (values.quoteAuthorization instanceof QuoteAuthorization || values.quoteAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = [values.quoteAuthorization]; - clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set([0]); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The quoteAuthorization must be of type \\" + @@ -136445,6 +143888,12 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -136500,38 +143949,113 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Question; - for (let i = 0; i < node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.length; i++) { - const value = node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[i] = context.value(value); + { + const array = node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.length; i++) { + const value = node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.length; i++) { - const value = node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[i] = context.value(value); + { + const array = node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.length; i++) { + const value = node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { - const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + { + const array = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { - const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; - if (value != null && typeof value === \\"object\\") { - node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + { + const array = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === \\"object\\") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { - const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; - if (value != null && typeof value === \\"object\\") { - node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + { + const array = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } } } } }); } @@ -136864,7 +144388,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { + !(i < (this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#oneOf\\"); @@ -136936,7 +144461,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { + !(i < (this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -137289,7 +144815,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { + !(i < (this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#anyOf\\"); @@ -137361,7 +144888,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { + !(i < (this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -137744,7 +145272,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/044f#quote\\"); @@ -137812,7 +145341,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -138186,7 +145716,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/044f#quoteAuthorization\\"); @@ -138254,7 +145785,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -138682,7 +146214,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf: (Object | URL)[] = []; - const _trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf: Set = new Set(); + const _trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf: VocabTrustSet = new Set(); let _2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf__array = values[\\"https://www.w3.org/ns/activitystreams#oneOf\\"]; @@ -138723,7 +146255,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = _2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf; const _2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf: (Object | URL)[] = []; - const _trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf: Set = new Set(); + const _trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf: VocabTrustSet = new Set(); let _2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf__array = values[\\"https://www.w3.org/ns/activitystreams#anyOf\\"]; @@ -138832,7 +146364,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount = _3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount; const _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); let _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote__array = values[\\"https://w3id.org/fep/044f#quote\\"]; @@ -138912,7 +146444,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; const _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); let _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization__array = values[\\"https://w3id.org/fep/044f#quoteAuthorization\\"]; @@ -139304,6 +146836,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -139814,6 +147352,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -140196,13 +147740,13 @@ export class Relationship extends Object { } #_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject: (Object | URL)[] = []; - #_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject: Set = new Set(); + #_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject: VocabTrustSet = new Set(); #_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: (Object | URL)[] = []; - #_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: Set = new Set(); + #_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: VocabTrustSet = new Set(); #_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship: (Object | URL)[] = []; - #_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship: Set = new Set(); + #_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship: VocabTrustSet = new Set(); /** * Constructs a new instance of Relationship with the given values. @@ -140277,14 +147821,36 @@ relationships?: (Object | URL)[];} ); } - if (Array.isArray(values.objects) && - values.objects.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.objects)) { + const array = values.objects; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.objects; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = values.objects.slice(); + this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = copied; - for (let i = 0; i < values.objects.length; i++) { - this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.add(i); - } + vocabSetTrustPrefix(this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length); } else { throw new TypeError( @@ -140317,14 +147883,36 @@ relationships?: (Object | URL)[];} ); } - if (Array.isArray(values.relationships) && - values.relationships.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.relationships)) { + const array = values.relationships; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.relationships; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = values.relationships.slice(); + this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = copied; - for (let i = 0; i < values.relationships.length; i++) { - this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.add(i); - } + vocabSetTrustPrefix(this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship, this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length); } else { throw new TypeError( @@ -140401,12 +147989,16 @@ relationships?: (Object | URL)[];} // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Relationship;clone.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.slice();clone.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = new Set(this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject); + const clone = super.clone(values, options) as unknown as Relationship;clone.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.length < vocabSparseArrayMinimumLength + ? this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.slice() : vocabCopyPropertyArray(this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject);clone.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = vocabCopyTrustSet( + this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject, clone.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject, + ); if (\\"subject\\" in values && values.subject != null) { if (values.subject instanceof Object || values.subject instanceof URL) { // @ts-ignore: type is checked above. clone.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = [values.subject]; - clone.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = new Set([0]); + clone.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = new Set(); + clone.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The subject must be of type \\" + @@ -140414,12 +148006,16 @@ relationships?: (Object | URL)[];} ); } } - clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.slice();clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set(this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object); + clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length < vocabSparseArrayMinimumLength + ? this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.slice() : vocabCopyPropertyArray(this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object);clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = vocabCopyTrustSet( + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, + ); if (\\"object\\" in values && values.object != null) { if (values.object instanceof Object || values.object instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = [values.object]; - clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set([0]); + clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set(); + clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The object must be of type \\" + @@ -140438,15 +148034,37 @@ relationships?: (Object | URL)[];} ); } - if (Array.isArray(values.objects) && - values.objects.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.objects)) { + const array = values.objects; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.objects; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = values.objects.slice(); + clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = copied; clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set(); - for (let i = 0; i < values.objects.length; i++) { - clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length); } else { throw new TypeError( @@ -140455,12 +148073,16 @@ relationships?: (Object | URL)[];} ); } } - clone.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.slice();clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = new Set(this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship); + clone.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length < vocabSparseArrayMinimumLength + ? this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.slice() : vocabCopyPropertyArray(this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship);clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = vocabCopyTrustSet( + this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship, clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship, + ); if (\\"relationship\\" in values && values.relationship != null) { if (values.relationship instanceof Object || values.relationship instanceof URL) { // @ts-ignore: type is checked above. clone.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = [values.relationship]; - clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = new Set([0]); + clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = new Set(); + clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The relationship must be of type \\" + @@ -140479,15 +148101,37 @@ relationships?: (Object | URL)[];} ); } - if (Array.isArray(values.relationships) && - values.relationships.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.relationships)) { + const array = values.relationships; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.relationships; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = values.relationships.slice(); + clone.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = copied; clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = new Set(); - for (let i = 0; i < values.relationships.length; i++) { - clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship, clone.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length); } else { throw new TypeError( @@ -140522,6 +148166,12 @@ relationships?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -140573,24 +148223,69 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Relationship; - for (let i = 0; i < node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.length; i++) { - const value = node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[i] = context.value(value); + { + const array = node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.length; i++) { + const value = node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length; i++) { - const value = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i] = context.value(value); + { + const array = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length; i++) { + const value = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length; i++) { - const value = node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[i] = context.value(value); + { + const array = node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length; i++) { + const value = node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[i] = context.value(value); + } + } } } } }); } @@ -140924,7 +148619,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[0]; if (!(v instanceof URL) && - !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { + !(0 < (this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[vocabTrustPrefix] ?? 0) || + this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#subject\\"); @@ -140992,7 +148688,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { + !(0 < (this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[vocabTrustPrefix] ?? 0) || + this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -141342,7 +149039,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (!(v instanceof URL) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { + !(0 < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#object\\"); @@ -141410,7 +149108,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { + !(0 < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -141498,7 +149197,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { + !(i < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#object\\"); @@ -141570,7 +149270,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { + !(i < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -141923,7 +149624,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[0]; if (!(v instanceof URL) && - !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { + !(0 < (this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[vocabTrustPrefix] ?? 0) || + this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#relationship\\"); @@ -141991,7 +149693,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { + !(0 < (this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[vocabTrustPrefix] ?? 0) || + this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -142081,7 +149784,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { + !(i < (this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[vocabTrustPrefix] ?? 0) || + this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#relationship\\"); @@ -142153,7 +149857,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { + !(i < (this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[vocabTrustPrefix] ?? 0) || + this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -142571,7 +150276,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject: (Object | URL)[] = []; - const _trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject: Set = new Set(); + const _trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject: VocabTrustSet = new Set(); let _2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject__array = values[\\"https://www.w3.org/ns/activitystreams#subject\\"]; @@ -142612,7 +150317,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = _2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject; const _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: (Object | URL)[] = []; - const _trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: Set = new Set(); + const _trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: VocabTrustSet = new Set(); let _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object__array = values[\\"https://www.w3.org/ns/activitystreams#object\\"]; @@ -142653,7 +150358,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; const _4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship: (Object | URL)[] = []; - const _trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship: Set = new Set(); + const _trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship: VocabTrustSet = new Set(); let _4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship__array = values[\\"https://www.w3.org/ns/activitystreams#relationship\\"]; @@ -142974,6 +150679,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -143346,39 +151057,39 @@ export class Service extends Object { #_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername: ((string | LanguageString))[] = []; #_axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); #_41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); #_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); #_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); #_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); #_4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); #_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); #_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints: (Endpoints)[] = []; #_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable: (boolean)[] = []; #_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended: (boolean)[] = []; @@ -143386,13 +151097,13 @@ export class Service extends Object { #_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable: (boolean)[] = []; #_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); #_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); #_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); #_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage: (string)[] = []; #_2xEU4QtkC53RAun67T81Egqt9vmL_isCat: (boolean)[] = []; #_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense: (URL)[] = []; @@ -143461,10 +151172,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -143497,14 +151232,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; - for (let i = 0; i < values.publicKeys.length; i++) { - this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -143537,14 +151294,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; - for (let i = 0; i < values.assertionMethods.length; i++) { - this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -143577,10 +151356,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -143709,14 +151512,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | if (\\"streams\\" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; - for (let i = 0; i < values.streams.length; i++) { - this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -143827,14 +151652,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; - for (let i = 0; i < values.aliases.length; i++) { - this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -143867,14 +151714,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; - for (let i = 0; i < values.services.length; i++) { - this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -143994,7 +151863,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Service;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice(); + const clone = super.clone(values, options) as unknown as Service;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.length < vocabSparseArrayMinimumLength + ? this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice() : vocabCopyPropertyArray(this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername); if (\\"preferredUsername\\" in values && values.preferredUsername != null) { if (typeof values.preferredUsername === \\"string\\" || values.preferredUsername instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -144018,10 +151888,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -144030,12 +151924,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice();clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < vocabSparseArrayMinimumLength + ? this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice() : vocabCopyPropertyArray(this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey);clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = vocabCopyTrustSet( + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, + ); if (\\"publicKey\\" in values && values.publicKey != null) { if (values.publicKey instanceof CryptographicKey || values.publicKey instanceof URL) { // @ts-ignore: type is checked above. clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = [values.publicKey]; - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set([0]); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The publicKey must be of type \\" + @@ -144054,15 +151952,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); - for (let i = 0; i < values.publicKeys.length; i++) { - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -144071,12 +151991,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice();clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < vocabSparseArrayMinimumLength + ? this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice() : vocabCopyPropertyArray(this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod);clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = vocabCopyTrustSet( + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, + ); if (\\"assertionMethod\\" in values && values.assertionMethod != null) { if (values.assertionMethod instanceof Multikey || values.assertionMethod instanceof URL) { // @ts-ignore: type is checked above. clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = [values.assertionMethod]; - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set([0]); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The assertionMethod must be of type \\" + @@ -144095,15 +152019,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); - for (let i = 0; i < values.assertionMethods.length; i++) { - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -144112,7 +152058,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < vocabSparseArrayMinimumLength + ? this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice() : vocabCopyPropertyArray(this.#_hQiaHhZP8hqxckxTBrpsGNs57E3); if (\\"gateway\\" in values && values.gateway != null) { if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { // @ts-ignore: type is checked above. @@ -144136,10 +152083,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -144148,7 +152119,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice(); + clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.length < vocabSparseArrayMinimumLength + ? this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice() : vocabCopyPropertyArray(this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers); if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -144161,12 +152133,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice();clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox); + clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < vocabSparseArrayMinimumLength + ? this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice() : vocabCopyPropertyArray(this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox);clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = vocabCopyTrustSet( + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, + ); if (\\"inbox\\" in values && values.inbox != null) { if (values.inbox instanceof OrderedCollection || values.inbox instanceof OrderedCollectionPage || values.inbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox]; - clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set([0]); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The inbox must be of type \\" + @@ -144174,12 +152150,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice();clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox); + clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < vocabSparseArrayMinimumLength + ? this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice() : vocabCopyPropertyArray(this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox);clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = vocabCopyTrustSet( + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, + ); if (\\"outbox\\" in values && values.outbox != null) { if (values.outbox instanceof OrderedCollection || values.outbox instanceof OrderedCollectionPage || values.outbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox]; - clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set([0]); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The outbox must be of type \\" + @@ -144187,12 +152167,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice();clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following); + clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < vocabSparseArrayMinimumLength + ? this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice() : vocabCopyPropertyArray(this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following);clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = vocabCopyTrustSet( + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, + ); if (\\"following\\" in values && values.following != null) { if (values.following instanceof Collection || values.following instanceof URL) { // @ts-ignore: type is checked above. clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = [values.following]; - clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set([0]); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The following must be of type \\" + @@ -144200,12 +152184,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice();clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers); + clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < vocabSparseArrayMinimumLength + ? this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice() : vocabCopyPropertyArray(this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers);clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = vocabCopyTrustSet( + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, + ); if (\\"followers\\" in values && values.followers != null) { if (values.followers instanceof Collection || values.followers instanceof URL) { // @ts-ignore: type is checked above. clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = [values.followers]; - clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set([0]); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The followers must be of type \\" + @@ -144213,12 +152201,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice();clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked); + clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < vocabSparseArrayMinimumLength + ? this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice() : vocabCopyPropertyArray(this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked);clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = vocabCopyTrustSet( + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, + ); if (\\"liked\\" in values && values.liked != null) { if (values.liked instanceof Collection || values.liked instanceof URL) { // @ts-ignore: type is checked above. clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = [values.liked]; - clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set([0]); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The liked must be of type \\" + @@ -144226,12 +152218,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice();clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured); + clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < vocabSparseArrayMinimumLength + ? this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice() : vocabCopyPropertyArray(this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured);clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = vocabCopyTrustSet( + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, + ); if (\\"featured\\" in values && values.featured != null) { if (values.featured instanceof Collection || values.featured instanceof URL) { // @ts-ignore: type is checked above. clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = [values.featured]; - clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set([0]); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featured must be of type \\" + @@ -144239,12 +152235,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice();clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags); + clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < vocabSparseArrayMinimumLength + ? this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice() : vocabCopyPropertyArray(this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags);clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = vocabCopyTrustSet( + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, + ); if (\\"featuredTags\\" in values && values.featuredTags != null) { if (values.featuredTags instanceof Collection || values.featuredTags instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = [values.featuredTags]; - clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set([0]); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredTags must be of type \\" + @@ -144252,12 +152252,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice();clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections); + clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length < vocabSparseArrayMinimumLength + ? this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice() : vocabCopyPropertyArray(this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections);clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = vocabCopyTrustSet( + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, + ); if (\\"featuredCollections\\" in values && values.featuredCollections != null) { if (values.featuredCollections instanceof Collection || values.featuredCollections instanceof URL) { // @ts-ignore: type is checked above. clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = [values.featuredCollections]; - clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set([0]); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredCollections must be of type \\" + @@ -144265,18 +152269,43 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice();clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length < vocabSparseArrayMinimumLength + ? this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice() : vocabCopyPropertyArray(this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams);clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = vocabCopyTrustSet( + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, + ); if (\\"streams\\" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(); - for (let i = 0; i < values.streams.length; i++) { - clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -144285,7 +152314,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice(); + clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length < vocabSparseArrayMinimumLength + ? this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice() : vocabCopyPropertyArray(this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints); if (\\"endpoints\\" in values && values.endpoints != null) { if (values.endpoints instanceof Endpoints) { // @ts-ignore: type is checked above. @@ -144298,7 +152328,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice(); + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.length < vocabSparseArrayMinimumLength + ? this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice() : vocabCopyPropertyArray(this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable); if (\\"discoverable\\" in values && values.discoverable != null) { if (typeof values.discoverable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -144311,7 +152342,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice(); + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.length < vocabSparseArrayMinimumLength + ? this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice() : vocabCopyPropertyArray(this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended); if (\\"suspended\\" in values && values.suspended != null) { if (typeof values.suspended === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -144324,7 +152356,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice(); + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.length < vocabSparseArrayMinimumLength + ? this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice() : vocabCopyPropertyArray(this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial); if (\\"memorial\\" in values && values.memorial != null) { if (typeof values.memorial === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -144337,7 +152370,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice(); + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.length < vocabSparseArrayMinimumLength + ? this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice() : vocabCopyPropertyArray(this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable); if (\\"indexable\\" in values && values.indexable != null) { if (typeof values.indexable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -144350,12 +152384,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice();clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo); + clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < vocabSparseArrayMinimumLength + ? this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice() : vocabCopyPropertyArray(this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo);clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = vocabCopyTrustSet( + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, + ); if (\\"successor\\" in values && values.successor != null) { if (values.successor instanceof Application || values.successor instanceof Group || values.successor instanceof Organization || values.successor instanceof Person || values.successor instanceof Service || values.successor instanceof URL) { // @ts-ignore: type is checked above. clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor]; - clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set([0]); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The successor must be of type \\" + @@ -144363,12 +152401,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice();clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < vocabSparseArrayMinimumLength + ? this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice() : vocabCopyPropertyArray(this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs);clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = vocabCopyTrustSet( + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, + ); if (\\"alias\\" in values && values.alias != null) { if (values.alias instanceof Application || values.alias instanceof Group || values.alias instanceof Organization || values.alias instanceof Person || values.alias instanceof Service || values.alias instanceof URL) { // @ts-ignore: type is checked above. clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [values.alias]; - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set([0]); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The alias must be of type \\" + @@ -144387,15 +152429,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); - for (let i = 0; i < values.aliases.length; i++) { - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -144404,12 +152468,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice();clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < vocabSparseArrayMinimumLength + ? this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice() : vocabCopyPropertyArray(this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service);clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = vocabCopyTrustSet( + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, + ); if (\\"service\\" in values && values.service != null) { if (values.service instanceof DidService || values.service instanceof URL) { // @ts-ignore: type is checked above. clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = [values.service]; - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set([0]); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The service must be of type \\" + @@ -144428,15 +152496,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); - for (let i = 0; i < values.services.length; i++) { - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -144445,7 +152535,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice(); + clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.length < vocabSparseArrayMinimumLength + ? this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice() : vocabCopyPropertyArray(this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage); if (\\"followedMessage\\" in values && values.followedMessage != null) { if (typeof values.followedMessage === \\"string\\") { // @ts-ignore: type is checked above. @@ -144458,7 +152549,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice(); + clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.length < vocabSparseArrayMinimumLength + ? this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice() : vocabCopyPropertyArray(this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat); if (\\"cat\\" in values && values.cat != null) { if (typeof values.cat === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -144471,7 +152563,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice(); + clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length < vocabSparseArrayMinimumLength + ? this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice() : vocabCopyPropertyArray(this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense); if (\\"preferredLicense\\" in values && values.preferredLicense != null) { if (values.preferredLicense instanceof URL) { // @ts-ignore: type is checked above. @@ -144510,6 +152603,12 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -144565,122 +152664,377 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Service; - for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { - const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; - if (value != null && typeof value === \\"object\\") { - node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + { + const array = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { - const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + { + const array = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { - const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; - if (value != null && typeof value === \\"object\\") { - node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + { + const array = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { - const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + { + const array = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { - const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + { + const array = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { - const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + { + const array = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { - const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; - if (value != null && typeof value === \\"object\\") { - node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + { + const array = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { - const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + { + const array = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { - const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + { + const array = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { - const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + { + const array = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { - const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; - if (value != null && typeof value === \\"object\\") { - node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + { + const array = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === \\"object\\") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { - const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + { + const array = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { - const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; - if (value != null && typeof value === \\"object\\") { - node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + { + const array = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { - const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + { + const array = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { - const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + { + const array = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { - const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + { + const array = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { - const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; - if (value != null && typeof value === \\"object\\") { - node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + { + const array = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === \\"object\\") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } } } } }); } @@ -145033,7 +153387,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#publicKey\\"); @@ -145101,7 +153456,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -145188,7 +153544,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#publicKey\\"); @@ -145260,7 +153617,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -145614,7 +153972,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#assertionMethod\\"); @@ -145682,7 +154041,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -145773,7 +154133,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#assertionMethod\\"); @@ -145845,7 +154206,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -146269,7 +154631,8 @@ get gateways(): (URL)[] { } let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://www.w3.org/ns/ldp#inbox\\"); @@ -146337,7 +154700,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -146711,7 +155075,8 @@ get gateways(): (URL)[] { } let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#outbox\\"); @@ -146779,7 +155144,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -147133,7 +155499,8 @@ get gateways(): (URL)[] { } let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#following\\"); @@ -147201,7 +155568,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -147558,7 +155926,8 @@ get gateways(): (URL)[] { } let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#followers\\"); @@ -147626,7 +155995,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -147981,7 +156351,8 @@ get gateways(): (URL)[] { } let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#liked\\"); @@ -148049,7 +156420,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -148402,7 +156774,8 @@ get gateways(): (URL)[] { } let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://joinmastodon.org/ns#featured\\"); @@ -148470,7 +156843,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -148823,7 +157197,8 @@ get gateways(): (URL)[] { } let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://joinmastodon.org/ns#featuredTags\\"); @@ -148891,7 +157266,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -149241,7 +157617,8 @@ get gateways(): (URL)[] { } let v = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[0]; if (!(v instanceof URL) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/7aa9#featuredCollections\\"); @@ -149309,7 +157686,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -149659,7 +158037,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#streams\\"); @@ -149731,7 +158110,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -150216,7 +158596,8 @@ get gateways(): (URL)[] { } let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#movedTo\\"); @@ -150284,7 +158665,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -150697,7 +159079,8 @@ get gateways(): (URL)[] { } let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"); @@ -150765,7 +159148,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -150856,7 +159240,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"); @@ -150928,7 +159313,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -151282,7 +159668,8 @@ get gateways(): (URL)[] { } let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/did#service\\"); @@ -151350,7 +159737,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -151441,7 +159829,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/did#service\\"); @@ -151513,7 +159902,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -152912,7 +161302,7 @@ get gateways(): (URL)[] { instance.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = _3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; const _axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); let _axq166E2eZADq34V4MYUc8KMZdC_publicKey__array = values[\\"https://w3id.org/security#publicKey\\"]; @@ -152953,7 +161343,7 @@ get gateways(): (URL)[] { instance.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = _axq166E2eZADq34V4MYUc8KMZdC_publicKey; const _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); let _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod__array = values[\\"https://w3id.org/security#assertionMethod\\"]; @@ -153052,7 +161442,7 @@ get gateways(): (URL)[] { instance.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); let _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox__array = values[\\"http://www.w3.org/ns/ldp#inbox\\"]; @@ -153099,7 +161489,7 @@ get gateways(): (URL)[] { instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; const _41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); let _41QwhqJouoLg3h8dRPKat21brynC_outbox__array = values[\\"https://www.w3.org/ns/activitystreams#outbox\\"]; @@ -153146,7 +161536,7 @@ get gateways(): (URL)[] { instance.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = _41QwhqJouoLg3h8dRPKat21brynC_outbox; const _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); let _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following__array = values[\\"https://www.w3.org/ns/activitystreams#following\\"]; @@ -153187,7 +161577,7 @@ get gateways(): (URL)[] { instance.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; const _BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); let _BBCTgfphhsFzpVfKTykGSpBNwoA_followers__array = values[\\"https://www.w3.org/ns/activitystreams#followers\\"]; @@ -153228,7 +161618,7 @@ get gateways(): (URL)[] { instance.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = _BBCTgfphhsFzpVfKTykGSpBNwoA_followers; const _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); let _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked__array = values[\\"https://www.w3.org/ns/activitystreams#liked\\"]; @@ -153269,7 +161659,7 @@ get gateways(): (URL)[] { instance.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; const _4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); let _4N1vBJzXDf8NbBumeECQMFvKetja_featured__array = values[\\"http://joinmastodon.org/ns#featured\\"]; @@ -153310,7 +161700,7 @@ get gateways(): (URL)[] { instance.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = _4N1vBJzXDf8NbBumeECQMFvKetja_featured; const _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); let _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags__array = values[\\"http://joinmastodon.org/ns#featuredTags\\"]; @@ -153351,7 +161741,7 @@ get gateways(): (URL)[] { instance.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; const _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); let _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections__array = values[\\"https://w3id.org/fep/7aa9#featuredCollections\\"]; @@ -153392,7 +161782,7 @@ get gateways(): (URL)[] { instance.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); let _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams__array = values[\\"https://www.w3.org/ns/activitystreams#streams\\"]; @@ -153581,7 +161971,7 @@ get gateways(): (URL)[] { instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); let _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array = values[\\"https://www.w3.org/ns/activitystreams#movedTo\\"]; @@ -153639,7 +162029,7 @@ get gateways(): (URL)[] { instance.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); let _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array = values[\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"]; @@ -153697,7 +162087,7 @@ get gateways(): (URL)[] { instance.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; const _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); let _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service__array = values[\\"https://www.w3.org/ns/did#service\\"]; @@ -154564,10 +162954,34 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} ); } - if (Array.isArray(values.contents) && - values.contents.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.contents)) { + const array = values.contents; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.contents; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = values.contents.slice(); + this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = copied; } else { throw new TypeError( @@ -154647,7 +163061,8 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} options ); copyPortableProvenance(this, clone); - clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.slice(); + clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.length < vocabSparseArrayMinimumLength + ? this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.slice() : vocabCopyPropertyArray(this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content); if (\\"content\\" in values && values.content != null) { if (typeof values.content === \\"string\\" || values.content instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -154671,10 +163086,34 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} ); } - if (Array.isArray(values.contents) && - values.contents.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.contents)) { + const array = values.contents; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.contents; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = values.contents.slice(); + clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = copied; } else { throw new TypeError( @@ -154683,7 +163122,8 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} ); } } - clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.slice(); + clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.length < vocabSparseArrayMinimumLength + ? this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.slice() : vocabCopyPropertyArray(this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType); if (\\"mediaType\\" in values && values.mediaType != null) { if (typeof values.mediaType === \\"string\\") { // @ts-ignore: type is checked above. @@ -154722,6 +163162,12 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -155455,6 +163901,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -155965,6 +164417,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -156399,10 +164857,34 @@ formerTypes?: (\$EntityType)[];deleted?: Temporal.Instant | null;} ); } - if (Array.isArray(values.formerTypes) && - values.formerTypes.every(v => isEntityType(v))) { + let copied!: (\$EntityType)[]; + let valid = false; + if (Array.isArray(values.formerTypes)) { + const array = values.formerTypes; + const test = (v: \$EntityType): boolean => isEntityType(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.formerTypes; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = values.formerTypes.slice(); + this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = copied; } else { throw new TypeError( @@ -156491,7 +164973,8 @@ formerTypes?: (\$EntityType)[];deleted?: Temporal.Instant | null;} // @ts-ignore: \$warning is not recognized as a property, but it is. options = { ...options, \$warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Tombstone;clone.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.slice(); + const clone = super.clone(values, options) as unknown as Tombstone;clone.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length < vocabSparseArrayMinimumLength + ? this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.slice() : vocabCopyPropertyArray(this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType); if (\\"formerType\\" in values && values.formerType != null) { if (isEntityType(values.formerType)) { // @ts-ignore: type is checked above. @@ -156515,10 +164998,34 @@ formerTypes?: (\$EntityType)[];deleted?: Temporal.Instant | null;} ); } - if (Array.isArray(values.formerTypes) && - values.formerTypes.every(v => isEntityType(v))) { + let copied!: (\$EntityType)[]; + let valid = false; + if (Array.isArray(values.formerTypes)) { + const array = values.formerTypes; + const test = (v: \$EntityType): boolean => isEntityType(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.formerTypes; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = values.formerTypes.slice(); + clone.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = copied; } else { throw new TypeError( @@ -156527,7 +165034,8 @@ formerTypes?: (\$EntityType)[];deleted?: Temporal.Instant | null;} ); } } - clone.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.slice(); + clone.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.length < vocabSparseArrayMinimumLength + ? this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.slice() : vocabCopyPropertyArray(this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted); if (\\"deleted\\" in values && values.deleted != null) { if (isTemporalInstant(values.deleted)) { // @ts-ignore: type is checked above. @@ -156566,6 +165074,12 @@ formerTypes?: (\$EntityType)[];deleted?: Temporal.Instant | null;} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -157331,6 +165845,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -157846,6 +166366,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -158359,6 +166885,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -158855,6 +167387,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -159377,6 +167915,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 3d3ccda38..99a4f37d2 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -80,6 +80,200 @@ function inspectIri(iri: URL): string { try { return formatIri(iri); } catch { return iri.href; } } +interface VocabSparseArraySnapshot { + length: number; + indices: number[]; +} + +interface VocabArrayValidation { + valid: boolean; + sparse: boolean; +} + +type VocabArrayCopy = { ok: true; array: T[] } | { ok: false }; + +// Most fields have no trusted prefix. Keep that metadata on the existing Set +// so empty fields need neither another object nor another instance slot. +const vocabTrustPrefix: unique symbol = Symbol(\\"vocabulary trust prefix\\"); +type VocabTrustSet = Set & { [vocabTrustPrefix]?: number }; + +function vocabSetTrustPrefix(trust: VocabTrustSet, prefix: number): void { + if (prefix > 0) trust[vocabTrustPrefix] = prefix; +} + +function vocabCopyTrustSet( + trust: VocabTrustSet, + destination: VocabTrustSet, +): VocabTrustSet { + // clone() already constructed the destination. Reuse its empty Set only + // when constructor defaults cannot contribute trust to the copied field. + const copy: VocabTrustSet = trust !== destination && trust.size === 0 && + destination.size === 0 && destination[vocabTrustPrefix] == null + ? destination : new Set(trust); + const prefix = trust[vocabTrustPrefix]; + if (prefix != null && prefix > 0) copy[vocabTrustPrefix] = prefix; + return copy; +} + +// These thresholds select an optimization, not a limit on property arrays. +const vocabSparseArrayMinimumLength = 4096; +const vocabSparseArrayProbeCount = 8; +const vocabSparseArrayPresentProbeLimit = 4; +const vocabArrayPrototype = Array.prototype; +const vocabObjectPrototype = globalThis.Object.prototype; +const vocabArrayDescriptors = [\\"constructor\\", \\"every\\", \\"slice\\"].map( + key => globalThis.Object.getOwnPropertyDescriptor(vocabArrayPrototype, key), +); +const vocabArraySpeciesDescriptor = globalThis.Object.getOwnPropertyDescriptor( + Array, Symbol.species, +); + +function vocabSameArrayDescriptor( + actual: PropertyDescriptor | undefined, + expected: PropertyDescriptor | undefined, +): boolean { + return actual?.value === expected?.value && actual?.get === expected?.get && + actual?.set === expected?.set && actual?.writable === expected?.writable && + actual?.enumerable === expected?.enumerable && + actual?.configurable === expected?.configurable; +} + +function vocabArrayIndex(key: string): number | undefined { + const index = Number(key); + return Number.isInteger(index) && index >= 0 && index < 0xffffffff && + String(index) === key + ? index + : undefined; +} + +function vocabSparseArraySnapshot( + array: unknown[], +): VocabSparseArraySnapshot | undefined { + if (!Array.isArray(array)) return undefined; + const length = array.length; + // Small dense fields take no prototype or key-enumeration overhead. + if (length < vocabSparseArrayMinimumLength) return undefined; + if (!Number.isInteger(length) || length > 0xffffffff || + globalThis.Object.getPrototypeOf(array) !== vocabArrayPrototype || + globalThis.Object.getPrototypeOf(vocabArrayPrototype) !== + vocabObjectPrototype || + globalThis.Object.getPrototypeOf(vocabObjectPrototype) !== null) { + return undefined; + } + const methods = [\\"constructor\\", \\"every\\", \\"slice\\"]; + for (let i = 0; i < methods.length; i++) { + const key = methods[i]; + if (globalThis.Object.hasOwn(array, key) || + !vocabSameArrayDescriptor( + globalThis.Object.getOwnPropertyDescriptor(vocabArrayPrototype, key), + vocabArrayDescriptors[i], + )) return undefined; + } + if (!vocabSameArrayDescriptor( + globalThis.Object.getOwnPropertyDescriptor(Array, Symbol.species), + vocabArraySpeciesDescriptor, + )) return undefined; + + // Descriptor probes do not invoke element getters. Plainly dense arrays + // keep native iteration without enumerating all their keys. + let present = 0; + for (let i = 0; i < vocabSparseArrayProbeCount; i++) { + const index = Math.floor(i * (length - 1) / (vocabSparseArrayProbeCount - 1)); + if (globalThis.Object.getOwnPropertyDescriptor(array, index) != null && + ++present >= vocabSparseArrayPresentProbeLimit) return undefined; + } + for (const prototype of [vocabArrayPrototype, vocabObjectPrototype]) { + for (const key of globalThis.Object.getOwnPropertyNames(prototype)) { + if (vocabArrayIndex(key) != null) return undefined; + } + } + const indices: number[] = []; + for (const key of globalThis.Object.getOwnPropertyNames(array)) { + const index = vocabArrayIndex(key); + if (index != null && index < length) indices.push(index); + } + if (indices.length >= length / 2) return undefined; + for (const index of indices) { + const descriptor = globalThis.Object.getOwnPropertyDescriptor(array, index); + if (descriptor == null || !(\\"value\\" in descriptor)) return undefined; + } + // Ordinary array keys already have canonical index order. This guard is + // not a Proxy detector; reflection traps and errors remain observable. + return { length, indices }; +} + +function vocabValidatePropertyArray( + array: T[], + test: (value: T) => boolean, +): VocabArrayValidation { + const snapshot = vocabSparseArraySnapshot(array); + if (snapshot == null) return { valid: array.every(test), sparse: false }; + for (const index of snapshot.indices) { + if (globalThis.Object.hasOwn(array, index) && !test(array[index])) { + return { valid: false, sparse: true }; + } + } + return { valid: true, sparse: true }; +} + +function vocabDefineArrayEntry(array: T[], index: number, value: T): void { + globalThis.Object.defineProperty(array, index, { + value, writable: true, enumerable: true, configurable: true, + }); +} + +function vocabCopySparsePropertyArray( + array: T[], + snapshot: VocabSparseArraySnapshot, + test?: (value: T) => boolean, +): VocabArrayCopy { + const copy: T[] = []; + // Seed dictionary storage before low indices or the final length can + // allocate storage for every hole. The temporary entry stays private. + if (snapshot.indices[snapshot.indices.length - 1] !== snapshot.length - 1) { + globalThis.Object.defineProperty(copy, snapshot.length - 1, { + value: undefined, writable: true, enumerable: true, configurable: true, + }); + delete copy[snapshot.length - 1]; + } + for (const index of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, index)) continue; + const value = array[index]; + if (test != null && !test(value)) return { ok: false }; + vocabDefineArrayEntry(copy, index, value); + } + // A validation callback may have deleted the last snapshot entry. + if (copy.length < snapshot.length) { + globalThis.Object.defineProperty(copy, snapshot.length - 1, { + value: undefined, writable: true, enumerable: true, configurable: true, + }); + delete copy[snapshot.length - 1]; + } + copy.length = snapshot.length; + return { ok: true, array: copy }; +} + +function vocabCopyPropertyArray(array: T[]): T[] { + const snapshot = vocabSparseArraySnapshot(array); + if (snapshot == null) return array.slice(); + const copied = vocabCopySparsePropertyArray(array, snapshot); + // Without a predicate the private copy cannot fail validation. + return (copied as { ok: true; array: T[] }).array; +} + +function vocabCopyValidatedPropertyArray( + array: T[], + test: (value: T) => boolean, + previous: VocabArrayValidation, +): VocabArrayCopy { + const snapshot = vocabSparseArraySnapshot(array); + if (snapshot != null) return vocabCopySparsePropertyArray(array, snapshot, test); + // Sparse validation may have changed the next input's density, descriptors + // or prototype. Validate that native-copy input before falling back. + if (previous.sparse && !array.every(test)) return { ok: false }; + return { ok: true, array: array.slice() }; +} + interface DeepCloneContext { value(value: T): T; } @@ -334,87 +528,87 @@ export class Object { } #_49BipA5dq9eoH8LX8xdsVumveTca_attachment: (Object | Link | PropertyValue | URL)[] = []; - #_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment: Set = new Set(); + #_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment: VocabTrustSet = new Set(); #_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo: Set = new Set(); + #_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo: VocabTrustSet = new Set(); #_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience: (Object | URL)[] = []; - #_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience: Set = new Set(); + #_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience: VocabTrustSet = new Set(); #_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content: ((string | LanguageString))[] = []; #_3mhZzGXSpQ431mBSz2kvych22v4e_context: (Object | Link | URL)[] = []; - #_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context: Set = new Set(); + #_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context: VocabTrustSet = new Set(); #_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name: ((string | LanguageString))[] = []; #_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime: (Temporal.Instant)[] = []; #_86xFhmgBapoMvYqjbjRuDPayTrS_generator: (Object | Link | URL)[] = []; - #_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator: Set = new Set(); + #_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator: VocabTrustSet = new Set(); #_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon: (Image | URL)[] = []; - #_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon: Set = new Set(); + #_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon: VocabTrustSet = new Set(); #_3dXrUdkARxwyJLtJcYi1AJ92H41U_image: (Image | URL)[] = []; - #_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image: Set = new Set(); + #_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image: VocabTrustSet = new Set(); #_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo: (Object | Link | URL)[] = []; - #_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo: Set = new Set(); + #_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo: VocabTrustSet = new Set(); #_31k5MUZJsnsPNg8dQQJieWaXTFnR_location: (Object | Link | URL)[] = []; - #_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location: Set = new Set(); + #_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location: VocabTrustSet = new Set(); #_gCVTegXxWWCw6wWRxa1QF65zusg_preview: (Link | Object | URL)[] = []; - #_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: Set = new Set(); + #_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: VocabTrustSet = new Set(); #_5e258TDXtuhaFRPZiGoDfEpjdMr_published: (Temporal.Instant)[] = []; #_7UpwM3JWcXhADcscukEehBorf6k_replies: (Collection | URL)[] = []; - #_trust_7UpwM3JWcXhADcscukEehBorf6k_replies: Set = new Set(); + #_trust_7UpwM3JWcXhADcscukEehBorf6k_replies: VocabTrustSet = new Set(); #_3kAfck9PcEYt2L7xug5y99YPbANs_shares: (Collection | URL)[] = []; - #_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares: Set = new Set(); + #_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares: VocabTrustSet = new Set(); #_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes: (Collection | URL)[] = []; - #_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes: Set = new Set(); + #_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes: VocabTrustSet = new Set(); #_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions: (Collection | URL)[] = []; - #_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions: Set = new Set(); + #_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions: VocabTrustSet = new Set(); #_2w3Jmue4up8iVDUA51WZqomEF438_startTime: (Temporal.Instant)[] = []; #_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary: ((string | LanguageString))[] = []; #_5chuqj6s95p5gg2sk1HntGfarRf_tag: (Object | Link | URL)[] = []; - #_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag: Set = new Set(); + #_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag: VocabTrustSet = new Set(); #_385aB7ySixcf5Un6z3VsWmThgCzQ_updated: (Temporal.Instant)[] = []; #_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url: ((URL | Link))[] = []; #_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to: (Object | URL)[] = []; - #_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to: Set = new Set(); + #_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to: VocabTrustSet = new Set(); #_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto: (Object | URL)[] = []; - #_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto: Set = new Set(); + #_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto: VocabTrustSet = new Set(); #_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc: (Object | URL)[] = []; - #_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc: Set = new Set(); + #_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc: VocabTrustSet = new Set(); #_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc: (Object | URL)[] = []; - #_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc: Set = new Set(); + #_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc: VocabTrustSet = new Set(); #_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType: (string)[] = []; #_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration: (Temporal.Duration)[] = []; #_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive: (boolean)[] = []; #_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source: (Source)[] = []; #_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof: (DataIntegrityProof | URL)[] = []; - #_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof: Set = new Set(); + #_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof: VocabTrustSet = new Set(); #_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy: (InteractionPolicy)[] = []; #_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy: (URL)[] = []; #_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization: (LikeAuthorization | URL)[] = []; - #_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization: Set = new Set(); + #_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization: VocabTrustSet = new Set(); #_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization: (ReplyAuthorization | URL)[] = []; - #_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization: Set = new Set(); + #_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization: VocabTrustSet = new Set(); #_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization: (AnnounceAuthorization | URL)[] = []; - #_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization: Set = new Set(); + #_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization: VocabTrustSet = new Set(); #_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations: (Translation)[] = []; #_2rzkBRS4gNPrkJk9DohHAMUAxA2d: (URL)[] = []; @@ -474,14 +668,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (\\"attachments\\" in values && values.attachments != null) { - if (Array.isArray(values.attachments) && - values.attachments.every(v => v instanceof Object || v instanceof Link || v instanceof PropertyValue || v instanceof URL)) { + let copied!: (Object | Link | PropertyValue | URL)[]; + let valid = false; + if (Array.isArray(values.attachments)) { + const array = values.attachments; + const test = (v: Object | Link | PropertyValue | URL): boolean => v instanceof Object || v instanceof Link || v instanceof PropertyValue || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.attachments; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = values.attachments.slice(); + this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = copied; - for (let i = 0; i < values.attachments.length; i++) { - this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.add(i); - } + vocabSetTrustPrefix(this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment, this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length); } else { throw new TypeError( @@ -514,14 +730,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.attributions) && - values.attributions.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.attributions)) { + const array = values.attributions; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.attributions; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = values.attributions.slice(); + this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = copied; - for (let i = 0; i < values.attributions.length; i++) { - this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.add(i); - } + vocabSetTrustPrefix(this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo, this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length); } else { throw new TypeError( @@ -554,14 +792,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.audiences) && - values.audiences.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.audiences)) { + const array = values.audiences; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.audiences; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = values.audiences.slice(); + this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = copied; - for (let i = 0; i < values.audiences.length; i++) { - this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.add(i); - } + vocabSetTrustPrefix(this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience, this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length); } else { throw new TypeError( @@ -594,10 +854,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.contents) && - values.contents.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.contents)) { + const array = values.contents; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.contents; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = values.contents.slice(); + this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = copied; } else { throw new TypeError( @@ -609,14 +893,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (\\"contexts\\" in values && values.contexts != null) { - if (Array.isArray(values.contexts) && - values.contexts.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.contexts)) { + const array = values.contexts; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.contexts; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context = values.contexts.slice(); + this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context = copied; - for (let i = 0; i < values.contexts.length; i++) { - this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.add(i); - } + vocabSetTrustPrefix(this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context, this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.length); } else { throw new TypeError( @@ -649,10 +955,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.names) && - values.names.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.names)) { + const array = values.names; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.names; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = values.names.slice(); + this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = copied; } else { throw new TypeError( @@ -677,14 +1007,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (\\"generators\\" in values && values.generators != null) { - if (Array.isArray(values.generators) && - values.generators.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.generators)) { + const array = values.generators; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.generators; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = values.generators.slice(); + this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = copied; - for (let i = 0; i < values.generators.length; i++) { - this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.add(i); - } + vocabSetTrustPrefix(this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator, this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.length); } else { throw new TypeError( @@ -717,14 +1069,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.icons) && - values.icons.every(v => v instanceof Image || v instanceof URL)) { + let copied!: (Image | URL)[]; + let valid = false; + if (Array.isArray(values.icons)) { + const array = values.icons; + const test = (v: Image | URL): boolean => v instanceof Image || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.icons; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = values.icons.slice(); + this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = copied; - for (let i = 0; i < values.icons.length; i++) { - this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.add(i); - } + vocabSetTrustPrefix(this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon, this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length); } else { throw new TypeError( @@ -757,14 +1131,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.images) && - values.images.every(v => v instanceof Image || v instanceof URL)) { + let copied!: (Image | URL)[]; + let valid = false; + if (Array.isArray(values.images)) { + const array = values.images; + const test = (v: Image | URL): boolean => v instanceof Image || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.images; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = values.images.slice(); + this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = copied; - for (let i = 0; i < values.images.length; i++) { - this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.add(i); - } + vocabSetTrustPrefix(this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image, this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length); } else { throw new TypeError( @@ -797,14 +1193,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.replyTargets) && - values.replyTargets.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.replyTargets)) { + const array = values.replyTargets; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.replyTargets; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = values.replyTargets.slice(); + this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = copied; - for (let i = 0; i < values.replyTargets.length; i++) { - this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.add(i); - } + vocabSetTrustPrefix(this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo, this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length); } else { throw new TypeError( @@ -837,14 +1255,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.locations) && - values.locations.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.locations)) { + const array = values.locations; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.locations; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = values.locations.slice(); + this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = copied; - for (let i = 0; i < values.locations.length; i++) { - this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.add(i); - } + vocabSetTrustPrefix(this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location, this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length); } else { throw new TypeError( @@ -877,14 +1317,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.previews) && - values.previews.every(v => v instanceof Link || v instanceof Object || v instanceof URL)) { + let copied!: (Link | Object | URL)[]; + let valid = false; + if (Array.isArray(values.previews)) { + const array = values.previews; + const test = (v: Link | Object | URL): boolean => v instanceof Link || v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.previews; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = values.previews.slice(); + this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = copied; - for (let i = 0; i < values.previews.length; i++) { - this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.add(i); - } + vocabSetTrustPrefix(this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length); } else { throw new TypeError( @@ -995,10 +1457,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.summaries) && - values.summaries.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.summaries)) { + const array = values.summaries; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.summaries; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = values.summaries.slice(); + this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = copied; } else { throw new TypeError( @@ -1010,14 +1496,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (\\"tags\\" in values && values.tags != null) { - if (Array.isArray(values.tags) && - values.tags.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.tags)) { + const array = values.tags; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.tags; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = values.tags.slice(); + this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = copied; - for (let i = 0; i < values.tags.length; i++) { - this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.add(i); - } + vocabSetTrustPrefix(this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag, this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.length); } else { throw new TypeError( @@ -1063,10 +1571,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.urls) && - values.urls.every(v => v instanceof URL || v instanceof Link)) { + let copied!: (URL | Link)[]; + let valid = false; + if (Array.isArray(values.urls)) { + const array = values.urls; + const test = (v: URL | Link): boolean => v instanceof URL || v instanceof Link; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.urls; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = values.urls.slice(); + this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = copied; } else { throw new TypeError( @@ -1099,14 +1631,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.tos) && - values.tos.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.tos)) { + const array = values.tos; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.tos; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = values.tos.slice(); + this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = copied; - for (let i = 0; i < values.tos.length; i++) { - this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.add(i); - } + vocabSetTrustPrefix(this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to, this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length); } else { throw new TypeError( @@ -1139,14 +1693,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.btos) && - values.btos.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.btos)) { + const array = values.btos; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.btos; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = values.btos.slice(); + this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = copied; - for (let i = 0; i < values.btos.length; i++) { - this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.add(i); - } + vocabSetTrustPrefix(this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto, this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length); } else { throw new TypeError( @@ -1179,14 +1755,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.ccs) && - values.ccs.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.ccs)) { + const array = values.ccs; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.ccs; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = values.ccs.slice(); + this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = copied; - for (let i = 0; i < values.ccs.length; i++) { - this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.add(i); - } + vocabSetTrustPrefix(this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc, this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length); } else { throw new TypeError( @@ -1219,14 +1817,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.bccs) && - values.bccs.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.bccs)) { + const array = values.bccs; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.bccs; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = values.bccs.slice(); + this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = copied; - for (let i = 0; i < values.bccs.length; i++) { - this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.add(i); - } + vocabSetTrustPrefix(this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc, this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length); } else { throw new TypeError( @@ -1311,14 +1931,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.proofs) && - values.proofs.every(v => v instanceof DataIntegrityProof || v instanceof URL)) { + let copied!: (DataIntegrityProof | URL)[]; + let valid = false; + if (Array.isArray(values.proofs)) { + const array = values.proofs; + const test = (v: DataIntegrityProof | URL): boolean => v instanceof DataIntegrityProof || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.proofs; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = values.proofs.slice(); + this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = copied; - for (let i = 0; i < values.proofs.length; i++) { - this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.add(i); - } + vocabSetTrustPrefix(this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof, this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length); } else { throw new TypeError( @@ -1395,10 +2037,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (\\"translations\\" in values && values.translations != null) { - if (Array.isArray(values.translations) && - values.translations.every(v => v instanceof Translation)) { + let copied!: (Translation)[]; + let valid = false; + if (Array.isArray(values.translations)) { + const array = values.translations; + const test = (v: Translation): boolean => v instanceof Translation; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.translations; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations = values.translations.slice(); + this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations = copied; } else { throw new TypeError( @@ -1410,10 +2076,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (\\"licenses\\" in values && values.licenses != null) { - if (Array.isArray(values.licenses) && - values.licenses.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.licenses)) { + const array = values.licenses; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.licenses; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = values.licenses.slice(); + this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = copied; } else { throw new TypeError( @@ -1495,18 +2185,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu options ); copyPortableProvenance(this, clone); - clone.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.slice();clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment = new Set(this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment); + clone.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length < vocabSparseArrayMinimumLength + ? this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.slice() : vocabCopyPropertyArray(this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment);clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment = vocabCopyTrustSet( + this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment, clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment, + ); if (\\"attachments\\" in values && values.attachments != null) { - if (Array.isArray(values.attachments) && - values.attachments.every(v => v instanceof Object || v instanceof Link || v instanceof PropertyValue || v instanceof URL)) { + let copied!: (Object | Link | PropertyValue | URL)[]; + let valid = false; + if (Array.isArray(values.attachments)) { + const array = values.attachments; + const test = (v: Object | Link | PropertyValue | URL): boolean => v instanceof Object || v instanceof Link || v instanceof PropertyValue || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.attachments; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = values.attachments.slice(); + clone.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = copied; clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment = new Set(); - for (let i = 0; i < values.attachments.length; i++) { - clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.add(i); - } + vocabSetTrustPrefix(clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment, clone.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length); } else { throw new TypeError( @@ -1515,12 +2230,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.slice();clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = new Set(this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo); + clone.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length < vocabSparseArrayMinimumLength + ? this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.slice() : vocabCopyPropertyArray(this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo);clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = vocabCopyTrustSet( + this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo, clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo, + ); if (\\"attribution\\" in values && values.attribution != null) { if (values.attribution instanceof Application || values.attribution instanceof Group || values.attribution instanceof Organization || values.attribution instanceof Person || values.attribution instanceof Service || values.attribution instanceof URL) { // @ts-ignore: type is checked above. clone.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = [values.attribution]; - clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = new Set([0]); + clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = new Set(); + clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The attribution must be of type \\" + @@ -1539,15 +2258,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.attributions) && - values.attributions.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.attributions)) { + const array = values.attributions; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.attributions; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = values.attributions.slice(); + clone.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = copied; clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = new Set(); - for (let i = 0; i < values.attributions.length; i++) { - clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.add(i); - } + vocabSetTrustPrefix(clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo, clone.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length); } else { throw new TypeError( @@ -1556,12 +2297,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.slice();clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = new Set(this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience); + clone.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length < vocabSparseArrayMinimumLength + ? this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.slice() : vocabCopyPropertyArray(this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience);clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = vocabCopyTrustSet( + this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience, clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience, + ); if (\\"audience\\" in values && values.audience != null) { if (values.audience instanceof Object || values.audience instanceof URL) { // @ts-ignore: type is checked above. clone.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = [values.audience]; - clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = new Set([0]); + clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = new Set(); + clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The audience must be of type \\" + @@ -1580,15 +2325,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.audiences) && - values.audiences.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.audiences)) { + const array = values.audiences; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.audiences; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = values.audiences.slice(); + clone.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = copied; clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = new Set(); - for (let i = 0; i < values.audiences.length; i++) { - clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience, clone.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length); } else { throw new TypeError( @@ -1597,7 +2364,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.slice(); + clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.length < vocabSparseArrayMinimumLength + ? this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.slice() : vocabCopyPropertyArray(this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content); if (\\"content\\" in values && values.content != null) { if (typeof values.content === \\"string\\" || values.content instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -1621,10 +2389,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.contents) && - values.contents.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.contents)) { + const array = values.contents; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.contents; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = values.contents.slice(); + clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = copied; } else { throw new TypeError( @@ -1633,18 +2425,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3mhZzGXSpQ431mBSz2kvych22v4e_context = this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.slice();clone.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context = new Set(this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context); + clone.#_3mhZzGXSpQ431mBSz2kvych22v4e_context = this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.length < vocabSparseArrayMinimumLength + ? this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.slice() : vocabCopyPropertyArray(this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context);clone.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context = vocabCopyTrustSet( + this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context, clone.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context, + ); if (\\"contexts\\" in values && values.contexts != null) { - if (Array.isArray(values.contexts) && - values.contexts.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.contexts)) { + const array = values.contexts; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.contexts; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3mhZzGXSpQ431mBSz2kvych22v4e_context = values.contexts.slice(); + clone.#_3mhZzGXSpQ431mBSz2kvych22v4e_context = copied; clone.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context = new Set(); - for (let i = 0; i < values.contexts.length; i++) { - clone.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context, clone.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.length); } else { throw new TypeError( @@ -1653,7 +2470,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice(); + clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.length < vocabSparseArrayMinimumLength + ? this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice() : vocabCopyPropertyArray(this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name); if (\\"name\\" in values && values.name != null) { if (typeof values.name === \\"string\\" || values.name instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -1677,10 +2495,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.names) && - values.names.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.names)) { + const array = values.names; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.names; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = values.names.slice(); + clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = copied; } else { throw new TypeError( @@ -1689,7 +2531,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime = this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime.slice(); + clone.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime = this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime.length < vocabSparseArrayMinimumLength + ? this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime.slice() : vocabCopyPropertyArray(this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime); if (\\"endTime\\" in values && values.endTime != null) { if (isTemporalInstant(values.endTime)) { // @ts-ignore: type is checked above. @@ -1702,18 +2545,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.slice();clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator = new Set(this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator); + clone.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.length < vocabSparseArrayMinimumLength + ? this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.slice() : vocabCopyPropertyArray(this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator);clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator = vocabCopyTrustSet( + this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator, clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator, + ); if (\\"generators\\" in values && values.generators != null) { - if (Array.isArray(values.generators) && - values.generators.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.generators)) { + const array = values.generators; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.generators; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = values.generators.slice(); + clone.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = copied; clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator = new Set(); - for (let i = 0; i < values.generators.length; i++) { - clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.add(i); - } + vocabSetTrustPrefix(clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator, clone.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.length); } else { throw new TypeError( @@ -1722,12 +2590,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.slice();clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = new Set(this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon); + clone.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length < vocabSparseArrayMinimumLength + ? this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.slice() : vocabCopyPropertyArray(this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon);clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = vocabCopyTrustSet( + this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon, clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon, + ); if (\\"icon\\" in values && values.icon != null) { if (values.icon instanceof Image || values.icon instanceof URL) { // @ts-ignore: type is checked above. clone.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = [values.icon]; - clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = new Set([0]); + clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = new Set(); + clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The icon must be of type \\" + @@ -1746,15 +2618,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.icons) && - values.icons.every(v => v instanceof Image || v instanceof URL)) { + let copied!: (Image | URL)[]; + let valid = false; + if (Array.isArray(values.icons)) { + const array = values.icons; + const test = (v: Image | URL): boolean => v instanceof Image || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.icons; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = values.icons.slice(); + clone.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = copied; clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = new Set(); - for (let i = 0; i < values.icons.length; i++) { - clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.add(i); - } + vocabSetTrustPrefix(clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon, clone.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length); } else { throw new TypeError( @@ -1763,12 +2657,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.slice();clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = new Set(this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image); + clone.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length < vocabSparseArrayMinimumLength + ? this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.slice() : vocabCopyPropertyArray(this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image);clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = vocabCopyTrustSet( + this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image, clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image, + ); if (\\"image\\" in values && values.image != null) { if (values.image instanceof Image || values.image instanceof URL) { // @ts-ignore: type is checked above. clone.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = [values.image]; - clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = new Set([0]); + clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = new Set(); + clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The image must be of type \\" + @@ -1787,15 +2685,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.images) && - values.images.every(v => v instanceof Image || v instanceof URL)) { + let copied!: (Image | URL)[]; + let valid = false; + if (Array.isArray(values.images)) { + const array = values.images; + const test = (v: Image | URL): boolean => v instanceof Image || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.images; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = values.images.slice(); + clone.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = copied; clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = new Set(); - for (let i = 0; i < values.images.length; i++) { - clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image, clone.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length); } else { throw new TypeError( @@ -1804,12 +2724,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.slice();clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = new Set(this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo); + clone.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length < vocabSparseArrayMinimumLength + ? this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.slice() : vocabCopyPropertyArray(this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo);clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = vocabCopyTrustSet( + this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo, clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo, + ); if (\\"replyTarget\\" in values && values.replyTarget != null) { if (values.replyTarget instanceof Object || values.replyTarget instanceof Link || values.replyTarget instanceof URL) { // @ts-ignore: type is checked above. clone.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = [values.replyTarget]; - clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = new Set([0]); + clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = new Set(); + clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The replyTarget must be of type \\" + @@ -1828,15 +2752,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.replyTargets) && - values.replyTargets.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.replyTargets)) { + const array = values.replyTargets; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.replyTargets; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = values.replyTargets.slice(); + clone.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = copied; clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = new Set(); - for (let i = 0; i < values.replyTargets.length; i++) { - clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo, clone.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length); } else { throw new TypeError( @@ -1845,12 +2791,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.slice();clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = new Set(this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location); + clone.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length < vocabSparseArrayMinimumLength + ? this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.slice() : vocabCopyPropertyArray(this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location);clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = vocabCopyTrustSet( + this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location, clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location, + ); if (\\"location\\" in values && values.location != null) { if (values.location instanceof Object || values.location instanceof Link || values.location instanceof URL) { // @ts-ignore: type is checked above. clone.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = [values.location]; - clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = new Set([0]); + clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = new Set(); + clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The location must be of type \\" + @@ -1869,15 +2819,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.locations) && - values.locations.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.locations)) { + const array = values.locations; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.locations; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = values.locations.slice(); + clone.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = copied; clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = new Set(); - for (let i = 0; i < values.locations.length; i++) { - clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.add(i); - } + vocabSetTrustPrefix(clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location, clone.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length); } else { throw new TypeError( @@ -1886,12 +2858,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.slice();clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = new Set(this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview); + clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length < vocabSparseArrayMinimumLength + ? this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.slice() : vocabCopyPropertyArray(this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview);clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = vocabCopyTrustSet( + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, + ); if (\\"preview\\" in values && values.preview != null) { if (values.preview instanceof Link || values.preview instanceof Object || values.preview instanceof URL) { // @ts-ignore: type is checked above. clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = [values.preview]; - clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = new Set([0]); + clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = new Set(); + clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The preview must be of type \\" + @@ -1910,15 +2886,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.previews) && - values.previews.every(v => v instanceof Link || v instanceof Object || v instanceof URL)) { + let copied!: (Link | Object | URL)[]; + let valid = false; + if (Array.isArray(values.previews)) { + const array = values.previews; + const test = (v: Link | Object | URL): boolean => v instanceof Link || v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.previews; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = values.previews.slice(); + clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = copied; clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = new Set(); - for (let i = 0; i < values.previews.length; i++) { - clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.add(i); - } + vocabSetTrustPrefix(clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length); } else { throw new TypeError( @@ -1927,7 +2925,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published = this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published.slice(); + clone.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published = this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published.length < vocabSparseArrayMinimumLength + ? this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published.slice() : vocabCopyPropertyArray(this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published); if (\\"published\\" in values && values.published != null) { if (isTemporalInstant(values.published)) { // @ts-ignore: type is checked above. @@ -1940,12 +2939,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_7UpwM3JWcXhADcscukEehBorf6k_replies = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies.slice();clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies = new Set(this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies); + clone.#_7UpwM3JWcXhADcscukEehBorf6k_replies = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies.length < vocabSparseArrayMinimumLength + ? this.#_7UpwM3JWcXhADcscukEehBorf6k_replies.slice() : vocabCopyPropertyArray(this.#_7UpwM3JWcXhADcscukEehBorf6k_replies);clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies = vocabCopyTrustSet( + this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies, clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies, + ); if (\\"replies\\" in values && values.replies != null) { if (values.replies instanceof Collection || values.replies instanceof URL) { // @ts-ignore: type is checked above. clone.#_7UpwM3JWcXhADcscukEehBorf6k_replies = [values.replies]; - clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies = new Set([0]); + clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies = new Set(); + clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The replies must be of type \\" + @@ -1953,12 +2956,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.slice();clone.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares = new Set(this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares); + clone.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.length < vocabSparseArrayMinimumLength + ? this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.slice() : vocabCopyPropertyArray(this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares);clone.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares = vocabCopyTrustSet( + this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares, clone.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares, + ); if (\\"shares\\" in values && values.shares != null) { if (values.shares instanceof Collection || values.shares instanceof URL) { // @ts-ignore: type is checked above. clone.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares = [values.shares]; - clone.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares = new Set([0]); + clone.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares = new Set(); + clone.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The shares must be of type \\" + @@ -1966,12 +2973,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.slice();clone.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = new Set(this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes); + clone.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.length < vocabSparseArrayMinimumLength + ? this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.slice() : vocabCopyPropertyArray(this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes);clone.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = vocabCopyTrustSet( + this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes, clone.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes, + ); if (\\"likes\\" in values && values.likes != null) { if (values.likes instanceof Collection || values.likes instanceof URL) { // @ts-ignore: type is checked above. clone.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = [values.likes]; - clone.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = new Set([0]); + clone.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = new Set(); + clone.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The likes must be of type \\" + @@ -1979,12 +2990,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.slice();clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = new Set(this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions); + clone.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.length < vocabSparseArrayMinimumLength + ? this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.slice() : vocabCopyPropertyArray(this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions);clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = vocabCopyTrustSet( + this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions, clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions, + ); if (\\"emojiReactions\\" in values && values.emojiReactions != null) { if (values.emojiReactions instanceof Collection || values.emojiReactions instanceof URL) { // @ts-ignore: type is checked above. clone.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = [values.emojiReactions]; - clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = new Set([0]); + clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = new Set(); + clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The emojiReactions must be of type \\" + @@ -1992,7 +3007,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime = this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime.slice(); + clone.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime = this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime.length < vocabSparseArrayMinimumLength + ? this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime.slice() : vocabCopyPropertyArray(this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime); if (\\"startTime\\" in values && values.startTime != null) { if (isTemporalInstant(values.startTime)) { // @ts-ignore: type is checked above. @@ -2005,7 +3021,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary.slice(); + clone.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary.length < vocabSparseArrayMinimumLength + ? this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary.slice() : vocabCopyPropertyArray(this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary); if (\\"summary\\" in values && values.summary != null) { if (typeof values.summary === \\"string\\" || values.summary instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -2029,10 +3046,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.summaries) && - values.summaries.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.summaries)) { + const array = values.summaries; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.summaries; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = values.summaries.slice(); + clone.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = copied; } else { throw new TypeError( @@ -2041,18 +3082,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.slice();clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag = new Set(this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag); + clone.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.length < vocabSparseArrayMinimumLength + ? this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.slice() : vocabCopyPropertyArray(this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag);clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag = vocabCopyTrustSet( + this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag, clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag, + ); if (\\"tags\\" in values && values.tags != null) { - if (Array.isArray(values.tags) && - values.tags.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.tags)) { + const array = values.tags; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.tags; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = values.tags.slice(); + clone.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = copied; clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag = new Set(); - for (let i = 0; i < values.tags.length; i++) { - clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.add(i); - } + vocabSetTrustPrefix(clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag, clone.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.length); } else { throw new TypeError( @@ -2061,7 +3127,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated = this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated.slice(); + clone.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated = this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated.length < vocabSparseArrayMinimumLength + ? this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated.slice() : vocabCopyPropertyArray(this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated); if (\\"updated\\" in values && values.updated != null) { if (isTemporalInstant(values.updated)) { // @ts-ignore: type is checked above. @@ -2074,7 +3141,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.slice(); + clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length < vocabSparseArrayMinimumLength + ? this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.slice() : vocabCopyPropertyArray(this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url); if (\\"url\\" in values && values.url != null) { if (values.url instanceof URL || values.url instanceof Link) { // @ts-ignore: type is checked above. @@ -2098,10 +3166,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.urls) && - values.urls.every(v => v instanceof URL || v instanceof Link)) { + let copied!: (URL | Link)[]; + let valid = false; + if (Array.isArray(values.urls)) { + const array = values.urls; + const test = (v: URL | Link): boolean => v instanceof URL || v instanceof Link; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.urls; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = values.urls.slice(); + clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = copied; } else { throw new TypeError( @@ -2110,12 +3202,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.slice();clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = new Set(this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to); + clone.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length < vocabSparseArrayMinimumLength + ? this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.slice() : vocabCopyPropertyArray(this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to);clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = vocabCopyTrustSet( + this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to, clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to, + ); if (\\"to\\" in values && values.to != null) { if (values.to instanceof Object || values.to instanceof URL) { // @ts-ignore: type is checked above. clone.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = [values.to]; - clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = new Set([0]); + clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = new Set(); + clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The to must be of type \\" + @@ -2134,15 +3230,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.tos) && - values.tos.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.tos)) { + const array = values.tos; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.tos; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = values.tos.slice(); + clone.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = copied; clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = new Set(); - for (let i = 0; i < values.tos.length; i++) { - clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to, clone.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length); } else { throw new TypeError( @@ -2151,12 +3269,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.slice();clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = new Set(this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto); + clone.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length < vocabSparseArrayMinimumLength + ? this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.slice() : vocabCopyPropertyArray(this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto);clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = vocabCopyTrustSet( + this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto, clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto, + ); if (\\"bto\\" in values && values.bto != null) { if (values.bto instanceof Object || values.bto instanceof URL) { // @ts-ignore: type is checked above. clone.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = [values.bto]; - clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = new Set([0]); + clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = new Set(); + clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The bto must be of type \\" + @@ -2175,15 +3297,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.btos) && - values.btos.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.btos)) { + const array = values.btos; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.btos; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = values.btos.slice(); + clone.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = copied; clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = new Set(); - for (let i = 0; i < values.btos.length; i++) { - clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.add(i); - } + vocabSetTrustPrefix(clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto, clone.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length); } else { throw new TypeError( @@ -2192,12 +3336,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.slice();clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = new Set(this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc); + clone.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length < vocabSparseArrayMinimumLength + ? this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.slice() : vocabCopyPropertyArray(this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc);clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = vocabCopyTrustSet( + this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc, clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc, + ); if (\\"cc\\" in values && values.cc != null) { if (values.cc instanceof Object || values.cc instanceof URL) { // @ts-ignore: type is checked above. clone.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = [values.cc]; - clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = new Set([0]); + clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = new Set(); + clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The cc must be of type \\" + @@ -2216,15 +3364,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.ccs) && - values.ccs.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.ccs)) { + const array = values.ccs; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.ccs; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = values.ccs.slice(); + clone.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = copied; clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = new Set(); - for (let i = 0; i < values.ccs.length; i++) { - clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.add(i); - } + vocabSetTrustPrefix(clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc, clone.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length); } else { throw new TypeError( @@ -2233,12 +3403,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.slice();clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = new Set(this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc); + clone.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length < vocabSparseArrayMinimumLength + ? this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.slice() : vocabCopyPropertyArray(this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc);clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = vocabCopyTrustSet( + this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc, clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc, + ); if (\\"bcc\\" in values && values.bcc != null) { if (values.bcc instanceof Object || values.bcc instanceof URL) { // @ts-ignore: type is checked above. clone.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = [values.bcc]; - clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = new Set([0]); + clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = new Set(); + clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The bcc must be of type \\" + @@ -2257,15 +3431,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.bccs) && - values.bccs.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.bccs)) { + const array = values.bccs; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.bccs; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = values.bccs.slice(); + clone.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = copied; clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = new Set(); - for (let i = 0; i < values.bccs.length; i++) { - clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc, clone.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length); } else { throw new TypeError( @@ -2274,7 +3470,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.slice(); + clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.length < vocabSparseArrayMinimumLength + ? this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.slice() : vocabCopyPropertyArray(this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType); if (\\"mediaType\\" in values && values.mediaType != null) { if (typeof values.mediaType === \\"string\\") { // @ts-ignore: type is checked above. @@ -2287,7 +3484,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration = this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration.slice(); + clone.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration = this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration.length < vocabSparseArrayMinimumLength + ? this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration.slice() : vocabCopyPropertyArray(this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration); if (\\"duration\\" in values && values.duration != null) { if (isTemporalDuration(values.duration)) { // @ts-ignore: type is checked above. @@ -2300,7 +3498,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive = this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive.slice(); + clone.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive = this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive.length < vocabSparseArrayMinimumLength + ? this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive.slice() : vocabCopyPropertyArray(this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive); if (\\"sensitive\\" in values && values.sensitive != null) { if (typeof values.sensitive === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -2313,7 +3512,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source = this.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.slice(); + clone.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source = this.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.length < vocabSparseArrayMinimumLength + ? this.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.slice() : vocabCopyPropertyArray(this.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source); if (\\"source\\" in values && values.source != null) { if (values.source instanceof Source) { // @ts-ignore: type is checked above. @@ -2326,12 +3526,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.slice();clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = new Set(this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof); + clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length < vocabSparseArrayMinimumLength + ? this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.slice() : vocabCopyPropertyArray(this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof);clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = vocabCopyTrustSet( + this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof, clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof, + ); if (\\"proof\\" in values && values.proof != null) { if (values.proof instanceof DataIntegrityProof || values.proof instanceof URL) { // @ts-ignore: type is checked above. clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = [values.proof]; - clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = new Set([0]); + clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = new Set(); + clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The proof must be of type \\" + @@ -2350,15 +3554,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.proofs) && - values.proofs.every(v => v instanceof DataIntegrityProof || v instanceof URL)) { + let copied!: (DataIntegrityProof | URL)[]; + let valid = false; + if (Array.isArray(values.proofs)) { + const array = values.proofs; + const test = (v: DataIntegrityProof | URL): boolean => v instanceof DataIntegrityProof || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.proofs; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = values.proofs.slice(); + clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = copied; clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = new Set(); - for (let i = 0; i < values.proofs.length; i++) { - clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.add(i); - } + vocabSetTrustPrefix(clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof, clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length); } else { throw new TypeError( @@ -2367,7 +3593,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy = this.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.slice(); + clone.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy = this.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.length < vocabSparseArrayMinimumLength + ? this.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.slice() : vocabCopyPropertyArray(this.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy); if (\\"interactionPolicy\\" in values && values.interactionPolicy != null) { if (values.interactionPolicy instanceof InteractionPolicy) { // @ts-ignore: type is checked above. @@ -2380,7 +3607,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy = this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.slice(); + clone.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy = this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.length < vocabSparseArrayMinimumLength + ? this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.slice() : vocabCopyPropertyArray(this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy); if (\\"approvedBy\\" in values && values.approvedBy != null) { if (values.approvedBy instanceof URL) { // @ts-ignore: type is checked above. @@ -2393,12 +3621,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.slice();clone.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = new Set(this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization); + clone.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.slice() : vocabCopyPropertyArray(this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization);clone.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = vocabCopyTrustSet( + this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization, clone.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization, + ); if (\\"likeAuthorization\\" in values && values.likeAuthorization != null) { if (values.likeAuthorization instanceof LikeAuthorization || values.likeAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = [values.likeAuthorization]; - clone.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = new Set([0]); + clone.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = new Set(); + clone.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The likeAuthorization must be of type \\" + @@ -2406,12 +3638,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.slice();clone.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = new Set(this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization); + clone.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.slice() : vocabCopyPropertyArray(this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization);clone.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = vocabCopyTrustSet( + this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization, clone.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization, + ); if (\\"replyAuthorization\\" in values && values.replyAuthorization != null) { if (values.replyAuthorization instanceof ReplyAuthorization || values.replyAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = [values.replyAuthorization]; - clone.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = new Set([0]); + clone.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = new Set(); + clone.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The replyAuthorization must be of type \\" + @@ -2419,12 +3655,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.slice();clone.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = new Set(this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization); + clone.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.slice() : vocabCopyPropertyArray(this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization);clone.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = vocabCopyTrustSet( + this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization, clone.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization, + ); if (\\"announceAuthorization\\" in values && values.announceAuthorization != null) { if (values.announceAuthorization instanceof AnnounceAuthorization || values.announceAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = [values.announceAuthorization]; - clone.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = new Set([0]); + clone.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = new Set(); + clone.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The announceAuthorization must be of type \\" + @@ -2432,13 +3672,38 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations = this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations.slice(); + clone.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations = this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations.length < vocabSparseArrayMinimumLength + ? this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations.slice() : vocabCopyPropertyArray(this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations); if (\\"translations\\" in values && values.translations != null) { - if (Array.isArray(values.translations) && - values.translations.every(v => v instanceof Translation)) { + let copied!: (Translation)[]; + let valid = false; + if (Array.isArray(values.translations)) { + const array = values.translations; + const test = (v: Translation): boolean => v instanceof Translation; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.translations; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations = values.translations.slice(); + clone.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations = copied; } else { throw new TypeError( @@ -2447,13 +3712,38 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.slice(); + clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length < vocabSparseArrayMinimumLength + ? this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.slice() : vocabCopyPropertyArray(this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d); if (\\"licenses\\" in values && values.licenses != null) { - if (Array.isArray(values.licenses) && - values.licenses.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.licenses)) { + const array = values.licenses; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.licenses; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = values.licenses.slice(); + clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = copied; } else { throw new TypeError( @@ -2488,6 +3778,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -2547,206 +3843,641 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length; i++) { - const value = node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment[i]; - if (value != null && typeof value === \\"object\\") { - node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment[i] = context.value(value); + { + const array = node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length; i++) { + const value = node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment[i]; + if (value != null && typeof value === \\"object\\") { + node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length; i++) { - const value = node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[i]; - if (value != null && typeof value === \\"object\\") { - node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[i] = context.value(value); + { + const array = node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length; i++) { + const value = node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length; i++) { - const value = node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[i] = context.value(value); + { + const array = node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length; i++) { + const value = node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.length; i++) { - const value = node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context[i] = context.value(value); + { + const array = node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.length; i++) { + const value = node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.length; i++) { - const value = node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator[i]; - if (value != null && typeof value === \\"object\\") { - node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator[i] = context.value(value); + { + const array = node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.length; i++) { + const value = node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator[i]; + if (value != null && typeof value === \\"object\\") { + node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length; i++) { - const value = node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[i]; - if (value != null && typeof value === \\"object\\") { - node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[i] = context.value(value); + { + const array = node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length; i++) { + const value = node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[i]; + if (value != null && typeof value === \\"object\\") { + node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length; i++) { - const value = node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[i] = context.value(value); + { + const array = node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length; i++) { + const value = node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length; i++) { - const value = node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[i] = context.value(value); + { + const array = node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length; i++) { + const value = node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length; i++) { - const value = node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[i]; - if (value != null && typeof value === \\"object\\") { - node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[i] = context.value(value); + { + const array = node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length; i++) { + const value = node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[i]; + if (value != null && typeof value === \\"object\\") { + node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length; i++) { - const value = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i]; - if (value != null && typeof value === \\"object\\") { - node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i] = context.value(value); + { + const array = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length; i++) { + const value = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i]; + if (value != null && typeof value === \\"object\\") { + node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_7UpwM3JWcXhADcscukEehBorf6k_replies.length; i++) { - const value = node.#_7UpwM3JWcXhADcscukEehBorf6k_replies[i]; - if (value != null && typeof value === \\"object\\") { - node.#_7UpwM3JWcXhADcscukEehBorf6k_replies[i] = context.value(value); + { + const array = node.#_7UpwM3JWcXhADcscukEehBorf6k_replies; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_7UpwM3JWcXhADcscukEehBorf6k_replies.length; i++) { + const value = node.#_7UpwM3JWcXhADcscukEehBorf6k_replies[i]; + if (value != null && typeof value === \\"object\\") { + node.#_7UpwM3JWcXhADcscukEehBorf6k_replies[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.length; i++) { - const value = node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[i] = context.value(value); + { + const array = node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.length; i++) { + const value = node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.length; i++) { - const value = node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[i]; - if (value != null && typeof value === \\"object\\") { - node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[i] = context.value(value); + { + const array = node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.length; i++) { + const value = node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[i]; + if (value != null && typeof value === \\"object\\") { + node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.length; i++) { - const value = node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[i]; - if (value != null && typeof value === \\"object\\") { - node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[i] = context.value(value); + { + const array = node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.length; i++) { + const value = node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[i]; + if (value != null && typeof value === \\"object\\") { + node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.length; i++) { - const value = node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag[i]; - if (value != null && typeof value === \\"object\\") { - node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag[i] = context.value(value); + { + const array = node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.length; i++) { + const value = node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag[i]; + if (value != null && typeof value === \\"object\\") { + node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length; i++) { - const value = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i] = context.value(value); + { + const array = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length; i++) { + const value = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length; i++) { - const value = node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[i] = context.value(value); + { + const array = node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length; i++) { + const value = node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length; i++) { - const value = node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[i]; - if (value != null && typeof value === \\"object\\") { - node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[i] = context.value(value); + { + const array = node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length; i++) { + const value = node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[i]; + if (value != null && typeof value === \\"object\\") { + node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length; i++) { - const value = node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[i]; - if (value != null && typeof value === \\"object\\") { - node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[i] = context.value(value); + { + const array = node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length; i++) { + const value = node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[i]; + if (value != null && typeof value === \\"object\\") { + node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length; i++) { - const value = node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[i] = context.value(value); + { + const array = node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length; i++) { + const value = node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.length; i++) { - const value = node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source[i] = context.value(value); + { + const array = node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.length; i++) { + const value = node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length; i++) { - const value = node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[i]; - if (value != null && typeof value === \\"object\\") { - node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[i] = context.value(value); + { + const array = node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length; i++) { + const value = node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[i]; + if (value != null && typeof value === \\"object\\") { + node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.length; i++) { - const value = node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy[i] = context.value(value); + { + const array = node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.length; i++) { + const value = node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.length; i++) { - const value = node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy[i]; - if (value != null && typeof value === \\"object\\") { - node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy[i] = context.value(value); + { + const array = node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.length; i++) { + const value = node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy[i]; + if (value != null && typeof value === \\"object\\") { + node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.length; i++) { - const value = node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[i] = context.value(value); + { + const array = node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.length; i++) { + const value = node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.length; i++) { - const value = node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[i]; - if (value != null && typeof value === \\"object\\") { - node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[i] = context.value(value); + { + const array = node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.length; i++) { + const value = node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.length; i++) { - const value = node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[i]; - if (value != null && typeof value === \\"object\\") { - node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[i] = context.value(value); + { + const array = node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.length; i++) { + const value = node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations.length; i++) { - const value = node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations[i]; - if (value != null && typeof value === \\"object\\") { - node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations[i] = context.value(value); + { + const array = node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations.length; i++) { + const value = node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations[i]; + if (value != null && typeof value === \\"object\\") { + node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length; i++) { - const value = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i] = context.value(value); + { + const array = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length; i++) { + const value = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i] = context.value(value); + } + } } } } }); } @@ -3109,7 +4840,8 @@ deepCloneDescriptors.set(this.prototype, { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { + !(i < (this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment[vocabTrustPrefix] ?? 0) || + this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#attachment\\"); @@ -3181,7 +4913,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { + !(i < (this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment[vocabTrustPrefix] ?? 0) || + this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -3594,7 +5327,8 @@ deepCloneDescriptors.set(this.prototype, { } let v = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[0]; if (!(v instanceof URL) && - !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { + !(0 < (this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#attributedTo\\"); @@ -3662,7 +5396,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { + !(0 < (this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -3752,7 +5487,8 @@ deepCloneDescriptors.set(this.prototype, { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { + !(i < (this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#attributedTo\\"); @@ -3824,7 +5560,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { + !(i < (this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -4176,7 +5913,8 @@ deepCloneDescriptors.set(this.prototype, { } let v = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[0]; if (!(v instanceof URL) && - !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { + !(0 < (this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[vocabTrustPrefix] ?? 0) || + this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#audience\\"); @@ -4244,7 +5982,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { + !(0 < (this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[vocabTrustPrefix] ?? 0) || + this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -4333,7 +6072,8 @@ deepCloneDescriptors.set(this.prototype, { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { + !(i < (this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[vocabTrustPrefix] ?? 0) || + this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#audience\\"); @@ -4405,7 +6145,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { + !(i < (this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[vocabTrustPrefix] ?? 0) || + this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -4806,7 +6547,8 @@ get contents(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { + !(i < (this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context[vocabTrustPrefix] ?? 0) || + this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#context\\"); @@ -4878,7 +6620,8 @@ get contents(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { + !(i < (this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context[vocabTrustPrefix] ?? 0) || + this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -5286,7 +7029,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { + !(i < (this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator[vocabTrustPrefix] ?? 0) || + this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#generator\\"); @@ -5358,7 +7102,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { + !(i < (this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator[vocabTrustPrefix] ?? 0) || + this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -5733,7 +7478,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[0]; if (!(v instanceof URL) && - !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { + !(0 < (this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[vocabTrustPrefix] ?? 0) || + this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#icon\\"); @@ -5801,7 +7547,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { + !(0 < (this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[vocabTrustPrefix] ?? 0) || + this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -5891,7 +7638,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { + !(i < (this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[vocabTrustPrefix] ?? 0) || + this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#icon\\"); @@ -5963,7 +7711,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { + !(i < (this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[vocabTrustPrefix] ?? 0) || + this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -6338,7 +8087,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[0]; if (!(v instanceof URL) && - !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { + !(0 < (this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[vocabTrustPrefix] ?? 0) || + this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#image\\"); @@ -6406,7 +8156,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { + !(0 < (this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[vocabTrustPrefix] ?? 0) || + this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -6496,7 +8247,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { + !(i < (this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[vocabTrustPrefix] ?? 0) || + this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#image\\"); @@ -6568,7 +8320,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { + !(i < (this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[vocabTrustPrefix] ?? 0) || + this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -6935,7 +8688,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[0]; if (!(v instanceof URL) && - !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { + !(0 < (this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[vocabTrustPrefix] ?? 0) || + this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#inReplyTo\\"); @@ -7003,7 +8757,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { + !(0 < (this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[vocabTrustPrefix] ?? 0) || + this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -7092,7 +8847,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { + !(i < (this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[vocabTrustPrefix] ?? 0) || + this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#inReplyTo\\"); @@ -7164,7 +8920,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { + !(i < (this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[vocabTrustPrefix] ?? 0) || + this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -7531,7 +9288,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[0]; if (!(v instanceof URL) && - !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { + !(0 < (this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[vocabTrustPrefix] ?? 0) || + this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#location\\"); @@ -7599,7 +9357,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { + !(0 < (this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[vocabTrustPrefix] ?? 0) || + this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -7688,7 +9447,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { + !(i < (this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[vocabTrustPrefix] ?? 0) || + this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#location\\"); @@ -7760,7 +9520,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { + !(i < (this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[vocabTrustPrefix] ?? 0) || + this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -8126,7 +9887,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[0]; if (!(v instanceof URL) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { + !(0 < (this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] ?? 0) || + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#preview\\"); @@ -8194,7 +9956,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { + !(0 < (this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] ?? 0) || + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -8282,7 +10045,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { + !(i < (this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] ?? 0) || + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#preview\\"); @@ -8354,7 +10118,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { + !(i < (this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] ?? 0) || + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -8719,7 +10484,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies[0]; if (!(v instanceof URL) && - !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { + !(0 < (this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies[vocabTrustPrefix] ?? 0) || + this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#replies\\"); @@ -8787,7 +10553,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { + !(0 < (this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies[vocabTrustPrefix] ?? 0) || + this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -9144,7 +10911,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[0]; if (!(v instanceof URL) && - !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { + !(0 < (this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares[vocabTrustPrefix] ?? 0) || + this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#shares\\"); @@ -9212,7 +10980,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { + !(0 < (this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares[vocabTrustPrefix] ?? 0) || + this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -9569,7 +11338,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[0]; if (!(v instanceof URL) && - !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { + !(0 < (this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[vocabTrustPrefix] ?? 0) || + this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#likes\\"); @@ -9637,7 +11407,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { + !(0 < (this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[vocabTrustPrefix] ?? 0) || + this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -9988,7 +11759,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[0]; if (!(v instanceof URL) && - !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { + !(0 < (this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[vocabTrustPrefix] ?? 0) || + this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://fedibird.com/ns#emojiReactions\\"); @@ -10056,7 +11828,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { + !(0 < (this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[vocabTrustPrefix] ?? 0) || + this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -10464,7 +12237,8 @@ get summaries(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { + !(i < (this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag[vocabTrustPrefix] ?? 0) || + this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#tag\\"); @@ -10536,7 +12310,8 @@ get summaries(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { + !(i < (this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag[vocabTrustPrefix] ?? 0) || + this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -10922,7 +12697,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[0]; if (!(v instanceof URL) && - !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { + !(0 < (this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[vocabTrustPrefix] ?? 0) || + this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#to\\"); @@ -10990,7 +12766,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { + !(0 < (this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[vocabTrustPrefix] ?? 0) || + this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -11079,7 +12856,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { + !(i < (this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[vocabTrustPrefix] ?? 0) || + this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#to\\"); @@ -11151,7 +12929,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { + !(i < (this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[vocabTrustPrefix] ?? 0) || + this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -11503,7 +13282,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[0]; if (!(v instanceof URL) && - !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { + !(0 < (this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[vocabTrustPrefix] ?? 0) || + this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#bto\\"); @@ -11571,7 +13351,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { + !(0 < (this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[vocabTrustPrefix] ?? 0) || + this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -11660,7 +13441,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { + !(i < (this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[vocabTrustPrefix] ?? 0) || + this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#bto\\"); @@ -11732,7 +13514,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { + !(i < (this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[vocabTrustPrefix] ?? 0) || + this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -12084,7 +13867,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[0]; if (!(v instanceof URL) && - !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { + !(0 < (this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[vocabTrustPrefix] ?? 0) || + this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#cc\\"); @@ -12152,7 +13936,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { + !(0 < (this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[vocabTrustPrefix] ?? 0) || + this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -12241,7 +14026,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { + !(i < (this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[vocabTrustPrefix] ?? 0) || + this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#cc\\"); @@ -12313,7 +14099,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { + !(i < (this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[vocabTrustPrefix] ?? 0) || + this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -12665,7 +14452,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[0]; if (!(v instanceof URL) && - !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { + !(0 < (this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[vocabTrustPrefix] ?? 0) || + this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#bcc\\"); @@ -12733,7 +14521,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { + !(0 < (this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[vocabTrustPrefix] ?? 0) || + this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -12822,7 +14611,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { + !(i < (this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[vocabTrustPrefix] ?? 0) || + this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#bcc\\"); @@ -12894,7 +14684,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { + !(i < (this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[vocabTrustPrefix] ?? 0) || + this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -13309,7 +15100,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[0]; if (!(v instanceof URL) && - !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { + !(0 < (this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[vocabTrustPrefix] ?? 0) || + this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#proof\\"); @@ -13377,7 +15169,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { + !(0 < (this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[vocabTrustPrefix] ?? 0) || + this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -13465,7 +15258,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { + !(i < (this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[vocabTrustPrefix] ?? 0) || + this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#proof\\"); @@ -13537,7 +15331,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { + !(i < (this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[vocabTrustPrefix] ?? 0) || + this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -13928,7 +15723,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { + !(0 < (this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#likeAuthorization\\"); @@ -13996,7 +15792,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { + !(0 < (this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -14347,7 +16144,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { + !(0 < (this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#replyAuthorization\\"); @@ -14415,7 +16213,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { + !(0 < (this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -14766,7 +16565,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { + !(0 < (this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#announceAuthorization\\"); @@ -14834,7 +16634,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { + !(0 < (this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -17046,7 +18847,7 @@ get licenses(): (URL)[] { let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _49BipA5dq9eoH8LX8xdsVumveTca_attachment: (Object | Link | PropertyValue | URL)[] = []; - const _trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment: Set = new Set(); + const _trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment: VocabTrustSet = new Set(); let _49BipA5dq9eoH8LX8xdsVumveTca_attachment__array = values[\\"https://www.w3.org/ns/activitystreams#attachment\\"]; @@ -17098,7 +18899,7 @@ get licenses(): (URL)[] { instance.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = _49BipA5dq9eoH8LX8xdsVumveTca_attachment; const _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo: Set = new Set(); + const _trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo: VocabTrustSet = new Set(); let _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo__array = values[\\"https://www.w3.org/ns/activitystreams#attributedTo\\"]; @@ -17156,7 +18957,7 @@ get licenses(): (URL)[] { instance.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo; const _3ocC3VVi88cEd5sPWL8djkZsvTN6_audience: (Object | URL)[] = []; - const _trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience: Set = new Set(); + const _trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience: VocabTrustSet = new Set(); let _3ocC3VVi88cEd5sPWL8djkZsvTN6_audience__array = values[\\"https://www.w3.org/ns/activitystreams#audience\\"]; @@ -17230,7 +19031,7 @@ get licenses(): (URL)[] { instance.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content; const _3mhZzGXSpQ431mBSz2kvych22v4e_context: (Object | Link | URL)[] = []; - const _trust_3mhZzGXSpQ431mBSz2kvych22v4e_context: Set = new Set(); + const _trust_3mhZzGXSpQ431mBSz2kvych22v4e_context: VocabTrustSet = new Set(); let _3mhZzGXSpQ431mBSz2kvych22v4e_context__array = values[\\"https://www.w3.org/ns/activitystreams#context\\"]; @@ -17344,7 +19145,7 @@ get licenses(): (URL)[] { instance.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime = _219RwDanjScTv5tYCjwGZVCM7KZ9_endTime; const _86xFhmgBapoMvYqjbjRuDPayTrS_generator: (Object | Link | URL)[] = []; - const _trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator: Set = new Set(); + const _trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator: VocabTrustSet = new Set(); let _86xFhmgBapoMvYqjbjRuDPayTrS_generator__array = values[\\"https://www.w3.org/ns/activitystreams#generator\\"]; @@ -17392,7 +19193,7 @@ get licenses(): (URL)[] { instance.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = _86xFhmgBapoMvYqjbjRuDPayTrS_generator; const _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon: (Image | URL)[] = []; - const _trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon: Set = new Set(); + const _trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon: VocabTrustSet = new Set(); let _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon__array = values[\\"https://www.w3.org/ns/activitystreams#icon\\"]; @@ -17456,7 +19257,7 @@ get licenses(): (URL)[] { instance.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon; const _3dXrUdkARxwyJLtJcYi1AJ92H41U_image: (Image | URL)[] = []; - const _trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image: Set = new Set(); + const _trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image: VocabTrustSet = new Set(); let _3dXrUdkARxwyJLtJcYi1AJ92H41U_image__array = values[\\"https://www.w3.org/ns/activitystreams#image\\"]; @@ -17520,7 +19321,7 @@ get licenses(): (URL)[] { instance.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = _3dXrUdkARxwyJLtJcYi1AJ92H41U_image; const _3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo: (Object | Link | URL)[] = []; - const _trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo: Set = new Set(); + const _trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo: VocabTrustSet = new Set(); let _3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo__array = values[\\"https://www.w3.org/ns/activitystreams#inReplyTo\\"]; @@ -17568,7 +19369,7 @@ get licenses(): (URL)[] { instance.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = _3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo; const _31k5MUZJsnsPNg8dQQJieWaXTFnR_location: (Object | Link | URL)[] = []; - const _trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location: Set = new Set(); + const _trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location: VocabTrustSet = new Set(); let _31k5MUZJsnsPNg8dQQJieWaXTFnR_location__array = values[\\"https://www.w3.org/ns/activitystreams#location\\"]; @@ -17616,7 +19417,7 @@ get licenses(): (URL)[] { instance.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = _31k5MUZJsnsPNg8dQQJieWaXTFnR_location; const _gCVTegXxWWCw6wWRxa1QF65zusg_preview: (Link | Object | URL)[] = []; - const _trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: Set = new Set(); + const _trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: VocabTrustSet = new Set(); let _gCVTegXxWWCw6wWRxa1QF65zusg_preview__array = values[\\"https://www.w3.org/ns/activitystreams#preview\\"]; @@ -17697,7 +19498,7 @@ get licenses(): (URL)[] { instance.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published = _5e258TDXtuhaFRPZiGoDfEpjdMr_published; const _7UpwM3JWcXhADcscukEehBorf6k_replies: (Collection | URL)[] = []; - const _trust_7UpwM3JWcXhADcscukEehBorf6k_replies: Set = new Set(); + const _trust_7UpwM3JWcXhADcscukEehBorf6k_replies: VocabTrustSet = new Set(); let _7UpwM3JWcXhADcscukEehBorf6k_replies__array = values[\\"https://www.w3.org/ns/activitystreams#replies\\"]; @@ -17738,7 +19539,7 @@ get licenses(): (URL)[] { instance.#_7UpwM3JWcXhADcscukEehBorf6k_replies = _7UpwM3JWcXhADcscukEehBorf6k_replies; const _3kAfck9PcEYt2L7xug5y99YPbANs_shares: (Collection | URL)[] = []; - const _trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares: Set = new Set(); + const _trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares: VocabTrustSet = new Set(); let _3kAfck9PcEYt2L7xug5y99YPbANs_shares__array = values[\\"https://www.w3.org/ns/activitystreams#shares\\"]; @@ -17779,7 +19580,7 @@ get licenses(): (URL)[] { instance.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares = _3kAfck9PcEYt2L7xug5y99YPbANs_shares; const _S3ceDnpMdzoTRCccB9FkJWrEzYW_likes: (Collection | URL)[] = []; - const _trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes: Set = new Set(); + const _trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes: VocabTrustSet = new Set(); let _S3ceDnpMdzoTRCccB9FkJWrEzYW_likes__array = values[\\"https://www.w3.org/ns/activitystreams#likes\\"]; @@ -17820,7 +19621,7 @@ get licenses(): (URL)[] { instance.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = _S3ceDnpMdzoTRCccB9FkJWrEzYW_likes; const _kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions: (Collection | URL)[] = []; - const _trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions: Set = new Set(); + const _trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions: VocabTrustSet = new Set(); let _kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions__array = values[\\"http://fedibird.com/ns#emojiReactions\\"]; @@ -17927,7 +19728,7 @@ get licenses(): (URL)[] { instance.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = _4LqirZspQbFWWQEbFcXAxm7tTDN1_summary; const _5chuqj6s95p5gg2sk1HntGfarRf_tag: (Object | Link | URL)[] = []; - const _trust_5chuqj6s95p5gg2sk1HntGfarRf_tag: Set = new Set(); + const _trust_5chuqj6s95p5gg2sk1HntGfarRf_tag: VocabTrustSet = new Set(); let _5chuqj6s95p5gg2sk1HntGfarRf_tag__array = values[\\"https://www.w3.org/ns/activitystreams#tag\\"]; @@ -18044,7 +19845,7 @@ get licenses(): (URL)[] { instance.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = _2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; const _3hFbw7DTpHhq3cvVhkY8njhcsXbd_to: (Object | URL)[] = []; - const _trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to: Set = new Set(); + const _trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to: VocabTrustSet = new Set(); let _3hFbw7DTpHhq3cvVhkY8njhcsXbd_to__array = values[\\"https://www.w3.org/ns/activitystreams#to\\"]; @@ -18085,7 +19886,7 @@ get licenses(): (URL)[] { instance.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = _3hFbw7DTpHhq3cvVhkY8njhcsXbd_to; const _aLZupjwL8XB7tzdLgCMXdjZ6qej_bto: (Object | URL)[] = []; - const _trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto: Set = new Set(); + const _trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto: VocabTrustSet = new Set(); let _aLZupjwL8XB7tzdLgCMXdjZ6qej_bto__array = values[\\"https://www.w3.org/ns/activitystreams#bto\\"]; @@ -18126,7 +19927,7 @@ get licenses(): (URL)[] { instance.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = _aLZupjwL8XB7tzdLgCMXdjZ6qej_bto; const _42a1SvBs24QSLzKcfjCyNTjW5a1g_cc: (Object | URL)[] = []; - const _trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc: Set = new Set(); + const _trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc: VocabTrustSet = new Set(); let _42a1SvBs24QSLzKcfjCyNTjW5a1g_cc__array = values[\\"https://www.w3.org/ns/activitystreams#cc\\"]; @@ -18167,7 +19968,7 @@ get licenses(): (URL)[] { instance.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = _42a1SvBs24QSLzKcfjCyNTjW5a1g_cc; const _3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc: (Object | URL)[] = []; - const _trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc: Set = new Set(); + const _trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc: VocabTrustSet = new Set(); let _3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc__array = values[\\"https://www.w3.org/ns/activitystreams#bcc\\"]; @@ -18327,7 +20128,7 @@ get licenses(): (URL)[] { instance.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source = _2ZwCFoS787v8y8bXKjMoE6MAbrEB_source; const _42rPnotok1ivQ2RNCKNbeFJgx8b8_proof: (DataIntegrityProof | URL)[] = []; - const _trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof: Set = new Set(); + const _trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof: VocabTrustSet = new Set(); let _42rPnotok1ivQ2RNCKNbeFJgx8b8_proof__array = values[\\"https://w3id.org/security#proof\\"]; @@ -18434,7 +20235,7 @@ get licenses(): (URL)[] { instance.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy = _23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy; const _3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization: (LikeAuthorization | URL)[] = []; - const _trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization: Set = new Set(); + const _trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization: VocabTrustSet = new Set(); let _3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization__array = values[\\"https://gotosocial.org/ns#likeAuthorization\\"]; @@ -18475,7 +20276,7 @@ get licenses(): (URL)[] { instance.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = _3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization; const _YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization: (ReplyAuthorization | URL)[] = []; - const _trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization: Set = new Set(); + const _trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization: VocabTrustSet = new Set(); let _YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization__array = values[\\"https://gotosocial.org/ns#replyAuthorization\\"]; @@ -18516,7 +20317,7 @@ get licenses(): (URL)[] { instance.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = _YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization; const _446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization: (AnnounceAuthorization | URL)[] = []; - const _trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization: Set = new Set(); + const _trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization: VocabTrustSet = new Set(); let _446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization__array = values[\\"https://gotosocial.org/ns#announceAuthorization\\"]; @@ -19723,6 +21524,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -20112,11 +21919,11 @@ export class ChatMessage extends Object { } #_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); #_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl: (URL)[] = []; #_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); /** * Constructs a new instance of ChatMessage with the given values. @@ -20257,12 +22064,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as ChatMessage;clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice();clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote); + const clone = super.clone(values, options) as unknown as ChatMessage;clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < vocabSparseArrayMinimumLength + ? this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice() : vocabCopyPropertyArray(this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote);clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = vocabCopyTrustSet( + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, + ); if (\\"quote\\" in values && values.quote != null) { if (values.quote instanceof Object || values.quote instanceof URL) { // @ts-ignore: type is checked above. clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = [values.quote]; - clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set([0]); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The quote must be of type \\" + @@ -20270,7 +22081,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice(); + clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length < vocabSparseArrayMinimumLength + ? this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice() : vocabCopyPropertyArray(this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl); if (\\"quoteUrl\\" in values && values.quoteUrl != null) { if (values.quoteUrl instanceof URL) { // @ts-ignore: type is checked above. @@ -20283,12 +22095,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice();clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization); + clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice() : vocabCopyPropertyArray(this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization);clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = vocabCopyTrustSet( + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, + ); if (\\"quoteAuthorization\\" in values && values.quoteAuthorization != null) { if (values.quoteAuthorization instanceof QuoteAuthorization || values.quoteAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = [values.quoteAuthorization]; - clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set([0]); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The quoteAuthorization must be of type \\" + @@ -20322,6 +22138,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -20371,24 +22193,69 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as ChatMessage; - for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { - const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + { + const array = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { - const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; - if (value != null && typeof value === \\"object\\") { - node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + { + const array = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === \\"object\\") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { - const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; - if (value != null && typeof value === \\"object\\") { - node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + { + const array = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } } } } }); } @@ -20721,7 +22588,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/044f#quote\\"); @@ -20789,7 +22657,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -21163,7 +23032,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/044f#quoteAuthorization\\"); @@ -21231,7 +23101,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -21658,7 +23529,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); let _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote__array = values[\\"https://w3id.org/fep/044f#quote\\"]; @@ -21738,7 +23609,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; const _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); let _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization__array = values[\\"https://w3id.org/fep/044f#quoteAuthorization\\"]; @@ -21913,22 +23784,22 @@ export class Activity extends Object { } #_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor: Set = new Set(); + #_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor: VocabTrustSet = new Set(); #_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: (Object | URL)[] = []; - #_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: Set = new Set(); + #_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: VocabTrustSet = new Set(); #_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target: (Object | URL)[] = []; - #_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target: Set = new Set(); + #_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target: VocabTrustSet = new Set(); #_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result: (Object | URL)[] = []; - #_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result: Set = new Set(); + #_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result: VocabTrustSet = new Set(); #_25zu2s3VxVujgEKqrDycjE284XQR_origin: (Object | URL)[] = []; - #_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin: Set = new Set(); + #_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin: VocabTrustSet = new Set(); #_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument: (Object | URL)[] = []; - #_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument: Set = new Set(); + #_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument: VocabTrustSet = new Set(); /** * Constructs a new instance of Activity with the given values. @@ -21994,14 +23865,36 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.actors) && - values.actors.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.actors)) { + const array = values.actors; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.actors; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = values.actors.slice(); + this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = copied; - for (let i = 0; i < values.actors.length; i++) { - this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.add(i); - } + vocabSetTrustPrefix(this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor, this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length); } else { throw new TypeError( @@ -22034,14 +23927,36 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.objects) && - values.objects.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.objects)) { + const array = values.objects; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.objects; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = values.objects.slice(); + this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = copied; - for (let i = 0; i < values.objects.length; i++) { - this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.add(i); - } + vocabSetTrustPrefix(this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length); } else { throw new TypeError( @@ -22074,14 +23989,36 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.targets) && - values.targets.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.targets)) { + const array = values.targets; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.targets; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = values.targets.slice(); + this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = copied; - for (let i = 0; i < values.targets.length; i++) { - this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.add(i); - } + vocabSetTrustPrefix(this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target, this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length); } else { throw new TypeError( @@ -22114,14 +24051,36 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.results) && - values.results.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.results)) { + const array = values.results; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.results; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = values.results.slice(); + this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = copied; - for (let i = 0; i < values.results.length; i++) { - this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.add(i); - } + vocabSetTrustPrefix(this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result, this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length); } else { throw new TypeError( @@ -22154,14 +24113,36 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.origins) && - values.origins.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.origins)) { + const array = values.origins; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.origins; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = values.origins.slice(); + this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = copied; - for (let i = 0; i < values.origins.length; i++) { - this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.add(i); - } + vocabSetTrustPrefix(this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin, this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length); } else { throw new TypeError( @@ -22194,14 +24175,36 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.instruments) && - values.instruments.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.instruments)) { + const array = values.instruments; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.instruments; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = values.instruments.slice(); + this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = copied; - for (let i = 0; i < values.instruments.length; i++) { - this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.add(i); - } + vocabSetTrustPrefix(this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument, this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length); } else { throw new TypeError( @@ -22282,12 +24285,16 @@ instruments?: (Object | URL)[];} // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Activity;clone.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.slice();clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = new Set(this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor); + const clone = super.clone(values, options) as unknown as Activity;clone.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length < vocabSparseArrayMinimumLength + ? this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.slice() : vocabCopyPropertyArray(this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor);clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = vocabCopyTrustSet( + this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor, clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor, + ); if (\\"actor\\" in values && values.actor != null) { if (values.actor instanceof Application || values.actor instanceof Group || values.actor instanceof Organization || values.actor instanceof Person || values.actor instanceof Service || values.actor instanceof URL) { // @ts-ignore: type is checked above. clone.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = [values.actor]; - clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = new Set([0]); + clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = new Set(); + clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The actor must be of type \\" + @@ -22306,15 +24313,37 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.actors) && - values.actors.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.actors)) { + const array = values.actors; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.actors; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = values.actors.slice(); + clone.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = copied; clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = new Set(); - for (let i = 0; i < values.actors.length; i++) { - clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor, clone.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length); } else { throw new TypeError( @@ -22323,12 +24352,16 @@ instruments?: (Object | URL)[];} ); } } - clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.slice();clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set(this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object); + clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length < vocabSparseArrayMinimumLength + ? this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.slice() : vocabCopyPropertyArray(this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object);clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = vocabCopyTrustSet( + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, + ); if (\\"object\\" in values && values.object != null) { if (values.object instanceof Object || values.object instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = [values.object]; - clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set([0]); + clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set(); + clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The object must be of type \\" + @@ -22347,15 +24380,37 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.objects) && - values.objects.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.objects)) { + const array = values.objects; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.objects; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = values.objects.slice(); + clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = copied; clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set(); - for (let i = 0; i < values.objects.length; i++) { - clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length); } else { throw new TypeError( @@ -22364,12 +24419,16 @@ instruments?: (Object | URL)[];} ); } } - clone.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.slice();clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = new Set(this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target); + clone.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length < vocabSparseArrayMinimumLength + ? this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.slice() : vocabCopyPropertyArray(this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target);clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = vocabCopyTrustSet( + this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target, clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target, + ); if (\\"target\\" in values && values.target != null) { if (values.target instanceof Object || values.target instanceof URL) { // @ts-ignore: type is checked above. clone.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = [values.target]; - clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = new Set([0]); + clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = new Set(); + clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The target must be of type \\" + @@ -22388,15 +24447,37 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.targets) && - values.targets.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.targets)) { + const array = values.targets; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.targets; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = values.targets.slice(); + clone.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = copied; clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = new Set(); - for (let i = 0; i < values.targets.length; i++) { - clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target, clone.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length); } else { throw new TypeError( @@ -22405,12 +24486,16 @@ instruments?: (Object | URL)[];} ); } } - clone.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.slice();clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = new Set(this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result); + clone.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length < vocabSparseArrayMinimumLength + ? this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.slice() : vocabCopyPropertyArray(this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result);clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = vocabCopyTrustSet( + this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result, clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result, + ); if (\\"result\\" in values && values.result != null) { if (values.result instanceof Object || values.result instanceof URL) { // @ts-ignore: type is checked above. clone.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = [values.result]; - clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = new Set([0]); + clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = new Set(); + clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The result must be of type \\" + @@ -22429,15 +24514,37 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.results) && - values.results.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.results)) { + const array = values.results; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.results; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = values.results.slice(); + clone.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = copied; clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = new Set(); - for (let i = 0; i < values.results.length; i++) { - clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.add(i); - } + vocabSetTrustPrefix(clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result, clone.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length); } else { throw new TypeError( @@ -22446,12 +24553,16 @@ instruments?: (Object | URL)[];} ); } } - clone.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.slice();clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin = new Set(this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin); + clone.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length < vocabSparseArrayMinimumLength + ? this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.slice() : vocabCopyPropertyArray(this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin);clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin = vocabCopyTrustSet( + this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin, clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin, + ); if (\\"origin\\" in values && values.origin != null) { if (values.origin instanceof Object || values.origin instanceof URL) { // @ts-ignore: type is checked above. clone.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = [values.origin]; - clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin = new Set([0]); + clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin = new Set(); + clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The origin must be of type \\" + @@ -22470,15 +24581,37 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.origins) && - values.origins.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.origins)) { + const array = values.origins; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.origins; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = values.origins.slice(); + clone.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = copied; clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin = new Set(); - for (let i = 0; i < values.origins.length; i++) { - clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.add(i); - } + vocabSetTrustPrefix(clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin, clone.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length); } else { throw new TypeError( @@ -22487,12 +24620,16 @@ instruments?: (Object | URL)[];} ); } } - clone.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.slice();clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = new Set(this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument); + clone.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length < vocabSparseArrayMinimumLength + ? this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.slice() : vocabCopyPropertyArray(this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument);clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = vocabCopyTrustSet( + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument, clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument, + ); if (\\"instrument\\" in values && values.instrument != null) { if (values.instrument instanceof Object || values.instrument instanceof URL) { // @ts-ignore: type is checked above. clone.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = [values.instrument]; - clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = new Set([0]); + clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = new Set(); + clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The instrument must be of type \\" + @@ -22511,15 +24648,37 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.instruments) && - values.instruments.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.instruments)) { + const array = values.instruments; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.instruments; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = values.instruments.slice(); + clone.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = copied; clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = new Set(); - for (let i = 0; i < values.instruments.length; i++) { - clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument, clone.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length); } else { throw new TypeError( @@ -22554,6 +24713,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -22609,45 +24774,135 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Activity; - for (let i = 0; i < node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length; i++) { - const value = node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[i] = context.value(value); + { + const array = node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length; i++) { + const value = node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length; i++) { - const value = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i] = context.value(value); + { + const array = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length; i++) { + const value = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length; i++) { - const value = node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[i] = context.value(value); + { + const array = node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length; i++) { + const value = node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length; i++) { - const value = node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[i]; - if (value != null && typeof value === \\"object\\") { - node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[i] = context.value(value); + { + const array = node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length; i++) { + const value = node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[i]; + if (value != null && typeof value === \\"object\\") { + node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length; i++) { - const value = node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[i]; - if (value != null && typeof value === \\"object\\") { - node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[i] = context.value(value); + { + const array = node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length; i++) { + const value = node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[i]; + if (value != null && typeof value === \\"object\\") { + node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length; i++) { - const value = node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[i] = context.value(value); + { + const array = node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length; i++) { + const value = node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[i] = context.value(value); + } + } } } } }); } @@ -23040,7 +25295,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[0]; if (!(v instanceof URL) && - !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { + !(0 < (this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[vocabTrustPrefix] ?? 0) || + this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#actor\\"); @@ -23108,7 +25364,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { + !(0 < (this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[vocabTrustPrefix] ?? 0) || + this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -23198,7 +25455,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { + !(i < (this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[vocabTrustPrefix] ?? 0) || + this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#actor\\"); @@ -23270,7 +25528,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { + !(i < (this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[vocabTrustPrefix] ?? 0) || + this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -23623,7 +25882,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (!(v instanceof URL) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { + !(0 < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#object\\"); @@ -23691,7 +25951,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { + !(0 < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -23781,7 +26042,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { + !(i < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#object\\"); @@ -23853,7 +26115,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { + !(i < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -24209,7 +26472,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[0]; if (!(v instanceof URL) && - !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { + !(0 < (this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[vocabTrustPrefix] ?? 0) || + this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#target\\"); @@ -24277,7 +26541,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { + !(0 < (this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[vocabTrustPrefix] ?? 0) || + this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -24370,7 +26635,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { + !(i < (this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[vocabTrustPrefix] ?? 0) || + this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#target\\"); @@ -24442,7 +26708,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { + !(i < (this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[vocabTrustPrefix] ?? 0) || + this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -24795,7 +27062,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[0]; if (!(v instanceof URL) && - !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { + !(0 < (this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[vocabTrustPrefix] ?? 0) || + this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#result\\"); @@ -24863,7 +27131,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { + !(0 < (this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[vocabTrustPrefix] ?? 0) || + this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -24953,7 +27222,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { + !(i < (this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[vocabTrustPrefix] ?? 0) || + this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#result\\"); @@ -25025,7 +27295,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { + !(i < (this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[vocabTrustPrefix] ?? 0) || + this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -25379,7 +27650,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[0]; if (!(v instanceof URL) && - !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { + !(0 < (this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin[vocabTrustPrefix] ?? 0) || + this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#origin\\"); @@ -25447,7 +27719,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { + !(0 < (this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin[vocabTrustPrefix] ?? 0) || + this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -25538,7 +27811,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { + !(i < (this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin[vocabTrustPrefix] ?? 0) || + this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#origin\\"); @@ -25610,7 +27884,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { + !(i < (this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin[vocabTrustPrefix] ?? 0) || + this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -25962,7 +28237,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[0]; if (!(v instanceof URL) && - !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { + !(0 < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#instrument\\"); @@ -26030,7 +28306,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { + !(0 < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -26119,7 +28396,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { + !(i < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#instrument\\"); @@ -26191,7 +28469,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { + !(i < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -26730,7 +29009,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor: Set = new Set(); + const _trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor: VocabTrustSet = new Set(); let _2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor__array = values[\\"https://www.w3.org/ns/activitystreams#actor\\"]; @@ -26788,7 +29067,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = _2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor; const _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: (Object | URL)[] = []; - const _trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: Set = new Set(); + const _trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: VocabTrustSet = new Set(); let _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object__array = values[\\"https://www.w3.org/ns/activitystreams#object\\"]; @@ -26829,7 +29108,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; const _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target: (Object | URL)[] = []; - const _trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target: Set = new Set(); + const _trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target: VocabTrustSet = new Set(); let _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target__array = values[\\"https://www.w3.org/ns/activitystreams#target\\"]; @@ -26870,7 +29149,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target; const _u4QGFbRFcYmPEKGbPv1hpBR9r5G_result: (Object | URL)[] = []; - const _trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result: Set = new Set(); + const _trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result: VocabTrustSet = new Set(); let _u4QGFbRFcYmPEKGbPv1hpBR9r5G_result__array = values[\\"https://www.w3.org/ns/activitystreams#result\\"]; @@ -26911,7 +29190,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = _u4QGFbRFcYmPEKGbPv1hpBR9r5G_result; const _25zu2s3VxVujgEKqrDycjE284XQR_origin: (Object | URL)[] = []; - const _trust_25zu2s3VxVujgEKqrDycjE284XQR_origin: Set = new Set(); + const _trust_25zu2s3VxVujgEKqrDycjE284XQR_origin: VocabTrustSet = new Set(); let _25zu2s3VxVujgEKqrDycjE284XQR_origin__array = values[\\"https://www.w3.org/ns/activitystreams#origin\\"]; @@ -26952,7 +29231,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = _25zu2s3VxVujgEKqrDycjE284XQR_origin; const _3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument: (Object | URL)[] = []; - const _trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument: Set = new Set(); + const _trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument: VocabTrustSet = new Set(); let _3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument__array = values[\\"https://www.w3.org/ns/activitystreams#instrument\\"]; @@ -27356,6 +29635,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -27917,7 +30202,8 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} options ); copyPortableProvenance(this, clone); - clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice(); + clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.length < vocabSparseArrayMinimumLength + ? this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice() : vocabCopyPropertyArray(this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name); if (\\"name\\" in values && values.name != null) { if (typeof values.name === \\"string\\" || values.name instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -27930,7 +30216,8 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} ); } } - clone.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value = this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value.slice(); + clone.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value = this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value.length < vocabSparseArrayMinimumLength + ? this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value.slice() : vocabCopyPropertyArray(this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value); if (\\"value\\" in values && values.value != null) { if (typeof values.value === \\"string\\" || values.value instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -27969,6 +30256,12 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -28755,7 +31048,8 @@ unit?: string | null;numericalValue?: Decimal | null;} options ); copyPortableProvenance(this, clone); - clone.#_27fgyFbosTtMAhuepJH8K3ZGURT6 = this.#_27fgyFbosTtMAhuepJH8K3ZGURT6.slice(); + clone.#_27fgyFbosTtMAhuepJH8K3ZGURT6 = this.#_27fgyFbosTtMAhuepJH8K3ZGURT6.length < vocabSparseArrayMinimumLength + ? this.#_27fgyFbosTtMAhuepJH8K3ZGURT6.slice() : vocabCopyPropertyArray(this.#_27fgyFbosTtMAhuepJH8K3ZGURT6); if (\\"unit\\" in values && values.unit != null) { if (typeof values.unit === \\"string\\") { // @ts-ignore: type is checked above. @@ -28768,7 +31062,8 @@ unit?: string | null;numericalValue?: Decimal | null;} ); } } - clone.#_1GQx8o2RgxRs4x9G5uT39XYBv7D = this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D.slice(); + clone.#_1GQx8o2RgxRs4x9G5uT39XYBv7D = this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D.length < vocabSparseArrayMinimumLength + ? this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D.slice() : vocabCopyPropertyArray(this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D); if (\\"numericalValue\\" in values && values.numericalValue != null) { if (typeof values.numericalValue === \\"string\\" && isDecimal(values.numericalValue)) { // @ts-ignore: type is checked above. @@ -28807,6 +31102,12 @@ unit?: string | null;numericalValue?: Decimal | null;} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -29389,10 +31690,10 @@ export class AnnounceAuthorization extends Object { } #_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); #_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); /** * Constructs a new instance of AnnounceAuthorization with the given values. @@ -29520,12 +31821,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as AnnounceAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice();clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject); + const clone = super.clone(values, options) as unknown as AnnounceAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < vocabSparseArrayMinimumLength + ? this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice() : vocabCopyPropertyArray(this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject);clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = vocabCopyTrustSet( + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, + ); if (\\"interactingObject\\" in values && values.interactingObject != null) { if (values.interactingObject instanceof Object || values.interactingObject instanceof URL) { // @ts-ignore: type is checked above. clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = [values.interactingObject]; - clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set([0]); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The interactingObject must be of type \\" + @@ -29533,12 +31838,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice();clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget); + clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < vocabSparseArrayMinimumLength + ? this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice() : vocabCopyPropertyArray(this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget);clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = vocabCopyTrustSet( + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, + ); if (\\"interactionTarget\\" in values && values.interactionTarget != null) { if (values.interactionTarget instanceof Object || values.interactionTarget instanceof URL) { // @ts-ignore: type is checked above. clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = [values.interactionTarget]; - clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set([0]); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The interactionTarget must be of type \\" + @@ -29572,6 +31881,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -29621,17 +31936,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as AnnounceAuthorization; - for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { - const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + { + const array = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { - const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + { + const array = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } } } } }); } @@ -29963,7 +32308,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#interactingObject\\"); @@ -30031,7 +32377,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -30381,7 +32728,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#interactionTarget\\"); @@ -30449,7 +32797,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -30826,7 +33175,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); let _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject__array = values[\\"https://gotosocial.org/ns#interactingObject\\"]; @@ -30867,7 +33216,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; const _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); let _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget__array = values[\\"https://gotosocial.org/ns#interactionTarget\\"]; @@ -31165,6 +33514,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -31775,7 +34130,8 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: options ); copyPortableProvenance(this, clone); - clone.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature = this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.slice(); + clone.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature = this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.length < vocabSparseArrayMinimumLength + ? this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.slice() : vocabCopyPropertyArray(this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature); if (\\"canFeature\\" in values && values.canFeature != null) { if (values.canFeature instanceof InteractionRule) { // @ts-ignore: type is checked above. @@ -31788,7 +34144,8 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: ); } } - clone.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike = this.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.slice(); + clone.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike = this.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.length < vocabSparseArrayMinimumLength + ? this.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.slice() : vocabCopyPropertyArray(this.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike); if (\\"canLike\\" in values && values.canLike != null) { if (values.canLike instanceof InteractionRule) { // @ts-ignore: type is checked above. @@ -31801,7 +34158,8 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: ); } } - clone.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply = this.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.slice(); + clone.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply = this.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.length < vocabSparseArrayMinimumLength + ? this.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.slice() : vocabCopyPropertyArray(this.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply); if (\\"canReply\\" in values && values.canReply != null) { if (values.canReply instanceof InteractionRule) { // @ts-ignore: type is checked above. @@ -31814,7 +34172,8 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: ); } } - clone.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce = this.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.slice(); + clone.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce = this.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.length < vocabSparseArrayMinimumLength + ? this.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.slice() : vocabCopyPropertyArray(this.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce); if (\\"canAnnounce\\" in values && values.canAnnounce != null) { if (values.canAnnounce instanceof InteractionRule) { // @ts-ignore: type is checked above. @@ -31827,7 +34186,8 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: ); } } - clone.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote = this.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.slice(); + clone.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote = this.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.length < vocabSparseArrayMinimumLength + ? this.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.slice() : vocabCopyPropertyArray(this.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote); if (\\"canQuote\\" in values && values.canQuote != null) { if (values.canQuote instanceof InteractionRule) { // @ts-ignore: type is checked above. @@ -31866,6 +34226,12 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -31909,38 +34275,113 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.length; i++) { - const value = node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature[i] = context.value(value); + { + const array = node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.length; i++) { + const value = node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.length; i++) { - const value = node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike[i] = context.value(value); + { + const array = node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.length; i++) { + const value = node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.length; i++) { - const value = node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply[i] = context.value(value); + { + const array = node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.length; i++) { + const value = node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.length; i++) { - const value = node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce[i]; - if (value != null && typeof value === \\"object\\") { - node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce[i] = context.value(value); + { + const array = node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.length; i++) { + const value = node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce[i]; + if (value != null && typeof value === \\"object\\") { + node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.length; i++) { - const value = node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote[i]; - if (value != null && typeof value === \\"object\\") { - node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote[i] = context.value(value); + { + const array = node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.length; i++) { + const value = node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote[i]; + if (value != null && typeof value === \\"object\\") { + node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote[i] = context.value(value); + } + } } } } }); } @@ -32879,10 +35320,34 @@ manualApprovals?: (URL)[];} ); } - if (Array.isArray(values.automaticApprovals) && - values.automaticApprovals.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.automaticApprovals)) { + const array = values.automaticApprovals; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.automaticApprovals; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = values.automaticApprovals.slice(); + this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = copied; } else { throw new TypeError( @@ -32915,10 +35380,34 @@ manualApprovals?: (URL)[];} ); } - if (Array.isArray(values.manualApprovals) && - values.manualApprovals.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.manualApprovals)) { + const array = values.manualApprovals; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.manualApprovals; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = values.manualApprovals.slice(); + this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = copied; } else { throw new TypeError( @@ -32986,7 +35475,8 @@ manualApprovals?: (URL)[];} options ); copyPortableProvenance(this, clone); - clone.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.slice(); + clone.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.length < vocabSparseArrayMinimumLength + ? this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.slice() : vocabCopyPropertyArray(this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval); if (\\"automaticApproval\\" in values && values.automaticApproval != null) { if (values.automaticApproval instanceof URL) { // @ts-ignore: type is checked above. @@ -33010,10 +35500,34 @@ manualApprovals?: (URL)[];} ); } - if (Array.isArray(values.automaticApprovals) && - values.automaticApprovals.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.automaticApprovals)) { + const array = values.automaticApprovals; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.automaticApprovals; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = values.automaticApprovals.slice(); + clone.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = copied; } else { throw new TypeError( @@ -33022,7 +35536,8 @@ manualApprovals?: (URL)[];} ); } } - clone.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.slice(); + clone.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.length < vocabSparseArrayMinimumLength + ? this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.slice() : vocabCopyPropertyArray(this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval); if (\\"manualApproval\\" in values && values.manualApproval != null) { if (values.manualApproval instanceof URL) { // @ts-ignore: type is checked above. @@ -33046,10 +35561,34 @@ manualApprovals?: (URL)[];} ); } - if (Array.isArray(values.manualApprovals) && - values.manualApprovals.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.manualApprovals)) { + const array = values.manualApprovals; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.manualApprovals; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = values.manualApprovals.slice(); + clone.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = copied; } else { throw new TypeError( @@ -33084,6 +35623,12 @@ manualApprovals?: (URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -33129,17 +35674,47 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.length; i++) { - const value = node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval[i] = context.value(value); + { + const array = node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.length; i++) { + const value = node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.length; i++) { - const value = node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval[i]; - if (value != null && typeof value === \\"object\\") { - node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval[i] = context.value(value); + { + const array = node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.length; i++) { + const value = node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval[i] = context.value(value); + } + } } } } }); } @@ -33663,10 +36238,10 @@ export class LikeAuthorization extends Object { } #_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); #_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); /** * Constructs a new instance of LikeAuthorization with the given values. @@ -33794,12 +36369,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as LikeAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice();clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject); + const clone = super.clone(values, options) as unknown as LikeAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < vocabSparseArrayMinimumLength + ? this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice() : vocabCopyPropertyArray(this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject);clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = vocabCopyTrustSet( + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, + ); if (\\"interactingObject\\" in values && values.interactingObject != null) { if (values.interactingObject instanceof Object || values.interactingObject instanceof URL) { // @ts-ignore: type is checked above. clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = [values.interactingObject]; - clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set([0]); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The interactingObject must be of type \\" + @@ -33807,12 +36386,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice();clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget); + clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < vocabSparseArrayMinimumLength + ? this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice() : vocabCopyPropertyArray(this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget);clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = vocabCopyTrustSet( + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, + ); if (\\"interactionTarget\\" in values && values.interactionTarget != null) { if (values.interactionTarget instanceof Object || values.interactionTarget instanceof URL) { // @ts-ignore: type is checked above. clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = [values.interactionTarget]; - clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set([0]); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The interactionTarget must be of type \\" + @@ -33846,6 +36429,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -33895,17 +36484,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as LikeAuthorization; - for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { - const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + { + const array = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { - const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + { + const array = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } } } } }); } @@ -34237,7 +36856,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#interactingObject\\"); @@ -34305,7 +36925,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -34655,7 +37276,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#interactionTarget\\"); @@ -34723,7 +37345,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -35100,7 +37723,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); let _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject__array = values[\\"https://gotosocial.org/ns#interactingObject\\"]; @@ -35141,7 +37764,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; const _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); let _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget__array = values[\\"https://gotosocial.org/ns#interactionTarget\\"]; @@ -35438,6 +38061,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -35817,10 +38446,10 @@ export class ReplyAuthorization extends Object { } #_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); #_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); /** * Constructs a new instance of ReplyAuthorization with the given values. @@ -35948,12 +38577,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as ReplyAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice();clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject); + const clone = super.clone(values, options) as unknown as ReplyAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < vocabSparseArrayMinimumLength + ? this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice() : vocabCopyPropertyArray(this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject);clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = vocabCopyTrustSet( + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, + ); if (\\"interactingObject\\" in values && values.interactingObject != null) { if (values.interactingObject instanceof Object || values.interactingObject instanceof URL) { // @ts-ignore: type is checked above. clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = [values.interactingObject]; - clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set([0]); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The interactingObject must be of type \\" + @@ -35961,12 +38594,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice();clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget); + clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < vocabSparseArrayMinimumLength + ? this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice() : vocabCopyPropertyArray(this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget);clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = vocabCopyTrustSet( + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, + ); if (\\"interactionTarget\\" in values && values.interactionTarget != null) { if (values.interactionTarget instanceof Object || values.interactionTarget instanceof URL) { // @ts-ignore: type is checked above. clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = [values.interactionTarget]; - clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set([0]); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The interactionTarget must be of type \\" + @@ -36000,6 +38637,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -36049,17 +38692,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as ReplyAuthorization; - for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { - const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + { + const array = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { - const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + { + const array = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } } } } }); } @@ -36391,7 +39064,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#interactingObject\\"); @@ -36459,7 +39133,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -36809,7 +39484,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#interactionTarget\\"); @@ -36877,7 +39553,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -37254,7 +39931,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); let _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject__array = values[\\"https://gotosocial.org/ns#interactingObject\\"]; @@ -37295,7 +39972,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; const _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); let _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget__array = values[\\"https://gotosocial.org/ns#interactionTarget\\"]; @@ -37592,6 +40269,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -37971,10 +40654,10 @@ export class QuoteAuthorization extends Object { } #_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); #_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); /** * Constructs a new instance of QuoteAuthorization with the given values. @@ -38102,12 +40785,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as QuoteAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice();clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject); + const clone = super.clone(values, options) as unknown as QuoteAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < vocabSparseArrayMinimumLength + ? this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice() : vocabCopyPropertyArray(this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject);clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = vocabCopyTrustSet( + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, + ); if (\\"interactingObject\\" in values && values.interactingObject != null) { if (values.interactingObject instanceof Object || values.interactingObject instanceof URL) { // @ts-ignore: type is checked above. clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = [values.interactingObject]; - clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set([0]); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The interactingObject must be of type \\" + @@ -38115,12 +40802,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice();clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget); + clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < vocabSparseArrayMinimumLength + ? this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice() : vocabCopyPropertyArray(this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget);clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = vocabCopyTrustSet( + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, + ); if (\\"interactionTarget\\" in values && values.interactionTarget != null) { if (values.interactionTarget instanceof Object || values.interactionTarget instanceof URL) { // @ts-ignore: type is checked above. clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = [values.interactionTarget]; - clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set([0]); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The interactionTarget must be of type \\" + @@ -38154,6 +40845,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -38203,17 +40900,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as QuoteAuthorization; - for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { - const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + { + const array = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { - const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + { + const array = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } } } } }); } @@ -38544,7 +41271,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#interactingObject\\"); @@ -38612,7 +41340,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -38962,7 +41691,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#interactionTarget\\"); @@ -39030,7 +41760,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -39407,7 +42138,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); let _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject__array = values[\\"https://gotosocial.org/ns#interactingObject\\"]; @@ -39448,7 +42179,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; const _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); let _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget__array = values[\\"https://gotosocial.org/ns#interactionTarget\\"]; @@ -39745,6 +42476,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -40193,7 +42930,7 @@ export class Translation { #_diXuPmFWiEqfLPhhrxg6Xc7ixZG: (Intl.Locale)[] = []; #_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR: Set = new Set(); + #_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR: VocabTrustSet = new Set(); #_Msz9PwRg7cWkiXPL4ixyQLtuuH7: (URL)[] = []; #_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated: (Temporal.Instant)[] = []; #_4KvkQNz1JjGs8S7iJDcGrUYETbUW: (URL)[] = []; @@ -40275,14 +43012,36 @@ urls?: ((URL | Link))[];} ); } - if (Array.isArray(values.translators) && - values.translators.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.translators)) { + const array = values.translators; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.translators; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = values.translators.slice(); + this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = copied; - for (let i = 0; i < values.translators.length; i++) { - this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.add(i); - } + vocabSetTrustPrefix(this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR, this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.length); } else { throw new TypeError( @@ -40354,10 +43113,34 @@ urls?: ((URL | Link))[];} ); } - if (Array.isArray(values.urls) && - values.urls.every(v => v instanceof URL || v instanceof Link)) { + let copied!: (URL | Link)[]; + let valid = false; + if (Array.isArray(values.urls)) { + const array = values.urls; + const test = (v: URL | Link): boolean => v instanceof URL || v instanceof Link; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.urls; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = values.urls.slice(); + this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = copied; } else { throw new TypeError( @@ -40425,7 +43208,8 @@ urls?: ((URL | Link))[];} options ); copyPortableProvenance(this, clone); - clone.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG = this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG.slice(); + clone.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG = this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG.length < vocabSparseArrayMinimumLength + ? this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG.slice() : vocabCopyPropertyArray(this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG); if (\\"language\\" in values && values.language != null) { if (values.language instanceof Intl.Locale) { // @ts-ignore: type is checked above. @@ -40438,12 +43222,16 @@ urls?: ((URL | Link))[];} ); } } - clone.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.slice();clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = new Set(this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR); + clone.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.length < vocabSparseArrayMinimumLength + ? this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.slice() : vocabCopyPropertyArray(this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR);clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = vocabCopyTrustSet( + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR, clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR, + ); if (\\"translator\\" in values && values.translator != null) { if (values.translator instanceof Application || values.translator instanceof Group || values.translator instanceof Organization || values.translator instanceof Person || values.translator instanceof Service || values.translator instanceof URL) { // @ts-ignore: type is checked above. clone.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = [values.translator]; - clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = new Set([0]); + clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = new Set(); + clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The translator must be of type \\" + @@ -40462,15 +43250,37 @@ urls?: ((URL | Link))[];} ); } - if (Array.isArray(values.translators) && - values.translators.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.translators)) { + const array = values.translators; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.translators; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = values.translators.slice(); + clone.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = copied; clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = new Set(); - for (let i = 0; i < values.translators.length; i++) { - clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.add(i); - } + vocabSetTrustPrefix(clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR, clone.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.length); } else { throw new TypeError( @@ -40479,7 +43289,8 @@ urls?: ((URL | Link))[];} ); } } - clone.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7 = this.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7.slice(); + clone.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7 = this.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7.length < vocabSparseArrayMinimumLength + ? this.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7.slice() : vocabCopyPropertyArray(this.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7); if (\\"original\\" in values && values.original != null) { if (values.original instanceof URL) { // @ts-ignore: type is checked above. @@ -40492,7 +43303,8 @@ urls?: ((URL | Link))[];} ); } } - clone.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated = this.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated.slice(); + clone.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated = this.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated.length < vocabSparseArrayMinimumLength + ? this.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated.slice() : vocabCopyPropertyArray(this.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated); if (\\"sourceUpdated\\" in values && values.sourceUpdated != null) { if (isTemporalInstant(values.sourceUpdated)) { // @ts-ignore: type is checked above. @@ -40505,7 +43317,8 @@ urls?: ((URL | Link))[];} ); } } - clone.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW = this.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW.slice(); + clone.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW = this.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW.length < vocabSparseArrayMinimumLength + ? this.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW.slice() : vocabCopyPropertyArray(this.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW); if (\\"basis\\" in values && values.basis != null) { if (values.basis instanceof URL) { // @ts-ignore: type is checked above. @@ -40518,7 +43331,8 @@ urls?: ((URL | Link))[];} ); } } - clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.slice(); + clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length < vocabSparseArrayMinimumLength + ? this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.slice() : vocabCopyPropertyArray(this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url); if (\\"url\\" in values && values.url != null) { if (values.url instanceof URL || values.url instanceof Link) { // @ts-ignore: type is checked above. @@ -40542,10 +43356,34 @@ urls?: ((URL | Link))[];} ); } - if (Array.isArray(values.urls) && - values.urls.every(v => v instanceof URL || v instanceof Link)) { + let copied!: (URL | Link)[]; + let valid = false; + if (Array.isArray(values.urls)) { + const array = values.urls; + const test = (v: URL | Link): boolean => v instanceof URL || v instanceof Link; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.urls; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = values.urls.slice(); + clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = copied; } else { throw new TypeError( @@ -40580,6 +43418,12 @@ urls?: ((URL | Link))[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -40625,31 +43469,91 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.length; i++) { - const value = node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[i]; - if (value != null && typeof value === \\"object\\") { - node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[i] = context.value(value); + { + const array = node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.length; i++) { + const value = node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7.length; i++) { - const value = node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7[i]; - if (value != null && typeof value === \\"object\\") { - node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7[i] = context.value(value); + { + const array = node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7.length; i++) { + const value = node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7[i]; + if (value != null && typeof value === \\"object\\") { + node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW.length; i++) { - const value = node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW[i] = context.value(value); + { + const array = node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW.length; i++) { + const value = node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length; i++) { - const value = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i] = context.value(value); + { + const array = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length; i++) { + const value = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i] = context.value(value); + } + } } } } }); } @@ -41060,7 +43964,8 @@ deepCloneDescriptors.set(this.prototype, { } let v = this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[0]; if (!(v instanceof URL) && - !this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(0)) { + !(0 < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://schema.org/translator\\"); @@ -41128,7 +44033,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, null, v.id, options, )) && - !this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(0)) { + !(0 < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -41221,7 +44127,8 @@ deepCloneDescriptors.set(this.prototype, { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(i)) { + !(i < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://schema.org/translator\\"); @@ -41293,7 +44200,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, null, v.id, options, )) && - !this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(i)) { + !(i < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -41905,7 +44813,7 @@ get urls(): ((URL | Link))[] { instance.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG = _diXuPmFWiEqfLPhhrxg6Xc7ixZG; const _hQqsdZa1zG8Ra1bQ3MBVsnmGnBR: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR: Set = new Set(); + const _trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR: VocabTrustSet = new Set(); let _hQqsdZa1zG8Ra1bQ3MBVsnmGnBR__array = values[\\"https://schema.org/translator\\"]; @@ -42310,10 +45218,10 @@ export class FeatureAuthorization extends Object { } #_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); #_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); /** * Constructs a new instance of FeatureAuthorization with the given values. @@ -42441,12 +45349,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as FeatureAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice();clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject); + const clone = super.clone(values, options) as unknown as FeatureAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < vocabSparseArrayMinimumLength + ? this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice() : vocabCopyPropertyArray(this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject);clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = vocabCopyTrustSet( + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, + ); if (\\"interactingObject\\" in values && values.interactingObject != null) { if (values.interactingObject instanceof Object || values.interactingObject instanceof URL) { // @ts-ignore: type is checked above. clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = [values.interactingObject]; - clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set([0]); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The interactingObject must be of type \\" + @@ -42454,12 +45366,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice();clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget); + clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < vocabSparseArrayMinimumLength + ? this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice() : vocabCopyPropertyArray(this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget);clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = vocabCopyTrustSet( + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, + ); if (\\"interactionTarget\\" in values && values.interactionTarget != null) { if (values.interactionTarget instanceof Object || values.interactionTarget instanceof URL) { // @ts-ignore: type is checked above. clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = [values.interactionTarget]; - clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set([0]); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The interactionTarget must be of type \\" + @@ -42493,6 +45409,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -42542,17 +45464,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as FeatureAuthorization; - for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { - const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + { + const array = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { - const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + { + const array = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } } } } }); } @@ -42882,7 +45834,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#interactingObject\\"); @@ -42950,7 +45903,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -43299,7 +46253,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://gotosocial.org/ns#interactionTarget\\"); @@ -43367,7 +46322,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -43744,7 +46700,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); let _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject__array = values[\\"https://gotosocial.org/ns#interactingObject\\"]; @@ -43785,7 +46741,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; const _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); let _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget__array = values[\\"https://gotosocial.org/ns#interactionTarget\\"]; @@ -44079,6 +47035,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -44456,40 +47418,40 @@ export class Collection extends Object { #_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems: (number)[] = []; #_3UyUdxnyn6cDn53QKrh4MBiearma_current: (CollectionPage | URL)[] = []; - #_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current: Set = new Set(); + #_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current: VocabTrustSet = new Set(); #_J52RqweMe6hhv7RnLJMC8BExTE5_first: (CollectionPage | URL)[] = []; - #_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first: Set = new Set(); + #_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first: VocabTrustSet = new Set(); #_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last: (CollectionPage | URL)[] = []; - #_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last: Set = new Set(); + #_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last: VocabTrustSet = new Set(); #_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: (Object | Link | URL)[] = []; - #_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: Set = new Set(); + #_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: VocabTrustSet = new Set(); #_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf: (Object | URL)[] = []; - #_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf: Set = new Set(); + #_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf: VocabTrustSet = new Set(); #_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf: (Object | URL)[] = []; - #_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf: Set = new Set(); + #_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf: VocabTrustSet = new Set(); #_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf: (Object | URL)[] = []; - #_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf: Set = new Set(); + #_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf: VocabTrustSet = new Set(); #_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf: (Object | URL)[] = []; - #_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf: Set = new Set(); + #_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf: VocabTrustSet = new Set(); #_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf: (Object | URL)[] = []; - #_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf: Set = new Set(); + #_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf: VocabTrustSet = new Set(); #_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf: (Object | URL)[] = []; - #_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf: Set = new Set(); + #_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf: VocabTrustSet = new Set(); #_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf: (Object | URL)[] = []; - #_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf: Set = new Set(); + #_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf: VocabTrustSet = new Set(); #_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf: (Object | URL)[] = []; - #_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf: Set = new Set(); + #_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf: VocabTrustSet = new Set(); /** * Constructs a new instance of Collection with the given values. @@ -44580,14 +47542,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (\\"items\\" in values && values.items != null) { - if (Array.isArray(values.items) && - values.items.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.items)) { + const array = values.items; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.items; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = values.items.slice(); + this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = copied; - for (let i = 0; i < values.items.length; i++) { - this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.add(i); - } + vocabSetTrustPrefix(this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length); } else { throw new TypeError( @@ -44766,7 +47750,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Collection;clone.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems = this.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems.slice(); + const clone = super.clone(values, options) as unknown as Collection;clone.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems = this.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems.length < vocabSparseArrayMinimumLength + ? this.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems.slice() : vocabCopyPropertyArray(this.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems); if (\\"totalItems\\" in values && values.totalItems != null) { if (typeof values.totalItems === \\"number\\" && Number.isInteger(values.totalItems) && values.totalItems >= 0) { // @ts-ignore: type is checked above. @@ -44779,12 +47764,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3UyUdxnyn6cDn53QKrh4MBiearma_current = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.slice();clone.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current = new Set(this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current); + clone.#_3UyUdxnyn6cDn53QKrh4MBiearma_current = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.length < vocabSparseArrayMinimumLength + ? this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.slice() : vocabCopyPropertyArray(this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current);clone.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current = vocabCopyTrustSet( + this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current, clone.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current, + ); if (\\"current\\" in values && values.current != null) { if (values.current instanceof CollectionPage || values.current instanceof URL) { // @ts-ignore: type is checked above. clone.#_3UyUdxnyn6cDn53QKrh4MBiearma_current = [values.current]; - clone.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current = new Set([0]); + clone.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current = new Set(); + clone.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The current must be of type \\" + @@ -44792,12 +47781,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_J52RqweMe6hhv7RnLJMC8BExTE5_first = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.slice();clone.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first = new Set(this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first); + clone.#_J52RqweMe6hhv7RnLJMC8BExTE5_first = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.length < vocabSparseArrayMinimumLength + ? this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.slice() : vocabCopyPropertyArray(this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first);clone.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first = vocabCopyTrustSet( + this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first, clone.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first, + ); if (\\"first\\" in values && values.first != null) { if (values.first instanceof CollectionPage || values.first instanceof URL) { // @ts-ignore: type is checked above. clone.#_J52RqweMe6hhv7RnLJMC8BExTE5_first = [values.first]; - clone.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first = new Set([0]); + clone.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first = new Set(); + clone.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The first must be of type \\" + @@ -44805,12 +47798,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.slice();clone.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = new Set(this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last); + clone.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.length < vocabSparseArrayMinimumLength + ? this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.slice() : vocabCopyPropertyArray(this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last);clone.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = vocabCopyTrustSet( + this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last, clone.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last, + ); if (\\"last\\" in values && values.last != null) { if (values.last instanceof CollectionPage || values.last instanceof URL) { // @ts-ignore: type is checked above. clone.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = [values.last]; - clone.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = new Set([0]); + clone.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = new Set(); + clone.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The last must be of type \\" + @@ -44818,18 +47815,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.slice();clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = new Set(this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items); + clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length < vocabSparseArrayMinimumLength + ? this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.slice() : vocabCopyPropertyArray(this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items);clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = vocabCopyTrustSet( + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, + ); if (\\"items\\" in values && values.items != null) { - if (Array.isArray(values.items) && - values.items.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.items)) { + const array = values.items; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.items; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = values.items.slice(); + clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = copied; clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = new Set(); - for (let i = 0; i < values.items.length; i++) { - clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length); } else { throw new TypeError( @@ -44838,12 +47860,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.slice();clone.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = new Set(this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf); + clone.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.length < vocabSparseArrayMinimumLength + ? this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.slice() : vocabCopyPropertyArray(this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf);clone.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = vocabCopyTrustSet( + this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf, clone.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf, + ); if (\\"likesOf\\" in values && values.likesOf != null) { if (values.likesOf instanceof Object || values.likesOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = [values.likesOf]; - clone.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = new Set([0]); + clone.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = new Set(); + clone.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The likesOf must be of type \\" + @@ -44851,12 +47877,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.slice();clone.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = new Set(this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf); + clone.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.length < vocabSparseArrayMinimumLength + ? this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.slice() : vocabCopyPropertyArray(this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf);clone.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = vocabCopyTrustSet( + this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf, clone.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf, + ); if (\\"sharesOf\\" in values && values.sharesOf != null) { if (values.sharesOf instanceof Object || values.sharesOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = [values.sharesOf]; - clone.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = new Set([0]); + clone.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = new Set(); + clone.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The sharesOf must be of type \\" + @@ -44864,12 +47894,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.slice();clone.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = new Set(this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf); + clone.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.length < vocabSparseArrayMinimumLength + ? this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.slice() : vocabCopyPropertyArray(this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf);clone.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = vocabCopyTrustSet( + this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf, clone.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf, + ); if (\\"repliesOf\\" in values && values.repliesOf != null) { if (values.repliesOf instanceof Object || values.repliesOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = [values.repliesOf]; - clone.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = new Set([0]); + clone.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = new Set(); + clone.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The repliesOf must be of type \\" + @@ -44877,12 +47911,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.slice();clone.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = new Set(this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf); + clone.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.length < vocabSparseArrayMinimumLength + ? this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.slice() : vocabCopyPropertyArray(this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf);clone.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = vocabCopyTrustSet( + this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf, clone.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf, + ); if (\\"inboxOf\\" in values && values.inboxOf != null) { if (values.inboxOf instanceof Object || values.inboxOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = [values.inboxOf]; - clone.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = new Set([0]); + clone.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = new Set(); + clone.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The inboxOf must be of type \\" + @@ -44890,12 +47928,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.slice();clone.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = new Set(this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf); + clone.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.length < vocabSparseArrayMinimumLength + ? this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.slice() : vocabCopyPropertyArray(this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf);clone.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = vocabCopyTrustSet( + this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf, clone.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf, + ); if (\\"outboxOf\\" in values && values.outboxOf != null) { if (values.outboxOf instanceof Object || values.outboxOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = [values.outboxOf]; - clone.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = new Set([0]); + clone.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = new Set(); + clone.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The outboxOf must be of type \\" + @@ -44903,12 +47945,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.slice();clone.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = new Set(this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf); + clone.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.length < vocabSparseArrayMinimumLength + ? this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.slice() : vocabCopyPropertyArray(this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf);clone.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = vocabCopyTrustSet( + this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf, clone.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf, + ); if (\\"followersOf\\" in values && values.followersOf != null) { if (values.followersOf instanceof Object || values.followersOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = [values.followersOf]; - clone.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = new Set([0]); + clone.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = new Set(); + clone.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The followersOf must be of type \\" + @@ -44916,12 +47962,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.slice();clone.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = new Set(this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf); + clone.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.length < vocabSparseArrayMinimumLength + ? this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.slice() : vocabCopyPropertyArray(this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf);clone.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = vocabCopyTrustSet( + this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf, clone.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf, + ); if (\\"followingOf\\" in values && values.followingOf != null) { if (values.followingOf instanceof Object || values.followingOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = [values.followingOf]; - clone.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = new Set([0]); + clone.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = new Set(); + clone.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The followingOf must be of type \\" + @@ -44929,12 +47979,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.slice();clone.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = new Set(this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf); + clone.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.length < vocabSparseArrayMinimumLength + ? this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.slice() : vocabCopyPropertyArray(this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf);clone.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = vocabCopyTrustSet( + this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf, clone.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf, + ); if (\\"likedOf\\" in values && values.likedOf != null) { if (values.likedOf instanceof Object || values.likedOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = [values.likedOf]; - clone.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = new Set([0]); + clone.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = new Set(); + clone.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The likedOf must be of type \\" + @@ -44968,6 +48022,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -45017,87 +48077,267 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Collection; - for (let i = 0; i < node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.length; i++) { - const value = node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[i] = context.value(value); + { + const array = node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.length; i++) { + const value = node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.length; i++) { - const value = node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[i]; - if (value != null && typeof value === \\"object\\") { - node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[i] = context.value(value); + { + const array = node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.length; i++) { + const value = node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[i]; + if (value != null && typeof value === \\"object\\") { + node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.length; i++) { - const value = node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[i]; - if (value != null && typeof value === \\"object\\") { - node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[i] = context.value(value); + { + const array = node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.length; i++) { + const value = node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[i]; + if (value != null && typeof value === \\"object\\") { + node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { - const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + { + const array = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { + const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.length; i++) { - const value = node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[i] = context.value(value); + { + const array = node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.length; i++) { + const value = node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.length; i++) { - const value = node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[i] = context.value(value); + { + const array = node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.length; i++) { + const value = node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.length; i++) { - const value = node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[i] = context.value(value); + { + const array = node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.length; i++) { + const value = node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.length; i++) { - const value = node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[i] = context.value(value); + { + const array = node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.length; i++) { + const value = node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.length; i++) { - const value = node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[i] = context.value(value); + { + const array = node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.length; i++) { + const value = node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.length; i++) { - const value = node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[i] = context.value(value); + { + const array = node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.length; i++) { + const value = node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.length; i++) { - const value = node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[i] = context.value(value); + { + const array = node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.length; i++) { + const value = node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.length; i++) { - const value = node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[i] = context.value(value); + { + const array = node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.length; i++) { + const value = node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[i] = context.value(value); + } + } } } } }); } @@ -45445,7 +48685,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[0]; if (!(v instanceof URL) && - !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { + !(0 < (this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current[vocabTrustPrefix] ?? 0) || + this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#current\\"); @@ -45513,7 +48754,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { + !(0 < (this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current[vocabTrustPrefix] ?? 0) || + this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -45864,7 +49106,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[0]; if (!(v instanceof URL) && - !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { + !(0 < (this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first[vocabTrustPrefix] ?? 0) || + this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#first\\"); @@ -45932,7 +49175,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { + !(0 < (this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first[vocabTrustPrefix] ?? 0) || + this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -46283,7 +49527,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[0]; if (!(v instanceof URL) && - !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { + !(0 < (this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[vocabTrustPrefix] ?? 0) || + this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#last\\"); @@ -46351,7 +49596,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { + !(0 < (this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[vocabTrustPrefix] ?? 0) || + this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -46717,7 +49963,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { + !(i < (this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[vocabTrustPrefix] ?? 0) || + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#items\\"); @@ -46789,7 +50036,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { + !(i < (this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[vocabTrustPrefix] ?? 0) || + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -47140,7 +50388,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[0]; if (!(v instanceof URL) && - !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { + !(0 < (this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[vocabTrustPrefix] ?? 0) || + this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/5711#likesOf\\"); @@ -47208,7 +50457,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { + !(0 < (this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[vocabTrustPrefix] ?? 0) || + this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -47558,7 +50808,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[0]; if (!(v instanceof URL) && - !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { + !(0 < (this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[vocabTrustPrefix] ?? 0) || + this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/5711#sharesOf\\"); @@ -47626,7 +50877,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { + !(0 < (this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[vocabTrustPrefix] ?? 0) || + this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -47976,7 +51228,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[0]; if (!(v instanceof URL) && - !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { + !(0 < (this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[vocabTrustPrefix] ?? 0) || + this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/5711#repliesOf\\"); @@ -48044,7 +51297,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { + !(0 < (this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[vocabTrustPrefix] ?? 0) || + this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -48394,7 +51648,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[0]; if (!(v instanceof URL) && - !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { + !(0 < (this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/5711#inboxOf\\"); @@ -48462,7 +51717,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { + !(0 < (this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -48812,7 +52068,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[0]; if (!(v instanceof URL) && - !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { + !(0 < (this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[vocabTrustPrefix] ?? 0) || + this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/5711#outboxOf\\"); @@ -48880,7 +52137,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { + !(0 < (this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[vocabTrustPrefix] ?? 0) || + this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -49230,7 +52488,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[0]; if (!(v instanceof URL) && - !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { + !(0 < (this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[vocabTrustPrefix] ?? 0) || + this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/5711#followersOf\\"); @@ -49298,7 +52557,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { + !(0 < (this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[vocabTrustPrefix] ?? 0) || + this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -49648,7 +52908,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[0]; if (!(v instanceof URL) && - !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { + !(0 < (this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/5711#followingOf\\"); @@ -49716,7 +52977,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { + !(0 < (this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -50066,7 +53328,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[0]; if (!(v instanceof URL) && - !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { + !(0 < (this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/5711#likedOf\\"); @@ -50134,7 +53397,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { + !(0 < (this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -50999,7 +54263,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems = _XDbmNDuWHmrhqH712zqtecdbv1V_totalItems; const _3UyUdxnyn6cDn53QKrh4MBiearma_current: (CollectionPage | URL)[] = []; - const _trust_3UyUdxnyn6cDn53QKrh4MBiearma_current: Set = new Set(); + const _trust_3UyUdxnyn6cDn53QKrh4MBiearma_current: VocabTrustSet = new Set(); let _3UyUdxnyn6cDn53QKrh4MBiearma_current__array = values[\\"https://www.w3.org/ns/activitystreams#current\\"]; @@ -51040,7 +54304,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_3UyUdxnyn6cDn53QKrh4MBiearma_current = _3UyUdxnyn6cDn53QKrh4MBiearma_current; const _J52RqweMe6hhv7RnLJMC8BExTE5_first: (CollectionPage | URL)[] = []; - const _trust_J52RqweMe6hhv7RnLJMC8BExTE5_first: Set = new Set(); + const _trust_J52RqweMe6hhv7RnLJMC8BExTE5_first: VocabTrustSet = new Set(); let _J52RqweMe6hhv7RnLJMC8BExTE5_first__array = values[\\"https://www.w3.org/ns/activitystreams#first\\"]; @@ -51081,7 +54345,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_J52RqweMe6hhv7RnLJMC8BExTE5_first = _J52RqweMe6hhv7RnLJMC8BExTE5_first; const _gyJJnyEFnuNVi1HFZKfAn3Hfn26_last: (CollectionPage | URL)[] = []; - const _trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last: Set = new Set(); + const _trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last: VocabTrustSet = new Set(); let _gyJJnyEFnuNVi1HFZKfAn3Hfn26_last__array = values[\\"https://www.w3.org/ns/activitystreams#last\\"]; @@ -51122,7 +54386,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = _gyJJnyEFnuNVi1HFZKfAn3Hfn26_last; const _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: (Object | Link | URL)[] = []; - const _trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: Set = new Set(); + const _trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: VocabTrustSet = new Set(); let _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items__array = values[\\"https://www.w3.org/ns/activitystreams#items\\"]; @@ -51170,7 +54434,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; const _4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf: (Object | URL)[] = []; - const _trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf: Set = new Set(); + const _trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf: VocabTrustSet = new Set(); let _4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf__array = values[\\"https://w3id.org/fep/5711#likesOf\\"]; @@ -51211,7 +54475,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = _4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf; const _3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf: (Object | URL)[] = []; - const _trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf: Set = new Set(); + const _trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf: VocabTrustSet = new Set(); let _3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf__array = values[\\"https://w3id.org/fep/5711#sharesOf\\"]; @@ -51252,7 +54516,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = _3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf; const _3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf: (Object | URL)[] = []; - const _trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf: Set = new Set(); + const _trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf: VocabTrustSet = new Set(); let _3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf__array = values[\\"https://w3id.org/fep/5711#repliesOf\\"]; @@ -51293,7 +54557,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = _3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf; const _2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf: (Object | URL)[] = []; - const _trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf: Set = new Set(); + const _trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf: VocabTrustSet = new Set(); let _2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf__array = values[\\"https://w3id.org/fep/5711#inboxOf\\"]; @@ -51334,7 +54598,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = _2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf; const _4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf: (Object | URL)[] = []; - const _trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf: Set = new Set(); + const _trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf: VocabTrustSet = new Set(); let _4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf__array = values[\\"https://w3id.org/fep/5711#outboxOf\\"]; @@ -51375,7 +54639,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = _4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf; const _41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf: (Object | URL)[] = []; - const _trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf: Set = new Set(); + const _trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf: VocabTrustSet = new Set(); let _41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf__array = values[\\"https://w3id.org/fep/5711#followersOf\\"]; @@ -51416,7 +54680,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = _41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf; const _2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf: (Object | URL)[] = []; - const _trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf: Set = new Set(); + const _trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf: VocabTrustSet = new Set(); let _2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf__array = values[\\"https://w3id.org/fep/5711#followingOf\\"]; @@ -51457,7 +54721,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = _2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf; const _2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf: (Object | URL)[] = []; - const _trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf: Set = new Set(); + const _trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf: VocabTrustSet = new Set(); let _2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf__array = values[\\"https://w3id.org/fep/5711#likedOf\\"]; @@ -51831,7 +55095,7 @@ export class OrderedCollection extends Collection { } #_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: (Object | Link | URL)[] = []; - #_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: Set = new Set(); + #_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: VocabTrustSet = new Set(); /** * Constructs a new instance of OrderedCollection with the given values. @@ -51870,14 +55134,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu super(values, options); if (\\"items\\" in values && values.items != null) { - if (Array.isArray(values.items) && - values.items.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.items)) { + const array = values.items; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.items; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = values.items.slice(); + this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = copied; - for (let i = 0; i < values.items.length; i++) { - this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.add(i); - } + vocabSetTrustPrefix(this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length); } else { throw new TypeError( @@ -51952,18 +55238,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as OrderedCollection;clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.slice();clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = new Set(this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items); + const clone = super.clone(values, options) as unknown as OrderedCollection;clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length < vocabSparseArrayMinimumLength + ? this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.slice() : vocabCopyPropertyArray(this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items);clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = vocabCopyTrustSet( + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, + ); if (\\"items\\" in values && values.items != null) { - if (Array.isArray(values.items) && - values.items.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.items)) { + const array = values.items; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.items; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = values.items.slice(); + clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = copied; clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = new Set(); - for (let i = 0; i < values.items.length; i++) { - clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length); } else { throw new TypeError( @@ -51998,6 +55309,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -52047,10 +55364,25 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as OrderedCollection; - for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { - const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + { + const array = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { + const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + } + } } } } }); } @@ -52397,7 +55729,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { + !(i < (this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[vocabTrustPrefix] ?? 0) || + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#items\\"); @@ -52469,7 +55802,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { + !(i < (this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[vocabTrustPrefix] ?? 0) || + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -52812,7 +56146,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: (Object | Link | URL)[] = []; - const _trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: Set = new Set(); + const _trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: VocabTrustSet = new Set(); let _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items__array = values[\\"https://www.w3.org/ns/activitystreams#items\\"]; @@ -53081,7 +56415,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as FeaturedCollection;clone.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic = this.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic.slice(); + const clone = super.clone(values, options) as unknown as FeaturedCollection;clone.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic = this.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic.length < vocabSparseArrayMinimumLength + ? this.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic.slice() : vocabCopyPropertyArray(this.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic); if (\\"topic\\" in values && values.topic != null) { if (values.topic instanceof Hashtag) { // @ts-ignore: type is checked above. @@ -53094,7 +56429,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice(); + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.length < vocabSparseArrayMinimumLength + ? this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice() : vocabCopyPropertyArray(this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable); if (\\"discoverable\\" in values && values.discoverable != null) { if (typeof values.discoverable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -53133,6 +56469,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -53182,10 +56524,25 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as FeaturedCollection; - for (let i = 0; i < node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic.length; i++) { - const value = node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic[i]; - if (value != null && typeof value === \\"object\\") { - node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic[i] = context.value(value); + { + const array = node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic.length; i++) { + const value = node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic[i]; + if (value != null && typeof value === \\"object\\") { + node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic[i] = context.value(value); + } + } } } } }); } @@ -53743,10 +57100,10 @@ export class FeaturedItem extends Object { } #_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject: (Object | URL)[] = []; - #_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject: Set = new Set(); + #_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject: VocabTrustSet = new Set(); #_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization: (FeatureAuthorization | URL)[] = []; - #_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization: Set = new Set(); + #_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization: VocabTrustSet = new Set(); /** * Constructs a new instance of FeaturedItem with the given values. @@ -53874,12 +57231,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as FeaturedItem;clone.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = this.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.slice();clone.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = new Set(this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject); + const clone = super.clone(values, options) as unknown as FeaturedItem;clone.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = this.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.length < vocabSparseArrayMinimumLength + ? this.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.slice() : vocabCopyPropertyArray(this.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject);clone.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = vocabCopyTrustSet( + this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject, clone.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject, + ); if (\\"featuredObject\\" in values && values.featuredObject != null) { if (values.featuredObject instanceof Object || values.featuredObject instanceof URL) { // @ts-ignore: type is checked above. clone.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = [values.featuredObject]; - clone.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = new Set([0]); + clone.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = new Set(); + clone.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredObject must be of type \\" + @@ -53887,12 +57248,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = this.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.slice();clone.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = new Set(this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization); + clone.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = this.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.slice() : vocabCopyPropertyArray(this.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization);clone.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = vocabCopyTrustSet( + this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization, clone.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization, + ); if (\\"featureAuthorization\\" in values && values.featureAuthorization != null) { if (values.featureAuthorization instanceof FeatureAuthorization || values.featureAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = [values.featureAuthorization]; - clone.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = new Set([0]); + clone.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = new Set(); + clone.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featureAuthorization must be of type \\" + @@ -53926,6 +57291,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -53975,17 +57346,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as FeaturedItem; - for (let i = 0; i < node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.length; i++) { - const value = node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[i]; - if (value != null && typeof value === \\"object\\") { - node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[i] = context.value(value); + { + const array = node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.length; i++) { + const value = node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.length; i++) { - const value = node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[i] = context.value(value); + { + const array = node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.length; i++) { + const value = node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[i] = context.value(value); + } + } } } } }); } @@ -54315,7 +57716,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[0]; if (!(v instanceof URL) && - !this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.has(0)) { + !(0 < (this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[vocabTrustPrefix] ?? 0) || + this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/7aa9#featuredObject\\"); @@ -54383,7 +57785,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.has(0)) { + !(0 < (this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[vocabTrustPrefix] ?? 0) || + this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -54734,7 +58137,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.has(0)) { + !(0 < (this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/7aa9#featureAuthorization\\"); @@ -54802,7 +58206,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.has(0)) { + !(0 < (this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -55179,7 +58584,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject: (Object | URL)[] = []; - const _trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject: Set = new Set(); + const _trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject: VocabTrustSet = new Set(); let _Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject__array = values[\\"https://w3id.org/fep/7aa9#featuredObject\\"]; @@ -55220,7 +58625,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = _Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject; const _2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization: (FeatureAuthorization | URL)[] = []; - const _trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization: Set = new Set(); + const _trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization: VocabTrustSet = new Set(); let _2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization__array = values[\\"https://w3id.org/fep/7aa9#featureAuthorization\\"]; @@ -55505,10 +58910,34 @@ endpoints?: (URL)[];} ); } - if (Array.isArray(values.endpoints) && - values.endpoints.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.endpoints)) { + const array = values.endpoints; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.endpoints; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = values.endpoints.slice(); + this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = copied; } else { throw new TypeError( @@ -55575,7 +59004,8 @@ endpoints?: (URL)[];} options ); copyPortableProvenance(this, clone); - clone.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.slice(); + clone.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.length < vocabSparseArrayMinimumLength + ? this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.slice() : vocabCopyPropertyArray(this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint); if (\\"endpoint\\" in values && values.endpoint != null) { if (values.endpoint instanceof URL) { // @ts-ignore: type is checked above. @@ -55599,10 +59029,34 @@ endpoints?: (URL)[];} ); } - if (Array.isArray(values.endpoints) && - values.endpoints.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.endpoints)) { + const array = values.endpoints; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.endpoints; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = values.endpoints.slice(); + clone.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = copied; } else { throw new TypeError( @@ -55637,6 +59091,12 @@ endpoints?: (URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -55681,10 +59141,25 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.length; i++) { - const value = node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint[i] = context.value(value); + { + const array = node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.length; i++) { + const value = node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint[i] = context.value(value); + } + } } } } }); } @@ -56200,6 +59675,12 @@ endpoints?: (URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -56611,7 +60092,7 @@ export class DataIntegrityProof { #_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite: (\\"eddsa-jcs-2022\\")[] = []; #_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod: (Multikey | URL)[] = []; - #_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod: Set = new Set(); + #_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod: VocabTrustSet = new Set(); #_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose: (\\"assertionMethod\\" | \\"authentication\\" | \\"capabilityInvocation\\" | \\"capabilityDelegation\\" | \\"keyAgreement\\")[] = []; #_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue: (Uint8Array)[] = []; #_3qzP3ukEZoUziK5FEiA1RhU4aqac: (Temporal.Instant)[] = []; @@ -56777,7 +60258,8 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | options ); copyPortableProvenance(this, clone); - clone.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite = this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite.slice(); + clone.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite = this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite.length < vocabSparseArrayMinimumLength + ? this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite.slice() : vocabCopyPropertyArray(this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite); if (\\"cryptosuite\\" in values && values.cryptosuite != null) { if (values.cryptosuite == \\"eddsa-jcs-2022\\") { // @ts-ignore: type is checked above. @@ -56790,12 +60272,16 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | ); } } - clone.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.slice();clone.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = new Set(this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod); + clone.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.length < vocabSparseArrayMinimumLength + ? this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.slice() : vocabCopyPropertyArray(this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod);clone.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = vocabCopyTrustSet( + this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod, clone.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod, + ); if (\\"verificationMethod\\" in values && values.verificationMethod != null) { if (values.verificationMethod instanceof Multikey || values.verificationMethod instanceof URL) { // @ts-ignore: type is checked above. clone.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = [values.verificationMethod]; - clone.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = new Set([0]); + clone.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = new Set(); + clone.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The verificationMethod must be of type \\" + @@ -56803,7 +60289,8 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | ); } } - clone.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose = this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose.slice(); + clone.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose = this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose.length < vocabSparseArrayMinimumLength + ? this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose.slice() : vocabCopyPropertyArray(this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose); if (\\"proofPurpose\\" in values && values.proofPurpose != null) { if (values.proofPurpose === \\"assertionMethod\\" || values.proofPurpose === \\"authentication\\" || values.proofPurpose === \\"capabilityInvocation\\" || values.proofPurpose === \\"capabilityDelegation\\" || @@ -56818,7 +60305,8 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | ); } } - clone.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue = this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue.slice(); + clone.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue = this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue.length < vocabSparseArrayMinimumLength + ? this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue.slice() : vocabCopyPropertyArray(this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue); if (\\"proofValue\\" in values && values.proofValue != null) { if (values.proofValue instanceof Uint8Array) { // @ts-ignore: type is checked above. @@ -56831,7 +60319,8 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | ); } } - clone.#_3qzP3ukEZoUziK5FEiA1RhU4aqac = this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac.slice(); + clone.#_3qzP3ukEZoUziK5FEiA1RhU4aqac = this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac.length < vocabSparseArrayMinimumLength + ? this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac.slice() : vocabCopyPropertyArray(this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac); if (\\"created\\" in values && values.created != null) { if (isTemporalInstant(values.created)) { // @ts-ignore: type is checked above. @@ -56870,6 +60359,12 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -56913,17 +60408,47 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.length; i++) { - const value = node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[i] = context.value(value); + { + const array = node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.length; i++) { + const value = node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue.length; i++) { - const value = node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue[i] = context.value(value); + { + const array = node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue.length; i++) { + const value = node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue[i] = context.value(value); + } + } } } } }); } @@ -57271,7 +60796,8 @@ deepCloneDescriptors.set(this.prototype, { } let v = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[0]; if (!(v instanceof URL) && - !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { + !(0 < (this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#verificationMethod\\"); @@ -57305,7 +60831,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { + !(0 < (this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -57741,7 +61268,7 @@ deepCloneDescriptors.set(this.prototype, { instance.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite = _3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite; const _2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod: (Multikey | URL)[] = []; - const _trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod: Set = new Set(); + const _trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod: VocabTrustSet = new Set(); let _2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod__array = values[\\"https://w3id.org/security#verificationMethod\\"]; @@ -58126,7 +61653,7 @@ export class CryptographicKey { } #_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner: Set = new Set(); + #_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner: VocabTrustSet = new Set(); #_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem: (CryptoKey)[] = []; /** @@ -58252,12 +61779,16 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi options ); copyPortableProvenance(this, clone); - clone.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.slice();clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = new Set(this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner); + clone.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length < vocabSparseArrayMinimumLength + ? this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.slice() : vocabCopyPropertyArray(this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner);clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = vocabCopyTrustSet( + this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner, clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner, + ); if (\\"owner\\" in values && values.owner != null) { if (values.owner instanceof Application || values.owner instanceof Group || values.owner instanceof Organization || values.owner instanceof Person || values.owner instanceof Service || values.owner instanceof URL) { // @ts-ignore: type is checked above. clone.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = [values.owner]; - clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = new Set([0]); + clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = new Set(); + clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The owner must be of type \\" + @@ -58265,7 +61796,8 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi ); } } - clone.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem = this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem.slice(); + clone.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem = this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem.length < vocabSparseArrayMinimumLength + ? this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem.slice() : vocabCopyPropertyArray(this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem); if (\\"publicKey\\" in values && values.publicKey != null) { if ( // @ts-ignore: CryptoKey exists in the global scope. @@ -58307,6 +61839,12 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -58350,10 +61888,25 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length; i++) { - const value = node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[i]; - if (value != null && typeof value === \\"object\\") { - node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[i] = context.value(value); + { + const array = node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length; i++) { + const value = node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[i]; + if (value != null && typeof value === \\"object\\") { + node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[i] = context.value(value); + } + } } } } }); } @@ -58743,7 +62296,8 @@ deepCloneDescriptors.set(this.prototype, { } let v = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[0]; if (!(v instanceof URL) && - !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { + !(0 < (this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[vocabTrustPrefix] ?? 0) || + this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#owner\\"); @@ -58811,7 +62365,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { + !(0 < (this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[vocabTrustPrefix] ?? 0) || + this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -59182,7 +62737,7 @@ deepCloneDescriptors.set(this.prototype, { let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner: Set = new Set(); + const _trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner: VocabTrustSet = new Set(); let _5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner__array = values[\\"https://w3id.org/security#owner\\"]; @@ -59466,7 +63021,7 @@ export class Multikey { } #_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller: Set = new Set(); + #_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller: VocabTrustSet = new Set(); #_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase: (CryptoKey)[] = []; /** @@ -59592,12 +63147,16 @@ controller?: Application | Group | Organization | Person | Service | URL | null; options ); copyPortableProvenance(this, clone); - clone.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.slice();clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = new Set(this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller); + clone.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length < vocabSparseArrayMinimumLength + ? this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.slice() : vocabCopyPropertyArray(this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller);clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = vocabCopyTrustSet( + this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller, clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller, + ); if (\\"controller\\" in values && values.controller != null) { if (values.controller instanceof Application || values.controller instanceof Group || values.controller instanceof Organization || values.controller instanceof Person || values.controller instanceof Service || values.controller instanceof URL) { // @ts-ignore: type is checked above. clone.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = [values.controller]; - clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = new Set([0]); + clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = new Set(); + clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The controller must be of type \\" + @@ -59605,7 +63164,8 @@ controller?: Application | Group | Organization | Person | Service | URL | null; ); } } - clone.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase = this.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase.slice(); + clone.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase = this.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase.length < vocabSparseArrayMinimumLength + ? this.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase.slice() : vocabCopyPropertyArray(this.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase); if (\\"publicKey\\" in values && values.publicKey != null) { if ( // @ts-ignore: CryptoKey exists in the global scope. @@ -59647,6 +63207,12 @@ controller?: Application | Group | Organization | Person | Service | URL | null; * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -59690,10 +63256,25 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length; i++) { - const value = node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[i] = context.value(value); + { + const array = node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length; i++) { + const value = node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[i] = context.value(value); + } + } } } } }); } @@ -60083,7 +63664,8 @@ deepCloneDescriptors.set(this.prototype, { } let v = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[0]; if (!(v instanceof URL) && - !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { + !(0 < (this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[vocabTrustPrefix] ?? 0) || + this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#controller\\"); @@ -60151,7 +63733,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { + !(0 < (this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[vocabTrustPrefix] ?? 0) || + this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -60529,7 +64112,7 @@ deepCloneDescriptors.set(this.prototype, { let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller: Set = new Set(); + const _trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller: VocabTrustSet = new Set(); let _2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller__array = values[\\"https://w3id.org/security#controller\\"]; @@ -60879,7 +64462,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Agreement;clone.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates = this.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates.slice(); + const clone = super.clone(values, options) as unknown as Agreement;clone.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates = this.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates.length < vocabSparseArrayMinimumLength + ? this.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates.slice() : vocabCopyPropertyArray(this.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates); if (\\"stipulates\\" in values && values.stipulates != null) { if (values.stipulates instanceof Commitment) { // @ts-ignore: type is checked above. @@ -60892,7 +64476,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal = this.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal.slice(); + clone.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal = this.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal.length < vocabSparseArrayMinimumLength + ? this.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal.slice() : vocabCopyPropertyArray(this.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal); if (\\"stipulatesReciprocal\\" in values && values.stipulatesReciprocal != null) { if (values.stipulatesReciprocal instanceof Commitment) { // @ts-ignore: type is checked above. @@ -60931,6 +64516,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -60980,17 +64571,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Agreement; - for (let i = 0; i < node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates.length; i++) { - const value = node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates[i]; - if (value != null && typeof value === \\"object\\") { - node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates[i] = context.value(value); + { + const array = node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates.length; i++) { + const value = node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates[i]; + if (value != null && typeof value === \\"object\\") { + node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal.length; i++) { - const value = node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal[i] = context.value(value); + { + const array = node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal.length; i++) { + const value = node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal[i] = context.value(value); + } + } } } } }); } @@ -61747,7 +65368,8 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} options ); copyPortableProvenance(this, clone); - clone.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies = this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.slice(); + clone.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies = this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.length < vocabSparseArrayMinimumLength + ? this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.slice() : vocabCopyPropertyArray(this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies); if (\\"satisfies\\" in values && values.satisfies != null) { if (values.satisfies instanceof URL) { // @ts-ignore: type is checked above. @@ -61760,7 +65382,8 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} ); } } - clone.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.slice(); + clone.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length < vocabSparseArrayMinimumLength + ? this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.slice() : vocabCopyPropertyArray(this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity); if (\\"resourceQuantity\\" in values && values.resourceQuantity != null) { if (values.resourceQuantity instanceof Measure) { // @ts-ignore: type is checked above. @@ -61799,6 +65422,12 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -61842,17 +65471,47 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.length; i++) { - const value = node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies[i]; - if (value != null && typeof value === \\"object\\") { - node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies[i] = context.value(value); + { + const array = node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.length; i++) { + const value = node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies[i]; + if (value != null && typeof value === \\"object\\") { + node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length; i++) { - const value = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i] = context.value(value); + { + const array = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length; i++) { + const value = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i] = context.value(value); + } + } } } } }); } @@ -62628,7 +66287,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur options ); copyPortableProvenance(this, clone); - clone.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action = this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.slice(); + clone.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action = this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.length < vocabSparseArrayMinimumLength + ? this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.slice() : vocabCopyPropertyArray(this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action); if (\\"action\\" in values && values.action != null) { if (typeof values.action === \\"string\\") { // @ts-ignore: type is checked above. @@ -62641,7 +66301,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur ); } } - clone.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo = this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.slice(); + clone.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo = this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.length < vocabSparseArrayMinimumLength + ? this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.slice() : vocabCopyPropertyArray(this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo); if (\\"resourceConformsTo\\" in values && values.resourceConformsTo != null) { if (values.resourceConformsTo instanceof URL) { // @ts-ignore: type is checked above. @@ -62654,7 +66315,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur ); } } - clone.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.slice(); + clone.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length < vocabSparseArrayMinimumLength + ? this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.slice() : vocabCopyPropertyArray(this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity); if (\\"resourceQuantity\\" in values && values.resourceQuantity != null) { if (values.resourceQuantity instanceof Measure) { // @ts-ignore: type is checked above. @@ -62667,7 +66329,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur ); } } - clone.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity = this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.slice(); + clone.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity = this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.length < vocabSparseArrayMinimumLength + ? this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.slice() : vocabCopyPropertyArray(this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity); if (\\"availableQuantity\\" in values && values.availableQuantity != null) { if (values.availableQuantity instanceof Measure) { // @ts-ignore: type is checked above. @@ -62680,7 +66343,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur ); } } - clone.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.slice(); + clone.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.length < vocabSparseArrayMinimumLength + ? this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.slice() : vocabCopyPropertyArray(this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity); if (\\"minimumQuantity\\" in values && values.minimumQuantity != null) { if (values.minimumQuantity instanceof Measure) { // @ts-ignore: type is checked above. @@ -62719,6 +66383,12 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -62762,31 +66432,91 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.length; i++) { - const value = node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[i]; - if (value != null && typeof value === \\"object\\") { - node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[i] = context.value(value); + { + const array = node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.length; i++) { + const value = node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length; i++) { - const value = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i] = context.value(value); + { + const array = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length; i++) { + const value = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.length; i++) { - const value = node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[i]; - if (value != null && typeof value === \\"object\\") { - node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[i] = context.value(value); + { + const array = node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.length; i++) { + const value = node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[i]; + if (value != null && typeof value === \\"object\\") { + node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.length; i++) { - const value = node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[i] = context.value(value); + { + const array = node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.length; i++) { + const value = node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[i] = context.value(value); + } + } } } } }); } @@ -63801,7 +67531,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Proposal;clone.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose = this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose.slice(); + const clone = super.clone(values, options) as unknown as Proposal;clone.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose = this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose.length < vocabSparseArrayMinimumLength + ? this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose.slice() : vocabCopyPropertyArray(this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose); if (\\"purpose\\" in values && values.purpose != null) { if (typeof values.purpose === \\"string\\") { // @ts-ignore: type is checked above. @@ -63814,7 +67545,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes = this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.slice(); + clone.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes = this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.length < vocabSparseArrayMinimumLength + ? this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.slice() : vocabCopyPropertyArray(this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes); if (\\"publishes\\" in values && values.publishes != null) { if (values.publishes instanceof Intent) { // @ts-ignore: type is checked above. @@ -63827,7 +67559,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal = this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.slice(); + clone.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal = this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.length < vocabSparseArrayMinimumLength + ? this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.slice() : vocabCopyPropertyArray(this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal); if (\\"reciprocal\\" in values && values.reciprocal != null) { if (values.reciprocal instanceof Intent) { // @ts-ignore: type is checked above. @@ -63840,7 +67573,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased.slice(); + clone.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased.length < vocabSparseArrayMinimumLength + ? this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased.slice() : vocabCopyPropertyArray(this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased); if (\\"unitBased\\" in values && values.unitBased != null) { if (typeof values.unitBased === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -63879,6 +67613,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -63928,17 +67668,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Proposal; - for (let i = 0; i < node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.length; i++) { - const value = node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[i]; - if (value != null && typeof value === \\"object\\") { - node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[i] = context.value(value); + { + const array = node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.length; i++) { + const value = node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.length; i++) { - const value = node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[i]; - if (value != null && typeof value === \\"object\\") { - node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[i] = context.value(value); + { + const array = node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.length; i++) { + const value = node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[i]; + if (value != null && typeof value === \\"object\\") { + node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[i] = context.value(value); + } + } } } } }); } @@ -64838,6 +68608,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -65354,6 +69130,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -65865,6 +69647,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -66237,39 +70025,39 @@ export class Application extends Object { #_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername: ((string | LanguageString))[] = []; #_axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); #_41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); #_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); #_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); #_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); #_4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); #_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); #_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints: (Endpoints)[] = []; #_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable: (boolean)[] = []; #_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended: (boolean)[] = []; @@ -66277,13 +70065,13 @@ export class Application extends Object { #_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable: (boolean)[] = []; #_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); #_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); #_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); #_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage: (string)[] = []; #_2xEU4QtkC53RAun67T81Egqt9vmL_isCat: (boolean)[] = []; #_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense: (URL)[] = []; @@ -66352,10 +70140,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -66388,14 +70200,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; - for (let i = 0; i < values.publicKeys.length; i++) { - this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -66428,14 +70262,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; - for (let i = 0; i < values.assertionMethods.length; i++) { - this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -66468,10 +70324,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -66600,14 +70480,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | if (\\"streams\\" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; - for (let i = 0; i < values.streams.length; i++) { - this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -66718,14 +70620,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; - for (let i = 0; i < values.aliases.length; i++) { - this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -66758,14 +70682,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; - for (let i = 0; i < values.services.length; i++) { - this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -66885,7 +70831,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Application;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice(); + const clone = super.clone(values, options) as unknown as Application;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.length < vocabSparseArrayMinimumLength + ? this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice() : vocabCopyPropertyArray(this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername); if (\\"preferredUsername\\" in values && values.preferredUsername != null) { if (typeof values.preferredUsername === \\"string\\" || values.preferredUsername instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -66909,10 +70856,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -66921,12 +70892,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice();clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < vocabSparseArrayMinimumLength + ? this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice() : vocabCopyPropertyArray(this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey);clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = vocabCopyTrustSet( + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, + ); if (\\"publicKey\\" in values && values.publicKey != null) { if (values.publicKey instanceof CryptographicKey || values.publicKey instanceof URL) { // @ts-ignore: type is checked above. clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = [values.publicKey]; - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set([0]); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The publicKey must be of type \\" + @@ -66945,15 +70920,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); - for (let i = 0; i < values.publicKeys.length; i++) { - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -66962,12 +70959,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice();clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < vocabSparseArrayMinimumLength + ? this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice() : vocabCopyPropertyArray(this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod);clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = vocabCopyTrustSet( + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, + ); if (\\"assertionMethod\\" in values && values.assertionMethod != null) { if (values.assertionMethod instanceof Multikey || values.assertionMethod instanceof URL) { // @ts-ignore: type is checked above. clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = [values.assertionMethod]; - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set([0]); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The assertionMethod must be of type \\" + @@ -66986,15 +70987,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); - for (let i = 0; i < values.assertionMethods.length; i++) { - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -67003,7 +71026,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < vocabSparseArrayMinimumLength + ? this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice() : vocabCopyPropertyArray(this.#_hQiaHhZP8hqxckxTBrpsGNs57E3); if (\\"gateway\\" in values && values.gateway != null) { if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { // @ts-ignore: type is checked above. @@ -67027,10 +71051,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -67039,7 +71087,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice(); + clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.length < vocabSparseArrayMinimumLength + ? this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice() : vocabCopyPropertyArray(this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers); if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -67052,12 +71101,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice();clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox); + clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < vocabSparseArrayMinimumLength + ? this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice() : vocabCopyPropertyArray(this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox);clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = vocabCopyTrustSet( + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, + ); if (\\"inbox\\" in values && values.inbox != null) { if (values.inbox instanceof OrderedCollection || values.inbox instanceof OrderedCollectionPage || values.inbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox]; - clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set([0]); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The inbox must be of type \\" + @@ -67065,12 +71118,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice();clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox); + clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < vocabSparseArrayMinimumLength + ? this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice() : vocabCopyPropertyArray(this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox);clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = vocabCopyTrustSet( + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, + ); if (\\"outbox\\" in values && values.outbox != null) { if (values.outbox instanceof OrderedCollection || values.outbox instanceof OrderedCollectionPage || values.outbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox]; - clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set([0]); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The outbox must be of type \\" + @@ -67078,12 +71135,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice();clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following); + clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < vocabSparseArrayMinimumLength + ? this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice() : vocabCopyPropertyArray(this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following);clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = vocabCopyTrustSet( + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, + ); if (\\"following\\" in values && values.following != null) { if (values.following instanceof Collection || values.following instanceof URL) { // @ts-ignore: type is checked above. clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = [values.following]; - clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set([0]); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The following must be of type \\" + @@ -67091,12 +71152,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice();clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers); + clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < vocabSparseArrayMinimumLength + ? this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice() : vocabCopyPropertyArray(this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers);clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = vocabCopyTrustSet( + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, + ); if (\\"followers\\" in values && values.followers != null) { if (values.followers instanceof Collection || values.followers instanceof URL) { // @ts-ignore: type is checked above. clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = [values.followers]; - clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set([0]); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The followers must be of type \\" + @@ -67104,12 +71169,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice();clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked); + clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < vocabSparseArrayMinimumLength + ? this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice() : vocabCopyPropertyArray(this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked);clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = vocabCopyTrustSet( + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, + ); if (\\"liked\\" in values && values.liked != null) { if (values.liked instanceof Collection || values.liked instanceof URL) { // @ts-ignore: type is checked above. clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = [values.liked]; - clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set([0]); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The liked must be of type \\" + @@ -67117,12 +71186,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice();clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured); + clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < vocabSparseArrayMinimumLength + ? this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice() : vocabCopyPropertyArray(this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured);clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = vocabCopyTrustSet( + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, + ); if (\\"featured\\" in values && values.featured != null) { if (values.featured instanceof Collection || values.featured instanceof URL) { // @ts-ignore: type is checked above. clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = [values.featured]; - clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set([0]); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featured must be of type \\" + @@ -67130,12 +71203,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice();clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags); + clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < vocabSparseArrayMinimumLength + ? this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice() : vocabCopyPropertyArray(this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags);clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = vocabCopyTrustSet( + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, + ); if (\\"featuredTags\\" in values && values.featuredTags != null) { if (values.featuredTags instanceof Collection || values.featuredTags instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = [values.featuredTags]; - clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set([0]); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredTags must be of type \\" + @@ -67143,12 +71220,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice();clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections); + clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length < vocabSparseArrayMinimumLength + ? this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice() : vocabCopyPropertyArray(this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections);clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = vocabCopyTrustSet( + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, + ); if (\\"featuredCollections\\" in values && values.featuredCollections != null) { if (values.featuredCollections instanceof Collection || values.featuredCollections instanceof URL) { // @ts-ignore: type is checked above. clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = [values.featuredCollections]; - clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set([0]); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredCollections must be of type \\" + @@ -67156,18 +71237,43 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice();clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length < vocabSparseArrayMinimumLength + ? this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice() : vocabCopyPropertyArray(this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams);clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = vocabCopyTrustSet( + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, + ); if (\\"streams\\" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(); - for (let i = 0; i < values.streams.length; i++) { - clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -67176,7 +71282,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice(); + clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length < vocabSparseArrayMinimumLength + ? this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice() : vocabCopyPropertyArray(this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints); if (\\"endpoints\\" in values && values.endpoints != null) { if (values.endpoints instanceof Endpoints) { // @ts-ignore: type is checked above. @@ -67189,7 +71296,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice(); + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.length < vocabSparseArrayMinimumLength + ? this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice() : vocabCopyPropertyArray(this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable); if (\\"discoverable\\" in values && values.discoverable != null) { if (typeof values.discoverable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -67202,7 +71310,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice(); + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.length < vocabSparseArrayMinimumLength + ? this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice() : vocabCopyPropertyArray(this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended); if (\\"suspended\\" in values && values.suspended != null) { if (typeof values.suspended === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -67215,7 +71324,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice(); + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.length < vocabSparseArrayMinimumLength + ? this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice() : vocabCopyPropertyArray(this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial); if (\\"memorial\\" in values && values.memorial != null) { if (typeof values.memorial === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -67228,7 +71338,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice(); + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.length < vocabSparseArrayMinimumLength + ? this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice() : vocabCopyPropertyArray(this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable); if (\\"indexable\\" in values && values.indexable != null) { if (typeof values.indexable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -67241,12 +71352,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice();clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo); + clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < vocabSparseArrayMinimumLength + ? this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice() : vocabCopyPropertyArray(this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo);clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = vocabCopyTrustSet( + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, + ); if (\\"successor\\" in values && values.successor != null) { if (values.successor instanceof Application || values.successor instanceof Group || values.successor instanceof Organization || values.successor instanceof Person || values.successor instanceof Service || values.successor instanceof URL) { // @ts-ignore: type is checked above. clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor]; - clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set([0]); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The successor must be of type \\" + @@ -67254,12 +71369,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice();clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < vocabSparseArrayMinimumLength + ? this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice() : vocabCopyPropertyArray(this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs);clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = vocabCopyTrustSet( + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, + ); if (\\"alias\\" in values && values.alias != null) { if (values.alias instanceof Application || values.alias instanceof Group || values.alias instanceof Organization || values.alias instanceof Person || values.alias instanceof Service || values.alias instanceof URL) { // @ts-ignore: type is checked above. clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [values.alias]; - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set([0]); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The alias must be of type \\" + @@ -67278,15 +71397,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); - for (let i = 0; i < values.aliases.length; i++) { - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -67295,12 +71436,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice();clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < vocabSparseArrayMinimumLength + ? this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice() : vocabCopyPropertyArray(this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service);clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = vocabCopyTrustSet( + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, + ); if (\\"service\\" in values && values.service != null) { if (values.service instanceof DidService || values.service instanceof URL) { // @ts-ignore: type is checked above. clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = [values.service]; - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set([0]); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The service must be of type \\" + @@ -67319,15 +71464,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); - for (let i = 0; i < values.services.length; i++) { - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -67336,7 +71503,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice(); + clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.length < vocabSparseArrayMinimumLength + ? this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice() : vocabCopyPropertyArray(this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage); if (\\"followedMessage\\" in values && values.followedMessage != null) { if (typeof values.followedMessage === \\"string\\") { // @ts-ignore: type is checked above. @@ -67349,7 +71517,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice(); + clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.length < vocabSparseArrayMinimumLength + ? this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice() : vocabCopyPropertyArray(this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat); if (\\"cat\\" in values && values.cat != null) { if (typeof values.cat === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -67362,7 +71531,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice(); + clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length < vocabSparseArrayMinimumLength + ? this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice() : vocabCopyPropertyArray(this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense); if (\\"preferredLicense\\" in values && values.preferredLicense != null) { if (values.preferredLicense instanceof URL) { // @ts-ignore: type is checked above. @@ -67401,6 +71571,12 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -67456,122 +71632,377 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Application; - for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { - const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; - if (value != null && typeof value === \\"object\\") { - node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + { + const array = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { - const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + { + const array = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { - const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; - if (value != null && typeof value === \\"object\\") { - node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + { + const array = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { - const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + { + const array = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { - const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + { + const array = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { - const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + { + const array = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { - const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; - if (value != null && typeof value === \\"object\\") { - node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + { + const array = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { - const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + { + const array = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { - const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + { + const array = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { - const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + { + const array = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { - const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; - if (value != null && typeof value === \\"object\\") { - node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + { + const array = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === \\"object\\") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { - const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + { + const array = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { - const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; - if (value != null && typeof value === \\"object\\") { - node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + { + const array = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { - const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + { + const array = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { - const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + { + const array = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { - const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + { + const array = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { - const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; - if (value != null && typeof value === \\"object\\") { - node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + { + const array = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === \\"object\\") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } } } } }); } @@ -67924,7 +72355,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#publicKey\\"); @@ -67992,7 +72424,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -68079,7 +72512,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#publicKey\\"); @@ -68151,7 +72585,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -68505,7 +72940,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#assertionMethod\\"); @@ -68573,7 +73009,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -68664,7 +73101,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#assertionMethod\\"); @@ -68736,7 +73174,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -69160,7 +73599,8 @@ get gateways(): (URL)[] { } let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://www.w3.org/ns/ldp#inbox\\"); @@ -69228,7 +73668,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -69602,7 +74043,8 @@ get gateways(): (URL)[] { } let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#outbox\\"); @@ -69670,7 +74112,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -70024,7 +74467,8 @@ get gateways(): (URL)[] { } let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#following\\"); @@ -70092,7 +74536,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -70449,7 +74894,8 @@ get gateways(): (URL)[] { } let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#followers\\"); @@ -70517,7 +74963,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -70872,7 +75319,8 @@ get gateways(): (URL)[] { } let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#liked\\"); @@ -70940,7 +75388,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -71293,7 +75742,8 @@ get gateways(): (URL)[] { } let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://joinmastodon.org/ns#featured\\"); @@ -71361,7 +75811,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -71714,7 +76165,8 @@ get gateways(): (URL)[] { } let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://joinmastodon.org/ns#featuredTags\\"); @@ -71782,7 +76234,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -72132,7 +76585,8 @@ get gateways(): (URL)[] { } let v = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[0]; if (!(v instanceof URL) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/7aa9#featuredCollections\\"); @@ -72200,7 +76654,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -72550,7 +77005,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#streams\\"); @@ -72622,7 +77078,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -73107,7 +77564,8 @@ get gateways(): (URL)[] { } let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#movedTo\\"); @@ -73175,7 +77633,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -73588,7 +78047,8 @@ get gateways(): (URL)[] { } let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"); @@ -73656,7 +78116,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -73747,7 +78208,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"); @@ -73819,7 +78281,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -74173,7 +78636,8 @@ get gateways(): (URL)[] { } let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/did#service\\"); @@ -74241,7 +78705,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -74332,7 +78797,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/did#service\\"); @@ -74404,7 +78870,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -75803,7 +80270,7 @@ get gateways(): (URL)[] { instance.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = _3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; const _axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); let _axq166E2eZADq34V4MYUc8KMZdC_publicKey__array = values[\\"https://w3id.org/security#publicKey\\"]; @@ -75844,7 +80311,7 @@ get gateways(): (URL)[] { instance.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = _axq166E2eZADq34V4MYUc8KMZdC_publicKey; const _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); let _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod__array = values[\\"https://w3id.org/security#assertionMethod\\"]; @@ -75943,7 +80410,7 @@ get gateways(): (URL)[] { instance.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); let _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox__array = values[\\"http://www.w3.org/ns/ldp#inbox\\"]; @@ -75990,7 +80457,7 @@ get gateways(): (URL)[] { instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; const _41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); let _41QwhqJouoLg3h8dRPKat21brynC_outbox__array = values[\\"https://www.w3.org/ns/activitystreams#outbox\\"]; @@ -76037,7 +80504,7 @@ get gateways(): (URL)[] { instance.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = _41QwhqJouoLg3h8dRPKat21brynC_outbox; const _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); let _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following__array = values[\\"https://www.w3.org/ns/activitystreams#following\\"]; @@ -76078,7 +80545,7 @@ get gateways(): (URL)[] { instance.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; const _BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); let _BBCTgfphhsFzpVfKTykGSpBNwoA_followers__array = values[\\"https://www.w3.org/ns/activitystreams#followers\\"]; @@ -76119,7 +80586,7 @@ get gateways(): (URL)[] { instance.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = _BBCTgfphhsFzpVfKTykGSpBNwoA_followers; const _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); let _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked__array = values[\\"https://www.w3.org/ns/activitystreams#liked\\"]; @@ -76160,7 +80627,7 @@ get gateways(): (URL)[] { instance.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; const _4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); let _4N1vBJzXDf8NbBumeECQMFvKetja_featured__array = values[\\"http://joinmastodon.org/ns#featured\\"]; @@ -76201,7 +80668,7 @@ get gateways(): (URL)[] { instance.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = _4N1vBJzXDf8NbBumeECQMFvKetja_featured; const _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); let _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags__array = values[\\"http://joinmastodon.org/ns#featuredTags\\"]; @@ -76242,7 +80709,7 @@ get gateways(): (URL)[] { instance.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; const _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); let _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections__array = values[\\"https://w3id.org/fep/7aa9#featuredCollections\\"]; @@ -76283,7 +80750,7 @@ get gateways(): (URL)[] { instance.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); let _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams__array = values[\\"https://www.w3.org/ns/activitystreams#streams\\"]; @@ -76472,7 +80939,7 @@ get gateways(): (URL)[] { instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); let _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array = values[\\"https://www.w3.org/ns/activitystreams#movedTo\\"]; @@ -76530,7 +80997,7 @@ get gateways(): (URL)[] { instance.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); let _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array = values[\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"]; @@ -76588,7 +81055,7 @@ get gateways(): (URL)[] { instance.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; const _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); let _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service__array = values[\\"https://www.w3.org/ns/did#service\\"]; @@ -77463,6 +81930,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -77986,6 +82459,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -78357,11 +82836,11 @@ export class Article extends Object { } #_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); #_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl: (URL)[] = []; #_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); /** * Constructs a new instance of Article with the given values. @@ -78502,12 +82981,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Article;clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice();clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote); + const clone = super.clone(values, options) as unknown as Article;clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < vocabSparseArrayMinimumLength + ? this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice() : vocabCopyPropertyArray(this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote);clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = vocabCopyTrustSet( + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, + ); if (\\"quote\\" in values && values.quote != null) { if (values.quote instanceof Object || values.quote instanceof URL) { // @ts-ignore: type is checked above. clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = [values.quote]; - clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set([0]); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The quote must be of type \\" + @@ -78515,7 +82998,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice(); + clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length < vocabSparseArrayMinimumLength + ? this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice() : vocabCopyPropertyArray(this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl); if (\\"quoteUrl\\" in values && values.quoteUrl != null) { if (values.quoteUrl instanceof URL) { // @ts-ignore: type is checked above. @@ -78528,12 +83012,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice();clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization); + clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice() : vocabCopyPropertyArray(this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization);clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = vocabCopyTrustSet( + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, + ); if (\\"quoteAuthorization\\" in values && values.quoteAuthorization != null) { if (values.quoteAuthorization instanceof QuoteAuthorization || values.quoteAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = [values.quoteAuthorization]; - clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set([0]); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The quoteAuthorization must be of type \\" + @@ -78567,6 +83055,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -78616,24 +83110,69 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Article; - for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { - const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + { + const array = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { - const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; - if (value != null && typeof value === \\"object\\") { - node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + { + const array = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === \\"object\\") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { - const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; - if (value != null && typeof value === \\"object\\") { - node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + { + const array = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } } } } }); } @@ -78966,7 +83505,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/044f#quote\\"); @@ -79034,7 +83574,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -79408,7 +83949,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/044f#quoteAuthorization\\"); @@ -79476,7 +84018,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -79903,7 +84446,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); let _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote__array = values[\\"https://w3id.org/fep/044f#quote\\"]; @@ -79983,7 +84526,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; const _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); let _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization__array = values[\\"https://w3id.org/fep/044f#quoteAuthorization\\"]; @@ -80294,7 +84837,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Document;clone.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width = this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width.slice(); + const clone = super.clone(values, options) as unknown as Document;clone.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width = this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width.length < vocabSparseArrayMinimumLength + ? this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width.slice() : vocabCopyPropertyArray(this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width); if (\\"width\\" in values && values.width != null) { if (typeof values.width === \\"number\\" && Number.isInteger(values.width) && values.width >= 0) { // @ts-ignore: type is checked above. @@ -80307,7 +84851,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height = this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.slice(); + clone.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height = this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.length < vocabSparseArrayMinimumLength + ? this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.slice() : vocabCopyPropertyArray(this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height); if (\\"height\\" in values && values.height != null) { if (typeof values.height === \\"number\\" && Number.isInteger(values.height) && values.height >= 0) { // @ts-ignore: type is checked above. @@ -80320,7 +84865,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.slice(); + clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.length < vocabSparseArrayMinimumLength + ? this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.slice() : vocabCopyPropertyArray(this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase); if (\\"digestMultibase\\" in values && values.digestMultibase != null) { if (typeof values.digestMultibase === \\"string\\") { // @ts-ignore: type is checked above. @@ -80359,6 +84905,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -81192,6 +85744,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -81715,6 +86273,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -82231,6 +86795,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -82605,13 +87175,13 @@ export class CollectionPage extends Collection { } #_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf: (Collection | URL)[] = []; - #_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf: Set = new Set(); + #_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf: VocabTrustSet = new Set(); #_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next: (CollectionPage | URL)[] = []; - #_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next: Set = new Set(); + #_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next: VocabTrustSet = new Set(); #_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev: (CollectionPage | URL)[] = []; - #_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev: Set = new Set(); + #_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev: VocabTrustSet = new Set(); /** * Constructs a new instance of CollectionPage with the given values. @@ -82752,12 +87322,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as CollectionPage;clone.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.slice();clone.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = new Set(this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf); + const clone = super.clone(values, options) as unknown as CollectionPage;clone.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.length < vocabSparseArrayMinimumLength + ? this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.slice() : vocabCopyPropertyArray(this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf);clone.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = vocabCopyTrustSet( + this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf, clone.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf, + ); if (\\"partOf\\" in values && values.partOf != null) { if (values.partOf instanceof Collection || values.partOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = [values.partOf]; - clone.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = new Set([0]); + clone.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = new Set(); + clone.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The partOf must be of type \\" + @@ -82765,12 +87339,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.slice();clone.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = new Set(this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next); + clone.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.length < vocabSparseArrayMinimumLength + ? this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.slice() : vocabCopyPropertyArray(this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next);clone.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = vocabCopyTrustSet( + this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next, clone.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next, + ); if (\\"next\\" in values && values.next != null) { if (values.next instanceof CollectionPage || values.next instanceof URL) { // @ts-ignore: type is checked above. clone.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = [values.next]; - clone.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = new Set([0]); + clone.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = new Set(); + clone.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The next must be of type \\" + @@ -82778,12 +87356,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.slice();clone.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = new Set(this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev); + clone.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.length < vocabSparseArrayMinimumLength + ? this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.slice() : vocabCopyPropertyArray(this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev);clone.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = vocabCopyTrustSet( + this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev, clone.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev, + ); if (\\"prev\\" in values && values.prev != null) { if (values.prev instanceof CollectionPage || values.prev instanceof URL) { // @ts-ignore: type is checked above. clone.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = [values.prev]; - clone.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = new Set([0]); + clone.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = new Set(); + clone.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The prev must be of type \\" + @@ -82817,6 +87399,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -82866,24 +87454,69 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as CollectionPage; - for (let i = 0; i < node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.length; i++) { - const value = node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[i] = context.value(value); + { + const array = node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.length; i++) { + const value = node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.length; i++) { - const value = node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[i] = context.value(value); + { + const array = node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.length; i++) { + const value = node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.length; i++) { - const value = node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[i] = context.value(value); + { + const array = node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.length; i++) { + const value = node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[i] = context.value(value); + } + } } } } }); } @@ -83215,7 +87848,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[0]; if (!(v instanceof URL) && - !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { + !(0 < (this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#partOf\\"); @@ -83283,7 +87917,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { + !(0 < (this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -83632,7 +88267,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[0]; if (!(v instanceof URL) && - !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { + !(0 < (this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[vocabTrustPrefix] ?? 0) || + this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#next\\"); @@ -83700,7 +88336,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { + !(0 < (this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[vocabTrustPrefix] ?? 0) || + this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -84050,7 +88687,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[0]; if (!(v instanceof URL) && - !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { + !(0 < (this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[vocabTrustPrefix] ?? 0) || + this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#prev\\"); @@ -84118,7 +88756,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { + !(0 < (this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[vocabTrustPrefix] ?? 0) || + this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -84539,7 +89178,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf: (Collection | URL)[] = []; - const _trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf: Set = new Set(); + const _trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf: VocabTrustSet = new Set(); let _2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf__array = values[\\"https://www.w3.org/ns/activitystreams#partOf\\"]; @@ -84580,7 +89219,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = _2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf; const _3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next: (CollectionPage | URL)[] = []; - const _trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next: Set = new Set(); + const _trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next: VocabTrustSet = new Set(); let _3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next__array = values[\\"https://www.w3.org/ns/activitystreams#next\\"]; @@ -84621,7 +89260,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = _3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next; const _3b8yG8tDNzQFFEnWhCc13G8eHooA_prev: (CollectionPage | URL)[] = []; - const _trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev: Set = new Set(); + const _trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev: VocabTrustSet = new Set(); let _3b8yG8tDNzQFFEnWhCc13G8eHooA_prev__array = values[\\"https://www.w3.org/ns/activitystreams#prev\\"]; @@ -84928,6 +89567,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -85438,6 +90083,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -85946,6 +90597,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -86577,7 +91234,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint options ); copyPortableProvenance(this, clone); - clone.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl = this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.slice(); + clone.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl = this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.length < vocabSparseArrayMinimumLength + ? this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.slice() : vocabCopyPropertyArray(this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl); if (\\"proxyUrl\\" in values && values.proxyUrl != null) { if (values.proxyUrl instanceof URL) { // @ts-ignore: type is checked above. @@ -86590,7 +91248,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ); } } - clone.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint = this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.slice(); + clone.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint = this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.length < vocabSparseArrayMinimumLength + ? this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.slice() : vocabCopyPropertyArray(this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint); if (\\"oauthAuthorizationEndpoint\\" in values && values.oauthAuthorizationEndpoint != null) { if (values.oauthAuthorizationEndpoint instanceof URL) { // @ts-ignore: type is checked above. @@ -86603,7 +91262,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ); } } - clone.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint = this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.slice(); + clone.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint = this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.length < vocabSparseArrayMinimumLength + ? this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.slice() : vocabCopyPropertyArray(this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint); if (\\"oauthTokenEndpoint\\" in values && values.oauthTokenEndpoint != null) { if (values.oauthTokenEndpoint instanceof URL) { // @ts-ignore: type is checked above. @@ -86616,7 +91276,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ); } } - clone.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey = this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.slice(); + clone.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey = this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.length < vocabSparseArrayMinimumLength + ? this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.slice() : vocabCopyPropertyArray(this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey); if (\\"provideClientKey\\" in values && values.provideClientKey != null) { if (values.provideClientKey instanceof URL) { // @ts-ignore: type is checked above. @@ -86629,7 +91290,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ); } } - clone.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey = this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.slice(); + clone.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey = this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.length < vocabSparseArrayMinimumLength + ? this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.slice() : vocabCopyPropertyArray(this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey); if (\\"signClientKey\\" in values && values.signClientKey != null) { if (values.signClientKey instanceof URL) { // @ts-ignore: type is checked above. @@ -86642,7 +91304,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ); } } - clone.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox = this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.slice(); + clone.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox = this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.length < vocabSparseArrayMinimumLength + ? this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.slice() : vocabCopyPropertyArray(this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox); if (\\"sharedInbox\\" in values && values.sharedInbox != null) { if (values.sharedInbox instanceof URL) { // @ts-ignore: type is checked above. @@ -86655,7 +91318,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ); } } - clone.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia = this.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia.slice(); + clone.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia = this.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia.length < vocabSparseArrayMinimumLength + ? this.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia.slice() : vocabCopyPropertyArray(this.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia); if (\\"uploadMedia\\" in values && values.uploadMedia != null) { if (values.uploadMedia instanceof URL) { // @ts-ignore: type is checked above. @@ -86694,6 +91358,12 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -86737,52 +91407,157 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.length; i++) { - const value = node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl[i] = context.value(value); + { + const array = node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.length; i++) { + const value = node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.length; i++) { - const value = node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint[i]; - if (value != null && typeof value === \\"object\\") { - node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint[i] = context.value(value); + { + const array = node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.length; i++) { + const value = node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint[i]; + if (value != null && typeof value === \\"object\\") { + node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.length; i++) { - const value = node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint[i]; - if (value != null && typeof value === \\"object\\") { - node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint[i] = context.value(value); + { + const array = node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.length; i++) { + const value = node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint[i]; + if (value != null && typeof value === \\"object\\") { + node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.length; i++) { - const value = node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey[i]; - if (value != null && typeof value === \\"object\\") { - node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey[i] = context.value(value); + { + const array = node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.length; i++) { + const value = node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.length; i++) { - const value = node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey[i] = context.value(value); + { + const array = node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.length; i++) { + const value = node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.length; i++) { - const value = node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox[i] = context.value(value); + { + const array = node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.length; i++) { + const value = node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia.length; i++) { - const value = node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia[i]; - if (value != null && typeof value === \\"object\\") { - node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia[i] = context.value(value); + { + const array = node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia.length; i++) { + const value = node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia[i]; + if (value != null && typeof value === \\"object\\") { + node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia[i] = context.value(value); + } + } } } } }); } @@ -87959,6 +92734,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -88483,6 +93264,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -88995,6 +93782,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -89367,39 +94160,39 @@ export class Group extends Object { #_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername: ((string | LanguageString))[] = []; #_axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); #_41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); #_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); #_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); #_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); #_4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); #_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); #_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints: (Endpoints)[] = []; #_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable: (boolean)[] = []; #_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended: (boolean)[] = []; @@ -89407,13 +94200,13 @@ export class Group extends Object { #_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable: (boolean)[] = []; #_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); #_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); #_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); #_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage: (string)[] = []; #_2xEU4QtkC53RAun67T81Egqt9vmL_isCat: (boolean)[] = []; #_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense: (URL)[] = []; @@ -89482,10 +94275,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -89518,14 +94335,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; - for (let i = 0; i < values.publicKeys.length; i++) { - this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -89558,14 +94397,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; - for (let i = 0; i < values.assertionMethods.length; i++) { - this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -89598,10 +94459,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -89730,14 +94615,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | if (\\"streams\\" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; - for (let i = 0; i < values.streams.length; i++) { - this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -89848,14 +94755,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; - for (let i = 0; i < values.aliases.length; i++) { - this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -89888,14 +94817,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; - for (let i = 0; i < values.services.length; i++) { - this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -90015,7 +94966,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Group;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice(); + const clone = super.clone(values, options) as unknown as Group;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.length < vocabSparseArrayMinimumLength + ? this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice() : vocabCopyPropertyArray(this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername); if (\\"preferredUsername\\" in values && values.preferredUsername != null) { if (typeof values.preferredUsername === \\"string\\" || values.preferredUsername instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -90039,10 +94991,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -90051,12 +95027,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice();clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < vocabSparseArrayMinimumLength + ? this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice() : vocabCopyPropertyArray(this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey);clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = vocabCopyTrustSet( + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, + ); if (\\"publicKey\\" in values && values.publicKey != null) { if (values.publicKey instanceof CryptographicKey || values.publicKey instanceof URL) { // @ts-ignore: type is checked above. clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = [values.publicKey]; - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set([0]); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The publicKey must be of type \\" + @@ -90075,15 +95055,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); - for (let i = 0; i < values.publicKeys.length; i++) { - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -90092,12 +95094,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice();clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < vocabSparseArrayMinimumLength + ? this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice() : vocabCopyPropertyArray(this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod);clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = vocabCopyTrustSet( + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, + ); if (\\"assertionMethod\\" in values && values.assertionMethod != null) { if (values.assertionMethod instanceof Multikey || values.assertionMethod instanceof URL) { // @ts-ignore: type is checked above. clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = [values.assertionMethod]; - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set([0]); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The assertionMethod must be of type \\" + @@ -90116,15 +95122,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); - for (let i = 0; i < values.assertionMethods.length; i++) { - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -90133,7 +95161,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < vocabSparseArrayMinimumLength + ? this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice() : vocabCopyPropertyArray(this.#_hQiaHhZP8hqxckxTBrpsGNs57E3); if (\\"gateway\\" in values && values.gateway != null) { if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { // @ts-ignore: type is checked above. @@ -90157,10 +95186,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -90169,7 +95222,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice(); + clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.length < vocabSparseArrayMinimumLength + ? this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice() : vocabCopyPropertyArray(this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers); if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -90182,12 +95236,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice();clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox); + clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < vocabSparseArrayMinimumLength + ? this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice() : vocabCopyPropertyArray(this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox);clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = vocabCopyTrustSet( + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, + ); if (\\"inbox\\" in values && values.inbox != null) { if (values.inbox instanceof OrderedCollection || values.inbox instanceof OrderedCollectionPage || values.inbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox]; - clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set([0]); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The inbox must be of type \\" + @@ -90195,12 +95253,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice();clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox); + clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < vocabSparseArrayMinimumLength + ? this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice() : vocabCopyPropertyArray(this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox);clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = vocabCopyTrustSet( + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, + ); if (\\"outbox\\" in values && values.outbox != null) { if (values.outbox instanceof OrderedCollection || values.outbox instanceof OrderedCollectionPage || values.outbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox]; - clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set([0]); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The outbox must be of type \\" + @@ -90208,12 +95270,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice();clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following); + clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < vocabSparseArrayMinimumLength + ? this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice() : vocabCopyPropertyArray(this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following);clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = vocabCopyTrustSet( + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, + ); if (\\"following\\" in values && values.following != null) { if (values.following instanceof Collection || values.following instanceof URL) { // @ts-ignore: type is checked above. clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = [values.following]; - clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set([0]); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The following must be of type \\" + @@ -90221,12 +95287,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice();clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers); + clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < vocabSparseArrayMinimumLength + ? this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice() : vocabCopyPropertyArray(this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers);clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = vocabCopyTrustSet( + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, + ); if (\\"followers\\" in values && values.followers != null) { if (values.followers instanceof Collection || values.followers instanceof URL) { // @ts-ignore: type is checked above. clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = [values.followers]; - clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set([0]); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The followers must be of type \\" + @@ -90234,12 +95304,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice();clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked); + clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < vocabSparseArrayMinimumLength + ? this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice() : vocabCopyPropertyArray(this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked);clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = vocabCopyTrustSet( + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, + ); if (\\"liked\\" in values && values.liked != null) { if (values.liked instanceof Collection || values.liked instanceof URL) { // @ts-ignore: type is checked above. clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = [values.liked]; - clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set([0]); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The liked must be of type \\" + @@ -90247,12 +95321,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice();clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured); + clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < vocabSparseArrayMinimumLength + ? this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice() : vocabCopyPropertyArray(this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured);clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = vocabCopyTrustSet( + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, + ); if (\\"featured\\" in values && values.featured != null) { if (values.featured instanceof Collection || values.featured instanceof URL) { // @ts-ignore: type is checked above. clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = [values.featured]; - clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set([0]); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featured must be of type \\" + @@ -90260,12 +95338,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice();clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags); + clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < vocabSparseArrayMinimumLength + ? this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice() : vocabCopyPropertyArray(this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags);clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = vocabCopyTrustSet( + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, + ); if (\\"featuredTags\\" in values && values.featuredTags != null) { if (values.featuredTags instanceof Collection || values.featuredTags instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = [values.featuredTags]; - clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set([0]); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredTags must be of type \\" + @@ -90273,12 +95355,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice();clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections); + clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length < vocabSparseArrayMinimumLength + ? this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice() : vocabCopyPropertyArray(this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections);clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = vocabCopyTrustSet( + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, + ); if (\\"featuredCollections\\" in values && values.featuredCollections != null) { if (values.featuredCollections instanceof Collection || values.featuredCollections instanceof URL) { // @ts-ignore: type is checked above. clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = [values.featuredCollections]; - clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set([0]); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredCollections must be of type \\" + @@ -90286,18 +95372,43 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice();clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length < vocabSparseArrayMinimumLength + ? this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice() : vocabCopyPropertyArray(this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams);clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = vocabCopyTrustSet( + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, + ); if (\\"streams\\" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(); - for (let i = 0; i < values.streams.length; i++) { - clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -90306,7 +95417,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice(); + clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length < vocabSparseArrayMinimumLength + ? this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice() : vocabCopyPropertyArray(this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints); if (\\"endpoints\\" in values && values.endpoints != null) { if (values.endpoints instanceof Endpoints) { // @ts-ignore: type is checked above. @@ -90319,7 +95431,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice(); + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.length < vocabSparseArrayMinimumLength + ? this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice() : vocabCopyPropertyArray(this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable); if (\\"discoverable\\" in values && values.discoverable != null) { if (typeof values.discoverable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -90332,7 +95445,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice(); + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.length < vocabSparseArrayMinimumLength + ? this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice() : vocabCopyPropertyArray(this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended); if (\\"suspended\\" in values && values.suspended != null) { if (typeof values.suspended === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -90345,7 +95459,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice(); + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.length < vocabSparseArrayMinimumLength + ? this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice() : vocabCopyPropertyArray(this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial); if (\\"memorial\\" in values && values.memorial != null) { if (typeof values.memorial === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -90358,7 +95473,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice(); + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.length < vocabSparseArrayMinimumLength + ? this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice() : vocabCopyPropertyArray(this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable); if (\\"indexable\\" in values && values.indexable != null) { if (typeof values.indexable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -90371,12 +95487,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice();clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo); + clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < vocabSparseArrayMinimumLength + ? this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice() : vocabCopyPropertyArray(this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo);clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = vocabCopyTrustSet( + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, + ); if (\\"successor\\" in values && values.successor != null) { if (values.successor instanceof Application || values.successor instanceof Group || values.successor instanceof Organization || values.successor instanceof Person || values.successor instanceof Service || values.successor instanceof URL) { // @ts-ignore: type is checked above. clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor]; - clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set([0]); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The successor must be of type \\" + @@ -90384,12 +95504,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice();clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < vocabSparseArrayMinimumLength + ? this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice() : vocabCopyPropertyArray(this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs);clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = vocabCopyTrustSet( + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, + ); if (\\"alias\\" in values && values.alias != null) { if (values.alias instanceof Application || values.alias instanceof Group || values.alias instanceof Organization || values.alias instanceof Person || values.alias instanceof Service || values.alias instanceof URL) { // @ts-ignore: type is checked above. clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [values.alias]; - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set([0]); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The alias must be of type \\" + @@ -90408,15 +95532,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); - for (let i = 0; i < values.aliases.length; i++) { - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -90425,12 +95571,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice();clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < vocabSparseArrayMinimumLength + ? this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice() : vocabCopyPropertyArray(this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service);clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = vocabCopyTrustSet( + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, + ); if (\\"service\\" in values && values.service != null) { if (values.service instanceof DidService || values.service instanceof URL) { // @ts-ignore: type is checked above. clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = [values.service]; - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set([0]); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The service must be of type \\" + @@ -90449,15 +95599,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); - for (let i = 0; i < values.services.length; i++) { - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -90466,7 +95638,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice(); + clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.length < vocabSparseArrayMinimumLength + ? this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice() : vocabCopyPropertyArray(this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage); if (\\"followedMessage\\" in values && values.followedMessage != null) { if (typeof values.followedMessage === \\"string\\") { // @ts-ignore: type is checked above. @@ -90479,7 +95652,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice(); + clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.length < vocabSparseArrayMinimumLength + ? this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice() : vocabCopyPropertyArray(this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat); if (\\"cat\\" in values && values.cat != null) { if (typeof values.cat === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -90492,7 +95666,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice(); + clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length < vocabSparseArrayMinimumLength + ? this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice() : vocabCopyPropertyArray(this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense); if (\\"preferredLicense\\" in values && values.preferredLicense != null) { if (values.preferredLicense instanceof URL) { // @ts-ignore: type is checked above. @@ -90531,6 +95706,12 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -90586,122 +95767,377 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Group; - for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { - const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; - if (value != null && typeof value === \\"object\\") { - node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + { + const array = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { - const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + { + const array = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { - const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; - if (value != null && typeof value === \\"object\\") { - node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + { + const array = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { - const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + { + const array = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { - const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + { + const array = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { - const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + { + const array = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { - const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; - if (value != null && typeof value === \\"object\\") { - node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + { + const array = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { - const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + { + const array = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { - const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + { + const array = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { - const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + { + const array = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { - const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; - if (value != null && typeof value === \\"object\\") { - node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + { + const array = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === \\"object\\") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { - const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + { + const array = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { - const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; - if (value != null && typeof value === \\"object\\") { - node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + { + const array = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { - const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + { + const array = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { - const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + { + const array = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { - const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + { + const array = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { - const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; - if (value != null && typeof value === \\"object\\") { - node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + { + const array = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === \\"object\\") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } } } } }); } @@ -91054,7 +96490,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#publicKey\\"); @@ -91122,7 +96559,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -91209,7 +96647,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#publicKey\\"); @@ -91281,7 +96720,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -91635,7 +97075,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#assertionMethod\\"); @@ -91703,7 +97144,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -91794,7 +97236,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#assertionMethod\\"); @@ -91866,7 +97309,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -92290,7 +97734,8 @@ get gateways(): (URL)[] { } let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://www.w3.org/ns/ldp#inbox\\"); @@ -92358,7 +97803,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -92732,7 +98178,8 @@ get gateways(): (URL)[] { } let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#outbox\\"); @@ -92800,7 +98247,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -93154,7 +98602,8 @@ get gateways(): (URL)[] { } let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#following\\"); @@ -93222,7 +98671,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -93579,7 +99029,8 @@ get gateways(): (URL)[] { } let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#followers\\"); @@ -93647,7 +99098,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -94002,7 +99454,8 @@ get gateways(): (URL)[] { } let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#liked\\"); @@ -94070,7 +99523,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -94423,7 +99877,8 @@ get gateways(): (URL)[] { } let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://joinmastodon.org/ns#featured\\"); @@ -94491,7 +99946,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -94844,7 +100300,8 @@ get gateways(): (URL)[] { } let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://joinmastodon.org/ns#featuredTags\\"); @@ -94912,7 +100369,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -95262,7 +100720,8 @@ get gateways(): (URL)[] { } let v = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[0]; if (!(v instanceof URL) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/7aa9#featuredCollections\\"); @@ -95330,7 +100789,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -95680,7 +101140,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#streams\\"); @@ -95752,7 +101213,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -96237,7 +101699,8 @@ get gateways(): (URL)[] { } let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#movedTo\\"); @@ -96305,7 +101768,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -96718,7 +102182,8 @@ get gateways(): (URL)[] { } let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"); @@ -96786,7 +102251,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -96877,7 +102343,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"); @@ -96949,7 +102416,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -97303,7 +102771,8 @@ get gateways(): (URL)[] { } let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/did#service\\"); @@ -97371,7 +102840,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -97462,7 +102932,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/did#service\\"); @@ -97534,7 +103005,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -98933,7 +104405,7 @@ get gateways(): (URL)[] { instance.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = _3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; const _axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); let _axq166E2eZADq34V4MYUc8KMZdC_publicKey__array = values[\\"https://w3id.org/security#publicKey\\"]; @@ -98974,7 +104446,7 @@ get gateways(): (URL)[] { instance.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = _axq166E2eZADq34V4MYUc8KMZdC_publicKey; const _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); let _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod__array = values[\\"https://w3id.org/security#assertionMethod\\"]; @@ -99073,7 +104545,7 @@ get gateways(): (URL)[] { instance.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); let _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox__array = values[\\"http://www.w3.org/ns/ldp#inbox\\"]; @@ -99120,7 +104592,7 @@ get gateways(): (URL)[] { instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; const _41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); let _41QwhqJouoLg3h8dRPKat21brynC_outbox__array = values[\\"https://www.w3.org/ns/activitystreams#outbox\\"]; @@ -99167,7 +104639,7 @@ get gateways(): (URL)[] { instance.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = _41QwhqJouoLg3h8dRPKat21brynC_outbox; const _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); let _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following__array = values[\\"https://www.w3.org/ns/activitystreams#following\\"]; @@ -99208,7 +104680,7 @@ get gateways(): (URL)[] { instance.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; const _BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); let _BBCTgfphhsFzpVfKTykGSpBNwoA_followers__array = values[\\"https://www.w3.org/ns/activitystreams#followers\\"]; @@ -99249,7 +104721,7 @@ get gateways(): (URL)[] { instance.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = _BBCTgfphhsFzpVfKTykGSpBNwoA_followers; const _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); let _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked__array = values[\\"https://www.w3.org/ns/activitystreams#liked\\"]; @@ -99290,7 +104762,7 @@ get gateways(): (URL)[] { instance.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; const _4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); let _4N1vBJzXDf8NbBumeECQMFvKetja_featured__array = values[\\"http://joinmastodon.org/ns#featured\\"]; @@ -99331,7 +104803,7 @@ get gateways(): (URL)[] { instance.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = _4N1vBJzXDf8NbBumeECQMFvKetja_featured; const _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); let _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags__array = values[\\"http://joinmastodon.org/ns#featuredTags\\"]; @@ -99372,7 +104844,7 @@ get gateways(): (URL)[] { instance.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; const _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); let _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections__array = values[\\"https://w3id.org/fep/7aa9#featuredCollections\\"]; @@ -99413,7 +104885,7 @@ get gateways(): (URL)[] { instance.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); let _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams__array = values[\\"https://www.w3.org/ns/activitystreams#streams\\"]; @@ -99602,7 +105074,7 @@ get gateways(): (URL)[] { instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); let _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array = values[\\"https://www.w3.org/ns/activitystreams#movedTo\\"]; @@ -99660,7 +105132,7 @@ get gateways(): (URL)[] { instance.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); let _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array = values[\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"]; @@ -99718,7 +105190,7 @@ get gateways(): (URL)[] { instance.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; const _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); let _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service__array = values[\\"https://www.w3.org/ns/did#service\\"]; @@ -100538,7 +106010,7 @@ export class Link { #_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width: (number)[] = []; #_gCVTegXxWWCw6wWRxa1QF65zusg_preview: (Link | Object | URL)[] = []; - #_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: Set = new Set(); + #_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: VocabTrustSet = new Set(); #_2rzkBRS4gNPrkJk9DohHAMUAxA2d: (URL)[] = []; /** @@ -100617,10 +106089,34 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } - if (Array.isArray(values.rels) && - values.rels.every(v => typeof v === \\"string\\")) { + let copied!: (string)[]; + let valid = false; + if (Array.isArray(values.rels)) { + const array = values.rels; + const test = (v: string): boolean => typeof v === \\"string\\"; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.rels; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel = values.rels.slice(); + this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel = copied; } else { throw new TypeError( @@ -100679,10 +106175,34 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } - if (Array.isArray(values.names) && - values.names.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.names)) { + const array = values.names; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.names; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = values.names.slice(); + this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = copied; } else { throw new TypeError( @@ -100733,14 +106253,36 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (\\"previews\\" in values && values.previews != null) { - if (Array.isArray(values.previews) && - values.previews.every(v => v instanceof Link || v instanceof Object || v instanceof URL)) { + let copied!: (Link | Object | URL)[]; + let valid = false; + if (Array.isArray(values.previews)) { + const array = values.previews; + const test = (v: Link | Object | URL): boolean => v instanceof Link || v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.previews; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = values.previews.slice(); + this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = copied; - for (let i = 0; i < values.previews.length; i++) { - this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.add(i); - } + vocabSetTrustPrefix(this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length); } else { throw new TypeError( @@ -100752,10 +106294,34 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (\\"licenses\\" in values && values.licenses != null) { - if (Array.isArray(values.licenses) && - values.licenses.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.licenses)) { + const array = values.licenses; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.licenses; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = values.licenses.slice(); + this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = copied; } else { throw new TypeError( @@ -100823,7 +106389,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num options ); copyPortableProvenance(this, clone); - clone.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href = this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.slice(); + clone.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href = this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.length < vocabSparseArrayMinimumLength + ? this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.slice() : vocabCopyPropertyArray(this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href); if (\\"href\\" in values && values.href != null) { if (values.href instanceof URL) { // @ts-ignore: type is checked above. @@ -100836,7 +106403,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel = this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel.slice(); + clone.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel = this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel.length < vocabSparseArrayMinimumLength + ? this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel.slice() : vocabCopyPropertyArray(this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel); if (\\"rel\\" in values && values.rel != null) { if (typeof values.rel === \\"string\\") { // @ts-ignore: type is checked above. @@ -100860,10 +106428,34 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } - if (Array.isArray(values.rels) && - values.rels.every(v => typeof v === \\"string\\")) { + let copied!: (string)[]; + let valid = false; + if (Array.isArray(values.rels)) { + const array = values.rels; + const test = (v: string): boolean => typeof v === \\"string\\"; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.rels; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel = values.rels.slice(); + clone.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel = copied; } else { throw new TypeError( @@ -100872,7 +106464,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.slice(); + clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.length < vocabSparseArrayMinimumLength + ? this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.slice() : vocabCopyPropertyArray(this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType); if (\\"mediaType\\" in values && values.mediaType != null) { if (typeof values.mediaType === \\"string\\") { // @ts-ignore: type is checked above. @@ -100885,7 +106478,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.slice(); + clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.length < vocabSparseArrayMinimumLength + ? this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.slice() : vocabCopyPropertyArray(this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase); if (\\"digestMultibase\\" in values && values.digestMultibase != null) { if (typeof values.digestMultibase === \\"string\\") { // @ts-ignore: type is checked above. @@ -100898,7 +106492,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice(); + clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.length < vocabSparseArrayMinimumLength + ? this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice() : vocabCopyPropertyArray(this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name); if (\\"name\\" in values && values.name != null) { if (typeof values.name === \\"string\\" || values.name instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -100922,10 +106517,34 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } - if (Array.isArray(values.names) && - values.names.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.names)) { + const array = values.names; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.names; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = values.names.slice(); + clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = copied; } else { throw new TypeError( @@ -100934,7 +106553,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang = this.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang.slice(); + clone.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang = this.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang.length < vocabSparseArrayMinimumLength + ? this.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang.slice() : vocabCopyPropertyArray(this.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang); if (\\"language\\" in values && values.language != null) { if (values.language instanceof Intl.Locale) { // @ts-ignore: type is checked above. @@ -100947,7 +106567,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height = this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.slice(); + clone.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height = this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.length < vocabSparseArrayMinimumLength + ? this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.slice() : vocabCopyPropertyArray(this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height); if (\\"height\\" in values && values.height != null) { if (typeof values.height === \\"number\\" && Number.isInteger(values.height) && values.height >= 0) { // @ts-ignore: type is checked above. @@ -100960,7 +106581,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width = this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width.slice(); + clone.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width = this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width.length < vocabSparseArrayMinimumLength + ? this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width.slice() : vocabCopyPropertyArray(this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width); if (\\"width\\" in values && values.width != null) { if (typeof values.width === \\"number\\" && Number.isInteger(values.width) && values.width >= 0) { // @ts-ignore: type is checked above. @@ -100973,18 +106595,43 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.slice();clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = new Set(this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview); + clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length < vocabSparseArrayMinimumLength + ? this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.slice() : vocabCopyPropertyArray(this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview);clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = vocabCopyTrustSet( + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, + ); if (\\"previews\\" in values && values.previews != null) { - if (Array.isArray(values.previews) && - values.previews.every(v => v instanceof Link || v instanceof Object || v instanceof URL)) { + let copied!: (Link | Object | URL)[]; + let valid = false; + if (Array.isArray(values.previews)) { + const array = values.previews; + const test = (v: Link | Object | URL): boolean => v instanceof Link || v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.previews; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = values.previews.slice(); + clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = copied; clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = new Set(); - for (let i = 0; i < values.previews.length; i++) { - clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.add(i); - } + vocabSetTrustPrefix(clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length); } else { throw new TypeError( @@ -100993,13 +106640,38 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.slice(); + clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length < vocabSparseArrayMinimumLength + ? this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.slice() : vocabCopyPropertyArray(this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d); if (\\"licenses\\" in values && values.licenses != null) { - if (Array.isArray(values.licenses) && - values.licenses.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.licenses)) { + const array = values.licenses; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.licenses; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = values.licenses.slice(); + clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = copied; } else { throw new TypeError( @@ -101034,6 +106706,12 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -101079,24 +106757,69 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.length; i++) { - const value = node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href[i]; - if (value != null && typeof value === \\"object\\") { - node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href[i] = context.value(value); + { + const array = node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.length; i++) { + const value = node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href[i]; + if (value != null && typeof value === \\"object\\") { + node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length; i++) { - const value = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i]; - if (value != null && typeof value === \\"object\\") { - node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i] = context.value(value); + { + const array = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length; i++) { + const value = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i]; + if (value != null && typeof value === \\"object\\") { + node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length; i++) { - const value = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i] = context.value(value); + { + const array = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length; i++) { + const value = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i] = context.value(value); + } + } } } } }); } @@ -101586,7 +107309,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { + !(i < (this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] ?? 0) || + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#preview\\"); @@ -101658,7 +107382,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { + !(i < (this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] ?? 0) || + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -102577,7 +108302,7 @@ get licenses(): (URL)[] { instance.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width = _2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width; const _gCVTegXxWWCw6wWRxa1QF65zusg_preview: (Link | Object | URL)[] = []; - const _trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: Set = new Set(); + const _trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: VocabTrustSet = new Set(); let _gCVTegXxWWCw6wWRxa1QF65zusg_preview__array = values[\\"https://www.w3.org/ns/activitystreams#preview\\"]; @@ -103062,6 +108787,12 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -103546,6 +109277,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -104070,6 +109807,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -104584,6 +110327,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -105094,6 +110843,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -105604,6 +111359,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -106114,6 +111875,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -106622,6 +112389,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -107090,6 +112863,12 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -107589,6 +113368,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -107962,11 +113747,11 @@ export class Note extends Object { } #_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); #_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl: (URL)[] = []; #_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); /** * Constructs a new instance of Note with the given values. @@ -108107,12 +113892,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Note;clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice();clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote); + const clone = super.clone(values, options) as unknown as Note;clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < vocabSparseArrayMinimumLength + ? this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice() : vocabCopyPropertyArray(this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote);clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = vocabCopyTrustSet( + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, + ); if (\\"quote\\" in values && values.quote != null) { if (values.quote instanceof Object || values.quote instanceof URL) { // @ts-ignore: type is checked above. clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = [values.quote]; - clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set([0]); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The quote must be of type \\" + @@ -108120,7 +113909,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice(); + clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length < vocabSparseArrayMinimumLength + ? this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice() : vocabCopyPropertyArray(this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl); if (\\"quoteUrl\\" in values && values.quoteUrl != null) { if (values.quoteUrl instanceof URL) { // @ts-ignore: type is checked above. @@ -108133,12 +113923,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice();clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization); + clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice() : vocabCopyPropertyArray(this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization);clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = vocabCopyTrustSet( + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, + ); if (\\"quoteAuthorization\\" in values && values.quoteAuthorization != null) { if (values.quoteAuthorization instanceof QuoteAuthorization || values.quoteAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = [values.quoteAuthorization]; - clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set([0]); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The quoteAuthorization must be of type \\" + @@ -108172,6 +113966,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -108221,24 +114021,69 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Note; - for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { - const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + { + const array = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { - const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; - if (value != null && typeof value === \\"object\\") { - node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + { + const array = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === \\"object\\") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { - const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; - if (value != null && typeof value === \\"object\\") { - node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + { + const array = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } } } } }); } @@ -108571,7 +114416,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/044f#quote\\"); @@ -108639,7 +114485,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -109013,7 +114860,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/044f#quoteAuthorization\\"); @@ -109081,7 +114929,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -109508,7 +115357,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); let _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote__array = values[\\"https://w3id.org/fep/044f#quote\\"]; @@ -109588,7 +115437,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; const _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); let _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization__array = values[\\"https://w3id.org/fep/044f#quoteAuthorization\\"]; @@ -109761,7 +115610,7 @@ export class OrderedCollectionPage extends CollectionPage { } #_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: (Object | Link | URL)[] = []; - #_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: Set = new Set(); + #_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: VocabTrustSet = new Set(); #_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex: (number)[] = []; /** @@ -109801,14 +115650,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu super(values, options); if (\\"items\\" in values && values.items != null) { - if (Array.isArray(values.items) && - values.items.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.items)) { + const array = values.items; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.items; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = values.items.slice(); + this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = copied; - for (let i = 0; i < values.items.length; i++) { - this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.add(i); - } + vocabSetTrustPrefix(this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length); } else { throw new TypeError( @@ -109896,18 +115767,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as OrderedCollectionPage;clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.slice();clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = new Set(this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items); + const clone = super.clone(values, options) as unknown as OrderedCollectionPage;clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length < vocabSparseArrayMinimumLength + ? this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.slice() : vocabCopyPropertyArray(this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items);clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = vocabCopyTrustSet( + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, + ); if (\\"items\\" in values && values.items != null) { - if (Array.isArray(values.items) && - values.items.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.items)) { + const array = values.items; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.items; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = values.items.slice(); + clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = copied; clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = new Set(); - for (let i = 0; i < values.items.length; i++) { - clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length); } else { throw new TypeError( @@ -109916,7 +115812,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex = this.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex.slice(); + clone.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex = this.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex.length < vocabSparseArrayMinimumLength + ? this.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex.slice() : vocabCopyPropertyArray(this.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex); if (\\"startIndex\\" in values && values.startIndex != null) { if (typeof values.startIndex === \\"number\\" && Number.isInteger(values.startIndex) && values.startIndex >= 0) { // @ts-ignore: type is checked above. @@ -109955,6 +115852,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -110004,10 +115907,25 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as OrderedCollectionPage; - for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { - const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + { + const array = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { + const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + } + } } } } }); } @@ -110354,7 +116272,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { + !(i < (this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[vocabTrustPrefix] ?? 0) || + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#items\\"); @@ -110426,7 +116345,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { + !(i < (this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[vocabTrustPrefix] ?? 0) || + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -110819,7 +116739,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: (Object | Link | URL)[] = []; - const _trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: Set = new Set(); + const _trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: VocabTrustSet = new Set(); let _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items__array = values[\\"https://www.w3.org/ns/activitystreams#items\\"]; @@ -111008,39 +116928,39 @@ export class Organization extends Object { #_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername: ((string | LanguageString))[] = []; #_axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); #_41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); #_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); #_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); #_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); #_4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); #_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); #_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints: (Endpoints)[] = []; #_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable: (boolean)[] = []; #_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended: (boolean)[] = []; @@ -111048,13 +116968,13 @@ export class Organization extends Object { #_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable: (boolean)[] = []; #_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); #_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); #_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); #_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage: (string)[] = []; #_2xEU4QtkC53RAun67T81Egqt9vmL_isCat: (boolean)[] = []; #_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense: (URL)[] = []; @@ -111123,10 +117043,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -111159,14 +117103,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; - for (let i = 0; i < values.publicKeys.length; i++) { - this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -111199,14 +117165,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; - for (let i = 0; i < values.assertionMethods.length; i++) { - this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -111239,10 +117227,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -111371,14 +117383,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | if (\\"streams\\" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; - for (let i = 0; i < values.streams.length; i++) { - this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -111489,14 +117523,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; - for (let i = 0; i < values.aliases.length; i++) { - this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -111529,14 +117585,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; - for (let i = 0; i < values.services.length; i++) { - this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -111656,7 +117734,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Organization;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice(); + const clone = super.clone(values, options) as unknown as Organization;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.length < vocabSparseArrayMinimumLength + ? this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice() : vocabCopyPropertyArray(this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername); if (\\"preferredUsername\\" in values && values.preferredUsername != null) { if (typeof values.preferredUsername === \\"string\\" || values.preferredUsername instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -111680,10 +117759,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -111692,12 +117795,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice();clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < vocabSparseArrayMinimumLength + ? this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice() : vocabCopyPropertyArray(this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey);clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = vocabCopyTrustSet( + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, + ); if (\\"publicKey\\" in values && values.publicKey != null) { if (values.publicKey instanceof CryptographicKey || values.publicKey instanceof URL) { // @ts-ignore: type is checked above. clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = [values.publicKey]; - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set([0]); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The publicKey must be of type \\" + @@ -111716,15 +117823,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); - for (let i = 0; i < values.publicKeys.length; i++) { - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -111733,12 +117862,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice();clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < vocabSparseArrayMinimumLength + ? this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice() : vocabCopyPropertyArray(this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod);clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = vocabCopyTrustSet( + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, + ); if (\\"assertionMethod\\" in values && values.assertionMethod != null) { if (values.assertionMethod instanceof Multikey || values.assertionMethod instanceof URL) { // @ts-ignore: type is checked above. clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = [values.assertionMethod]; - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set([0]); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The assertionMethod must be of type \\" + @@ -111757,15 +117890,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); - for (let i = 0; i < values.assertionMethods.length; i++) { - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -111774,7 +117929,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < vocabSparseArrayMinimumLength + ? this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice() : vocabCopyPropertyArray(this.#_hQiaHhZP8hqxckxTBrpsGNs57E3); if (\\"gateway\\" in values && values.gateway != null) { if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { // @ts-ignore: type is checked above. @@ -111798,10 +117954,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -111810,7 +117990,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice(); + clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.length < vocabSparseArrayMinimumLength + ? this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice() : vocabCopyPropertyArray(this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers); if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -111823,12 +118004,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice();clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox); + clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < vocabSparseArrayMinimumLength + ? this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice() : vocabCopyPropertyArray(this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox);clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = vocabCopyTrustSet( + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, + ); if (\\"inbox\\" in values && values.inbox != null) { if (values.inbox instanceof OrderedCollection || values.inbox instanceof OrderedCollectionPage || values.inbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox]; - clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set([0]); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The inbox must be of type \\" + @@ -111836,12 +118021,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice();clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox); + clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < vocabSparseArrayMinimumLength + ? this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice() : vocabCopyPropertyArray(this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox);clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = vocabCopyTrustSet( + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, + ); if (\\"outbox\\" in values && values.outbox != null) { if (values.outbox instanceof OrderedCollection || values.outbox instanceof OrderedCollectionPage || values.outbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox]; - clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set([0]); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The outbox must be of type \\" + @@ -111849,12 +118038,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice();clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following); + clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < vocabSparseArrayMinimumLength + ? this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice() : vocabCopyPropertyArray(this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following);clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = vocabCopyTrustSet( + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, + ); if (\\"following\\" in values && values.following != null) { if (values.following instanceof Collection || values.following instanceof URL) { // @ts-ignore: type is checked above. clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = [values.following]; - clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set([0]); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The following must be of type \\" + @@ -111862,12 +118055,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice();clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers); + clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < vocabSparseArrayMinimumLength + ? this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice() : vocabCopyPropertyArray(this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers);clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = vocabCopyTrustSet( + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, + ); if (\\"followers\\" in values && values.followers != null) { if (values.followers instanceof Collection || values.followers instanceof URL) { // @ts-ignore: type is checked above. clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = [values.followers]; - clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set([0]); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The followers must be of type \\" + @@ -111875,12 +118072,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice();clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked); + clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < vocabSparseArrayMinimumLength + ? this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice() : vocabCopyPropertyArray(this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked);clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = vocabCopyTrustSet( + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, + ); if (\\"liked\\" in values && values.liked != null) { if (values.liked instanceof Collection || values.liked instanceof URL) { // @ts-ignore: type is checked above. clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = [values.liked]; - clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set([0]); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The liked must be of type \\" + @@ -111888,12 +118089,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice();clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured); + clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < vocabSparseArrayMinimumLength + ? this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice() : vocabCopyPropertyArray(this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured);clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = vocabCopyTrustSet( + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, + ); if (\\"featured\\" in values && values.featured != null) { if (values.featured instanceof Collection || values.featured instanceof URL) { // @ts-ignore: type is checked above. clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = [values.featured]; - clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set([0]); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featured must be of type \\" + @@ -111901,12 +118106,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice();clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags); + clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < vocabSparseArrayMinimumLength + ? this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice() : vocabCopyPropertyArray(this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags);clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = vocabCopyTrustSet( + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, + ); if (\\"featuredTags\\" in values && values.featuredTags != null) { if (values.featuredTags instanceof Collection || values.featuredTags instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = [values.featuredTags]; - clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set([0]); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredTags must be of type \\" + @@ -111914,12 +118123,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice();clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections); + clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length < vocabSparseArrayMinimumLength + ? this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice() : vocabCopyPropertyArray(this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections);clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = vocabCopyTrustSet( + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, + ); if (\\"featuredCollections\\" in values && values.featuredCollections != null) { if (values.featuredCollections instanceof Collection || values.featuredCollections instanceof URL) { // @ts-ignore: type is checked above. clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = [values.featuredCollections]; - clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set([0]); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredCollections must be of type \\" + @@ -111927,18 +118140,43 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice();clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length < vocabSparseArrayMinimumLength + ? this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice() : vocabCopyPropertyArray(this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams);clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = vocabCopyTrustSet( + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, + ); if (\\"streams\\" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(); - for (let i = 0; i < values.streams.length; i++) { - clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -111947,7 +118185,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice(); + clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length < vocabSparseArrayMinimumLength + ? this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice() : vocabCopyPropertyArray(this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints); if (\\"endpoints\\" in values && values.endpoints != null) { if (values.endpoints instanceof Endpoints) { // @ts-ignore: type is checked above. @@ -111960,7 +118199,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice(); + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.length < vocabSparseArrayMinimumLength + ? this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice() : vocabCopyPropertyArray(this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable); if (\\"discoverable\\" in values && values.discoverable != null) { if (typeof values.discoverable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -111973,7 +118213,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice(); + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.length < vocabSparseArrayMinimumLength + ? this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice() : vocabCopyPropertyArray(this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended); if (\\"suspended\\" in values && values.suspended != null) { if (typeof values.suspended === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -111986,7 +118227,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice(); + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.length < vocabSparseArrayMinimumLength + ? this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice() : vocabCopyPropertyArray(this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial); if (\\"memorial\\" in values && values.memorial != null) { if (typeof values.memorial === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -111999,7 +118241,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice(); + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.length < vocabSparseArrayMinimumLength + ? this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice() : vocabCopyPropertyArray(this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable); if (\\"indexable\\" in values && values.indexable != null) { if (typeof values.indexable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -112012,12 +118255,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice();clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo); + clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < vocabSparseArrayMinimumLength + ? this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice() : vocabCopyPropertyArray(this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo);clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = vocabCopyTrustSet( + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, + ); if (\\"successor\\" in values && values.successor != null) { if (values.successor instanceof Application || values.successor instanceof Group || values.successor instanceof Organization || values.successor instanceof Person || values.successor instanceof Service || values.successor instanceof URL) { // @ts-ignore: type is checked above. clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor]; - clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set([0]); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The successor must be of type \\" + @@ -112025,12 +118272,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice();clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < vocabSparseArrayMinimumLength + ? this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice() : vocabCopyPropertyArray(this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs);clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = vocabCopyTrustSet( + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, + ); if (\\"alias\\" in values && values.alias != null) { if (values.alias instanceof Application || values.alias instanceof Group || values.alias instanceof Organization || values.alias instanceof Person || values.alias instanceof Service || values.alias instanceof URL) { // @ts-ignore: type is checked above. clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [values.alias]; - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set([0]); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The alias must be of type \\" + @@ -112049,15 +118300,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); - for (let i = 0; i < values.aliases.length; i++) { - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -112066,12 +118339,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice();clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < vocabSparseArrayMinimumLength + ? this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice() : vocabCopyPropertyArray(this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service);clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = vocabCopyTrustSet( + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, + ); if (\\"service\\" in values && values.service != null) { if (values.service instanceof DidService || values.service instanceof URL) { // @ts-ignore: type is checked above. clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = [values.service]; - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set([0]); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The service must be of type \\" + @@ -112090,15 +118367,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); - for (let i = 0; i < values.services.length; i++) { - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -112107,7 +118406,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice(); + clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.length < vocabSparseArrayMinimumLength + ? this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice() : vocabCopyPropertyArray(this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage); if (\\"followedMessage\\" in values && values.followedMessage != null) { if (typeof values.followedMessage === \\"string\\") { // @ts-ignore: type is checked above. @@ -112120,7 +118420,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice(); + clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.length < vocabSparseArrayMinimumLength + ? this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice() : vocabCopyPropertyArray(this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat); if (\\"cat\\" in values && values.cat != null) { if (typeof values.cat === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -112133,7 +118434,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice(); + clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length < vocabSparseArrayMinimumLength + ? this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice() : vocabCopyPropertyArray(this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense); if (\\"preferredLicense\\" in values && values.preferredLicense != null) { if (values.preferredLicense instanceof URL) { // @ts-ignore: type is checked above. @@ -112172,6 +118474,12 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -112227,122 +118535,377 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Organization; - for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { - const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; - if (value != null && typeof value === \\"object\\") { - node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + { + const array = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { - const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + { + const array = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { - const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; - if (value != null && typeof value === \\"object\\") { - node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + { + const array = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { - const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + { + const array = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { - const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + { + const array = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { - const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + { + const array = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { - const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; - if (value != null && typeof value === \\"object\\") { - node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + { + const array = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { - const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + { + const array = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { - const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + { + const array = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { - const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + { + const array = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { - const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; - if (value != null && typeof value === \\"object\\") { - node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + { + const array = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === \\"object\\") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { - const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + { + const array = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { - const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; - if (value != null && typeof value === \\"object\\") { - node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + { + const array = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { - const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + { + const array = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { - const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + { + const array = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { - const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + { + const array = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { - const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; - if (value != null && typeof value === \\"object\\") { - node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + { + const array = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === \\"object\\") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } } } } }); } @@ -112695,7 +119258,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#publicKey\\"); @@ -112763,7 +119327,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -112850,7 +119415,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#publicKey\\"); @@ -112922,7 +119488,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -113276,7 +119843,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#assertionMethod\\"); @@ -113344,7 +119912,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -113435,7 +120004,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#assertionMethod\\"); @@ -113507,7 +120077,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -113931,7 +120502,8 @@ get gateways(): (URL)[] { } let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://www.w3.org/ns/ldp#inbox\\"); @@ -113999,7 +120571,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -114373,7 +120946,8 @@ get gateways(): (URL)[] { } let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#outbox\\"); @@ -114441,7 +121015,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -114795,7 +121370,8 @@ get gateways(): (URL)[] { } let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#following\\"); @@ -114863,7 +121439,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -115220,7 +121797,8 @@ get gateways(): (URL)[] { } let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#followers\\"); @@ -115288,7 +121866,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -115643,7 +122222,8 @@ get gateways(): (URL)[] { } let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#liked\\"); @@ -115711,7 +122291,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -116064,7 +122645,8 @@ get gateways(): (URL)[] { } let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://joinmastodon.org/ns#featured\\"); @@ -116132,7 +122714,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -116485,7 +123068,8 @@ get gateways(): (URL)[] { } let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://joinmastodon.org/ns#featuredTags\\"); @@ -116553,7 +123137,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -116903,7 +123488,8 @@ get gateways(): (URL)[] { } let v = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[0]; if (!(v instanceof URL) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/7aa9#featuredCollections\\"); @@ -116971,7 +123557,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -117321,7 +123908,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#streams\\"); @@ -117393,7 +123981,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -117878,7 +124467,8 @@ get gateways(): (URL)[] { } let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#movedTo\\"); @@ -117946,7 +124536,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -118359,7 +124950,8 @@ get gateways(): (URL)[] { } let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"); @@ -118427,7 +125019,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -118518,7 +125111,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"); @@ -118590,7 +125184,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -118944,7 +125539,8 @@ get gateways(): (URL)[] { } let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/did#service\\"); @@ -119012,7 +125608,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -119103,7 +125700,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/did#service\\"); @@ -119175,7 +125773,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -120574,7 +127173,7 @@ get gateways(): (URL)[] { instance.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = _3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; const _axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); let _axq166E2eZADq34V4MYUc8KMZdC_publicKey__array = values[\\"https://w3id.org/security#publicKey\\"]; @@ -120615,7 +127214,7 @@ get gateways(): (URL)[] { instance.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = _axq166E2eZADq34V4MYUc8KMZdC_publicKey; const _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); let _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod__array = values[\\"https://w3id.org/security#assertionMethod\\"]; @@ -120714,7 +127313,7 @@ get gateways(): (URL)[] { instance.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); let _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox__array = values[\\"http://www.w3.org/ns/ldp#inbox\\"]; @@ -120761,7 +127360,7 @@ get gateways(): (URL)[] { instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; const _41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); let _41QwhqJouoLg3h8dRPKat21brynC_outbox__array = values[\\"https://www.w3.org/ns/activitystreams#outbox\\"]; @@ -120808,7 +127407,7 @@ get gateways(): (URL)[] { instance.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = _41QwhqJouoLg3h8dRPKat21brynC_outbox; const _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); let _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following__array = values[\\"https://www.w3.org/ns/activitystreams#following\\"]; @@ -120849,7 +127448,7 @@ get gateways(): (URL)[] { instance.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; const _BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); let _BBCTgfphhsFzpVfKTykGSpBNwoA_followers__array = values[\\"https://www.w3.org/ns/activitystreams#followers\\"]; @@ -120890,7 +127489,7 @@ get gateways(): (URL)[] { instance.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = _BBCTgfphhsFzpVfKTykGSpBNwoA_followers; const _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); let _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked__array = values[\\"https://www.w3.org/ns/activitystreams#liked\\"]; @@ -120931,7 +127530,7 @@ get gateways(): (URL)[] { instance.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; const _4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); let _4N1vBJzXDf8NbBumeECQMFvKetja_featured__array = values[\\"http://joinmastodon.org/ns#featured\\"]; @@ -120972,7 +127571,7 @@ get gateways(): (URL)[] { instance.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = _4N1vBJzXDf8NbBumeECQMFvKetja_featured; const _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); let _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags__array = values[\\"http://joinmastodon.org/ns#featuredTags\\"]; @@ -121013,7 +127612,7 @@ get gateways(): (URL)[] { instance.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; const _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); let _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections__array = values[\\"https://w3id.org/fep/7aa9#featuredCollections\\"]; @@ -121054,7 +127653,7 @@ get gateways(): (URL)[] { instance.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); let _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams__array = values[\\"https://www.w3.org/ns/activitystreams#streams\\"]; @@ -121243,7 +127842,7 @@ get gateways(): (URL)[] { instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); let _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array = values[\\"https://www.w3.org/ns/activitystreams#movedTo\\"]; @@ -121301,7 +127900,7 @@ get gateways(): (URL)[] { instance.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); let _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array = values[\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"]; @@ -121359,7 +127958,7 @@ get gateways(): (URL)[] { instance.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; const _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); let _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service__array = values[\\"https://www.w3.org/ns/did#service\\"]; @@ -122219,6 +128818,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -122604,39 +129209,39 @@ export class Person extends Object { #_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername: ((string | LanguageString))[] = []; #_axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); #_41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); #_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); #_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); #_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); #_4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); #_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); #_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints: (Endpoints)[] = []; #_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable: (boolean)[] = []; #_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended: (boolean)[] = []; @@ -122644,13 +129249,13 @@ export class Person extends Object { #_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable: (boolean)[] = []; #_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); #_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); #_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); #_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage: (string)[] = []; #_2xEU4QtkC53RAun67T81Egqt9vmL_isCat: (boolean)[] = []; #_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense: (URL)[] = []; @@ -122719,10 +129324,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -122755,14 +129384,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; - for (let i = 0; i < values.publicKeys.length; i++) { - this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -122795,14 +129446,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; - for (let i = 0; i < values.assertionMethods.length; i++) { - this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -122835,10 +129508,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -122967,14 +129664,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | if (\\"streams\\" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; - for (let i = 0; i < values.streams.length; i++) { - this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -123085,14 +129804,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; - for (let i = 0; i < values.aliases.length; i++) { - this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -123125,14 +129866,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; - for (let i = 0; i < values.services.length; i++) { - this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -123252,7 +130015,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Person;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice(); + const clone = super.clone(values, options) as unknown as Person;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.length < vocabSparseArrayMinimumLength + ? this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice() : vocabCopyPropertyArray(this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername); if (\\"preferredUsername\\" in values && values.preferredUsername != null) { if (typeof values.preferredUsername === \\"string\\" || values.preferredUsername instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -123276,10 +130040,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -123288,12 +130076,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice();clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < vocabSparseArrayMinimumLength + ? this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice() : vocabCopyPropertyArray(this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey);clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = vocabCopyTrustSet( + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, + ); if (\\"publicKey\\" in values && values.publicKey != null) { if (values.publicKey instanceof CryptographicKey || values.publicKey instanceof URL) { // @ts-ignore: type is checked above. clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = [values.publicKey]; - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set([0]); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The publicKey must be of type \\" + @@ -123312,15 +130104,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); - for (let i = 0; i < values.publicKeys.length; i++) { - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -123329,12 +130143,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice();clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < vocabSparseArrayMinimumLength + ? this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice() : vocabCopyPropertyArray(this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod);clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = vocabCopyTrustSet( + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, + ); if (\\"assertionMethod\\" in values && values.assertionMethod != null) { if (values.assertionMethod instanceof Multikey || values.assertionMethod instanceof URL) { // @ts-ignore: type is checked above. clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = [values.assertionMethod]; - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set([0]); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The assertionMethod must be of type \\" + @@ -123353,15 +130171,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); - for (let i = 0; i < values.assertionMethods.length; i++) { - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -123370,7 +130210,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < vocabSparseArrayMinimumLength + ? this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice() : vocabCopyPropertyArray(this.#_hQiaHhZP8hqxckxTBrpsGNs57E3); if (\\"gateway\\" in values && values.gateway != null) { if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { // @ts-ignore: type is checked above. @@ -123394,10 +130235,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -123406,7 +130271,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice(); + clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.length < vocabSparseArrayMinimumLength + ? this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice() : vocabCopyPropertyArray(this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers); if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -123419,12 +130285,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice();clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox); + clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < vocabSparseArrayMinimumLength + ? this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice() : vocabCopyPropertyArray(this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox);clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = vocabCopyTrustSet( + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, + ); if (\\"inbox\\" in values && values.inbox != null) { if (values.inbox instanceof OrderedCollection || values.inbox instanceof OrderedCollectionPage || values.inbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox]; - clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set([0]); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The inbox must be of type \\" + @@ -123432,12 +130302,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice();clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox); + clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < vocabSparseArrayMinimumLength + ? this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice() : vocabCopyPropertyArray(this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox);clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = vocabCopyTrustSet( + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, + ); if (\\"outbox\\" in values && values.outbox != null) { if (values.outbox instanceof OrderedCollection || values.outbox instanceof OrderedCollectionPage || values.outbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox]; - clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set([0]); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The outbox must be of type \\" + @@ -123445,12 +130319,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice();clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following); + clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < vocabSparseArrayMinimumLength + ? this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice() : vocabCopyPropertyArray(this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following);clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = vocabCopyTrustSet( + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, + ); if (\\"following\\" in values && values.following != null) { if (values.following instanceof Collection || values.following instanceof URL) { // @ts-ignore: type is checked above. clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = [values.following]; - clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set([0]); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The following must be of type \\" + @@ -123458,12 +130336,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice();clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers); + clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < vocabSparseArrayMinimumLength + ? this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice() : vocabCopyPropertyArray(this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers);clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = vocabCopyTrustSet( + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, + ); if (\\"followers\\" in values && values.followers != null) { if (values.followers instanceof Collection || values.followers instanceof URL) { // @ts-ignore: type is checked above. clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = [values.followers]; - clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set([0]); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The followers must be of type \\" + @@ -123471,12 +130353,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice();clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked); + clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < vocabSparseArrayMinimumLength + ? this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice() : vocabCopyPropertyArray(this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked);clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = vocabCopyTrustSet( + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, + ); if (\\"liked\\" in values && values.liked != null) { if (values.liked instanceof Collection || values.liked instanceof URL) { // @ts-ignore: type is checked above. clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = [values.liked]; - clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set([0]); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The liked must be of type \\" + @@ -123484,12 +130370,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice();clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured); + clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < vocabSparseArrayMinimumLength + ? this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice() : vocabCopyPropertyArray(this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured);clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = vocabCopyTrustSet( + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, + ); if (\\"featured\\" in values && values.featured != null) { if (values.featured instanceof Collection || values.featured instanceof URL) { // @ts-ignore: type is checked above. clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = [values.featured]; - clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set([0]); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featured must be of type \\" + @@ -123497,12 +130387,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice();clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags); + clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < vocabSparseArrayMinimumLength + ? this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice() : vocabCopyPropertyArray(this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags);clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = vocabCopyTrustSet( + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, + ); if (\\"featuredTags\\" in values && values.featuredTags != null) { if (values.featuredTags instanceof Collection || values.featuredTags instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = [values.featuredTags]; - clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set([0]); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredTags must be of type \\" + @@ -123510,12 +130404,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice();clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections); + clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length < vocabSparseArrayMinimumLength + ? this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice() : vocabCopyPropertyArray(this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections);clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = vocabCopyTrustSet( + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, + ); if (\\"featuredCollections\\" in values && values.featuredCollections != null) { if (values.featuredCollections instanceof Collection || values.featuredCollections instanceof URL) { // @ts-ignore: type is checked above. clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = [values.featuredCollections]; - clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set([0]); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredCollections must be of type \\" + @@ -123523,18 +130421,43 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice();clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length < vocabSparseArrayMinimumLength + ? this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice() : vocabCopyPropertyArray(this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams);clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = vocabCopyTrustSet( + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, + ); if (\\"streams\\" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(); - for (let i = 0; i < values.streams.length; i++) { - clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -123543,7 +130466,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice(); + clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length < vocabSparseArrayMinimumLength + ? this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice() : vocabCopyPropertyArray(this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints); if (\\"endpoints\\" in values && values.endpoints != null) { if (values.endpoints instanceof Endpoints) { // @ts-ignore: type is checked above. @@ -123556,7 +130480,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice(); + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.length < vocabSparseArrayMinimumLength + ? this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice() : vocabCopyPropertyArray(this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable); if (\\"discoverable\\" in values && values.discoverable != null) { if (typeof values.discoverable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -123569,7 +130494,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice(); + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.length < vocabSparseArrayMinimumLength + ? this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice() : vocabCopyPropertyArray(this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended); if (\\"suspended\\" in values && values.suspended != null) { if (typeof values.suspended === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -123582,7 +130508,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice(); + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.length < vocabSparseArrayMinimumLength + ? this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice() : vocabCopyPropertyArray(this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial); if (\\"memorial\\" in values && values.memorial != null) { if (typeof values.memorial === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -123595,7 +130522,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice(); + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.length < vocabSparseArrayMinimumLength + ? this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice() : vocabCopyPropertyArray(this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable); if (\\"indexable\\" in values && values.indexable != null) { if (typeof values.indexable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -123608,12 +130536,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice();clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo); + clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < vocabSparseArrayMinimumLength + ? this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice() : vocabCopyPropertyArray(this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo);clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = vocabCopyTrustSet( + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, + ); if (\\"successor\\" in values && values.successor != null) { if (values.successor instanceof Application || values.successor instanceof Group || values.successor instanceof Organization || values.successor instanceof Person || values.successor instanceof Service || values.successor instanceof URL) { // @ts-ignore: type is checked above. clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor]; - clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set([0]); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The successor must be of type \\" + @@ -123621,12 +130553,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice();clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < vocabSparseArrayMinimumLength + ? this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice() : vocabCopyPropertyArray(this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs);clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = vocabCopyTrustSet( + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, + ); if (\\"alias\\" in values && values.alias != null) { if (values.alias instanceof Application || values.alias instanceof Group || values.alias instanceof Organization || values.alias instanceof Person || values.alias instanceof Service || values.alias instanceof URL) { // @ts-ignore: type is checked above. clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [values.alias]; - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set([0]); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The alias must be of type \\" + @@ -123645,15 +130581,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); - for (let i = 0; i < values.aliases.length; i++) { - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -123662,12 +130620,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice();clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < vocabSparseArrayMinimumLength + ? this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice() : vocabCopyPropertyArray(this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service);clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = vocabCopyTrustSet( + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, + ); if (\\"service\\" in values && values.service != null) { if (values.service instanceof DidService || values.service instanceof URL) { // @ts-ignore: type is checked above. clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = [values.service]; - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set([0]); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The service must be of type \\" + @@ -123686,15 +130648,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); - for (let i = 0; i < values.services.length; i++) { - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -123703,7 +130687,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice(); + clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.length < vocabSparseArrayMinimumLength + ? this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice() : vocabCopyPropertyArray(this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage); if (\\"followedMessage\\" in values && values.followedMessage != null) { if (typeof values.followedMessage === \\"string\\") { // @ts-ignore: type is checked above. @@ -123716,7 +130701,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice(); + clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.length < vocabSparseArrayMinimumLength + ? this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice() : vocabCopyPropertyArray(this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat); if (\\"cat\\" in values && values.cat != null) { if (typeof values.cat === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -123729,7 +130715,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice(); + clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length < vocabSparseArrayMinimumLength + ? this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice() : vocabCopyPropertyArray(this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense); if (\\"preferredLicense\\" in values && values.preferredLicense != null) { if (values.preferredLicense instanceof URL) { // @ts-ignore: type is checked above. @@ -123768,6 +130755,12 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -123823,122 +130816,377 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Person; - for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { - const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; - if (value != null && typeof value === \\"object\\") { - node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + { + const array = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { - const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + { + const array = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { - const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; - if (value != null && typeof value === \\"object\\") { - node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + { + const array = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { - const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + { + const array = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { - const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + { + const array = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { - const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + { + const array = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { - const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; - if (value != null && typeof value === \\"object\\") { - node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + { + const array = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { - const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + { + const array = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { - const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + { + const array = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { - const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + { + const array = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { - const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; - if (value != null && typeof value === \\"object\\") { - node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + { + const array = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === \\"object\\") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { - const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + { + const array = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { - const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; - if (value != null && typeof value === \\"object\\") { - node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + { + const array = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { - const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + { + const array = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { - const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + { + const array = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { - const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + { + const array = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { - const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; - if (value != null && typeof value === \\"object\\") { - node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + { + const array = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === \\"object\\") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } } } } }); } @@ -124291,7 +131539,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#publicKey\\"); @@ -124359,7 +131608,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -124446,7 +131696,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#publicKey\\"); @@ -124518,7 +131769,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -124872,7 +132124,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#assertionMethod\\"); @@ -124940,7 +132193,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -125031,7 +132285,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#assertionMethod\\"); @@ -125103,7 +132358,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -125527,7 +132783,8 @@ get gateways(): (URL)[] { } let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://www.w3.org/ns/ldp#inbox\\"); @@ -125595,7 +132852,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -125969,7 +133227,8 @@ get gateways(): (URL)[] { } let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#outbox\\"); @@ -126037,7 +133296,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -126391,7 +133651,8 @@ get gateways(): (URL)[] { } let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#following\\"); @@ -126459,7 +133720,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -126816,7 +134078,8 @@ get gateways(): (URL)[] { } let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#followers\\"); @@ -126884,7 +134147,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -127239,7 +134503,8 @@ get gateways(): (URL)[] { } let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#liked\\"); @@ -127307,7 +134572,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -127660,7 +134926,8 @@ get gateways(): (URL)[] { } let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://joinmastodon.org/ns#featured\\"); @@ -127728,7 +134995,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -128081,7 +135349,8 @@ get gateways(): (URL)[] { } let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://joinmastodon.org/ns#featuredTags\\"); @@ -128149,7 +135418,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -128499,7 +135769,8 @@ get gateways(): (URL)[] { } let v = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[0]; if (!(v instanceof URL) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/7aa9#featuredCollections\\"); @@ -128567,7 +135838,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -128917,7 +136189,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#streams\\"); @@ -128989,7 +136262,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -129474,7 +136748,8 @@ get gateways(): (URL)[] { } let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#movedTo\\"); @@ -129542,7 +136817,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -129955,7 +137231,8 @@ get gateways(): (URL)[] { } let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"); @@ -130023,7 +137300,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -130114,7 +137392,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"); @@ -130186,7 +137465,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -130540,7 +137820,8 @@ get gateways(): (URL)[] { } let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/did#service\\"); @@ -130608,7 +137889,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -130699,7 +137981,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/did#service\\"); @@ -130771,7 +138054,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -132170,7 +139454,7 @@ get gateways(): (URL)[] { instance.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = _3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; const _axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); let _axq166E2eZADq34V4MYUc8KMZdC_publicKey__array = values[\\"https://w3id.org/security#publicKey\\"]; @@ -132211,7 +139495,7 @@ get gateways(): (URL)[] { instance.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = _axq166E2eZADq34V4MYUc8KMZdC_publicKey; const _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); let _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod__array = values[\\"https://w3id.org/security#assertionMethod\\"]; @@ -132310,7 +139594,7 @@ get gateways(): (URL)[] { instance.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); let _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox__array = values[\\"http://www.w3.org/ns/ldp#inbox\\"]; @@ -132357,7 +139641,7 @@ get gateways(): (URL)[] { instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; const _41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); let _41QwhqJouoLg3h8dRPKat21brynC_outbox__array = values[\\"https://www.w3.org/ns/activitystreams#outbox\\"]; @@ -132404,7 +139688,7 @@ get gateways(): (URL)[] { instance.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = _41QwhqJouoLg3h8dRPKat21brynC_outbox; const _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); let _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following__array = values[\\"https://www.w3.org/ns/activitystreams#following\\"]; @@ -132445,7 +139729,7 @@ get gateways(): (URL)[] { instance.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; const _BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); let _BBCTgfphhsFzpVfKTykGSpBNwoA_followers__array = values[\\"https://www.w3.org/ns/activitystreams#followers\\"]; @@ -132486,7 +139770,7 @@ get gateways(): (URL)[] { instance.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = _BBCTgfphhsFzpVfKTykGSpBNwoA_followers; const _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); let _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked__array = values[\\"https://www.w3.org/ns/activitystreams#liked\\"]; @@ -132527,7 +139811,7 @@ get gateways(): (URL)[] { instance.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; const _4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); let _4N1vBJzXDf8NbBumeECQMFvKetja_featured__array = values[\\"http://joinmastodon.org/ns#featured\\"]; @@ -132568,7 +139852,7 @@ get gateways(): (URL)[] { instance.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = _4N1vBJzXDf8NbBumeECQMFvKetja_featured; const _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); let _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags__array = values[\\"http://joinmastodon.org/ns#featuredTags\\"]; @@ -132609,7 +139893,7 @@ get gateways(): (URL)[] { instance.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; const _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); let _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections__array = values[\\"https://w3id.org/fep/7aa9#featuredCollections\\"]; @@ -132650,7 +139934,7 @@ get gateways(): (URL)[] { instance.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); let _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams__array = values[\\"https://www.w3.org/ns/activitystreams#streams\\"]; @@ -132839,7 +140123,7 @@ get gateways(): (URL)[] { instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); let _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array = values[\\"https://www.w3.org/ns/activitystreams#movedTo\\"]; @@ -132897,7 +140181,7 @@ get gateways(): (URL)[] { instance.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); let _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array = values[\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"]; @@ -132955,7 +140239,7 @@ get gateways(): (URL)[] { instance.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; const _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); let _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service__array = values[\\"https://www.w3.org/ns/did#service\\"]; @@ -133876,7 +141160,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Place;clone.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy = this.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy.slice(); + const clone = super.clone(values, options) as unknown as Place;clone.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy = this.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy.length < vocabSparseArrayMinimumLength + ? this.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy.slice() : vocabCopyPropertyArray(this.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy); if (\\"accuracy\\" in values && values.accuracy != null) { if (typeof values.accuracy === \\"number\\" && !Number.isNaN(values.accuracy)) { // @ts-ignore: type is checked above. @@ -133889,7 +141174,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude = this.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude.slice(); + clone.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude = this.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude.length < vocabSparseArrayMinimumLength + ? this.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude.slice() : vocabCopyPropertyArray(this.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude); if (\\"altitude\\" in values && values.altitude != null) { if (typeof values.altitude === \\"number\\" && !Number.isNaN(values.altitude)) { // @ts-ignore: type is checked above. @@ -133902,7 +141188,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude = this.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude.slice(); + clone.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude = this.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude.length < vocabSparseArrayMinimumLength + ? this.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude.slice() : vocabCopyPropertyArray(this.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude); if (\\"latitude\\" in values && values.latitude != null) { if (typeof values.latitude === \\"number\\" && !Number.isNaN(values.latitude)) { // @ts-ignore: type is checked above. @@ -133915,7 +141202,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude = this.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude.slice(); + clone.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude = this.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude.length < vocabSparseArrayMinimumLength + ? this.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude.slice() : vocabCopyPropertyArray(this.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude); if (\\"longitude\\" in values && values.longitude != null) { if (typeof values.longitude === \\"number\\" && !Number.isNaN(values.longitude)) { // @ts-ignore: type is checked above. @@ -133928,7 +141216,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius = this.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius.slice(); + clone.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius = this.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius.length < vocabSparseArrayMinimumLength + ? this.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius.slice() : vocabCopyPropertyArray(this.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius); if (\\"radius\\" in values && values.radius != null) { if (typeof values.radius === \\"number\\" && !Number.isNaN(values.radius)) { // @ts-ignore: type is checked above. @@ -133941,7 +141230,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units = this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units.slice(); + clone.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units = this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units.length < vocabSparseArrayMinimumLength + ? this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units.slice() : vocabCopyPropertyArray(this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units); if (\\"units\\" in values && values.units != null) { if (values.units == \\"cm\\" || values.units == \\"feet\\" || values.units == \\"inches\\" || values.units == \\"km\\" || values.units == \\"m\\" || values.units == \\"miles\\" || values.units instanceof URL) { // @ts-ignore: type is checked above. @@ -133980,6 +141270,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -134029,10 +141325,25 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Place; - for (let i = 0; i < node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units.length; i++) { - const value = node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units[i]; - if (value != null && typeof value === \\"object\\") { - node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units[i] = context.value(value); + { + const array = node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units.length; i++) { + const value = node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units[i]; + if (value != null && typeof value === \\"object\\") { + node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units[i] = context.value(value); + } + } } } } }); } @@ -135002,7 +142313,7 @@ export class Profile extends Object { } #_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes: (Object | URL)[] = []; - #_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes: Set = new Set(); + #_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes: VocabTrustSet = new Set(); /** * Constructs a new instance of Profile with the given values. @@ -135117,12 +142428,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Profile;clone.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.slice();clone.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = new Set(this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes); + const clone = super.clone(values, options) as unknown as Profile;clone.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.length < vocabSparseArrayMinimumLength + ? this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.slice() : vocabCopyPropertyArray(this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes);clone.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = vocabCopyTrustSet( + this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes, clone.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes, + ); if (\\"describes\\" in values && values.describes != null) { if (values.describes instanceof Object || values.describes instanceof URL) { // @ts-ignore: type is checked above. clone.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = [values.describes]; - clone.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = new Set([0]); + clone.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = new Set(); + clone.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The describes must be of type \\" + @@ -135156,6 +142471,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -135205,10 +142526,25 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Profile; - for (let i = 0; i < node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.length; i++) { - const value = node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[i] = context.value(value); + { + const array = node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.length; i++) { + const value = node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[i] = context.value(value); + } + } } } } }); } @@ -135540,7 +142876,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[0]; if (!(v instanceof URL) && - !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { + !(0 < (this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[vocabTrustPrefix] ?? 0) || + this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#describes\\"); @@ -135608,7 +142945,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { + !(0 < (this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[vocabTrustPrefix] ?? 0) || + this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -135945,7 +143283,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes: (Object | URL)[] = []; - const _trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes: Set = new Set(); + const _trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes: VocabTrustSet = new Set(); let _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes__array = values[\\"https://www.w3.org/ns/activitystreams#describes\\"]; @@ -136083,19 +143421,19 @@ export class Question extends IntransitiveActivity { } #_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf: (Object | URL)[] = []; - #_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf: Set = new Set(); + #_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf: VocabTrustSet = new Set(); #_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf: (Object | URL)[] = []; - #_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf: Set = new Set(); + #_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf: VocabTrustSet = new Set(); #_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed: ((Temporal.Instant | boolean))[] = []; #_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount: (number)[] = []; #_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); #_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl: (URL)[] = []; #_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); /** * Constructs a new instance of Question with the given values. @@ -136140,14 +143478,36 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti super(values, options); if (\\"exclusiveOptions\\" in values && values.exclusiveOptions != null) { - if (Array.isArray(values.exclusiveOptions) && - values.exclusiveOptions.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.exclusiveOptions)) { + const array = values.exclusiveOptions; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.exclusiveOptions; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = values.exclusiveOptions.slice(); + this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = copied; - for (let i = 0; i < values.exclusiveOptions.length; i++) { - this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.add(i); - } + vocabSetTrustPrefix(this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf, this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.length); } else { throw new TypeError( @@ -136159,14 +143519,36 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (\\"inclusiveOptions\\" in values && values.inclusiveOptions != null) { - if (Array.isArray(values.inclusiveOptions) && - values.inclusiveOptions.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.inclusiveOptions)) { + const array = values.inclusiveOptions; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.inclusiveOptions; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = values.inclusiveOptions.slice(); + this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = copied; - for (let i = 0; i < values.inclusiveOptions.length; i++) { - this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.add(i); - } + vocabSetTrustPrefix(this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf, this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.length); } else { throw new TypeError( @@ -136312,18 +143694,43 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Question;clone.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.slice();clone.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = new Set(this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf); + const clone = super.clone(values, options) as unknown as Question;clone.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.length < vocabSparseArrayMinimumLength + ? this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.slice() : vocabCopyPropertyArray(this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf);clone.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = vocabCopyTrustSet( + this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf, clone.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf, + ); if (\\"exclusiveOptions\\" in values && values.exclusiveOptions != null) { - if (Array.isArray(values.exclusiveOptions) && - values.exclusiveOptions.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.exclusiveOptions)) { + const array = values.exclusiveOptions; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.exclusiveOptions; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = values.exclusiveOptions.slice(); + clone.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = copied; clone.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = new Set(); - for (let i = 0; i < values.exclusiveOptions.length; i++) { - clone.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf, clone.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.length); } else { throw new TypeError( @@ -136332,18 +143739,43 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ); } } - clone.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.slice();clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = new Set(this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf); + clone.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.length < vocabSparseArrayMinimumLength + ? this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.slice() : vocabCopyPropertyArray(this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf);clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = vocabCopyTrustSet( + this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf, clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf, + ); if (\\"inclusiveOptions\\" in values && values.inclusiveOptions != null) { - if (Array.isArray(values.inclusiveOptions) && - values.inclusiveOptions.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.inclusiveOptions)) { + const array = values.inclusiveOptions; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.inclusiveOptions; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = values.inclusiveOptions.slice(); + clone.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = copied; clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = new Set(); - for (let i = 0; i < values.inclusiveOptions.length; i++) { - clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf, clone.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.length); } else { throw new TypeError( @@ -136352,7 +143784,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ); } } - clone.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed = this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed.slice(); + clone.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed = this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed.length < vocabSparseArrayMinimumLength + ? this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed.slice() : vocabCopyPropertyArray(this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed); if (\\"closed\\" in values && values.closed != null) { if (isTemporalInstant(values.closed) || typeof values.closed === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -136365,7 +143798,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ); } } - clone.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount = this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount.slice(); + clone.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount = this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount.length < vocabSparseArrayMinimumLength + ? this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount.slice() : vocabCopyPropertyArray(this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount); if (\\"voters\\" in values && values.voters != null) { if (typeof values.voters === \\"number\\" && Number.isInteger(values.voters) && values.voters >= 0) { // @ts-ignore: type is checked above. @@ -136378,12 +143812,16 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ); } } - clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice();clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote); + clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < vocabSparseArrayMinimumLength + ? this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice() : vocabCopyPropertyArray(this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote);clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = vocabCopyTrustSet( + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, + ); if (\\"quote\\" in values && values.quote != null) { if (values.quote instanceof Object || values.quote instanceof URL) { // @ts-ignore: type is checked above. clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = [values.quote]; - clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set([0]); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The quote must be of type \\" + @@ -136391,7 +143829,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ); } } - clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice(); + clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length < vocabSparseArrayMinimumLength + ? this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice() : vocabCopyPropertyArray(this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl); if (\\"quoteUrl\\" in values && values.quoteUrl != null) { if (values.quoteUrl instanceof URL) { // @ts-ignore: type is checked above. @@ -136404,12 +143843,16 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ); } } - clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice();clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization); + clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice() : vocabCopyPropertyArray(this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization);clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = vocabCopyTrustSet( + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, + ); if (\\"quoteAuthorization\\" in values && values.quoteAuthorization != null) { if (values.quoteAuthorization instanceof QuoteAuthorization || values.quoteAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = [values.quoteAuthorization]; - clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set([0]); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The quoteAuthorization must be of type \\" + @@ -136443,6 +143886,12 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -136498,38 +143947,113 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Question; - for (let i = 0; i < node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.length; i++) { - const value = node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[i] = context.value(value); + { + const array = node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.length; i++) { + const value = node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.length; i++) { - const value = node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[i] = context.value(value); + { + const array = node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.length; i++) { + const value = node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { - const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + { + const array = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { - const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; - if (value != null && typeof value === \\"object\\") { - node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + { + const array = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === \\"object\\") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { - const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; - if (value != null && typeof value === \\"object\\") { - node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + { + const array = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === \\"object\\") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } } } } }); } @@ -136862,7 +144386,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { + !(i < (this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#oneOf\\"); @@ -136934,7 +144459,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { + !(i < (this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -137287,7 +144813,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { + !(i < (this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#anyOf\\"); @@ -137359,7 +144886,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { + !(i < (this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -137742,7 +145270,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/044f#quote\\"); @@ -137810,7 +145339,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -138184,7 +145714,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/044f#quoteAuthorization\\"); @@ -138252,7 +145783,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -138680,7 +146212,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf: (Object | URL)[] = []; - const _trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf: Set = new Set(); + const _trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf: VocabTrustSet = new Set(); let _2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf__array = values[\\"https://www.w3.org/ns/activitystreams#oneOf\\"]; @@ -138721,7 +146253,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = _2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf; const _2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf: (Object | URL)[] = []; - const _trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf: Set = new Set(); + const _trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf: VocabTrustSet = new Set(); let _2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf__array = values[\\"https://www.w3.org/ns/activitystreams#anyOf\\"]; @@ -138830,7 +146362,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount = _3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount; const _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); let _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote__array = values[\\"https://w3id.org/fep/044f#quote\\"]; @@ -138910,7 +146442,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; const _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); let _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization__array = values[\\"https://w3id.org/fep/044f#quoteAuthorization\\"]; @@ -139302,6 +146834,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -139812,6 +147350,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -140194,13 +147738,13 @@ export class Relationship extends Object { } #_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject: (Object | URL)[] = []; - #_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject: Set = new Set(); + #_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject: VocabTrustSet = new Set(); #_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: (Object | URL)[] = []; - #_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: Set = new Set(); + #_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: VocabTrustSet = new Set(); #_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship: (Object | URL)[] = []; - #_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship: Set = new Set(); + #_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship: VocabTrustSet = new Set(); /** * Constructs a new instance of Relationship with the given values. @@ -140275,14 +147819,36 @@ relationships?: (Object | URL)[];} ); } - if (Array.isArray(values.objects) && - values.objects.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.objects)) { + const array = values.objects; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.objects; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = values.objects.slice(); + this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = copied; - for (let i = 0; i < values.objects.length; i++) { - this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.add(i); - } + vocabSetTrustPrefix(this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length); } else { throw new TypeError( @@ -140315,14 +147881,36 @@ relationships?: (Object | URL)[];} ); } - if (Array.isArray(values.relationships) && - values.relationships.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.relationships)) { + const array = values.relationships; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.relationships; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = values.relationships.slice(); + this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = copied; - for (let i = 0; i < values.relationships.length; i++) { - this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.add(i); - } + vocabSetTrustPrefix(this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship, this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length); } else { throw new TypeError( @@ -140399,12 +147987,16 @@ relationships?: (Object | URL)[];} // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Relationship;clone.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.slice();clone.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = new Set(this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject); + const clone = super.clone(values, options) as unknown as Relationship;clone.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.length < vocabSparseArrayMinimumLength + ? this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.slice() : vocabCopyPropertyArray(this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject);clone.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = vocabCopyTrustSet( + this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject, clone.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject, + ); if (\\"subject\\" in values && values.subject != null) { if (values.subject instanceof Object || values.subject instanceof URL) { // @ts-ignore: type is checked above. clone.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = [values.subject]; - clone.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = new Set([0]); + clone.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = new Set(); + clone.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The subject must be of type \\" + @@ -140412,12 +148004,16 @@ relationships?: (Object | URL)[];} ); } } - clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.slice();clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set(this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object); + clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length < vocabSparseArrayMinimumLength + ? this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.slice() : vocabCopyPropertyArray(this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object);clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = vocabCopyTrustSet( + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, + ); if (\\"object\\" in values && values.object != null) { if (values.object instanceof Object || values.object instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = [values.object]; - clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set([0]); + clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set(); + clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The object must be of type \\" + @@ -140436,15 +148032,37 @@ relationships?: (Object | URL)[];} ); } - if (Array.isArray(values.objects) && - values.objects.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.objects)) { + const array = values.objects; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.objects; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = values.objects.slice(); + clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = copied; clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set(); - for (let i = 0; i < values.objects.length; i++) { - clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length); } else { throw new TypeError( @@ -140453,12 +148071,16 @@ relationships?: (Object | URL)[];} ); } } - clone.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.slice();clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = new Set(this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship); + clone.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length < vocabSparseArrayMinimumLength + ? this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.slice() : vocabCopyPropertyArray(this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship);clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = vocabCopyTrustSet( + this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship, clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship, + ); if (\\"relationship\\" in values && values.relationship != null) { if (values.relationship instanceof Object || values.relationship instanceof URL) { // @ts-ignore: type is checked above. clone.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = [values.relationship]; - clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = new Set([0]); + clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = new Set(); + clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The relationship must be of type \\" + @@ -140477,15 +148099,37 @@ relationships?: (Object | URL)[];} ); } - if (Array.isArray(values.relationships) && - values.relationships.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.relationships)) { + const array = values.relationships; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.relationships; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = values.relationships.slice(); + clone.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = copied; clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = new Set(); - for (let i = 0; i < values.relationships.length; i++) { - clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship, clone.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length); } else { throw new TypeError( @@ -140520,6 +148164,12 @@ relationships?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -140571,24 +148221,69 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Relationship; - for (let i = 0; i < node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.length; i++) { - const value = node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[i] = context.value(value); + { + const array = node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.length; i++) { + const value = node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length; i++) { - const value = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i] = context.value(value); + { + const array = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length; i++) { + const value = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length; i++) { - const value = node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[i] = context.value(value); + { + const array = node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length; i++) { + const value = node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[i] = context.value(value); + } + } } } } }); } @@ -140922,7 +148617,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[0]; if (!(v instanceof URL) && - !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { + !(0 < (this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[vocabTrustPrefix] ?? 0) || + this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#subject\\"); @@ -140990,7 +148686,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { + !(0 < (this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[vocabTrustPrefix] ?? 0) || + this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -141340,7 +149037,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (!(v instanceof URL) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { + !(0 < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#object\\"); @@ -141408,7 +149106,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { + !(0 < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -141496,7 +149195,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { + !(i < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#object\\"); @@ -141568,7 +149268,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { + !(i < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -141921,7 +149622,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[0]; if (!(v instanceof URL) && - !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { + !(0 < (this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[vocabTrustPrefix] ?? 0) || + this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#relationship\\"); @@ -141989,7 +149691,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { + !(0 < (this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[vocabTrustPrefix] ?? 0) || + this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -142079,7 +149782,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { + !(i < (this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[vocabTrustPrefix] ?? 0) || + this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#relationship\\"); @@ -142151,7 +149855,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { + !(i < (this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[vocabTrustPrefix] ?? 0) || + this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -142569,7 +150274,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject: (Object | URL)[] = []; - const _trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject: Set = new Set(); + const _trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject: VocabTrustSet = new Set(); let _2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject__array = values[\\"https://www.w3.org/ns/activitystreams#subject\\"]; @@ -142610,7 +150315,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = _2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject; const _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: (Object | URL)[] = []; - const _trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: Set = new Set(); + const _trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: VocabTrustSet = new Set(); let _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object__array = values[\\"https://www.w3.org/ns/activitystreams#object\\"]; @@ -142651,7 +150356,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; const _4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship: (Object | URL)[] = []; - const _trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship: Set = new Set(); + const _trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship: VocabTrustSet = new Set(); let _4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship__array = values[\\"https://www.w3.org/ns/activitystreams#relationship\\"]; @@ -142972,6 +150677,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -143344,39 +151055,39 @@ export class Service extends Object { #_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername: ((string | LanguageString))[] = []; #_axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); #_41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); #_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); #_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); #_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); #_4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); #_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); #_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints: (Endpoints)[] = []; #_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable: (boolean)[] = []; #_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended: (boolean)[] = []; @@ -143384,13 +151095,13 @@ export class Service extends Object { #_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable: (boolean)[] = []; #_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); #_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); #_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); #_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage: (string)[] = []; #_2xEU4QtkC53RAun67T81Egqt9vmL_isCat: (boolean)[] = []; #_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense: (URL)[] = []; @@ -143459,10 +151170,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -143495,14 +151230,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; - for (let i = 0; i < values.publicKeys.length; i++) { - this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -143535,14 +151292,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; - for (let i = 0; i < values.assertionMethods.length; i++) { - this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -143575,10 +151354,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -143707,14 +151510,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | if (\\"streams\\" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; - for (let i = 0; i < values.streams.length; i++) { - this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -143825,14 +151650,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; - for (let i = 0; i < values.aliases.length; i++) { - this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -143865,14 +151712,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; - for (let i = 0; i < values.services.length; i++) { - this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -143992,7 +151861,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Service;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice(); + const clone = super.clone(values, options) as unknown as Service;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.length < vocabSparseArrayMinimumLength + ? this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice() : vocabCopyPropertyArray(this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername); if (\\"preferredUsername\\" in values && values.preferredUsername != null) { if (typeof values.preferredUsername === \\"string\\" || values.preferredUsername instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -144016,10 +151886,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -144028,12 +151922,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice();clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < vocabSparseArrayMinimumLength + ? this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice() : vocabCopyPropertyArray(this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey);clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = vocabCopyTrustSet( + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, + ); if (\\"publicKey\\" in values && values.publicKey != null) { if (values.publicKey instanceof CryptographicKey || values.publicKey instanceof URL) { // @ts-ignore: type is checked above. clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = [values.publicKey]; - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set([0]); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The publicKey must be of type \\" + @@ -144052,15 +151950,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); - for (let i = 0; i < values.publicKeys.length; i++) { - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -144069,12 +151989,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice();clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < vocabSparseArrayMinimumLength + ? this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice() : vocabCopyPropertyArray(this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod);clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = vocabCopyTrustSet( + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, + ); if (\\"assertionMethod\\" in values && values.assertionMethod != null) { if (values.assertionMethod instanceof Multikey || values.assertionMethod instanceof URL) { // @ts-ignore: type is checked above. clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = [values.assertionMethod]; - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set([0]); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The assertionMethod must be of type \\" + @@ -144093,15 +152017,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); - for (let i = 0; i < values.assertionMethods.length; i++) { - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -144110,7 +152056,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < vocabSparseArrayMinimumLength + ? this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice() : vocabCopyPropertyArray(this.#_hQiaHhZP8hqxckxTBrpsGNs57E3); if (\\"gateway\\" in values && values.gateway != null) { if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { // @ts-ignore: type is checked above. @@ -144134,10 +152081,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -144146,7 +152117,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice(); + clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.length < vocabSparseArrayMinimumLength + ? this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice() : vocabCopyPropertyArray(this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers); if (\\"manuallyApprovesFollowers\\" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -144159,12 +152131,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice();clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox); + clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < vocabSparseArrayMinimumLength + ? this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice() : vocabCopyPropertyArray(this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox);clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = vocabCopyTrustSet( + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, + ); if (\\"inbox\\" in values && values.inbox != null) { if (values.inbox instanceof OrderedCollection || values.inbox instanceof OrderedCollectionPage || values.inbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox]; - clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set([0]); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The inbox must be of type \\" + @@ -144172,12 +152148,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice();clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox); + clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < vocabSparseArrayMinimumLength + ? this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice() : vocabCopyPropertyArray(this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox);clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = vocabCopyTrustSet( + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, + ); if (\\"outbox\\" in values && values.outbox != null) { if (values.outbox instanceof OrderedCollection || values.outbox instanceof OrderedCollectionPage || values.outbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox]; - clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set([0]); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The outbox must be of type \\" + @@ -144185,12 +152165,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice();clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following); + clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < vocabSparseArrayMinimumLength + ? this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice() : vocabCopyPropertyArray(this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following);clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = vocabCopyTrustSet( + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, + ); if (\\"following\\" in values && values.following != null) { if (values.following instanceof Collection || values.following instanceof URL) { // @ts-ignore: type is checked above. clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = [values.following]; - clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set([0]); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The following must be of type \\" + @@ -144198,12 +152182,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice();clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers); + clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < vocabSparseArrayMinimumLength + ? this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice() : vocabCopyPropertyArray(this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers);clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = vocabCopyTrustSet( + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, + ); if (\\"followers\\" in values && values.followers != null) { if (values.followers instanceof Collection || values.followers instanceof URL) { // @ts-ignore: type is checked above. clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = [values.followers]; - clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set([0]); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The followers must be of type \\" + @@ -144211,12 +152199,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice();clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked); + clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < vocabSparseArrayMinimumLength + ? this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice() : vocabCopyPropertyArray(this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked);clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = vocabCopyTrustSet( + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, + ); if (\\"liked\\" in values && values.liked != null) { if (values.liked instanceof Collection || values.liked instanceof URL) { // @ts-ignore: type is checked above. clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = [values.liked]; - clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set([0]); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The liked must be of type \\" + @@ -144224,12 +152216,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice();clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured); + clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < vocabSparseArrayMinimumLength + ? this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice() : vocabCopyPropertyArray(this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured);clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = vocabCopyTrustSet( + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, + ); if (\\"featured\\" in values && values.featured != null) { if (values.featured instanceof Collection || values.featured instanceof URL) { // @ts-ignore: type is checked above. clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = [values.featured]; - clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set([0]); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featured must be of type \\" + @@ -144237,12 +152233,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice();clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags); + clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < vocabSparseArrayMinimumLength + ? this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice() : vocabCopyPropertyArray(this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags);clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = vocabCopyTrustSet( + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, + ); if (\\"featuredTags\\" in values && values.featuredTags != null) { if (values.featuredTags instanceof Collection || values.featuredTags instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = [values.featuredTags]; - clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set([0]); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredTags must be of type \\" + @@ -144250,12 +152250,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice();clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections); + clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length < vocabSparseArrayMinimumLength + ? this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice() : vocabCopyPropertyArray(this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections);clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = vocabCopyTrustSet( + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, + ); if (\\"featuredCollections\\" in values && values.featuredCollections != null) { if (values.featuredCollections instanceof Collection || values.featuredCollections instanceof URL) { // @ts-ignore: type is checked above. clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = [values.featuredCollections]; - clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set([0]); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The featuredCollections must be of type \\" + @@ -144263,18 +152267,43 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice();clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length < vocabSparseArrayMinimumLength + ? this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice() : vocabCopyPropertyArray(this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams);clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = vocabCopyTrustSet( + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, + ); if (\\"streams\\" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(); - for (let i = 0; i < values.streams.length; i++) { - clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -144283,7 +152312,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice(); + clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length < vocabSparseArrayMinimumLength + ? this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice() : vocabCopyPropertyArray(this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints); if (\\"endpoints\\" in values && values.endpoints != null) { if (values.endpoints instanceof Endpoints) { // @ts-ignore: type is checked above. @@ -144296,7 +152326,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice(); + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.length < vocabSparseArrayMinimumLength + ? this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice() : vocabCopyPropertyArray(this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable); if (\\"discoverable\\" in values && values.discoverable != null) { if (typeof values.discoverable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -144309,7 +152340,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice(); + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.length < vocabSparseArrayMinimumLength + ? this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice() : vocabCopyPropertyArray(this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended); if (\\"suspended\\" in values && values.suspended != null) { if (typeof values.suspended === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -144322,7 +152354,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice(); + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.length < vocabSparseArrayMinimumLength + ? this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice() : vocabCopyPropertyArray(this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial); if (\\"memorial\\" in values && values.memorial != null) { if (typeof values.memorial === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -144335,7 +152368,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice(); + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.length < vocabSparseArrayMinimumLength + ? this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice() : vocabCopyPropertyArray(this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable); if (\\"indexable\\" in values && values.indexable != null) { if (typeof values.indexable === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -144348,12 +152382,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice();clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo); + clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < vocabSparseArrayMinimumLength + ? this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice() : vocabCopyPropertyArray(this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo);clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = vocabCopyTrustSet( + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, + ); if (\\"successor\\" in values && values.successor != null) { if (values.successor instanceof Application || values.successor instanceof Group || values.successor instanceof Organization || values.successor instanceof Person || values.successor instanceof Service || values.successor instanceof URL) { // @ts-ignore: type is checked above. clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor]; - clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set([0]); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The successor must be of type \\" + @@ -144361,12 +152399,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice();clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < vocabSparseArrayMinimumLength + ? this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice() : vocabCopyPropertyArray(this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs);clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = vocabCopyTrustSet( + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, + ); if (\\"alias\\" in values && values.alias != null) { if (values.alias instanceof Application || values.alias instanceof Group || values.alias instanceof Organization || values.alias instanceof Person || values.alias instanceof Service || values.alias instanceof URL) { // @ts-ignore: type is checked above. clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [values.alias]; - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set([0]); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The alias must be of type \\" + @@ -144385,15 +152427,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); - for (let i = 0; i < values.aliases.length; i++) { - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -144402,12 +152466,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice();clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < vocabSparseArrayMinimumLength + ? this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice() : vocabCopyPropertyArray(this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service);clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = vocabCopyTrustSet( + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, + ); if (\\"service\\" in values && values.service != null) { if (values.service instanceof DidService || values.service instanceof URL) { // @ts-ignore: type is checked above. clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = [values.service]; - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set([0]); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] = 1; } else { throw new TypeError( \\"The service must be of type \\" + @@ -144426,15 +152494,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); - for (let i = 0; i < values.services.length; i++) { - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -144443,7 +152533,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice(); + clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.length < vocabSparseArrayMinimumLength + ? this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice() : vocabCopyPropertyArray(this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage); if (\\"followedMessage\\" in values && values.followedMessage != null) { if (typeof values.followedMessage === \\"string\\") { // @ts-ignore: type is checked above. @@ -144456,7 +152547,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice(); + clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.length < vocabSparseArrayMinimumLength + ? this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice() : vocabCopyPropertyArray(this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat); if (\\"cat\\" in values && values.cat != null) { if (typeof values.cat === \\"boolean\\") { // @ts-ignore: type is checked above. @@ -144469,7 +152561,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice(); + clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length < vocabSparseArrayMinimumLength + ? this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice() : vocabCopyPropertyArray(this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense); if (\\"preferredLicense\\" in values && values.preferredLicense != null) { if (values.preferredLicense instanceof URL) { // @ts-ignore: type is checked above. @@ -144508,6 +152601,12 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -144563,122 +152662,377 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Service; - for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { - const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; - if (value != null && typeof value === \\"object\\") { - node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + { + const array = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === \\"object\\") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { - const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + { + const array = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { - const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; - if (value != null && typeof value === \\"object\\") { - node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + { + const array = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === \\"object\\") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { - const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + { + const array = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { - const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; - if (value != null && typeof value === \\"object\\") { - node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + { + const array = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === \\"object\\") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { - const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + { + const array = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { - const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; - if (value != null && typeof value === \\"object\\") { - node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + { + const array = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === \\"object\\") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { - const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + { + const array = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { - const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + { + const array = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { - const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + { + const array = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { - const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; - if (value != null && typeof value === \\"object\\") { - node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + { + const array = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === \\"object\\") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { - const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + { + const array = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { - const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; - if (value != null && typeof value === \\"object\\") { - node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + { + const array = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === \\"object\\") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { - const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; - if (value != null && typeof value === \\"object\\") { - node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + { + const array = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === \\"object\\") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { - const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; - if (value != null && typeof value === \\"object\\") { - node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + { + const array = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === \\"object\\") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { - const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; - if (value != null && typeof value === \\"object\\") { - node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + { + const array = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === \\"object\\") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { - const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; - if (value != null && typeof value === \\"object\\") { - node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + { + const array = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === \\"object\\") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === \\"object\\") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } } } } }); } @@ -145031,7 +153385,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#publicKey\\"); @@ -145099,7 +153454,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -145186,7 +153542,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#publicKey\\"); @@ -145258,7 +153615,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -145612,7 +153970,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#assertionMethod\\"); @@ -145680,7 +154039,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -145771,7 +154131,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/security#assertionMethod\\"); @@ -145843,7 +154204,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -146267,7 +154629,8 @@ get gateways(): (URL)[] { } let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://www.w3.org/ns/ldp#inbox\\"); @@ -146335,7 +154698,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -146709,7 +155073,8 @@ get gateways(): (URL)[] { } let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#outbox\\"); @@ -146777,7 +155142,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -147131,7 +155497,8 @@ get gateways(): (URL)[] { } let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#following\\"); @@ -147199,7 +155566,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -147556,7 +155924,8 @@ get gateways(): (URL)[] { } let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#followers\\"); @@ -147624,7 +155993,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -147979,7 +156349,8 @@ get gateways(): (URL)[] { } let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#liked\\"); @@ -148047,7 +156418,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -148400,7 +156772,8 @@ get gateways(): (URL)[] { } let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://joinmastodon.org/ns#featured\\"); @@ -148468,7 +156841,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -148821,7 +157195,8 @@ get gateways(): (URL)[] { } let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"http://joinmastodon.org/ns#featuredTags\\"); @@ -148889,7 +157264,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -149239,7 +157615,8 @@ get gateways(): (URL)[] { } let v = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[0]; if (!(v instanceof URL) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://w3id.org/fep/7aa9#featuredCollections\\"); @@ -149307,7 +157684,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -149657,7 +158035,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#streams\\"); @@ -149729,7 +158108,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -150214,7 +158594,8 @@ get gateways(): (URL)[] { } let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#movedTo\\"); @@ -150282,7 +158663,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -150695,7 +159077,8 @@ get gateways(): (URL)[] { } let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"); @@ -150763,7 +159146,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -150854,7 +159238,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"); @@ -150926,7 +159311,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -151280,7 +159666,8 @@ get gateways(): (URL)[] { } let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/did#service\\"); @@ -151348,7 +159735,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -151439,7 +159827,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, \\"https://www.w3.org/ns/did#service\\"); @@ -151511,7 +159900,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -152910,7 +161300,7 @@ get gateways(): (URL)[] { instance.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = _3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; const _axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); let _axq166E2eZADq34V4MYUc8KMZdC_publicKey__array = values[\\"https://w3id.org/security#publicKey\\"]; @@ -152951,7 +161341,7 @@ get gateways(): (URL)[] { instance.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = _axq166E2eZADq34V4MYUc8KMZdC_publicKey; const _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); let _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod__array = values[\\"https://w3id.org/security#assertionMethod\\"]; @@ -153050,7 +161440,7 @@ get gateways(): (URL)[] { instance.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); let _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox__array = values[\\"http://www.w3.org/ns/ldp#inbox\\"]; @@ -153097,7 +161487,7 @@ get gateways(): (URL)[] { instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; const _41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); let _41QwhqJouoLg3h8dRPKat21brynC_outbox__array = values[\\"https://www.w3.org/ns/activitystreams#outbox\\"]; @@ -153144,7 +161534,7 @@ get gateways(): (URL)[] { instance.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = _41QwhqJouoLg3h8dRPKat21brynC_outbox; const _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); let _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following__array = values[\\"https://www.w3.org/ns/activitystreams#following\\"]; @@ -153185,7 +161575,7 @@ get gateways(): (URL)[] { instance.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; const _BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); let _BBCTgfphhsFzpVfKTykGSpBNwoA_followers__array = values[\\"https://www.w3.org/ns/activitystreams#followers\\"]; @@ -153226,7 +161616,7 @@ get gateways(): (URL)[] { instance.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = _BBCTgfphhsFzpVfKTykGSpBNwoA_followers; const _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); let _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked__array = values[\\"https://www.w3.org/ns/activitystreams#liked\\"]; @@ -153267,7 +161657,7 @@ get gateways(): (URL)[] { instance.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; const _4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); let _4N1vBJzXDf8NbBumeECQMFvKetja_featured__array = values[\\"http://joinmastodon.org/ns#featured\\"]; @@ -153308,7 +161698,7 @@ get gateways(): (URL)[] { instance.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = _4N1vBJzXDf8NbBumeECQMFvKetja_featured; const _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); let _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags__array = values[\\"http://joinmastodon.org/ns#featuredTags\\"]; @@ -153349,7 +161739,7 @@ get gateways(): (URL)[] { instance.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; const _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); let _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections__array = values[\\"https://w3id.org/fep/7aa9#featuredCollections\\"]; @@ -153390,7 +161780,7 @@ get gateways(): (URL)[] { instance.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); let _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams__array = values[\\"https://www.w3.org/ns/activitystreams#streams\\"]; @@ -153579,7 +161969,7 @@ get gateways(): (URL)[] { instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); let _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array = values[\\"https://www.w3.org/ns/activitystreams#movedTo\\"]; @@ -153637,7 +162027,7 @@ get gateways(): (URL)[] { instance.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); let _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array = values[\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\"]; @@ -153695,7 +162085,7 @@ get gateways(): (URL)[] { instance.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; const _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); let _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service__array = values[\\"https://www.w3.org/ns/did#service\\"]; @@ -154562,10 +162952,34 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} ); } - if (Array.isArray(values.contents) && - values.contents.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.contents)) { + const array = values.contents; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.contents; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = values.contents.slice(); + this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = copied; } else { throw new TypeError( @@ -154645,7 +163059,8 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} options ); copyPortableProvenance(this, clone); - clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.slice(); + clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.length < vocabSparseArrayMinimumLength + ? this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.slice() : vocabCopyPropertyArray(this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content); if (\\"content\\" in values && values.content != null) { if (typeof values.content === \\"string\\" || values.content instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -154669,10 +163084,34 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} ); } - if (Array.isArray(values.contents) && - values.contents.every(v => typeof v === \\"string\\" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.contents)) { + const array = values.contents; + const test = (v: string | LanguageString): boolean => typeof v === \\"string\\" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.contents; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = values.contents.slice(); + clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = copied; } else { throw new TypeError( @@ -154681,7 +163120,8 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} ); } } - clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.slice(); + clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.length < vocabSparseArrayMinimumLength + ? this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.slice() : vocabCopyPropertyArray(this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType); if (\\"mediaType\\" in values && values.mediaType != null) { if (typeof values.mediaType === \\"string\\") { // @ts-ignore: type is checked above. @@ -154720,6 +163160,12 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -155453,6 +163899,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -155963,6 +164415,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -156397,10 +164855,34 @@ formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} ); } - if (Array.isArray(values.formerTypes) && - values.formerTypes.every(v => isEntityType(v))) { + let copied!: ($EntityType)[]; + let valid = false; + if (Array.isArray(values.formerTypes)) { + const array = values.formerTypes; + const test = (v: $EntityType): boolean => isEntityType(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.formerTypes; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = values.formerTypes.slice(); + this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = copied; } else { throw new TypeError( @@ -156489,7 +164971,8 @@ formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Tombstone;clone.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.slice(); + const clone = super.clone(values, options) as unknown as Tombstone;clone.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length < vocabSparseArrayMinimumLength + ? this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.slice() : vocabCopyPropertyArray(this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType); if (\\"formerType\\" in values && values.formerType != null) { if (isEntityType(values.formerType)) { // @ts-ignore: type is checked above. @@ -156513,10 +164996,34 @@ formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} ); } - if (Array.isArray(values.formerTypes) && - values.formerTypes.every(v => isEntityType(v))) { + let copied!: ($EntityType)[]; + let valid = false; + if (Array.isArray(values.formerTypes)) { + const array = values.formerTypes; + const test = (v: $EntityType): boolean => isEntityType(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.formerTypes; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = values.formerTypes.slice(); + clone.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = copied; } else { throw new TypeError( @@ -156525,7 +165032,8 @@ formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} ); } } - clone.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.slice(); + clone.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.length < vocabSparseArrayMinimumLength + ? this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.slice() : vocabCopyPropertyArray(this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted); if (\\"deleted\\" in values && values.deleted != null) { if (isTemporalInstant(values.deleted)) { // @ts-ignore: type is checked above. @@ -156564,6 +165072,12 @@ formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -157329,6 +165843,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -157844,6 +166364,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -158357,6 +166883,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -158853,6 +167385,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -159375,6 +167913,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 1d722c403..29ba26d99 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -82,6 +82,200 @@ function inspectIri(iri: URL): string { try { return formatIri(iri); } catch { return iri.href; } } +interface VocabSparseArraySnapshot { + length: number; + indices: number[]; +} + +interface VocabArrayValidation { + valid: boolean; + sparse: boolean; +} + +type VocabArrayCopy = { ok: true; array: T[] } | { ok: false }; + +// Most fields have no trusted prefix. Keep that metadata on the existing Set +// so empty fields need neither another object nor another instance slot. +const vocabTrustPrefix: unique symbol = Symbol("vocabulary trust prefix"); +type VocabTrustSet = Set & { [vocabTrustPrefix]?: number }; + +function vocabSetTrustPrefix(trust: VocabTrustSet, prefix: number): void { + if (prefix > 0) trust[vocabTrustPrefix] = prefix; +} + +function vocabCopyTrustSet( + trust: VocabTrustSet, + destination: VocabTrustSet, +): VocabTrustSet { + // clone() already constructed the destination. Reuse its empty Set only + // when constructor defaults cannot contribute trust to the copied field. + const copy: VocabTrustSet = trust !== destination && trust.size === 0 && + destination.size === 0 && destination[vocabTrustPrefix] == null + ? destination : new Set(trust); + const prefix = trust[vocabTrustPrefix]; + if (prefix != null && prefix > 0) copy[vocabTrustPrefix] = prefix; + return copy; +} + +// These thresholds select an optimization, not a limit on property arrays. +const vocabSparseArrayMinimumLength = 4096; +const vocabSparseArrayProbeCount = 8; +const vocabSparseArrayPresentProbeLimit = 4; +const vocabArrayPrototype = Array.prototype; +const vocabObjectPrototype = globalThis.Object.prototype; +const vocabArrayDescriptors = ["constructor", "every", "slice"].map( + key => globalThis.Object.getOwnPropertyDescriptor(vocabArrayPrototype, key), +); +const vocabArraySpeciesDescriptor = globalThis.Object.getOwnPropertyDescriptor( + Array, Symbol.species, +); + +function vocabSameArrayDescriptor( + actual: PropertyDescriptor | undefined, + expected: PropertyDescriptor | undefined, +): boolean { + return actual?.value === expected?.value && actual?.get === expected?.get && + actual?.set === expected?.set && actual?.writable === expected?.writable && + actual?.enumerable === expected?.enumerable && + actual?.configurable === expected?.configurable; +} + +function vocabArrayIndex(key: string): number | undefined { + const index = Number(key); + return Number.isInteger(index) && index >= 0 && index < 0xffffffff && + String(index) === key + ? index + : undefined; +} + +function vocabSparseArraySnapshot( + array: unknown[], +): VocabSparseArraySnapshot | undefined { + if (!Array.isArray(array)) return undefined; + const length = array.length; + // Small dense fields take no prototype or key-enumeration overhead. + if (length < vocabSparseArrayMinimumLength) return undefined; + if (!Number.isInteger(length) || length > 0xffffffff || + globalThis.Object.getPrototypeOf(array) !== vocabArrayPrototype || + globalThis.Object.getPrototypeOf(vocabArrayPrototype) !== + vocabObjectPrototype || + globalThis.Object.getPrototypeOf(vocabObjectPrototype) !== null) { + return undefined; + } + const methods = ["constructor", "every", "slice"]; + for (let i = 0; i < methods.length; i++) { + const key = methods[i]; + if (globalThis.Object.hasOwn(array, key) || + !vocabSameArrayDescriptor( + globalThis.Object.getOwnPropertyDescriptor(vocabArrayPrototype, key), + vocabArrayDescriptors[i], + )) return undefined; + } + if (!vocabSameArrayDescriptor( + globalThis.Object.getOwnPropertyDescriptor(Array, Symbol.species), + vocabArraySpeciesDescriptor, + )) return undefined; + + // Descriptor probes do not invoke element getters. Plainly dense arrays + // keep native iteration without enumerating all their keys. + let present = 0; + for (let i = 0; i < vocabSparseArrayProbeCount; i++) { + const index = Math.floor(i * (length - 1) / (vocabSparseArrayProbeCount - 1)); + if (globalThis.Object.getOwnPropertyDescriptor(array, index) != null && + ++present >= vocabSparseArrayPresentProbeLimit) return undefined; + } + for (const prototype of [vocabArrayPrototype, vocabObjectPrototype]) { + for (const key of globalThis.Object.getOwnPropertyNames(prototype)) { + if (vocabArrayIndex(key) != null) return undefined; + } + } + const indices: number[] = []; + for (const key of globalThis.Object.getOwnPropertyNames(array)) { + const index = vocabArrayIndex(key); + if (index != null && index < length) indices.push(index); + } + if (indices.length >= length / 2) return undefined; + for (const index of indices) { + const descriptor = globalThis.Object.getOwnPropertyDescriptor(array, index); + if (descriptor == null || !("value" in descriptor)) return undefined; + } + // Ordinary array keys already have canonical index order. This guard is + // not a Proxy detector; reflection traps and errors remain observable. + return { length, indices }; +} + +function vocabValidatePropertyArray( + array: T[], + test: (value: T) => boolean, +): VocabArrayValidation { + const snapshot = vocabSparseArraySnapshot(array); + if (snapshot == null) return { valid: array.every(test), sparse: false }; + for (const index of snapshot.indices) { + if (globalThis.Object.hasOwn(array, index) && !test(array[index])) { + return { valid: false, sparse: true }; + } + } + return { valid: true, sparse: true }; +} + +function vocabDefineArrayEntry(array: T[], index: number, value: T): void { + globalThis.Object.defineProperty(array, index, { + value, writable: true, enumerable: true, configurable: true, + }); +} + +function vocabCopySparsePropertyArray( + array: T[], + snapshot: VocabSparseArraySnapshot, + test?: (value: T) => boolean, +): VocabArrayCopy { + const copy: T[] = []; + // Seed dictionary storage before low indices or the final length can + // allocate storage for every hole. The temporary entry stays private. + if (snapshot.indices[snapshot.indices.length - 1] !== snapshot.length - 1) { + globalThis.Object.defineProperty(copy, snapshot.length - 1, { + value: undefined, writable: true, enumerable: true, configurable: true, + }); + delete copy[snapshot.length - 1]; + } + for (const index of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, index)) continue; + const value = array[index]; + if (test != null && !test(value)) return { ok: false }; + vocabDefineArrayEntry(copy, index, value); + } + // A validation callback may have deleted the last snapshot entry. + if (copy.length < snapshot.length) { + globalThis.Object.defineProperty(copy, snapshot.length - 1, { + value: undefined, writable: true, enumerable: true, configurable: true, + }); + delete copy[snapshot.length - 1]; + } + copy.length = snapshot.length; + return { ok: true, array: copy }; +} + +function vocabCopyPropertyArray(array: T[]): T[] { + const snapshot = vocabSparseArraySnapshot(array); + if (snapshot == null) return array.slice(); + const copied = vocabCopySparsePropertyArray(array, snapshot); + // Without a predicate the private copy cannot fail validation. + return (copied as { ok: true; array: T[] }).array; +} + +function vocabCopyValidatedPropertyArray( + array: T[], + test: (value: T) => boolean, + previous: VocabArrayValidation, +): VocabArrayCopy { + const snapshot = vocabSparseArraySnapshot(array); + if (snapshot != null) return vocabCopySparsePropertyArray(array, snapshot, test); + // Sparse validation may have changed the next input's density, descriptors + // or prototype. Validate that native-copy input before falling back. + if (previous.sparse && !array.every(test)) return { ok: false }; + return { ok: true, array: array.slice() }; +} + interface DeepCloneContext { value(value: T): T; } @@ -336,87 +530,87 @@ export class Object { } #_49BipA5dq9eoH8LX8xdsVumveTca_attachment: (Object | Link | PropertyValue | URL)[] = []; - #_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment: Set = new Set(); + #_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment: VocabTrustSet = new Set(); #_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo: Set = new Set(); + #_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo: VocabTrustSet = new Set(); #_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience: (Object | URL)[] = []; - #_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience: Set = new Set(); + #_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience: VocabTrustSet = new Set(); #_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content: ((string | LanguageString))[] = []; #_3mhZzGXSpQ431mBSz2kvych22v4e_context: (Object | Link | URL)[] = []; - #_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context: Set = new Set(); + #_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context: VocabTrustSet = new Set(); #_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name: ((string | LanguageString))[] = []; #_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime: (Temporal.Instant)[] = []; #_86xFhmgBapoMvYqjbjRuDPayTrS_generator: (Object | Link | URL)[] = []; - #_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator: Set = new Set(); + #_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator: VocabTrustSet = new Set(); #_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon: (Image | URL)[] = []; - #_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon: Set = new Set(); + #_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon: VocabTrustSet = new Set(); #_3dXrUdkARxwyJLtJcYi1AJ92H41U_image: (Image | URL)[] = []; - #_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image: Set = new Set(); + #_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image: VocabTrustSet = new Set(); #_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo: (Object | Link | URL)[] = []; - #_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo: Set = new Set(); + #_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo: VocabTrustSet = new Set(); #_31k5MUZJsnsPNg8dQQJieWaXTFnR_location: (Object | Link | URL)[] = []; - #_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location: Set = new Set(); + #_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location: VocabTrustSet = new Set(); #_gCVTegXxWWCw6wWRxa1QF65zusg_preview: (Link | Object | URL)[] = []; - #_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: Set = new Set(); + #_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: VocabTrustSet = new Set(); #_5e258TDXtuhaFRPZiGoDfEpjdMr_published: (Temporal.Instant)[] = []; #_7UpwM3JWcXhADcscukEehBorf6k_replies: (Collection | URL)[] = []; - #_trust_7UpwM3JWcXhADcscukEehBorf6k_replies: Set = new Set(); + #_trust_7UpwM3JWcXhADcscukEehBorf6k_replies: VocabTrustSet = new Set(); #_3kAfck9PcEYt2L7xug5y99YPbANs_shares: (Collection | URL)[] = []; - #_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares: Set = new Set(); + #_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares: VocabTrustSet = new Set(); #_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes: (Collection | URL)[] = []; - #_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes: Set = new Set(); + #_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes: VocabTrustSet = new Set(); #_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions: (Collection | URL)[] = []; - #_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions: Set = new Set(); + #_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions: VocabTrustSet = new Set(); #_2w3Jmue4up8iVDUA51WZqomEF438_startTime: (Temporal.Instant)[] = []; #_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary: ((string | LanguageString))[] = []; #_5chuqj6s95p5gg2sk1HntGfarRf_tag: (Object | Link | URL)[] = []; - #_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag: Set = new Set(); + #_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag: VocabTrustSet = new Set(); #_385aB7ySixcf5Un6z3VsWmThgCzQ_updated: (Temporal.Instant)[] = []; #_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url: ((URL | Link))[] = []; #_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to: (Object | URL)[] = []; - #_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to: Set = new Set(); + #_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to: VocabTrustSet = new Set(); #_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto: (Object | URL)[] = []; - #_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto: Set = new Set(); + #_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto: VocabTrustSet = new Set(); #_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc: (Object | URL)[] = []; - #_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc: Set = new Set(); + #_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc: VocabTrustSet = new Set(); #_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc: (Object | URL)[] = []; - #_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc: Set = new Set(); + #_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc: VocabTrustSet = new Set(); #_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType: (string)[] = []; #_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration: (Temporal.Duration)[] = []; #_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive: (boolean)[] = []; #_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source: (Source)[] = []; #_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof: (DataIntegrityProof | URL)[] = []; - #_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof: Set = new Set(); + #_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof: VocabTrustSet = new Set(); #_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy: (InteractionPolicy)[] = []; #_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy: (URL)[] = []; #_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization: (LikeAuthorization | URL)[] = []; - #_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization: Set = new Set(); + #_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization: VocabTrustSet = new Set(); #_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization: (ReplyAuthorization | URL)[] = []; - #_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization: Set = new Set(); + #_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization: VocabTrustSet = new Set(); #_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization: (AnnounceAuthorization | URL)[] = []; - #_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization: Set = new Set(); + #_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization: VocabTrustSet = new Set(); #_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations: (Translation)[] = []; #_2rzkBRS4gNPrkJk9DohHAMUAxA2d: (URL)[] = []; @@ -476,14 +670,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if ("attachments" in values && values.attachments != null) { - if (Array.isArray(values.attachments) && - values.attachments.every(v => v instanceof Object || v instanceof Link || v instanceof PropertyValue || v instanceof URL)) { + let copied!: (Object | Link | PropertyValue | URL)[]; + let valid = false; + if (Array.isArray(values.attachments)) { + const array = values.attachments; + const test = (v: Object | Link | PropertyValue | URL): boolean => v instanceof Object || v instanceof Link || v instanceof PropertyValue || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.attachments; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = values.attachments.slice(); + this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = copied; - for (let i = 0; i < values.attachments.length; i++) { - this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.add(i); - } + vocabSetTrustPrefix(this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment, this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length); } else { throw new TypeError( @@ -516,14 +732,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.attributions) && - values.attributions.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.attributions)) { + const array = values.attributions; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.attributions; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = values.attributions.slice(); + this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = copied; - for (let i = 0; i < values.attributions.length; i++) { - this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.add(i); - } + vocabSetTrustPrefix(this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo, this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length); } else { throw new TypeError( @@ -556,14 +794,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.audiences) && - values.audiences.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.audiences)) { + const array = values.audiences; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.audiences; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = values.audiences.slice(); + this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = copied; - for (let i = 0; i < values.audiences.length; i++) { - this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.add(i); - } + vocabSetTrustPrefix(this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience, this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length); } else { throw new TypeError( @@ -596,10 +856,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.contents) && - values.contents.every(v => typeof v === "string" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.contents)) { + const array = values.contents; + const test = (v: string | LanguageString): boolean => typeof v === "string" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.contents; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = values.contents.slice(); + this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = copied; } else { throw new TypeError( @@ -611,14 +895,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if ("contexts" in values && values.contexts != null) { - if (Array.isArray(values.contexts) && - values.contexts.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.contexts)) { + const array = values.contexts; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.contexts; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context = values.contexts.slice(); + this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context = copied; - for (let i = 0; i < values.contexts.length; i++) { - this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.add(i); - } + vocabSetTrustPrefix(this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context, this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.length); } else { throw new TypeError( @@ -651,10 +957,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.names) && - values.names.every(v => typeof v === "string" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.names)) { + const array = values.names; + const test = (v: string | LanguageString): boolean => typeof v === "string" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.names; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = values.names.slice(); + this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = copied; } else { throw new TypeError( @@ -679,14 +1009,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if ("generators" in values && values.generators != null) { - if (Array.isArray(values.generators) && - values.generators.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.generators)) { + const array = values.generators; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.generators; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = values.generators.slice(); + this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = copied; - for (let i = 0; i < values.generators.length; i++) { - this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.add(i); - } + vocabSetTrustPrefix(this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator, this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.length); } else { throw new TypeError( @@ -719,14 +1071,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.icons) && - values.icons.every(v => v instanceof Image || v instanceof URL)) { + let copied!: (Image | URL)[]; + let valid = false; + if (Array.isArray(values.icons)) { + const array = values.icons; + const test = (v: Image | URL): boolean => v instanceof Image || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.icons; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = values.icons.slice(); + this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = copied; - for (let i = 0; i < values.icons.length; i++) { - this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.add(i); - } + vocabSetTrustPrefix(this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon, this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length); } else { throw new TypeError( @@ -759,14 +1133,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.images) && - values.images.every(v => v instanceof Image || v instanceof URL)) { + let copied!: (Image | URL)[]; + let valid = false; + if (Array.isArray(values.images)) { + const array = values.images; + const test = (v: Image | URL): boolean => v instanceof Image || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.images; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = values.images.slice(); + this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = copied; - for (let i = 0; i < values.images.length; i++) { - this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.add(i); - } + vocabSetTrustPrefix(this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image, this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length); } else { throw new TypeError( @@ -799,14 +1195,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.replyTargets) && - values.replyTargets.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.replyTargets)) { + const array = values.replyTargets; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.replyTargets; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = values.replyTargets.slice(); + this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = copied; - for (let i = 0; i < values.replyTargets.length; i++) { - this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.add(i); - } + vocabSetTrustPrefix(this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo, this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length); } else { throw new TypeError( @@ -839,14 +1257,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.locations) && - values.locations.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.locations)) { + const array = values.locations; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.locations; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = values.locations.slice(); + this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = copied; - for (let i = 0; i < values.locations.length; i++) { - this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.add(i); - } + vocabSetTrustPrefix(this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location, this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length); } else { throw new TypeError( @@ -879,14 +1319,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.previews) && - values.previews.every(v => v instanceof Link || v instanceof Object || v instanceof URL)) { + let copied!: (Link | Object | URL)[]; + let valid = false; + if (Array.isArray(values.previews)) { + const array = values.previews; + const test = (v: Link | Object | URL): boolean => v instanceof Link || v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.previews; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = values.previews.slice(); + this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = copied; - for (let i = 0; i < values.previews.length; i++) { - this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.add(i); - } + vocabSetTrustPrefix(this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length); } else { throw new TypeError( @@ -997,10 +1459,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.summaries) && - values.summaries.every(v => typeof v === "string" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.summaries)) { + const array = values.summaries; + const test = (v: string | LanguageString): boolean => typeof v === "string" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.summaries; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = values.summaries.slice(); + this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = copied; } else { throw new TypeError( @@ -1012,14 +1498,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if ("tags" in values && values.tags != null) { - if (Array.isArray(values.tags) && - values.tags.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.tags)) { + const array = values.tags; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.tags; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = values.tags.slice(); + this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = copied; - for (let i = 0; i < values.tags.length; i++) { - this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.add(i); - } + vocabSetTrustPrefix(this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag, this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.length); } else { throw new TypeError( @@ -1065,10 +1573,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.urls) && - values.urls.every(v => v instanceof URL || v instanceof Link)) { + let copied!: (URL | Link)[]; + let valid = false; + if (Array.isArray(values.urls)) { + const array = values.urls; + const test = (v: URL | Link): boolean => v instanceof URL || v instanceof Link; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.urls; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = values.urls.slice(); + this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = copied; } else { throw new TypeError( @@ -1101,14 +1633,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.tos) && - values.tos.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.tos)) { + const array = values.tos; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.tos; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = values.tos.slice(); + this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = copied; - for (let i = 0; i < values.tos.length; i++) { - this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.add(i); - } + vocabSetTrustPrefix(this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to, this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length); } else { throw new TypeError( @@ -1141,14 +1695,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.btos) && - values.btos.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.btos)) { + const array = values.btos; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.btos; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = values.btos.slice(); + this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = copied; - for (let i = 0; i < values.btos.length; i++) { - this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.add(i); - } + vocabSetTrustPrefix(this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto, this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length); } else { throw new TypeError( @@ -1181,14 +1757,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.ccs) && - values.ccs.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.ccs)) { + const array = values.ccs; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.ccs; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = values.ccs.slice(); + this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = copied; - for (let i = 0; i < values.ccs.length; i++) { - this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.add(i); - } + vocabSetTrustPrefix(this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc, this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length); } else { throw new TypeError( @@ -1221,14 +1819,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.bccs) && - values.bccs.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.bccs)) { + const array = values.bccs; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.bccs; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = values.bccs.slice(); + this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = copied; - for (let i = 0; i < values.bccs.length; i++) { - this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.add(i); - } + vocabSetTrustPrefix(this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc, this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length); } else { throw new TypeError( @@ -1313,14 +1933,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.proofs) && - values.proofs.every(v => v instanceof DataIntegrityProof || v instanceof URL)) { + let copied!: (DataIntegrityProof | URL)[]; + let valid = false; + if (Array.isArray(values.proofs)) { + const array = values.proofs; + const test = (v: DataIntegrityProof | URL): boolean => v instanceof DataIntegrityProof || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.proofs; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = values.proofs.slice(); + this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = copied; - for (let i = 0; i < values.proofs.length; i++) { - this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.add(i); - } + vocabSetTrustPrefix(this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof, this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length); } else { throw new TypeError( @@ -1397,10 +2039,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if ("translations" in values && values.translations != null) { - if (Array.isArray(values.translations) && - values.translations.every(v => v instanceof Translation)) { + let copied!: (Translation)[]; + let valid = false; + if (Array.isArray(values.translations)) { + const array = values.translations; + const test = (v: Translation): boolean => v instanceof Translation; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.translations; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations = values.translations.slice(); + this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations = copied; } else { throw new TypeError( @@ -1412,10 +2078,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if ("licenses" in values && values.licenses != null) { - if (Array.isArray(values.licenses) && - values.licenses.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.licenses)) { + const array = values.licenses; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.licenses; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = values.licenses.slice(); + this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = copied; } else { throw new TypeError( @@ -1497,18 +2187,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu options ); copyPortableProvenance(this, clone); - clone.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.slice();clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment = new Set(this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment); + clone.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length < vocabSparseArrayMinimumLength + ? this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.slice() : vocabCopyPropertyArray(this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment);clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment = vocabCopyTrustSet( + this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment, clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment, + ); if ("attachments" in values && values.attachments != null) { - if (Array.isArray(values.attachments) && - values.attachments.every(v => v instanceof Object || v instanceof Link || v instanceof PropertyValue || v instanceof URL)) { + let copied!: (Object | Link | PropertyValue | URL)[]; + let valid = false; + if (Array.isArray(values.attachments)) { + const array = values.attachments; + const test = (v: Object | Link | PropertyValue | URL): boolean => v instanceof Object || v instanceof Link || v instanceof PropertyValue || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.attachments; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = values.attachments.slice(); + clone.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = copied; clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment = new Set(); - for (let i = 0; i < values.attachments.length; i++) { - clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.add(i); - } + vocabSetTrustPrefix(clone.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment, clone.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length); } else { throw new TypeError( @@ -1517,12 +2232,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.slice();clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = new Set(this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo); + clone.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length < vocabSparseArrayMinimumLength + ? this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.slice() : vocabCopyPropertyArray(this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo);clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = vocabCopyTrustSet( + this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo, clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo, + ); if ("attribution" in values && values.attribution != null) { if (values.attribution instanceof Application || values.attribution instanceof Group || values.attribution instanceof Organization || values.attribution instanceof Person || values.attribution instanceof Service || values.attribution instanceof URL) { // @ts-ignore: type is checked above. clone.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = [values.attribution]; - clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = new Set([0]); + clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = new Set(); + clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[vocabTrustPrefix] = 1; } else { throw new TypeError( "The attribution must be of type " + @@ -1541,15 +2260,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.attributions) && - values.attributions.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.attributions)) { + const array = values.attributions; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.attributions; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = values.attributions.slice(); + clone.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = copied; clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = new Set(); - for (let i = 0; i < values.attributions.length; i++) { - clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.add(i); - } + vocabSetTrustPrefix(clone.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo, clone.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length); } else { throw new TypeError( @@ -1558,12 +2299,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.slice();clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = new Set(this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience); + clone.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length < vocabSparseArrayMinimumLength + ? this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.slice() : vocabCopyPropertyArray(this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience);clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = vocabCopyTrustSet( + this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience, clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience, + ); if ("audience" in values && values.audience != null) { if (values.audience instanceof Object || values.audience instanceof URL) { // @ts-ignore: type is checked above. clone.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = [values.audience]; - clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = new Set([0]); + clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = new Set(); + clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[vocabTrustPrefix] = 1; } else { throw new TypeError( "The audience must be of type " + @@ -1582,15 +2327,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.audiences) && - values.audiences.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.audiences)) { + const array = values.audiences; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.audiences; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = values.audiences.slice(); + clone.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = copied; clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience = new Set(); - for (let i = 0; i < values.audiences.length; i++) { - clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience, clone.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length); } else { throw new TypeError( @@ -1599,7 +2366,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.slice(); + clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.length < vocabSparseArrayMinimumLength + ? this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.slice() : vocabCopyPropertyArray(this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content); if ("content" in values && values.content != null) { if (typeof values.content === "string" || values.content instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -1623,10 +2391,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.contents) && - values.contents.every(v => typeof v === "string" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.contents)) { + const array = values.contents; + const test = (v: string | LanguageString): boolean => typeof v === "string" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.contents; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = values.contents.slice(); + clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = copied; } else { throw new TypeError( @@ -1635,18 +2427,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3mhZzGXSpQ431mBSz2kvych22v4e_context = this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.slice();clone.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context = new Set(this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context); + clone.#_3mhZzGXSpQ431mBSz2kvych22v4e_context = this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.length < vocabSparseArrayMinimumLength + ? this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.slice() : vocabCopyPropertyArray(this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context);clone.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context = vocabCopyTrustSet( + this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context, clone.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context, + ); if ("contexts" in values && values.contexts != null) { - if (Array.isArray(values.contexts) && - values.contexts.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.contexts)) { + const array = values.contexts; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.contexts; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3mhZzGXSpQ431mBSz2kvych22v4e_context = values.contexts.slice(); + clone.#_3mhZzGXSpQ431mBSz2kvych22v4e_context = copied; clone.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context = new Set(); - for (let i = 0; i < values.contexts.length; i++) { - clone.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context, clone.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.length); } else { throw new TypeError( @@ -1655,7 +2472,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice(); + clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.length < vocabSparseArrayMinimumLength + ? this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice() : vocabCopyPropertyArray(this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name); if ("name" in values && values.name != null) { if (typeof values.name === "string" || values.name instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -1679,10 +2497,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.names) && - values.names.every(v => typeof v === "string" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.names)) { + const array = values.names; + const test = (v: string | LanguageString): boolean => typeof v === "string" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.names; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = values.names.slice(); + clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = copied; } else { throw new TypeError( @@ -1691,7 +2533,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime = this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime.slice(); + clone.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime = this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime.length < vocabSparseArrayMinimumLength + ? this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime.slice() : vocabCopyPropertyArray(this.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime); if ("endTime" in values && values.endTime != null) { if (isTemporalInstant(values.endTime)) { // @ts-ignore: type is checked above. @@ -1704,18 +2547,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.slice();clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator = new Set(this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator); + clone.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.length < vocabSparseArrayMinimumLength + ? this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.slice() : vocabCopyPropertyArray(this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator);clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator = vocabCopyTrustSet( + this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator, clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator, + ); if ("generators" in values && values.generators != null) { - if (Array.isArray(values.generators) && - values.generators.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.generators)) { + const array = values.generators; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.generators; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = values.generators.slice(); + clone.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = copied; clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator = new Set(); - for (let i = 0; i < values.generators.length; i++) { - clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.add(i); - } + vocabSetTrustPrefix(clone.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator, clone.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.length); } else { throw new TypeError( @@ -1724,12 +2592,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.slice();clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = new Set(this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon); + clone.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length < vocabSparseArrayMinimumLength + ? this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.slice() : vocabCopyPropertyArray(this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon);clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = vocabCopyTrustSet( + this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon, clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon, + ); if ("icon" in values && values.icon != null) { if (values.icon instanceof Image || values.icon instanceof URL) { // @ts-ignore: type is checked above. clone.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = [values.icon]; - clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = new Set([0]); + clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = new Set(); + clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[vocabTrustPrefix] = 1; } else { throw new TypeError( "The icon must be of type " + @@ -1748,15 +2620,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.icons) && - values.icons.every(v => v instanceof Image || v instanceof URL)) { + let copied!: (Image | URL)[]; + let valid = false; + if (Array.isArray(values.icons)) { + const array = values.icons; + const test = (v: Image | URL): boolean => v instanceof Image || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.icons; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = values.icons.slice(); + clone.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = copied; clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = new Set(); - for (let i = 0; i < values.icons.length; i++) { - clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.add(i); - } + vocabSetTrustPrefix(clone.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon, clone.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length); } else { throw new TypeError( @@ -1765,12 +2659,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.slice();clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = new Set(this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image); + clone.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length < vocabSparseArrayMinimumLength + ? this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.slice() : vocabCopyPropertyArray(this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image);clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = vocabCopyTrustSet( + this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image, clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image, + ); if ("image" in values && values.image != null) { if (values.image instanceof Image || values.image instanceof URL) { // @ts-ignore: type is checked above. clone.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = [values.image]; - clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = new Set([0]); + clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = new Set(); + clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[vocabTrustPrefix] = 1; } else { throw new TypeError( "The image must be of type " + @@ -1789,15 +2687,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.images) && - values.images.every(v => v instanceof Image || v instanceof URL)) { + let copied!: (Image | URL)[]; + let valid = false; + if (Array.isArray(values.images)) { + const array = values.images; + const test = (v: Image | URL): boolean => v instanceof Image || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.images; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = values.images.slice(); + clone.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = copied; clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = new Set(); - for (let i = 0; i < values.images.length; i++) { - clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image, clone.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length); } else { throw new TypeError( @@ -1806,12 +2726,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.slice();clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = new Set(this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo); + clone.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length < vocabSparseArrayMinimumLength + ? this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.slice() : vocabCopyPropertyArray(this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo);clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = vocabCopyTrustSet( + this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo, clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo, + ); if ("replyTarget" in values && values.replyTarget != null) { if (values.replyTarget instanceof Object || values.replyTarget instanceof Link || values.replyTarget instanceof URL) { // @ts-ignore: type is checked above. clone.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = [values.replyTarget]; - clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = new Set([0]); + clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = new Set(); + clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[vocabTrustPrefix] = 1; } else { throw new TypeError( "The replyTarget must be of type " + @@ -1830,15 +2754,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.replyTargets) && - values.replyTargets.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.replyTargets)) { + const array = values.replyTargets; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.replyTargets; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = values.replyTargets.slice(); + clone.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = copied; clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = new Set(); - for (let i = 0; i < values.replyTargets.length; i++) { - clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo, clone.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length); } else { throw new TypeError( @@ -1847,12 +2793,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.slice();clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = new Set(this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location); + clone.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length < vocabSparseArrayMinimumLength + ? this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.slice() : vocabCopyPropertyArray(this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location);clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = vocabCopyTrustSet( + this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location, clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location, + ); if ("location" in values && values.location != null) { if (values.location instanceof Object || values.location instanceof Link || values.location instanceof URL) { // @ts-ignore: type is checked above. clone.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = [values.location]; - clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = new Set([0]); + clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = new Set(); + clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[vocabTrustPrefix] = 1; } else { throw new TypeError( "The location must be of type " + @@ -1871,15 +2821,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.locations) && - values.locations.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.locations)) { + const array = values.locations; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.locations; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = values.locations.slice(); + clone.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = copied; clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = new Set(); - for (let i = 0; i < values.locations.length; i++) { - clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.add(i); - } + vocabSetTrustPrefix(clone.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location, clone.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length); } else { throw new TypeError( @@ -1888,12 +2860,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.slice();clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = new Set(this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview); + clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length < vocabSparseArrayMinimumLength + ? this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.slice() : vocabCopyPropertyArray(this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview);clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = vocabCopyTrustSet( + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, + ); if ("preview" in values && values.preview != null) { if (values.preview instanceof Link || values.preview instanceof Object || values.preview instanceof URL) { // @ts-ignore: type is checked above. clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = [values.preview]; - clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = new Set([0]); + clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = new Set(); + clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] = 1; } else { throw new TypeError( "The preview must be of type " + @@ -1912,15 +2888,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.previews) && - values.previews.every(v => v instanceof Link || v instanceof Object || v instanceof URL)) { + let copied!: (Link | Object | URL)[]; + let valid = false; + if (Array.isArray(values.previews)) { + const array = values.previews; + const test = (v: Link | Object | URL): boolean => v instanceof Link || v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.previews; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = values.previews.slice(); + clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = copied; clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = new Set(); - for (let i = 0; i < values.previews.length; i++) { - clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.add(i); - } + vocabSetTrustPrefix(clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length); } else { throw new TypeError( @@ -1929,7 +2927,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published = this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published.slice(); + clone.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published = this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published.length < vocabSparseArrayMinimumLength + ? this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published.slice() : vocabCopyPropertyArray(this.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published); if ("published" in values && values.published != null) { if (isTemporalInstant(values.published)) { // @ts-ignore: type is checked above. @@ -1942,12 +2941,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_7UpwM3JWcXhADcscukEehBorf6k_replies = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies.slice();clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies = new Set(this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies); + clone.#_7UpwM3JWcXhADcscukEehBorf6k_replies = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies.length < vocabSparseArrayMinimumLength + ? this.#_7UpwM3JWcXhADcscukEehBorf6k_replies.slice() : vocabCopyPropertyArray(this.#_7UpwM3JWcXhADcscukEehBorf6k_replies);clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies = vocabCopyTrustSet( + this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies, clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies, + ); if ("replies" in values && values.replies != null) { if (values.replies instanceof Collection || values.replies instanceof URL) { // @ts-ignore: type is checked above. clone.#_7UpwM3JWcXhADcscukEehBorf6k_replies = [values.replies]; - clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies = new Set([0]); + clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies = new Set(); + clone.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies[vocabTrustPrefix] = 1; } else { throw new TypeError( "The replies must be of type " + @@ -1955,12 +2958,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.slice();clone.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares = new Set(this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares); + clone.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.length < vocabSparseArrayMinimumLength + ? this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.slice() : vocabCopyPropertyArray(this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares);clone.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares = vocabCopyTrustSet( + this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares, clone.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares, + ); if ("shares" in values && values.shares != null) { if (values.shares instanceof Collection || values.shares instanceof URL) { // @ts-ignore: type is checked above. clone.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares = [values.shares]; - clone.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares = new Set([0]); + clone.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares = new Set(); + clone.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares[vocabTrustPrefix] = 1; } else { throw new TypeError( "The shares must be of type " + @@ -1968,12 +2975,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.slice();clone.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = new Set(this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes); + clone.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.length < vocabSparseArrayMinimumLength + ? this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.slice() : vocabCopyPropertyArray(this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes);clone.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = vocabCopyTrustSet( + this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes, clone.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes, + ); if ("likes" in values && values.likes != null) { if (values.likes instanceof Collection || values.likes instanceof URL) { // @ts-ignore: type is checked above. clone.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = [values.likes]; - clone.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = new Set([0]); + clone.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = new Set(); + clone.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[vocabTrustPrefix] = 1; } else { throw new TypeError( "The likes must be of type " + @@ -1981,12 +2992,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.slice();clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = new Set(this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions); + clone.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.length < vocabSparseArrayMinimumLength + ? this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.slice() : vocabCopyPropertyArray(this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions);clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = vocabCopyTrustSet( + this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions, clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions, + ); if ("emojiReactions" in values && values.emojiReactions != null) { if (values.emojiReactions instanceof Collection || values.emojiReactions instanceof URL) { // @ts-ignore: type is checked above. clone.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = [values.emojiReactions]; - clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = new Set([0]); + clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions = new Set(); + clone.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[vocabTrustPrefix] = 1; } else { throw new TypeError( "The emojiReactions must be of type " + @@ -1994,7 +3009,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime = this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime.slice(); + clone.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime = this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime.length < vocabSparseArrayMinimumLength + ? this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime.slice() : vocabCopyPropertyArray(this.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime); if ("startTime" in values && values.startTime != null) { if (isTemporalInstant(values.startTime)) { // @ts-ignore: type is checked above. @@ -2007,7 +3023,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary.slice(); + clone.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary.length < vocabSparseArrayMinimumLength + ? this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary.slice() : vocabCopyPropertyArray(this.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary); if ("summary" in values && values.summary != null) { if (typeof values.summary === "string" || values.summary instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -2031,10 +3048,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.summaries) && - values.summaries.every(v => typeof v === "string" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.summaries)) { + const array = values.summaries; + const test = (v: string | LanguageString): boolean => typeof v === "string" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.summaries; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = values.summaries.slice(); + clone.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = copied; } else { throw new TypeError( @@ -2043,18 +3084,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.slice();clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag = new Set(this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag); + clone.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.length < vocabSparseArrayMinimumLength + ? this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.slice() : vocabCopyPropertyArray(this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag);clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag = vocabCopyTrustSet( + this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag, clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag, + ); if ("tags" in values && values.tags != null) { - if (Array.isArray(values.tags) && - values.tags.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.tags)) { + const array = values.tags; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.tags; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = values.tags.slice(); + clone.#_5chuqj6s95p5gg2sk1HntGfarRf_tag = copied; clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag = new Set(); - for (let i = 0; i < values.tags.length; i++) { - clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.add(i); - } + vocabSetTrustPrefix(clone.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag, clone.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.length); } else { throw new TypeError( @@ -2063,7 +3129,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated = this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated.slice(); + clone.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated = this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated.length < vocabSparseArrayMinimumLength + ? this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated.slice() : vocabCopyPropertyArray(this.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated); if ("updated" in values && values.updated != null) { if (isTemporalInstant(values.updated)) { // @ts-ignore: type is checked above. @@ -2076,7 +3143,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.slice(); + clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length < vocabSparseArrayMinimumLength + ? this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.slice() : vocabCopyPropertyArray(this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url); if ("url" in values && values.url != null) { if (values.url instanceof URL || values.url instanceof Link) { // @ts-ignore: type is checked above. @@ -2100,10 +3168,34 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.urls) && - values.urls.every(v => v instanceof URL || v instanceof Link)) { + let copied!: (URL | Link)[]; + let valid = false; + if (Array.isArray(values.urls)) { + const array = values.urls; + const test = (v: URL | Link): boolean => v instanceof URL || v instanceof Link; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.urls; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = values.urls.slice(); + clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = copied; } else { throw new TypeError( @@ -2112,12 +3204,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.slice();clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = new Set(this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to); + clone.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length < vocabSparseArrayMinimumLength + ? this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.slice() : vocabCopyPropertyArray(this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to);clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = vocabCopyTrustSet( + this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to, clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to, + ); if ("to" in values && values.to != null) { if (values.to instanceof Object || values.to instanceof URL) { // @ts-ignore: type is checked above. clone.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = [values.to]; - clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = new Set([0]); + clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = new Set(); + clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[vocabTrustPrefix] = 1; } else { throw new TypeError( "The to must be of type " + @@ -2136,15 +3232,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.tos) && - values.tos.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.tos)) { + const array = values.tos; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.tos; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = values.tos.slice(); + clone.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = copied; clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = new Set(); - for (let i = 0; i < values.tos.length; i++) { - clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to, clone.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length); } else { throw new TypeError( @@ -2153,12 +3271,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.slice();clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = new Set(this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto); + clone.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length < vocabSparseArrayMinimumLength + ? this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.slice() : vocabCopyPropertyArray(this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto);clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = vocabCopyTrustSet( + this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto, clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto, + ); if ("bto" in values && values.bto != null) { if (values.bto instanceof Object || values.bto instanceof URL) { // @ts-ignore: type is checked above. clone.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = [values.bto]; - clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = new Set([0]); + clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = new Set(); + clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[vocabTrustPrefix] = 1; } else { throw new TypeError( "The bto must be of type " + @@ -2177,15 +3299,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.btos) && - values.btos.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.btos)) { + const array = values.btos; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.btos; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = values.btos.slice(); + clone.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = copied; clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = new Set(); - for (let i = 0; i < values.btos.length; i++) { - clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.add(i); - } + vocabSetTrustPrefix(clone.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto, clone.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length); } else { throw new TypeError( @@ -2194,12 +3338,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.slice();clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = new Set(this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc); + clone.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length < vocabSparseArrayMinimumLength + ? this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.slice() : vocabCopyPropertyArray(this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc);clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = vocabCopyTrustSet( + this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc, clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc, + ); if ("cc" in values && values.cc != null) { if (values.cc instanceof Object || values.cc instanceof URL) { // @ts-ignore: type is checked above. clone.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = [values.cc]; - clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = new Set([0]); + clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = new Set(); + clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[vocabTrustPrefix] = 1; } else { throw new TypeError( "The cc must be of type " + @@ -2218,15 +3366,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.ccs) && - values.ccs.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.ccs)) { + const array = values.ccs; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.ccs; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = values.ccs.slice(); + clone.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = copied; clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = new Set(); - for (let i = 0; i < values.ccs.length; i++) { - clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.add(i); - } + vocabSetTrustPrefix(clone.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc, clone.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length); } else { throw new TypeError( @@ -2235,12 +3405,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.slice();clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = new Set(this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc); + clone.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length < vocabSparseArrayMinimumLength + ? this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.slice() : vocabCopyPropertyArray(this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc);clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = vocabCopyTrustSet( + this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc, clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc, + ); if ("bcc" in values && values.bcc != null) { if (values.bcc instanceof Object || values.bcc instanceof URL) { // @ts-ignore: type is checked above. clone.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = [values.bcc]; - clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = new Set([0]); + clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = new Set(); + clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[vocabTrustPrefix] = 1; } else { throw new TypeError( "The bcc must be of type " + @@ -2259,15 +3433,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.bccs) && - values.bccs.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.bccs)) { + const array = values.bccs; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.bccs; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = values.bccs.slice(); + clone.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = copied; clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc = new Set(); - for (let i = 0; i < values.bccs.length; i++) { - clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc, clone.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length); } else { throw new TypeError( @@ -2276,7 +3472,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.slice(); + clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.length < vocabSparseArrayMinimumLength + ? this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.slice() : vocabCopyPropertyArray(this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType); if ("mediaType" in values && values.mediaType != null) { if (typeof values.mediaType === "string") { // @ts-ignore: type is checked above. @@ -2289,7 +3486,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration = this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration.slice(); + clone.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration = this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration.length < vocabSparseArrayMinimumLength + ? this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration.slice() : vocabCopyPropertyArray(this.#_3bNvLMBN1bCJETiTihM3wvi1B2JX_duration); if ("duration" in values && values.duration != null) { if (isTemporalDuration(values.duration)) { // @ts-ignore: type is checked above. @@ -2302,7 +3500,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive = this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive.slice(); + clone.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive = this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive.length < vocabSparseArrayMinimumLength + ? this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive.slice() : vocabCopyPropertyArray(this.#_u8gdcDTtChQ4tbSQMXc4cYWyum7_sensitive); if ("sensitive" in values && values.sensitive != null) { if (typeof values.sensitive === "boolean") { // @ts-ignore: type is checked above. @@ -2315,7 +3514,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source = this.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.slice(); + clone.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source = this.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.length < vocabSparseArrayMinimumLength + ? this.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.slice() : vocabCopyPropertyArray(this.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source); if ("source" in values && values.source != null) { if (values.source instanceof Source) { // @ts-ignore: type is checked above. @@ -2328,12 +3528,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.slice();clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = new Set(this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof); + clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length < vocabSparseArrayMinimumLength + ? this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.slice() : vocabCopyPropertyArray(this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof);clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = vocabCopyTrustSet( + this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof, clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof, + ); if ("proof" in values && values.proof != null) { if (values.proof instanceof DataIntegrityProof || values.proof instanceof URL) { // @ts-ignore: type is checked above. clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = [values.proof]; - clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = new Set([0]); + clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = new Set(); + clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[vocabTrustPrefix] = 1; } else { throw new TypeError( "The proof must be of type " + @@ -2352,15 +3556,37 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } - if (Array.isArray(values.proofs) && - values.proofs.every(v => v instanceof DataIntegrityProof || v instanceof URL)) { + let copied!: (DataIntegrityProof | URL)[]; + let valid = false; + if (Array.isArray(values.proofs)) { + const array = values.proofs; + const test = (v: DataIntegrityProof | URL): boolean => v instanceof DataIntegrityProof || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.proofs; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = values.proofs.slice(); + clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = copied; clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof = new Set(); - for (let i = 0; i < values.proofs.length; i++) { - clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.add(i); - } + vocabSetTrustPrefix(clone.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof, clone.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length); } else { throw new TypeError( @@ -2369,7 +3595,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy = this.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.slice(); + clone.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy = this.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.length < vocabSparseArrayMinimumLength + ? this.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.slice() : vocabCopyPropertyArray(this.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy); if ("interactionPolicy" in values && values.interactionPolicy != null) { if (values.interactionPolicy instanceof InteractionPolicy) { // @ts-ignore: type is checked above. @@ -2382,7 +3609,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy = this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.slice(); + clone.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy = this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.length < vocabSparseArrayMinimumLength + ? this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.slice() : vocabCopyPropertyArray(this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy); if ("approvedBy" in values && values.approvedBy != null) { if (values.approvedBy instanceof URL) { // @ts-ignore: type is checked above. @@ -2395,12 +3623,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.slice();clone.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = new Set(this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization); + clone.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.slice() : vocabCopyPropertyArray(this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization);clone.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = vocabCopyTrustSet( + this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization, clone.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization, + ); if ("likeAuthorization" in values && values.likeAuthorization != null) { if (values.likeAuthorization instanceof LikeAuthorization || values.likeAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = [values.likeAuthorization]; - clone.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = new Set([0]); + clone.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = new Set(); + clone.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( "The likeAuthorization must be of type " + @@ -2408,12 +3640,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.slice();clone.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = new Set(this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization); + clone.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.slice() : vocabCopyPropertyArray(this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization);clone.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = vocabCopyTrustSet( + this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization, clone.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization, + ); if ("replyAuthorization" in values && values.replyAuthorization != null) { if (values.replyAuthorization instanceof ReplyAuthorization || values.replyAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = [values.replyAuthorization]; - clone.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = new Set([0]); + clone.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = new Set(); + clone.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( "The replyAuthorization must be of type " + @@ -2421,12 +3657,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.slice();clone.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = new Set(this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization); + clone.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.slice() : vocabCopyPropertyArray(this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization);clone.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = vocabCopyTrustSet( + this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization, clone.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization, + ); if ("announceAuthorization" in values && values.announceAuthorization != null) { if (values.announceAuthorization instanceof AnnounceAuthorization || values.announceAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = [values.announceAuthorization]; - clone.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = new Set([0]); + clone.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization = new Set(); + clone.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( "The announceAuthorization must be of type " + @@ -2434,13 +3674,38 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations = this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations.slice(); + clone.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations = this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations.length < vocabSparseArrayMinimumLength + ? this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations.slice() : vocabCopyPropertyArray(this.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations); if ("translations" in values && values.translations != null) { - if (Array.isArray(values.translations) && - values.translations.every(v => v instanceof Translation)) { + let copied!: (Translation)[]; + let valid = false; + if (Array.isArray(values.translations)) { + const array = values.translations; + const test = (v: Translation): boolean => v instanceof Translation; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.translations; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations = values.translations.slice(); + clone.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations = copied; } else { throw new TypeError( @@ -2449,13 +3714,38 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.slice(); + clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length < vocabSparseArrayMinimumLength + ? this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.slice() : vocabCopyPropertyArray(this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d); if ("licenses" in values && values.licenses != null) { - if (Array.isArray(values.licenses) && - values.licenses.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.licenses)) { + const array = values.licenses; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.licenses; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = values.licenses.slice(); + clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = copied; } else { throw new TypeError( @@ -2490,6 +3780,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -2549,206 +3845,641 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length; i++) { - const value = node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment[i]; - if (value != null && typeof value === "object") { - node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment[i] = context.value(value); + { + const array = node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment.length; i++) { + const value = node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment[i]; + if (value != null && typeof value === "object") { + node.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length; i++) { - const value = node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[i]; - if (value != null && typeof value === "object") { - node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[i] = context.value(value); + { + const array = node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length; i++) { + const value = node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[i]; + if (value != null && typeof value === "object") { + node.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length; i++) { - const value = node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[i]; - if (value != null && typeof value === "object") { - node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[i] = context.value(value); + { + const array = node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length; i++) { + const value = node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[i]; + if (value != null && typeof value === "object") { + node.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.length; i++) { - const value = node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context[i]; - if (value != null && typeof value === "object") { - node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context[i] = context.value(value); + { + const array = node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context.length; i++) { + const value = node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context[i]; + if (value != null && typeof value === "object") { + node.#_3mhZzGXSpQ431mBSz2kvych22v4e_context[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.length; i++) { - const value = node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator[i]; - if (value != null && typeof value === "object") { - node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator[i] = context.value(value); + { + const array = node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator.length; i++) { + const value = node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator[i]; + if (value != null && typeof value === "object") { + node.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length; i++) { - const value = node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[i]; - if (value != null && typeof value === "object") { - node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[i] = context.value(value); + { + const array = node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length; i++) { + const value = node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[i]; + if (value != null && typeof value === "object") { + node.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length; i++) { - const value = node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[i]; - if (value != null && typeof value === "object") { - node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[i] = context.value(value); + { + const array = node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length; i++) { + const value = node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[i]; + if (value != null && typeof value === "object") { + node.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length; i++) { - const value = node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[i]; - if (value != null && typeof value === "object") { - node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[i] = context.value(value); + { + const array = node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length; i++) { + const value = node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[i]; + if (value != null && typeof value === "object") { + node.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length; i++) { - const value = node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[i]; - if (value != null && typeof value === "object") { - node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[i] = context.value(value); + { + const array = node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length; i++) { + const value = node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[i]; + if (value != null && typeof value === "object") { + node.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length; i++) { - const value = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i]; - if (value != null && typeof value === "object") { - node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i] = context.value(value); + { + const array = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length; i++) { + const value = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i]; + if (value != null && typeof value === "object") { + node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_7UpwM3JWcXhADcscukEehBorf6k_replies.length; i++) { - const value = node.#_7UpwM3JWcXhADcscukEehBorf6k_replies[i]; - if (value != null && typeof value === "object") { - node.#_7UpwM3JWcXhADcscukEehBorf6k_replies[i] = context.value(value); + { + const array = node.#_7UpwM3JWcXhADcscukEehBorf6k_replies; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_7UpwM3JWcXhADcscukEehBorf6k_replies.length; i++) { + const value = node.#_7UpwM3JWcXhADcscukEehBorf6k_replies[i]; + if (value != null && typeof value === "object") { + node.#_7UpwM3JWcXhADcscukEehBorf6k_replies[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.length; i++) { - const value = node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[i]; - if (value != null && typeof value === "object") { - node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[i] = context.value(value); + { + const array = node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.length; i++) { + const value = node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[i]; + if (value != null && typeof value === "object") { + node.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.length; i++) { - const value = node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[i]; - if (value != null && typeof value === "object") { - node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[i] = context.value(value); + { + const array = node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.length; i++) { + const value = node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[i]; + if (value != null && typeof value === "object") { + node.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.length; i++) { - const value = node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[i]; - if (value != null && typeof value === "object") { - node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[i] = context.value(value); + { + const array = node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.length; i++) { + const value = node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[i]; + if (value != null && typeof value === "object") { + node.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.length; i++) { - const value = node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag[i]; - if (value != null && typeof value === "object") { - node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag[i] = context.value(value); + { + const array = node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag.length; i++) { + const value = node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag[i]; + if (value != null && typeof value === "object") { + node.#_5chuqj6s95p5gg2sk1HntGfarRf_tag[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length; i++) { - const value = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i]; - if (value != null && typeof value === "object") { - node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i] = context.value(value); + { + const array = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length; i++) { + const value = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i]; + if (value != null && typeof value === "object") { + node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length; i++) { - const value = node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[i]; - if (value != null && typeof value === "object") { - node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[i] = context.value(value); + { + const array = node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length; i++) { + const value = node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[i]; + if (value != null && typeof value === "object") { + node.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length; i++) { - const value = node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[i]; - if (value != null && typeof value === "object") { - node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[i] = context.value(value); + { + const array = node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length; i++) { + const value = node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[i]; + if (value != null && typeof value === "object") { + node.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length; i++) { - const value = node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[i]; - if (value != null && typeof value === "object") { - node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[i] = context.value(value); + { + const array = node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length; i++) { + const value = node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[i]; + if (value != null && typeof value === "object") { + node.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length; i++) { - const value = node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[i]; - if (value != null && typeof value === "object") { - node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[i] = context.value(value); + { + const array = node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length; i++) { + const value = node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[i]; + if (value != null && typeof value === "object") { + node.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.length; i++) { - const value = node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source[i]; - if (value != null && typeof value === "object") { - node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source[i] = context.value(value); + { + const array = node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.length; i++) { + const value = node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source[i]; + if (value != null && typeof value === "object") { + node.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length; i++) { - const value = node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[i]; - if (value != null && typeof value === "object") { - node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[i] = context.value(value); + { + const array = node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length; i++) { + const value = node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[i]; + if (value != null && typeof value === "object") { + node.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.length; i++) { - const value = node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy[i]; - if (value != null && typeof value === "object") { - node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy[i] = context.value(value); + { + const array = node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.length; i++) { + const value = node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy[i]; + if (value != null && typeof value === "object") { + node.#_2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.length; i++) { - const value = node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy[i]; - if (value != null && typeof value === "object") { - node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy[i] = context.value(value); + { + const array = node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.length; i++) { + const value = node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy[i]; + if (value != null && typeof value === "object") { + node.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.length; i++) { - const value = node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[i]; - if (value != null && typeof value === "object") { - node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[i] = context.value(value); + { + const array = node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.length; i++) { + const value = node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[i]; + if (value != null && typeof value === "object") { + node.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.length; i++) { - const value = node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[i]; - if (value != null && typeof value === "object") { - node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[i] = context.value(value); + { + const array = node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.length; i++) { + const value = node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[i]; + if (value != null && typeof value === "object") { + node.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.length; i++) { - const value = node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[i]; - if (value != null && typeof value === "object") { - node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[i] = context.value(value); + { + const array = node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.length; i++) { + const value = node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[i]; + if (value != null && typeof value === "object") { + node.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations.length; i++) { - const value = node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations[i]; - if (value != null && typeof value === "object") { - node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations[i] = context.value(value); + { + const array = node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations.length; i++) { + const value = node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations[i]; + if (value != null && typeof value === "object") { + node.#_a1jKLXa1P1ZoKTfTM2CzmhHK3cP_translations[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length; i++) { - const value = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i]; - if (value != null && typeof value === "object") { - node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i] = context.value(value); + { + const array = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length; i++) { + const value = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i]; + if (value != null && typeof value === "object") { + node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i] = context.value(value); + } + } } } } }); } @@ -3111,7 +4842,8 @@ deepCloneDescriptors.set(this.prototype, { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { + !(i < (this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment[vocabTrustPrefix] ?? 0) || + this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#attachment"); @@ -3183,7 +4915,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { + !(i < (this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment[vocabTrustPrefix] ?? 0) || + this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -3596,7 +5329,8 @@ deepCloneDescriptors.set(this.prototype, { } let v = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[0]; if (!(v instanceof URL) && - !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { + !(0 < (this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#attributedTo"); @@ -3664,7 +5398,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { + !(0 < (this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -3754,7 +5489,8 @@ deepCloneDescriptors.set(this.prototype, { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { + !(i < (this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#attributedTo"); @@ -3826,7 +5562,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { + !(i < (this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -4178,7 +5915,8 @@ deepCloneDescriptors.set(this.prototype, { } let v = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[0]; if (!(v instanceof URL) && - !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { + !(0 < (this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[vocabTrustPrefix] ?? 0) || + this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#audience"); @@ -4246,7 +5984,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { + !(0 < (this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[vocabTrustPrefix] ?? 0) || + this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -4335,7 +6074,8 @@ deepCloneDescriptors.set(this.prototype, { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { + !(i < (this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[vocabTrustPrefix] ?? 0) || + this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#audience"); @@ -4407,7 +6147,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { + !(i < (this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[vocabTrustPrefix] ?? 0) || + this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -4808,7 +6549,8 @@ get contents(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { + !(i < (this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context[vocabTrustPrefix] ?? 0) || + this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#context"); @@ -4880,7 +6622,8 @@ get contents(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { + !(i < (this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context[vocabTrustPrefix] ?? 0) || + this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -5288,7 +7031,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { + !(i < (this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator[vocabTrustPrefix] ?? 0) || + this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#generator"); @@ -5360,7 +7104,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { + !(i < (this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator[vocabTrustPrefix] ?? 0) || + this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -5735,7 +7480,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[0]; if (!(v instanceof URL) && - !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { + !(0 < (this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[vocabTrustPrefix] ?? 0) || + this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#icon"); @@ -5803,7 +7549,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { + !(0 < (this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[vocabTrustPrefix] ?? 0) || + this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -5893,7 +7640,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { + !(i < (this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[vocabTrustPrefix] ?? 0) || + this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#icon"); @@ -5965,7 +7713,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { + !(i < (this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[vocabTrustPrefix] ?? 0) || + this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -6340,7 +8089,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[0]; if (!(v instanceof URL) && - !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { + !(0 < (this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[vocabTrustPrefix] ?? 0) || + this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#image"); @@ -6408,7 +8158,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { + !(0 < (this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[vocabTrustPrefix] ?? 0) || + this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -6498,7 +8249,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { + !(i < (this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[vocabTrustPrefix] ?? 0) || + this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#image"); @@ -6570,7 +8322,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { + !(i < (this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[vocabTrustPrefix] ?? 0) || + this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -6937,7 +8690,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[0]; if (!(v instanceof URL) && - !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { + !(0 < (this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[vocabTrustPrefix] ?? 0) || + this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#inReplyTo"); @@ -7005,7 +8759,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { + !(0 < (this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[vocabTrustPrefix] ?? 0) || + this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -7094,7 +8849,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { + !(i < (this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[vocabTrustPrefix] ?? 0) || + this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#inReplyTo"); @@ -7166,7 +8922,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { + !(i < (this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[vocabTrustPrefix] ?? 0) || + this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -7533,7 +9290,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[0]; if (!(v instanceof URL) && - !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { + !(0 < (this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[vocabTrustPrefix] ?? 0) || + this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#location"); @@ -7601,7 +9359,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { + !(0 < (this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[vocabTrustPrefix] ?? 0) || + this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -7690,7 +9449,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { + !(i < (this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[vocabTrustPrefix] ?? 0) || + this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#location"); @@ -7762,7 +9522,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { + !(i < (this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[vocabTrustPrefix] ?? 0) || + this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -8128,7 +9889,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[0]; if (!(v instanceof URL) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { + !(0 < (this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] ?? 0) || + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#preview"); @@ -8196,7 +9958,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { + !(0 < (this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] ?? 0) || + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -8284,7 +10047,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { + !(i < (this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] ?? 0) || + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#preview"); @@ -8356,7 +10120,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { + !(i < (this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] ?? 0) || + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -8721,7 +10486,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies[0]; if (!(v instanceof URL) && - !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { + !(0 < (this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies[vocabTrustPrefix] ?? 0) || + this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#replies"); @@ -8789,7 +10555,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { + !(0 < (this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies[vocabTrustPrefix] ?? 0) || + this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -9146,7 +10913,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[0]; if (!(v instanceof URL) && - !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { + !(0 < (this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares[vocabTrustPrefix] ?? 0) || + this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#shares"); @@ -9214,7 +10982,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { + !(0 < (this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares[vocabTrustPrefix] ?? 0) || + this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -9571,7 +11340,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[0]; if (!(v instanceof URL) && - !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { + !(0 < (this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[vocabTrustPrefix] ?? 0) || + this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#likes"); @@ -9639,7 +11409,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { + !(0 < (this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[vocabTrustPrefix] ?? 0) || + this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -9990,7 +11761,8 @@ get names(): ((string | LanguageString))[] { } let v = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[0]; if (!(v instanceof URL) && - !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { + !(0 < (this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[vocabTrustPrefix] ?? 0) || + this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "http://fedibird.com/ns#emojiReactions"); @@ -10058,7 +11830,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { + !(0 < (this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[vocabTrustPrefix] ?? 0) || + this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -10466,7 +12239,8 @@ get summaries(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { + !(i < (this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag[vocabTrustPrefix] ?? 0) || + this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#tag"); @@ -10538,7 +12312,8 @@ get summaries(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { + !(i < (this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag[vocabTrustPrefix] ?? 0) || + this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -10924,7 +12699,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[0]; if (!(v instanceof URL) && - !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { + !(0 < (this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[vocabTrustPrefix] ?? 0) || + this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#to"); @@ -10992,7 +12768,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { + !(0 < (this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[vocabTrustPrefix] ?? 0) || + this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -11081,7 +12858,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { + !(i < (this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[vocabTrustPrefix] ?? 0) || + this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#to"); @@ -11153,7 +12931,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { + !(i < (this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[vocabTrustPrefix] ?? 0) || + this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -11505,7 +13284,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[0]; if (!(v instanceof URL) && - !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { + !(0 < (this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[vocabTrustPrefix] ?? 0) || + this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#bto"); @@ -11573,7 +13353,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { + !(0 < (this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[vocabTrustPrefix] ?? 0) || + this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -11662,7 +13443,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { + !(i < (this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[vocabTrustPrefix] ?? 0) || + this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#bto"); @@ -11734,7 +13516,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { + !(i < (this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[vocabTrustPrefix] ?? 0) || + this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -12086,7 +13869,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[0]; if (!(v instanceof URL) && - !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { + !(0 < (this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[vocabTrustPrefix] ?? 0) || + this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#cc"); @@ -12154,7 +13938,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { + !(0 < (this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[vocabTrustPrefix] ?? 0) || + this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -12243,7 +14028,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { + !(i < (this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[vocabTrustPrefix] ?? 0) || + this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#cc"); @@ -12315,7 +14101,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { + !(i < (this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[vocabTrustPrefix] ?? 0) || + this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -12667,7 +14454,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[0]; if (!(v instanceof URL) && - !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { + !(0 < (this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[vocabTrustPrefix] ?? 0) || + this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#bcc"); @@ -12735,7 +14523,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { + !(0 < (this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[vocabTrustPrefix] ?? 0) || + this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -12824,7 +14613,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { + !(i < (this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[vocabTrustPrefix] ?? 0) || + this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#bcc"); @@ -12896,7 +14686,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { + !(i < (this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[vocabTrustPrefix] ?? 0) || + this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -13311,7 +15102,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[0]; if (!(v instanceof URL) && - !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { + !(0 < (this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[vocabTrustPrefix] ?? 0) || + this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#proof"); @@ -13379,7 +15171,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { + !(0 < (this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[vocabTrustPrefix] ?? 0) || + this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -13467,7 +15260,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { + !(i < (this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[vocabTrustPrefix] ?? 0) || + this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#proof"); @@ -13539,7 +15333,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { + !(i < (this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[vocabTrustPrefix] ?? 0) || + this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -13930,7 +15725,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { + !(0 < (this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://gotosocial.org/ns#likeAuthorization"); @@ -13998,7 +15794,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { + !(0 < (this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -14349,7 +16146,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { + !(0 < (this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://gotosocial.org/ns#replyAuthorization"); @@ -14417,7 +16215,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { + !(0 < (this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -14768,7 +16567,8 @@ get urls(): ((URL | Link))[] { } let v = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { + !(0 < (this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://gotosocial.org/ns#announceAuthorization"); @@ -14836,7 +16636,8 @@ get urls(): ((URL | Link))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { + !(0 < (this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -17048,7 +18849,7 @@ get licenses(): (URL)[] { let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _49BipA5dq9eoH8LX8xdsVumveTca_attachment: (Object | Link | PropertyValue | URL)[] = []; - const _trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment: Set = new Set(); + const _trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment: VocabTrustSet = new Set(); let _49BipA5dq9eoH8LX8xdsVumveTca_attachment__array = values["https://www.w3.org/ns/activitystreams#attachment"]; @@ -17100,7 +18901,7 @@ get licenses(): (URL)[] { instance.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment = _49BipA5dq9eoH8LX8xdsVumveTca_attachment; const _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo: Set = new Set(); + const _trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo: VocabTrustSet = new Set(); let _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo__array = values["https://www.w3.org/ns/activitystreams#attributedTo"]; @@ -17158,7 +18959,7 @@ get licenses(): (URL)[] { instance.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo = _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo; const _3ocC3VVi88cEd5sPWL8djkZsvTN6_audience: (Object | URL)[] = []; - const _trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience: Set = new Set(); + const _trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience: VocabTrustSet = new Set(); let _3ocC3VVi88cEd5sPWL8djkZsvTN6_audience__array = values["https://www.w3.org/ns/activitystreams#audience"]; @@ -17232,7 +19033,7 @@ get licenses(): (URL)[] { instance.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content; const _3mhZzGXSpQ431mBSz2kvych22v4e_context: (Object | Link | URL)[] = []; - const _trust_3mhZzGXSpQ431mBSz2kvych22v4e_context: Set = new Set(); + const _trust_3mhZzGXSpQ431mBSz2kvych22v4e_context: VocabTrustSet = new Set(); let _3mhZzGXSpQ431mBSz2kvych22v4e_context__array = values["https://www.w3.org/ns/activitystreams#context"]; @@ -17346,7 +19147,7 @@ get licenses(): (URL)[] { instance.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime = _219RwDanjScTv5tYCjwGZVCM7KZ9_endTime; const _86xFhmgBapoMvYqjbjRuDPayTrS_generator: (Object | Link | URL)[] = []; - const _trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator: Set = new Set(); + const _trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator: VocabTrustSet = new Set(); let _86xFhmgBapoMvYqjbjRuDPayTrS_generator__array = values["https://www.w3.org/ns/activitystreams#generator"]; @@ -17394,7 +19195,7 @@ get licenses(): (URL)[] { instance.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator = _86xFhmgBapoMvYqjbjRuDPayTrS_generator; const _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon: (Image | URL)[] = []; - const _trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon: Set = new Set(); + const _trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon: VocabTrustSet = new Set(); let _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon__array = values["https://www.w3.org/ns/activitystreams#icon"]; @@ -17458,7 +19259,7 @@ get licenses(): (URL)[] { instance.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon = _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon; const _3dXrUdkARxwyJLtJcYi1AJ92H41U_image: (Image | URL)[] = []; - const _trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image: Set = new Set(); + const _trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image: VocabTrustSet = new Set(); let _3dXrUdkARxwyJLtJcYi1AJ92H41U_image__array = values["https://www.w3.org/ns/activitystreams#image"]; @@ -17522,7 +19323,7 @@ get licenses(): (URL)[] { instance.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image = _3dXrUdkARxwyJLtJcYi1AJ92H41U_image; const _3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo: (Object | Link | URL)[] = []; - const _trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo: Set = new Set(); + const _trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo: VocabTrustSet = new Set(); let _3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo__array = values["https://www.w3.org/ns/activitystreams#inReplyTo"]; @@ -17570,7 +19371,7 @@ get licenses(): (URL)[] { instance.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo = _3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo; const _31k5MUZJsnsPNg8dQQJieWaXTFnR_location: (Object | Link | URL)[] = []; - const _trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location: Set = new Set(); + const _trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location: VocabTrustSet = new Set(); let _31k5MUZJsnsPNg8dQQJieWaXTFnR_location__array = values["https://www.w3.org/ns/activitystreams#location"]; @@ -17618,7 +19419,7 @@ get licenses(): (URL)[] { instance.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location = _31k5MUZJsnsPNg8dQQJieWaXTFnR_location; const _gCVTegXxWWCw6wWRxa1QF65zusg_preview: (Link | Object | URL)[] = []; - const _trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: Set = new Set(); + const _trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: VocabTrustSet = new Set(); let _gCVTegXxWWCw6wWRxa1QF65zusg_preview__array = values["https://www.w3.org/ns/activitystreams#preview"]; @@ -17699,7 +19500,7 @@ get licenses(): (URL)[] { instance.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published = _5e258TDXtuhaFRPZiGoDfEpjdMr_published; const _7UpwM3JWcXhADcscukEehBorf6k_replies: (Collection | URL)[] = []; - const _trust_7UpwM3JWcXhADcscukEehBorf6k_replies: Set = new Set(); + const _trust_7UpwM3JWcXhADcscukEehBorf6k_replies: VocabTrustSet = new Set(); let _7UpwM3JWcXhADcscukEehBorf6k_replies__array = values["https://www.w3.org/ns/activitystreams#replies"]; @@ -17740,7 +19541,7 @@ get licenses(): (URL)[] { instance.#_7UpwM3JWcXhADcscukEehBorf6k_replies = _7UpwM3JWcXhADcscukEehBorf6k_replies; const _3kAfck9PcEYt2L7xug5y99YPbANs_shares: (Collection | URL)[] = []; - const _trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares: Set = new Set(); + const _trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares: VocabTrustSet = new Set(); let _3kAfck9PcEYt2L7xug5y99YPbANs_shares__array = values["https://www.w3.org/ns/activitystreams#shares"]; @@ -17781,7 +19582,7 @@ get licenses(): (URL)[] { instance.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares = _3kAfck9PcEYt2L7xug5y99YPbANs_shares; const _S3ceDnpMdzoTRCccB9FkJWrEzYW_likes: (Collection | URL)[] = []; - const _trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes: Set = new Set(); + const _trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes: VocabTrustSet = new Set(); let _S3ceDnpMdzoTRCccB9FkJWrEzYW_likes__array = values["https://www.w3.org/ns/activitystreams#likes"]; @@ -17822,7 +19623,7 @@ get licenses(): (URL)[] { instance.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes = _S3ceDnpMdzoTRCccB9FkJWrEzYW_likes; const _kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions: (Collection | URL)[] = []; - const _trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions: Set = new Set(); + const _trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions: VocabTrustSet = new Set(); let _kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions__array = values["http://fedibird.com/ns#emojiReactions"]; @@ -17929,7 +19730,7 @@ get licenses(): (URL)[] { instance.#_4LqirZspQbFWWQEbFcXAxm7tTDN1_summary = _4LqirZspQbFWWQEbFcXAxm7tTDN1_summary; const _5chuqj6s95p5gg2sk1HntGfarRf_tag: (Object | Link | URL)[] = []; - const _trust_5chuqj6s95p5gg2sk1HntGfarRf_tag: Set = new Set(); + const _trust_5chuqj6s95p5gg2sk1HntGfarRf_tag: VocabTrustSet = new Set(); let _5chuqj6s95p5gg2sk1HntGfarRf_tag__array = values["https://www.w3.org/ns/activitystreams#tag"]; @@ -18046,7 +19847,7 @@ get licenses(): (URL)[] { instance.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = _2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; const _3hFbw7DTpHhq3cvVhkY8njhcsXbd_to: (Object | URL)[] = []; - const _trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to: Set = new Set(); + const _trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to: VocabTrustSet = new Set(); let _3hFbw7DTpHhq3cvVhkY8njhcsXbd_to__array = values["https://www.w3.org/ns/activitystreams#to"]; @@ -18087,7 +19888,7 @@ get licenses(): (URL)[] { instance.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to = _3hFbw7DTpHhq3cvVhkY8njhcsXbd_to; const _aLZupjwL8XB7tzdLgCMXdjZ6qej_bto: (Object | URL)[] = []; - const _trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto: Set = new Set(); + const _trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto: VocabTrustSet = new Set(); let _aLZupjwL8XB7tzdLgCMXdjZ6qej_bto__array = values["https://www.w3.org/ns/activitystreams#bto"]; @@ -18128,7 +19929,7 @@ get licenses(): (URL)[] { instance.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto = _aLZupjwL8XB7tzdLgCMXdjZ6qej_bto; const _42a1SvBs24QSLzKcfjCyNTjW5a1g_cc: (Object | URL)[] = []; - const _trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc: Set = new Set(); + const _trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc: VocabTrustSet = new Set(); let _42a1SvBs24QSLzKcfjCyNTjW5a1g_cc__array = values["https://www.w3.org/ns/activitystreams#cc"]; @@ -18169,7 +19970,7 @@ get licenses(): (URL)[] { instance.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc = _42a1SvBs24QSLzKcfjCyNTjW5a1g_cc; const _3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc: (Object | URL)[] = []; - const _trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc: Set = new Set(); + const _trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc: VocabTrustSet = new Set(); let _3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc__array = values["https://www.w3.org/ns/activitystreams#bcc"]; @@ -18329,7 +20130,7 @@ get licenses(): (URL)[] { instance.#_2ZwCFoS787v8y8bXKjMoE6MAbrEB_source = _2ZwCFoS787v8y8bXKjMoE6MAbrEB_source; const _42rPnotok1ivQ2RNCKNbeFJgx8b8_proof: (DataIntegrityProof | URL)[] = []; - const _trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof: Set = new Set(); + const _trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof: VocabTrustSet = new Set(); let _42rPnotok1ivQ2RNCKNbeFJgx8b8_proof__array = values["https://w3id.org/security#proof"]; @@ -18436,7 +20237,7 @@ get licenses(): (URL)[] { instance.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy = _23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy; const _3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization: (LikeAuthorization | URL)[] = []; - const _trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization: Set = new Set(); + const _trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization: VocabTrustSet = new Set(); let _3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization__array = values["https://gotosocial.org/ns#likeAuthorization"]; @@ -18477,7 +20278,7 @@ get licenses(): (URL)[] { instance.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization = _3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization; const _YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization: (ReplyAuthorization | URL)[] = []; - const _trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization: Set = new Set(); + const _trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization: VocabTrustSet = new Set(); let _YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization__array = values["https://gotosocial.org/ns#replyAuthorization"]; @@ -18518,7 +20319,7 @@ get licenses(): (URL)[] { instance.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization = _YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization; const _446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization: (AnnounceAuthorization | URL)[] = []; - const _trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization: Set = new Set(); + const _trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization: VocabTrustSet = new Set(); let _446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization__array = values["https://gotosocial.org/ns#announceAuthorization"]; @@ -19725,6 +21526,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -20114,11 +21921,11 @@ export class ChatMessage extends Object { } #_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); #_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl: (URL)[] = []; #_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); /** * Constructs a new instance of ChatMessage with the given values. @@ -20259,12 +22066,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as ChatMessage;clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice();clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote); + const clone = super.clone(values, options) as unknown as ChatMessage;clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < vocabSparseArrayMinimumLength + ? this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice() : vocabCopyPropertyArray(this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote);clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = vocabCopyTrustSet( + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, + ); if ("quote" in values && values.quote != null) { if (values.quote instanceof Object || values.quote instanceof URL) { // @ts-ignore: type is checked above. clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = [values.quote]; - clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set([0]); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] = 1; } else { throw new TypeError( "The quote must be of type " + @@ -20272,7 +22083,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice(); + clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length < vocabSparseArrayMinimumLength + ? this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice() : vocabCopyPropertyArray(this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl); if ("quoteUrl" in values && values.quoteUrl != null) { if (values.quoteUrl instanceof URL) { // @ts-ignore: type is checked above. @@ -20285,12 +22097,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice();clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization); + clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice() : vocabCopyPropertyArray(this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization);clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = vocabCopyTrustSet( + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, + ); if ("quoteAuthorization" in values && values.quoteAuthorization != null) { if (values.quoteAuthorization instanceof QuoteAuthorization || values.quoteAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = [values.quoteAuthorization]; - clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set([0]); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( "The quoteAuthorization must be of type " + @@ -20324,6 +22140,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -20373,24 +22195,69 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as ChatMessage; - for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { - const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; - if (value != null && typeof value === "object") { - node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + { + const array = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === "object") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { - const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; - if (value != null && typeof value === "object") { - node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + { + const array = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === "object") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { - const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; - if (value != null && typeof value === "object") { - node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + { + const array = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === "object") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } } } } }); } @@ -20723,7 +22590,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/044f#quote"); @@ -20791,7 +22659,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -21165,7 +23034,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/044f#quoteAuthorization"); @@ -21233,7 +23103,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -21660,7 +23531,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); let _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote__array = values["https://w3id.org/fep/044f#quote"]; @@ -21740,7 +23611,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; const _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); let _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization__array = values["https://w3id.org/fep/044f#quoteAuthorization"]; @@ -21915,22 +23786,22 @@ export class Activity extends Object { } #_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor: Set = new Set(); + #_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor: VocabTrustSet = new Set(); #_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: (Object | URL)[] = []; - #_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: Set = new Set(); + #_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: VocabTrustSet = new Set(); #_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target: (Object | URL)[] = []; - #_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target: Set = new Set(); + #_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target: VocabTrustSet = new Set(); #_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result: (Object | URL)[] = []; - #_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result: Set = new Set(); + #_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result: VocabTrustSet = new Set(); #_25zu2s3VxVujgEKqrDycjE284XQR_origin: (Object | URL)[] = []; - #_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin: Set = new Set(); + #_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin: VocabTrustSet = new Set(); #_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument: (Object | URL)[] = []; - #_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument: Set = new Set(); + #_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument: VocabTrustSet = new Set(); /** * Constructs a new instance of Activity with the given values. @@ -21996,14 +23867,36 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.actors) && - values.actors.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.actors)) { + const array = values.actors; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.actors; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = values.actors.slice(); + this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = copied; - for (let i = 0; i < values.actors.length; i++) { - this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.add(i); - } + vocabSetTrustPrefix(this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor, this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length); } else { throw new TypeError( @@ -22036,14 +23929,36 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.objects) && - values.objects.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.objects)) { + const array = values.objects; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.objects; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = values.objects.slice(); + this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = copied; - for (let i = 0; i < values.objects.length; i++) { - this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.add(i); - } + vocabSetTrustPrefix(this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length); } else { throw new TypeError( @@ -22076,14 +23991,36 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.targets) && - values.targets.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.targets)) { + const array = values.targets; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.targets; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = values.targets.slice(); + this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = copied; - for (let i = 0; i < values.targets.length; i++) { - this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.add(i); - } + vocabSetTrustPrefix(this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target, this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length); } else { throw new TypeError( @@ -22116,14 +24053,36 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.results) && - values.results.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.results)) { + const array = values.results; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.results; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = values.results.slice(); + this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = copied; - for (let i = 0; i < values.results.length; i++) { - this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.add(i); - } + vocabSetTrustPrefix(this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result, this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length); } else { throw new TypeError( @@ -22156,14 +24115,36 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.origins) && - values.origins.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.origins)) { + const array = values.origins; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.origins; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = values.origins.slice(); + this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = copied; - for (let i = 0; i < values.origins.length; i++) { - this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.add(i); - } + vocabSetTrustPrefix(this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin, this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length); } else { throw new TypeError( @@ -22196,14 +24177,36 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.instruments) && - values.instruments.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.instruments)) { + const array = values.instruments; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.instruments; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = values.instruments.slice(); + this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = copied; - for (let i = 0; i < values.instruments.length; i++) { - this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.add(i); - } + vocabSetTrustPrefix(this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument, this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length); } else { throw new TypeError( @@ -22284,12 +24287,16 @@ instruments?: (Object | URL)[];} // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Activity;clone.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.slice();clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = new Set(this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor); + const clone = super.clone(values, options) as unknown as Activity;clone.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length < vocabSparseArrayMinimumLength + ? this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.slice() : vocabCopyPropertyArray(this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor);clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = vocabCopyTrustSet( + this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor, clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor, + ); if ("actor" in values && values.actor != null) { if (values.actor instanceof Application || values.actor instanceof Group || values.actor instanceof Organization || values.actor instanceof Person || values.actor instanceof Service || values.actor instanceof URL) { // @ts-ignore: type is checked above. clone.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = [values.actor]; - clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = new Set([0]); + clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = new Set(); + clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[vocabTrustPrefix] = 1; } else { throw new TypeError( "The actor must be of type " + @@ -22308,15 +24315,37 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.actors) && - values.actors.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.actors)) { + const array = values.actors; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.actors; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = values.actors.slice(); + clone.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = copied; clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = new Set(); - for (let i = 0; i < values.actors.length; i++) { - clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor, clone.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length); } else { throw new TypeError( @@ -22325,12 +24354,16 @@ instruments?: (Object | URL)[];} ); } } - clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.slice();clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set(this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object); + clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length < vocabSparseArrayMinimumLength + ? this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.slice() : vocabCopyPropertyArray(this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object);clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = vocabCopyTrustSet( + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, + ); if ("object" in values && values.object != null) { if (values.object instanceof Object || values.object instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = [values.object]; - clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set([0]); + clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set(); + clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] = 1; } else { throw new TypeError( "The object must be of type " + @@ -22349,15 +24382,37 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.objects) && - values.objects.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.objects)) { + const array = values.objects; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.objects; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = values.objects.slice(); + clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = copied; clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set(); - for (let i = 0; i < values.objects.length; i++) { - clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length); } else { throw new TypeError( @@ -22366,12 +24421,16 @@ instruments?: (Object | URL)[];} ); } } - clone.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.slice();clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = new Set(this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target); + clone.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length < vocabSparseArrayMinimumLength + ? this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.slice() : vocabCopyPropertyArray(this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target);clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = vocabCopyTrustSet( + this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target, clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target, + ); if ("target" in values && values.target != null) { if (values.target instanceof Object || values.target instanceof URL) { // @ts-ignore: type is checked above. clone.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = [values.target]; - clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = new Set([0]); + clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = new Set(); + clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[vocabTrustPrefix] = 1; } else { throw new TypeError( "The target must be of type " + @@ -22390,15 +24449,37 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.targets) && - values.targets.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.targets)) { + const array = values.targets; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.targets; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = values.targets.slice(); + clone.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = copied; clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = new Set(); - for (let i = 0; i < values.targets.length; i++) { - clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target, clone.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length); } else { throw new TypeError( @@ -22407,12 +24488,16 @@ instruments?: (Object | URL)[];} ); } } - clone.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.slice();clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = new Set(this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result); + clone.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length < vocabSparseArrayMinimumLength + ? this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.slice() : vocabCopyPropertyArray(this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result);clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = vocabCopyTrustSet( + this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result, clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result, + ); if ("result" in values && values.result != null) { if (values.result instanceof Object || values.result instanceof URL) { // @ts-ignore: type is checked above. clone.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = [values.result]; - clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = new Set([0]); + clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = new Set(); + clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[vocabTrustPrefix] = 1; } else { throw new TypeError( "The result must be of type " + @@ -22431,15 +24516,37 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.results) && - values.results.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.results)) { + const array = values.results; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.results; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = values.results.slice(); + clone.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = copied; clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = new Set(); - for (let i = 0; i < values.results.length; i++) { - clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.add(i); - } + vocabSetTrustPrefix(clone.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result, clone.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length); } else { throw new TypeError( @@ -22448,12 +24555,16 @@ instruments?: (Object | URL)[];} ); } } - clone.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.slice();clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin = new Set(this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin); + clone.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length < vocabSparseArrayMinimumLength + ? this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.slice() : vocabCopyPropertyArray(this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin);clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin = vocabCopyTrustSet( + this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin, clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin, + ); if ("origin" in values && values.origin != null) { if (values.origin instanceof Object || values.origin instanceof URL) { // @ts-ignore: type is checked above. clone.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = [values.origin]; - clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin = new Set([0]); + clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin = new Set(); + clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin[vocabTrustPrefix] = 1; } else { throw new TypeError( "The origin must be of type " + @@ -22472,15 +24583,37 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.origins) && - values.origins.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.origins)) { + const array = values.origins; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.origins; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = values.origins.slice(); + clone.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = copied; clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin = new Set(); - for (let i = 0; i < values.origins.length; i++) { - clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.add(i); - } + vocabSetTrustPrefix(clone.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin, clone.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length); } else { throw new TypeError( @@ -22489,12 +24622,16 @@ instruments?: (Object | URL)[];} ); } } - clone.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.slice();clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = new Set(this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument); + clone.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length < vocabSparseArrayMinimumLength + ? this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.slice() : vocabCopyPropertyArray(this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument);clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = vocabCopyTrustSet( + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument, clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument, + ); if ("instrument" in values && values.instrument != null) { if (values.instrument instanceof Object || values.instrument instanceof URL) { // @ts-ignore: type is checked above. clone.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = [values.instrument]; - clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = new Set([0]); + clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = new Set(); + clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] = 1; } else { throw new TypeError( "The instrument must be of type " + @@ -22513,15 +24650,37 @@ instruments?: (Object | URL)[];} ); } - if (Array.isArray(values.instruments) && - values.instruments.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.instruments)) { + const array = values.instruments; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.instruments; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = values.instruments.slice(); + clone.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = copied; clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument = new Set(); - for (let i = 0; i < values.instruments.length; i++) { - clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument, clone.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length); } else { throw new TypeError( @@ -22556,6 +24715,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -22611,45 +24776,135 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Activity; - for (let i = 0; i < node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length; i++) { - const value = node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[i]; - if (value != null && typeof value === "object") { - node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[i] = context.value(value); + { + const array = node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length; i++) { + const value = node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[i]; + if (value != null && typeof value === "object") { + node.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length; i++) { - const value = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i]; - if (value != null && typeof value === "object") { - node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i] = context.value(value); + { + const array = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length; i++) { + const value = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i]; + if (value != null && typeof value === "object") { + node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length; i++) { - const value = node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[i]; - if (value != null && typeof value === "object") { - node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[i] = context.value(value); + { + const array = node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length; i++) { + const value = node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[i]; + if (value != null && typeof value === "object") { + node.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length; i++) { - const value = node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[i]; - if (value != null && typeof value === "object") { - node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[i] = context.value(value); + { + const array = node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length; i++) { + const value = node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[i]; + if (value != null && typeof value === "object") { + node.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length; i++) { - const value = node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[i]; - if (value != null && typeof value === "object") { - node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[i] = context.value(value); + { + const array = node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length; i++) { + const value = node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[i]; + if (value != null && typeof value === "object") { + node.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length; i++) { - const value = node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[i]; - if (value != null && typeof value === "object") { - node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[i] = context.value(value); + { + const array = node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length; i++) { + const value = node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[i]; + if (value != null && typeof value === "object") { + node.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[i] = context.value(value); + } + } } } } }); } @@ -23042,7 +25297,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[0]; if (!(v instanceof URL) && - !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { + !(0 < (this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[vocabTrustPrefix] ?? 0) || + this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#actor"); @@ -23110,7 +25366,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { + !(0 < (this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[vocabTrustPrefix] ?? 0) || + this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -23200,7 +25457,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { + !(i < (this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[vocabTrustPrefix] ?? 0) || + this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#actor"); @@ -23272,7 +25530,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { + !(i < (this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[vocabTrustPrefix] ?? 0) || + this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -23625,7 +25884,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (!(v instanceof URL) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { + !(0 < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#object"); @@ -23693,7 +25953,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { + !(0 < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -23783,7 +26044,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { + !(i < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#object"); @@ -23855,7 +26117,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { + !(i < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -24211,7 +26474,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[0]; if (!(v instanceof URL) && - !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { + !(0 < (this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[vocabTrustPrefix] ?? 0) || + this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#target"); @@ -24279,7 +26543,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { + !(0 < (this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[vocabTrustPrefix] ?? 0) || + this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -24372,7 +26637,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { + !(i < (this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[vocabTrustPrefix] ?? 0) || + this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#target"); @@ -24444,7 +26710,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { + !(i < (this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[vocabTrustPrefix] ?? 0) || + this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -24797,7 +27064,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[0]; if (!(v instanceof URL) && - !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { + !(0 < (this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[vocabTrustPrefix] ?? 0) || + this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#result"); @@ -24865,7 +27133,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { + !(0 < (this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[vocabTrustPrefix] ?? 0) || + this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -24955,7 +27224,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { + !(i < (this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[vocabTrustPrefix] ?? 0) || + this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#result"); @@ -25027,7 +27297,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { + !(i < (this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[vocabTrustPrefix] ?? 0) || + this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -25381,7 +27652,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[0]; if (!(v instanceof URL) && - !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { + !(0 < (this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin[vocabTrustPrefix] ?? 0) || + this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#origin"); @@ -25449,7 +27721,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { + !(0 < (this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin[vocabTrustPrefix] ?? 0) || + this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -25540,7 +27813,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { + !(i < (this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin[vocabTrustPrefix] ?? 0) || + this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#origin"); @@ -25612,7 +27886,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { + !(i < (this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin[vocabTrustPrefix] ?? 0) || + this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -25964,7 +28239,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[0]; if (!(v instanceof URL) && - !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { + !(0 < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#instrument"); @@ -26032,7 +28308,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { + !(0 < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -26121,7 +28398,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { + !(i < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#instrument"); @@ -26193,7 +28471,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { + !(i < (this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[vocabTrustPrefix] ?? 0) || + this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -26732,7 +29011,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor: Set = new Set(); + const _trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor: VocabTrustSet = new Set(); let _2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor__array = values["https://www.w3.org/ns/activitystreams#actor"]; @@ -26790,7 +29069,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor = _2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor; const _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: (Object | URL)[] = []; - const _trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: Set = new Set(); + const _trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: VocabTrustSet = new Set(); let _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object__array = values["https://www.w3.org/ns/activitystreams#object"]; @@ -26831,7 +29110,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; const _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target: (Object | URL)[] = []; - const _trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target: Set = new Set(); + const _trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target: VocabTrustSet = new Set(); let _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target__array = values["https://www.w3.org/ns/activitystreams#target"]; @@ -26872,7 +29151,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target = _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target; const _u4QGFbRFcYmPEKGbPv1hpBR9r5G_result: (Object | URL)[] = []; - const _trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result: Set = new Set(); + const _trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result: VocabTrustSet = new Set(); let _u4QGFbRFcYmPEKGbPv1hpBR9r5G_result__array = values["https://www.w3.org/ns/activitystreams#result"]; @@ -26913,7 +29192,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result = _u4QGFbRFcYmPEKGbPv1hpBR9r5G_result; const _25zu2s3VxVujgEKqrDycjE284XQR_origin: (Object | URL)[] = []; - const _trust_25zu2s3VxVujgEKqrDycjE284XQR_origin: Set = new Set(); + const _trust_25zu2s3VxVujgEKqrDycjE284XQR_origin: VocabTrustSet = new Set(); let _25zu2s3VxVujgEKqrDycjE284XQR_origin__array = values["https://www.w3.org/ns/activitystreams#origin"]; @@ -26954,7 +29233,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_25zu2s3VxVujgEKqrDycjE284XQR_origin = _25zu2s3VxVujgEKqrDycjE284XQR_origin; const _3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument: (Object | URL)[] = []; - const _trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument: Set = new Set(); + const _trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument: VocabTrustSet = new Set(); let _3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument__array = values["https://www.w3.org/ns/activitystreams#instrument"]; @@ -27358,6 +29637,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -27919,7 +30204,8 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} options ); copyPortableProvenance(this, clone); - clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice(); + clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.length < vocabSparseArrayMinimumLength + ? this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice() : vocabCopyPropertyArray(this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name); if ("name" in values && values.name != null) { if (typeof values.name === "string" || values.name instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -27932,7 +30218,8 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} ); } } - clone.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value = this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value.slice(); + clone.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value = this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value.length < vocabSparseArrayMinimumLength + ? this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value.slice() : vocabCopyPropertyArray(this.#_2cSy2magg4iZ7zLaG8U7DiJMoCkx_value); if ("value" in values && values.value != null) { if (typeof values.value === "string" || values.value instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -27971,6 +30258,12 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -28757,7 +31050,8 @@ unit?: string | null;numericalValue?: Decimal | null;} options ); copyPortableProvenance(this, clone); - clone.#_27fgyFbosTtMAhuepJH8K3ZGURT6 = this.#_27fgyFbosTtMAhuepJH8K3ZGURT6.slice(); + clone.#_27fgyFbosTtMAhuepJH8K3ZGURT6 = this.#_27fgyFbosTtMAhuepJH8K3ZGURT6.length < vocabSparseArrayMinimumLength + ? this.#_27fgyFbosTtMAhuepJH8K3ZGURT6.slice() : vocabCopyPropertyArray(this.#_27fgyFbosTtMAhuepJH8K3ZGURT6); if ("unit" in values && values.unit != null) { if (typeof values.unit === "string") { // @ts-ignore: type is checked above. @@ -28770,7 +31064,8 @@ unit?: string | null;numericalValue?: Decimal | null;} ); } } - clone.#_1GQx8o2RgxRs4x9G5uT39XYBv7D = this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D.slice(); + clone.#_1GQx8o2RgxRs4x9G5uT39XYBv7D = this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D.length < vocabSparseArrayMinimumLength + ? this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D.slice() : vocabCopyPropertyArray(this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D); if ("numericalValue" in values && values.numericalValue != null) { if (typeof values.numericalValue === "string" && isDecimal(values.numericalValue)) { // @ts-ignore: type is checked above. @@ -28809,6 +31104,12 @@ unit?: string | null;numericalValue?: Decimal | null;} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -29391,10 +31692,10 @@ export class AnnounceAuthorization extends Object { } #_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); #_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); /** * Constructs a new instance of AnnounceAuthorization with the given values. @@ -29522,12 +31823,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as AnnounceAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice();clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject); + const clone = super.clone(values, options) as unknown as AnnounceAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < vocabSparseArrayMinimumLength + ? this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice() : vocabCopyPropertyArray(this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject);clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = vocabCopyTrustSet( + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, + ); if ("interactingObject" in values && values.interactingObject != null) { if (values.interactingObject instanceof Object || values.interactingObject instanceof URL) { // @ts-ignore: type is checked above. clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = [values.interactingObject]; - clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set([0]); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] = 1; } else { throw new TypeError( "The interactingObject must be of type " + @@ -29535,12 +31840,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice();clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget); + clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < vocabSparseArrayMinimumLength + ? this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice() : vocabCopyPropertyArray(this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget);clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = vocabCopyTrustSet( + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, + ); if ("interactionTarget" in values && values.interactionTarget != null) { if (values.interactionTarget instanceof Object || values.interactionTarget instanceof URL) { // @ts-ignore: type is checked above. clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = [values.interactionTarget]; - clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set([0]); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] = 1; } else { throw new TypeError( "The interactionTarget must be of type " + @@ -29574,6 +31883,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -29623,17 +31938,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as AnnounceAuthorization; - for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { - const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; - if (value != null && typeof value === "object") { - node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + { + const array = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === "object") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { - const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; - if (value != null && typeof value === "object") { - node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + { + const array = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === "object") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } } } } }); } @@ -29965,7 +32310,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://gotosocial.org/ns#interactingObject"); @@ -30033,7 +32379,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -30383,7 +32730,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://gotosocial.org/ns#interactionTarget"); @@ -30451,7 +32799,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -30828,7 +33177,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); let _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject__array = values["https://gotosocial.org/ns#interactingObject"]; @@ -30869,7 +33218,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; const _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); let _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget__array = values["https://gotosocial.org/ns#interactionTarget"]; @@ -31167,6 +33516,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -31777,7 +34132,8 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: options ); copyPortableProvenance(this, clone); - clone.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature = this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.slice(); + clone.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature = this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.length < vocabSparseArrayMinimumLength + ? this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.slice() : vocabCopyPropertyArray(this.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature); if ("canFeature" in values && values.canFeature != null) { if (values.canFeature instanceof InteractionRule) { // @ts-ignore: type is checked above. @@ -31790,7 +34146,8 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: ); } } - clone.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike = this.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.slice(); + clone.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike = this.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.length < vocabSparseArrayMinimumLength + ? this.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.slice() : vocabCopyPropertyArray(this.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike); if ("canLike" in values && values.canLike != null) { if (values.canLike instanceof InteractionRule) { // @ts-ignore: type is checked above. @@ -31803,7 +34160,8 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: ); } } - clone.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply = this.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.slice(); + clone.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply = this.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.length < vocabSparseArrayMinimumLength + ? this.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.slice() : vocabCopyPropertyArray(this.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply); if ("canReply" in values && values.canReply != null) { if (values.canReply instanceof InteractionRule) { // @ts-ignore: type is checked above. @@ -31816,7 +34174,8 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: ); } } - clone.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce = this.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.slice(); + clone.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce = this.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.length < vocabSparseArrayMinimumLength + ? this.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.slice() : vocabCopyPropertyArray(this.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce); if ("canAnnounce" in values && values.canAnnounce != null) { if (values.canAnnounce instanceof InteractionRule) { // @ts-ignore: type is checked above. @@ -31829,7 +34188,8 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: ); } } - clone.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote = this.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.slice(); + clone.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote = this.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.length < vocabSparseArrayMinimumLength + ? this.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.slice() : vocabCopyPropertyArray(this.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote); if ("canQuote" in values && values.canQuote != null) { if (values.canQuote instanceof InteractionRule) { // @ts-ignore: type is checked above. @@ -31868,6 +34228,12 @@ canFeature?: InteractionRule | null;canLike?: InteractionRule | null;canReply?: * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -31911,38 +34277,113 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.length; i++) { - const value = node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature[i]; - if (value != null && typeof value === "object") { - node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature[i] = context.value(value); + { + const array = node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature.length; i++) { + const value = node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature[i]; + if (value != null && typeof value === "object") { + node.#_2hdwkUHmthzVPdo1ttxKsP7AGKka_canFeature[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.length; i++) { - const value = node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike[i]; - if (value != null && typeof value === "object") { - node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike[i] = context.value(value); + { + const array = node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.length; i++) { + const value = node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike[i]; + if (value != null && typeof value === "object") { + node.#_3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.length; i++) { - const value = node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply[i]; - if (value != null && typeof value === "object") { - node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply[i] = context.value(value); + { + const array = node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.length; i++) { + const value = node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply[i]; + if (value != null && typeof value === "object") { + node.#_2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.length; i++) { - const value = node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce[i]; - if (value != null && typeof value === "object") { - node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce[i] = context.value(value); + { + const array = node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.length; i++) { + const value = node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce[i]; + if (value != null && typeof value === "object") { + node.#_fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.length; i++) { - const value = node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote[i]; - if (value != null && typeof value === "object") { - node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote[i] = context.value(value); + { + const array = node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.length; i++) { + const value = node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote[i]; + if (value != null && typeof value === "object") { + node.#_LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote[i] = context.value(value); + } + } } } } }); } @@ -32881,10 +35322,34 @@ manualApprovals?: (URL)[];} ); } - if (Array.isArray(values.automaticApprovals) && - values.automaticApprovals.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.automaticApprovals)) { + const array = values.automaticApprovals; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.automaticApprovals; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = values.automaticApprovals.slice(); + this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = copied; } else { throw new TypeError( @@ -32917,10 +35382,34 @@ manualApprovals?: (URL)[];} ); } - if (Array.isArray(values.manualApprovals) && - values.manualApprovals.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.manualApprovals)) { + const array = values.manualApprovals; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.manualApprovals; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = values.manualApprovals.slice(); + this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = copied; } else { throw new TypeError( @@ -32988,7 +35477,8 @@ manualApprovals?: (URL)[];} options ); copyPortableProvenance(this, clone); - clone.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.slice(); + clone.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.length < vocabSparseArrayMinimumLength + ? this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.slice() : vocabCopyPropertyArray(this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval); if ("automaticApproval" in values && values.automaticApproval != null) { if (values.automaticApproval instanceof URL) { // @ts-ignore: type is checked above. @@ -33012,10 +35502,34 @@ manualApprovals?: (URL)[];} ); } - if (Array.isArray(values.automaticApprovals) && - values.automaticApprovals.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.automaticApprovals)) { + const array = values.automaticApprovals; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.automaticApprovals; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = values.automaticApprovals.slice(); + clone.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval = copied; } else { throw new TypeError( @@ -33024,7 +35538,8 @@ manualApprovals?: (URL)[];} ); } } - clone.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.slice(); + clone.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.length < vocabSparseArrayMinimumLength + ? this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.slice() : vocabCopyPropertyArray(this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval); if ("manualApproval" in values && values.manualApproval != null) { if (values.manualApproval instanceof URL) { // @ts-ignore: type is checked above. @@ -33048,10 +35563,34 @@ manualApprovals?: (URL)[];} ); } - if (Array.isArray(values.manualApprovals) && - values.manualApprovals.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.manualApprovals)) { + const array = values.manualApprovals; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.manualApprovals; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = values.manualApprovals.slice(); + clone.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval = copied; } else { throw new TypeError( @@ -33086,6 +35625,12 @@ manualApprovals?: (URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -33131,17 +35676,47 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.length; i++) { - const value = node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval[i]; - if (value != null && typeof value === "object") { - node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval[i] = context.value(value); + { + const array = node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.length; i++) { + const value = node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval[i]; + if (value != null && typeof value === "object") { + node.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.length; i++) { - const value = node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval[i]; - if (value != null && typeof value === "object") { - node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval[i] = context.value(value); + { + const array = node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.length; i++) { + const value = node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval[i]; + if (value != null && typeof value === "object") { + node.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval[i] = context.value(value); + } + } } } } }); } @@ -33665,10 +36240,10 @@ export class LikeAuthorization extends Object { } #_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); #_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); /** * Constructs a new instance of LikeAuthorization with the given values. @@ -33796,12 +36371,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as LikeAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice();clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject); + const clone = super.clone(values, options) as unknown as LikeAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < vocabSparseArrayMinimumLength + ? this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice() : vocabCopyPropertyArray(this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject);clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = vocabCopyTrustSet( + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, + ); if ("interactingObject" in values && values.interactingObject != null) { if (values.interactingObject instanceof Object || values.interactingObject instanceof URL) { // @ts-ignore: type is checked above. clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = [values.interactingObject]; - clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set([0]); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] = 1; } else { throw new TypeError( "The interactingObject must be of type " + @@ -33809,12 +36388,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice();clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget); + clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < vocabSparseArrayMinimumLength + ? this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice() : vocabCopyPropertyArray(this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget);clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = vocabCopyTrustSet( + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, + ); if ("interactionTarget" in values && values.interactionTarget != null) { if (values.interactionTarget instanceof Object || values.interactionTarget instanceof URL) { // @ts-ignore: type is checked above. clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = [values.interactionTarget]; - clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set([0]); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] = 1; } else { throw new TypeError( "The interactionTarget must be of type " + @@ -33848,6 +36431,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -33897,17 +36486,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as LikeAuthorization; - for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { - const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; - if (value != null && typeof value === "object") { - node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + { + const array = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === "object") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { - const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; - if (value != null && typeof value === "object") { - node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + { + const array = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === "object") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } } } } }); } @@ -34239,7 +36858,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://gotosocial.org/ns#interactingObject"); @@ -34307,7 +36927,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -34657,7 +37278,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://gotosocial.org/ns#interactionTarget"); @@ -34725,7 +37347,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -35102,7 +37725,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); let _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject__array = values["https://gotosocial.org/ns#interactingObject"]; @@ -35143,7 +37766,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; const _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); let _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget__array = values["https://gotosocial.org/ns#interactionTarget"]; @@ -35440,6 +38063,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -35819,10 +38448,10 @@ export class ReplyAuthorization extends Object { } #_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); #_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); /** * Constructs a new instance of ReplyAuthorization with the given values. @@ -35950,12 +38579,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as ReplyAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice();clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject); + const clone = super.clone(values, options) as unknown as ReplyAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < vocabSparseArrayMinimumLength + ? this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice() : vocabCopyPropertyArray(this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject);clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = vocabCopyTrustSet( + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, + ); if ("interactingObject" in values && values.interactingObject != null) { if (values.interactingObject instanceof Object || values.interactingObject instanceof URL) { // @ts-ignore: type is checked above. clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = [values.interactingObject]; - clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set([0]); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] = 1; } else { throw new TypeError( "The interactingObject must be of type " + @@ -35963,12 +38596,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice();clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget); + clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < vocabSparseArrayMinimumLength + ? this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice() : vocabCopyPropertyArray(this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget);clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = vocabCopyTrustSet( + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, + ); if ("interactionTarget" in values && values.interactionTarget != null) { if (values.interactionTarget instanceof Object || values.interactionTarget instanceof URL) { // @ts-ignore: type is checked above. clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = [values.interactionTarget]; - clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set([0]); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] = 1; } else { throw new TypeError( "The interactionTarget must be of type " + @@ -36002,6 +38639,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -36051,17 +38694,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as ReplyAuthorization; - for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { - const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; - if (value != null && typeof value === "object") { - node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + { + const array = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === "object") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { - const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; - if (value != null && typeof value === "object") { - node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + { + const array = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === "object") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } } } } }); } @@ -36393,7 +39066,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://gotosocial.org/ns#interactingObject"); @@ -36461,7 +39135,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -36811,7 +39486,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://gotosocial.org/ns#interactionTarget"); @@ -36879,7 +39555,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -37256,7 +39933,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); let _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject__array = values["https://gotosocial.org/ns#interactingObject"]; @@ -37297,7 +39974,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; const _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); let _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget__array = values["https://gotosocial.org/ns#interactionTarget"]; @@ -37594,6 +40271,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -37973,10 +40656,10 @@ export class QuoteAuthorization extends Object { } #_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); #_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); /** * Constructs a new instance of QuoteAuthorization with the given values. @@ -38104,12 +40787,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as QuoteAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice();clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject); + const clone = super.clone(values, options) as unknown as QuoteAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < vocabSparseArrayMinimumLength + ? this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice() : vocabCopyPropertyArray(this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject);clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = vocabCopyTrustSet( + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, + ); if ("interactingObject" in values && values.interactingObject != null) { if (values.interactingObject instanceof Object || values.interactingObject instanceof URL) { // @ts-ignore: type is checked above. clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = [values.interactingObject]; - clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set([0]); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] = 1; } else { throw new TypeError( "The interactingObject must be of type " + @@ -38117,12 +40804,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice();clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget); + clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < vocabSparseArrayMinimumLength + ? this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice() : vocabCopyPropertyArray(this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget);clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = vocabCopyTrustSet( + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, + ); if ("interactionTarget" in values && values.interactionTarget != null) { if (values.interactionTarget instanceof Object || values.interactionTarget instanceof URL) { // @ts-ignore: type is checked above. clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = [values.interactionTarget]; - clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set([0]); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] = 1; } else { throw new TypeError( "The interactionTarget must be of type " + @@ -38156,6 +40847,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -38205,17 +40902,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as QuoteAuthorization; - for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { - const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; - if (value != null && typeof value === "object") { - node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + { + const array = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === "object") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { - const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; - if (value != null && typeof value === "object") { - node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + { + const array = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === "object") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } } } } }); } @@ -38546,7 +41273,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://gotosocial.org/ns#interactingObject"); @@ -38614,7 +41342,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -38964,7 +41693,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://gotosocial.org/ns#interactionTarget"); @@ -39032,7 +41762,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -39409,7 +42140,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); let _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject__array = values["https://gotosocial.org/ns#interactingObject"]; @@ -39450,7 +42181,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; const _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); let _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget__array = values["https://gotosocial.org/ns#interactionTarget"]; @@ -39747,6 +42478,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -40195,7 +42932,7 @@ export class Translation { #_diXuPmFWiEqfLPhhrxg6Xc7ixZG: (Intl.Locale)[] = []; #_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR: Set = new Set(); + #_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR: VocabTrustSet = new Set(); #_Msz9PwRg7cWkiXPL4ixyQLtuuH7: (URL)[] = []; #_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated: (Temporal.Instant)[] = []; #_4KvkQNz1JjGs8S7iJDcGrUYETbUW: (URL)[] = []; @@ -40277,14 +43014,36 @@ urls?: ((URL | Link))[];} ); } - if (Array.isArray(values.translators) && - values.translators.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.translators)) { + const array = values.translators; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.translators; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = values.translators.slice(); + this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = copied; - for (let i = 0; i < values.translators.length; i++) { - this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.add(i); - } + vocabSetTrustPrefix(this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR, this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.length); } else { throw new TypeError( @@ -40356,10 +43115,34 @@ urls?: ((URL | Link))[];} ); } - if (Array.isArray(values.urls) && - values.urls.every(v => v instanceof URL || v instanceof Link)) { + let copied!: (URL | Link)[]; + let valid = false; + if (Array.isArray(values.urls)) { + const array = values.urls; + const test = (v: URL | Link): boolean => v instanceof URL || v instanceof Link; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.urls; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = values.urls.slice(); + this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = copied; } else { throw new TypeError( @@ -40427,7 +43210,8 @@ urls?: ((URL | Link))[];} options ); copyPortableProvenance(this, clone); - clone.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG = this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG.slice(); + clone.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG = this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG.length < vocabSparseArrayMinimumLength + ? this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG.slice() : vocabCopyPropertyArray(this.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG); if ("language" in values && values.language != null) { if (values.language instanceof Intl.Locale) { // @ts-ignore: type is checked above. @@ -40440,12 +43224,16 @@ urls?: ((URL | Link))[];} ); } } - clone.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.slice();clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = new Set(this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR); + clone.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.length < vocabSparseArrayMinimumLength + ? this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.slice() : vocabCopyPropertyArray(this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR);clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = vocabCopyTrustSet( + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR, clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR, + ); if ("translator" in values && values.translator != null) { if (values.translator instanceof Application || values.translator instanceof Group || values.translator instanceof Organization || values.translator instanceof Person || values.translator instanceof Service || values.translator instanceof URL) { // @ts-ignore: type is checked above. clone.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = [values.translator]; - clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = new Set([0]); + clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = new Set(); + clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] = 1; } else { throw new TypeError( "The translator must be of type " + @@ -40464,15 +43252,37 @@ urls?: ((URL | Link))[];} ); } - if (Array.isArray(values.translators) && - values.translators.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.translators)) { + const array = values.translators; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.translators; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = values.translators.slice(); + clone.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = copied; clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR = new Set(); - for (let i = 0; i < values.translators.length; i++) { - clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.add(i); - } + vocabSetTrustPrefix(clone.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR, clone.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.length); } else { throw new TypeError( @@ -40481,7 +43291,8 @@ urls?: ((URL | Link))[];} ); } } - clone.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7 = this.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7.slice(); + clone.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7 = this.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7.length < vocabSparseArrayMinimumLength + ? this.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7.slice() : vocabCopyPropertyArray(this.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7); if ("original" in values && values.original != null) { if (values.original instanceof URL) { // @ts-ignore: type is checked above. @@ -40494,7 +43305,8 @@ urls?: ((URL | Link))[];} ); } } - clone.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated = this.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated.slice(); + clone.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated = this.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated.length < vocabSparseArrayMinimumLength + ? this.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated.slice() : vocabCopyPropertyArray(this.#_yTNTBtDbKTVj9kzyXpuk3rzbcGv_sourceUpdated); if ("sourceUpdated" in values && values.sourceUpdated != null) { if (isTemporalInstant(values.sourceUpdated)) { // @ts-ignore: type is checked above. @@ -40507,7 +43319,8 @@ urls?: ((URL | Link))[];} ); } } - clone.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW = this.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW.slice(); + clone.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW = this.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW.length < vocabSparseArrayMinimumLength + ? this.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW.slice() : vocabCopyPropertyArray(this.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW); if ("basis" in values && values.basis != null) { if (values.basis instanceof URL) { // @ts-ignore: type is checked above. @@ -40520,7 +43333,8 @@ urls?: ((URL | Link))[];} ); } } - clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.slice(); + clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length < vocabSparseArrayMinimumLength + ? this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.slice() : vocabCopyPropertyArray(this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url); if ("url" in values && values.url != null) { if (values.url instanceof URL || values.url instanceof Link) { // @ts-ignore: type is checked above. @@ -40544,10 +43358,34 @@ urls?: ((URL | Link))[];} ); } - if (Array.isArray(values.urls) && - values.urls.every(v => v instanceof URL || v instanceof Link)) { + let copied!: (URL | Link)[]; + let valid = false; + if (Array.isArray(values.urls)) { + const array = values.urls; + const test = (v: URL | Link): boolean => v instanceof URL || v instanceof Link; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.urls; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = values.urls.slice(); + clone.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url = copied; } else { throw new TypeError( @@ -40582,6 +43420,12 @@ urls?: ((URL | Link))[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -40627,31 +43471,91 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.length; i++) { - const value = node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[i]; - if (value != null && typeof value === "object") { - node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[i] = context.value(value); + { + const array = node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.length; i++) { + const value = node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[i]; + if (value != null && typeof value === "object") { + node.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7.length; i++) { - const value = node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7[i]; - if (value != null && typeof value === "object") { - node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7[i] = context.value(value); + { + const array = node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7.length; i++) { + const value = node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7[i]; + if (value != null && typeof value === "object") { + node.#_Msz9PwRg7cWkiXPL4ixyQLtuuH7[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW.length; i++) { - const value = node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW[i]; - if (value != null && typeof value === "object") { - node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW[i] = context.value(value); + { + const array = node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW.length; i++) { + const value = node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW[i]; + if (value != null && typeof value === "object") { + node.#_4KvkQNz1JjGs8S7iJDcGrUYETbUW[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length; i++) { - const value = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i]; - if (value != null && typeof value === "object") { - node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i] = context.value(value); + { + const array = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url.length; i++) { + const value = node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i]; + if (value != null && typeof value === "object") { + node.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url[i] = context.value(value); + } + } } } } }); } @@ -41062,7 +43966,8 @@ deepCloneDescriptors.set(this.prototype, { } let v = this.#_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[0]; if (!(v instanceof URL) && - !this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(0)) { + !(0 < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://schema.org/translator"); @@ -41130,7 +44035,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, null, v.id, options, )) && - !this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(0)) { + !(0 < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -41223,7 +44129,8 @@ deepCloneDescriptors.set(this.prototype, { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(i)) { + !(i < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://schema.org/translator"); @@ -41295,7 +44202,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, null, v.id, options, )) && - !this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(i)) { + !(i < (this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR[vocabTrustPrefix] ?? 0) || + this.#_trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -41907,7 +44815,7 @@ get urls(): ((URL | Link))[] { instance.#_diXuPmFWiEqfLPhhrxg6Xc7ixZG = _diXuPmFWiEqfLPhhrxg6Xc7ixZG; const _hQqsdZa1zG8Ra1bQ3MBVsnmGnBR: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR: Set = new Set(); + const _trust_hQqsdZa1zG8Ra1bQ3MBVsnmGnBR: VocabTrustSet = new Set(); let _hQqsdZa1zG8Ra1bQ3MBVsnmGnBR__array = values["https://schema.org/translator"]; @@ -42312,10 +45220,10 @@ export class FeatureAuthorization extends Object { } #_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + #_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); #_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + #_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); /** * Constructs a new instance of FeatureAuthorization with the given values. @@ -42443,12 +45351,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as FeatureAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice();clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject); + const clone = super.clone(values, options) as unknown as FeatureAuthorization;clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < vocabSparseArrayMinimumLength + ? this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.slice() : vocabCopyPropertyArray(this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject);clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = vocabCopyTrustSet( + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject, + ); if ("interactingObject" in values && values.interactingObject != null) { if (values.interactingObject instanceof Object || values.interactingObject instanceof URL) { // @ts-ignore: type is checked above. clone.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = [values.interactingObject]; - clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set([0]); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = new Set(); + clone.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] = 1; } else { throw new TypeError( "The interactingObject must be of type " + @@ -42456,12 +45368,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice();clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget); + clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < vocabSparseArrayMinimumLength + ? this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.slice() : vocabCopyPropertyArray(this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget);clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = vocabCopyTrustSet( + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget, + ); if ("interactionTarget" in values && values.interactionTarget != null) { if (values.interactionTarget instanceof Object || values.interactionTarget instanceof URL) { // @ts-ignore: type is checked above. clone.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = [values.interactionTarget]; - clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set([0]); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget = new Set(); + clone.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] = 1; } else { throw new TypeError( "The interactionTarget must be of type " + @@ -42495,6 +45411,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -42544,17 +45466,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as FeatureAuthorization; - for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { - const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; - if (value != null && typeof value === "object") { - node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + { + const array = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length; i++) { + const value = node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i]; + if (value != null && typeof value === "object") { + node.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { - const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; - if (value != null && typeof value === "object") { - node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + { + const array = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length; i++) { + const value = node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i]; + if (value != null && typeof value === "object") { + node.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[i] = context.value(value); + } + } } } } }); } @@ -42884,7 +45836,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://gotosocial.org/ns#interactingObject"); @@ -42952,7 +45905,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { + !(0 < (this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[vocabTrustPrefix] ?? 0) || + this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -43301,7 +46255,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://gotosocial.org/ns#interactionTarget"); @@ -43369,7 +46324,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { + !(0 < (this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[vocabTrustPrefix] ?? 0) || + this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -43746,7 +46702,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: (Object | URL)[] = []; - const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: Set = new Set(); + const _trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject: VocabTrustSet = new Set(); let _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject__array = values["https://gotosocial.org/ns#interactingObject"]; @@ -43787,7 +46743,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject = _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject; const _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: (Object | URL)[] = []; - const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: Set = new Set(); + const _trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget: VocabTrustSet = new Set(); let _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget__array = values["https://gotosocial.org/ns#interactionTarget"]; @@ -44081,6 +47037,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -44458,40 +47420,40 @@ export class Collection extends Object { #_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems: (number)[] = []; #_3UyUdxnyn6cDn53QKrh4MBiearma_current: (CollectionPage | URL)[] = []; - #_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current: Set = new Set(); + #_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current: VocabTrustSet = new Set(); #_J52RqweMe6hhv7RnLJMC8BExTE5_first: (CollectionPage | URL)[] = []; - #_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first: Set = new Set(); + #_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first: VocabTrustSet = new Set(); #_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last: (CollectionPage | URL)[] = []; - #_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last: Set = new Set(); + #_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last: VocabTrustSet = new Set(); #_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: (Object | Link | URL)[] = []; - #_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: Set = new Set(); + #_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: VocabTrustSet = new Set(); #_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf: (Object | URL)[] = []; - #_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf: Set = new Set(); + #_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf: VocabTrustSet = new Set(); #_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf: (Object | URL)[] = []; - #_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf: Set = new Set(); + #_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf: VocabTrustSet = new Set(); #_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf: (Object | URL)[] = []; - #_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf: Set = new Set(); + #_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf: VocabTrustSet = new Set(); #_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf: (Object | URL)[] = []; - #_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf: Set = new Set(); + #_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf: VocabTrustSet = new Set(); #_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf: (Object | URL)[] = []; - #_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf: Set = new Set(); + #_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf: VocabTrustSet = new Set(); #_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf: (Object | URL)[] = []; - #_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf: Set = new Set(); + #_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf: VocabTrustSet = new Set(); #_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf: (Object | URL)[] = []; - #_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf: Set = new Set(); + #_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf: VocabTrustSet = new Set(); #_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf: (Object | URL)[] = []; - #_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf: Set = new Set(); + #_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf: VocabTrustSet = new Set(); /** * Constructs a new instance of Collection with the given values. @@ -44582,14 +47544,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if ("items" in values && values.items != null) { - if (Array.isArray(values.items) && - values.items.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.items)) { + const array = values.items; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.items; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = values.items.slice(); + this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = copied; - for (let i = 0; i < values.items.length; i++) { - this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.add(i); - } + vocabSetTrustPrefix(this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length); } else { throw new TypeError( @@ -44768,7 +47752,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Collection;clone.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems = this.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems.slice(); + const clone = super.clone(values, options) as unknown as Collection;clone.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems = this.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems.length < vocabSparseArrayMinimumLength + ? this.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems.slice() : vocabCopyPropertyArray(this.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems); if ("totalItems" in values && values.totalItems != null) { if (typeof values.totalItems === "number" && Number.isInteger(values.totalItems) && values.totalItems >= 0) { // @ts-ignore: type is checked above. @@ -44781,12 +47766,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3UyUdxnyn6cDn53QKrh4MBiearma_current = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.slice();clone.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current = new Set(this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current); + clone.#_3UyUdxnyn6cDn53QKrh4MBiearma_current = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.length < vocabSparseArrayMinimumLength + ? this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.slice() : vocabCopyPropertyArray(this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current);clone.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current = vocabCopyTrustSet( + this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current, clone.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current, + ); if ("current" in values && values.current != null) { if (values.current instanceof CollectionPage || values.current instanceof URL) { // @ts-ignore: type is checked above. clone.#_3UyUdxnyn6cDn53QKrh4MBiearma_current = [values.current]; - clone.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current = new Set([0]); + clone.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current = new Set(); + clone.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current[vocabTrustPrefix] = 1; } else { throw new TypeError( "The current must be of type " + @@ -44794,12 +47783,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_J52RqweMe6hhv7RnLJMC8BExTE5_first = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.slice();clone.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first = new Set(this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first); + clone.#_J52RqweMe6hhv7RnLJMC8BExTE5_first = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.length < vocabSparseArrayMinimumLength + ? this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.slice() : vocabCopyPropertyArray(this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first);clone.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first = vocabCopyTrustSet( + this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first, clone.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first, + ); if ("first" in values && values.first != null) { if (values.first instanceof CollectionPage || values.first instanceof URL) { // @ts-ignore: type is checked above. clone.#_J52RqweMe6hhv7RnLJMC8BExTE5_first = [values.first]; - clone.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first = new Set([0]); + clone.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first = new Set(); + clone.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first[vocabTrustPrefix] = 1; } else { throw new TypeError( "The first must be of type " + @@ -44807,12 +47800,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.slice();clone.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = new Set(this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last); + clone.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.length < vocabSparseArrayMinimumLength + ? this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.slice() : vocabCopyPropertyArray(this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last);clone.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = vocabCopyTrustSet( + this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last, clone.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last, + ); if ("last" in values && values.last != null) { if (values.last instanceof CollectionPage || values.last instanceof URL) { // @ts-ignore: type is checked above. clone.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = [values.last]; - clone.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = new Set([0]); + clone.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = new Set(); + clone.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[vocabTrustPrefix] = 1; } else { throw new TypeError( "The last must be of type " + @@ -44820,18 +47817,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.slice();clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = new Set(this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items); + clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length < vocabSparseArrayMinimumLength + ? this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.slice() : vocabCopyPropertyArray(this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items);clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = vocabCopyTrustSet( + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, + ); if ("items" in values && values.items != null) { - if (Array.isArray(values.items) && - values.items.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.items)) { + const array = values.items; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.items; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = values.items.slice(); + clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = copied; clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = new Set(); - for (let i = 0; i < values.items.length; i++) { - clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length); } else { throw new TypeError( @@ -44840,12 +47862,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.slice();clone.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = new Set(this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf); + clone.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.length < vocabSparseArrayMinimumLength + ? this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.slice() : vocabCopyPropertyArray(this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf);clone.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = vocabCopyTrustSet( + this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf, clone.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf, + ); if ("likesOf" in values && values.likesOf != null) { if (values.likesOf instanceof Object || values.likesOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = [values.likesOf]; - clone.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = new Set([0]); + clone.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = new Set(); + clone.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[vocabTrustPrefix] = 1; } else { throw new TypeError( "The likesOf must be of type " + @@ -44853,12 +47879,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.slice();clone.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = new Set(this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf); + clone.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.length < vocabSparseArrayMinimumLength + ? this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.slice() : vocabCopyPropertyArray(this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf);clone.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = vocabCopyTrustSet( + this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf, clone.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf, + ); if ("sharesOf" in values && values.sharesOf != null) { if (values.sharesOf instanceof Object || values.sharesOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = [values.sharesOf]; - clone.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = new Set([0]); + clone.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = new Set(); + clone.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[vocabTrustPrefix] = 1; } else { throw new TypeError( "The sharesOf must be of type " + @@ -44866,12 +47896,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.slice();clone.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = new Set(this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf); + clone.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.length < vocabSparseArrayMinimumLength + ? this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.slice() : vocabCopyPropertyArray(this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf);clone.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = vocabCopyTrustSet( + this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf, clone.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf, + ); if ("repliesOf" in values && values.repliesOf != null) { if (values.repliesOf instanceof Object || values.repliesOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = [values.repliesOf]; - clone.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = new Set([0]); + clone.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = new Set(); + clone.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[vocabTrustPrefix] = 1; } else { throw new TypeError( "The repliesOf must be of type " + @@ -44879,12 +47913,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.slice();clone.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = new Set(this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf); + clone.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.length < vocabSparseArrayMinimumLength + ? this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.slice() : vocabCopyPropertyArray(this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf);clone.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = vocabCopyTrustSet( + this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf, clone.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf, + ); if ("inboxOf" in values && values.inboxOf != null) { if (values.inboxOf instanceof Object || values.inboxOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = [values.inboxOf]; - clone.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = new Set([0]); + clone.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = new Set(); + clone.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[vocabTrustPrefix] = 1; } else { throw new TypeError( "The inboxOf must be of type " + @@ -44892,12 +47930,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.slice();clone.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = new Set(this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf); + clone.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.length < vocabSparseArrayMinimumLength + ? this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.slice() : vocabCopyPropertyArray(this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf);clone.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = vocabCopyTrustSet( + this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf, clone.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf, + ); if ("outboxOf" in values && values.outboxOf != null) { if (values.outboxOf instanceof Object || values.outboxOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = [values.outboxOf]; - clone.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = new Set([0]); + clone.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = new Set(); + clone.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[vocabTrustPrefix] = 1; } else { throw new TypeError( "The outboxOf must be of type " + @@ -44905,12 +47947,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.slice();clone.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = new Set(this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf); + clone.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.length < vocabSparseArrayMinimumLength + ? this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.slice() : vocabCopyPropertyArray(this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf);clone.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = vocabCopyTrustSet( + this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf, clone.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf, + ); if ("followersOf" in values && values.followersOf != null) { if (values.followersOf instanceof Object || values.followersOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = [values.followersOf]; - clone.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = new Set([0]); + clone.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = new Set(); + clone.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[vocabTrustPrefix] = 1; } else { throw new TypeError( "The followersOf must be of type " + @@ -44918,12 +47964,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.slice();clone.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = new Set(this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf); + clone.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.length < vocabSparseArrayMinimumLength + ? this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.slice() : vocabCopyPropertyArray(this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf);clone.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = vocabCopyTrustSet( + this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf, clone.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf, + ); if ("followingOf" in values && values.followingOf != null) { if (values.followingOf instanceof Object || values.followingOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = [values.followingOf]; - clone.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = new Set([0]); + clone.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = new Set(); + clone.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[vocabTrustPrefix] = 1; } else { throw new TypeError( "The followingOf must be of type " + @@ -44931,12 +47981,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.slice();clone.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = new Set(this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf); + clone.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.length < vocabSparseArrayMinimumLength + ? this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.slice() : vocabCopyPropertyArray(this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf);clone.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = vocabCopyTrustSet( + this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf, clone.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf, + ); if ("likedOf" in values && values.likedOf != null) { if (values.likedOf instanceof Object || values.likedOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = [values.likedOf]; - clone.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = new Set([0]); + clone.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf = new Set(); + clone.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[vocabTrustPrefix] = 1; } else { throw new TypeError( "The likedOf must be of type " + @@ -44970,6 +48024,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -45019,87 +48079,267 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Collection; - for (let i = 0; i < node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.length; i++) { - const value = node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[i]; - if (value != null && typeof value === "object") { - node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[i] = context.value(value); + { + const array = node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.length; i++) { + const value = node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[i]; + if (value != null && typeof value === "object") { + node.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.length; i++) { - const value = node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[i]; - if (value != null && typeof value === "object") { - node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[i] = context.value(value); + { + const array = node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.length; i++) { + const value = node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[i]; + if (value != null && typeof value === "object") { + node.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.length; i++) { - const value = node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[i]; - if (value != null && typeof value === "object") { - node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[i] = context.value(value); + { + const array = node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.length; i++) { + const value = node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[i]; + if (value != null && typeof value === "object") { + node.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { - const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; - if (value != null && typeof value === "object") { - node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + { + const array = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { + const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; + if (value != null && typeof value === "object") { + node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.length; i++) { - const value = node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[i]; - if (value != null && typeof value === "object") { - node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[i] = context.value(value); + { + const array = node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.length; i++) { + const value = node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[i]; + if (value != null && typeof value === "object") { + node.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.length; i++) { - const value = node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[i]; - if (value != null && typeof value === "object") { - node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[i] = context.value(value); + { + const array = node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.length; i++) { + const value = node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[i]; + if (value != null && typeof value === "object") { + node.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.length; i++) { - const value = node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[i]; - if (value != null && typeof value === "object") { - node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[i] = context.value(value); + { + const array = node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.length; i++) { + const value = node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[i]; + if (value != null && typeof value === "object") { + node.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.length; i++) { - const value = node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[i]; - if (value != null && typeof value === "object") { - node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[i] = context.value(value); + { + const array = node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.length; i++) { + const value = node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[i]; + if (value != null && typeof value === "object") { + node.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.length; i++) { - const value = node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[i]; - if (value != null && typeof value === "object") { - node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[i] = context.value(value); + { + const array = node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.length; i++) { + const value = node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[i]; + if (value != null && typeof value === "object") { + node.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.length; i++) { - const value = node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[i]; - if (value != null && typeof value === "object") { - node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[i] = context.value(value); + { + const array = node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.length; i++) { + const value = node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[i]; + if (value != null && typeof value === "object") { + node.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.length; i++) { - const value = node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[i]; - if (value != null && typeof value === "object") { - node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[i] = context.value(value); + { + const array = node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.length; i++) { + const value = node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[i]; + if (value != null && typeof value === "object") { + node.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.length; i++) { - const value = node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[i]; - if (value != null && typeof value === "object") { - node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[i] = context.value(value); + { + const array = node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.length; i++) { + const value = node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[i]; + if (value != null && typeof value === "object") { + node.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[i] = context.value(value); + } + } } } } }); } @@ -45447,7 +48687,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[0]; if (!(v instanceof URL) && - !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { + !(0 < (this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current[vocabTrustPrefix] ?? 0) || + this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#current"); @@ -45515,7 +48756,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { + !(0 < (this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current[vocabTrustPrefix] ?? 0) || + this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -45866,7 +49108,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[0]; if (!(v instanceof URL) && - !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { + !(0 < (this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first[vocabTrustPrefix] ?? 0) || + this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#first"); @@ -45934,7 +49177,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { + !(0 < (this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first[vocabTrustPrefix] ?? 0) || + this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -46285,7 +49529,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[0]; if (!(v instanceof URL) && - !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { + !(0 < (this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[vocabTrustPrefix] ?? 0) || + this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#last"); @@ -46353,7 +49598,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { + !(0 < (this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[vocabTrustPrefix] ?? 0) || + this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -46719,7 +49965,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { + !(i < (this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[vocabTrustPrefix] ?? 0) || + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#items"); @@ -46791,7 +50038,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { + !(i < (this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[vocabTrustPrefix] ?? 0) || + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -47142,7 +50390,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[0]; if (!(v instanceof URL) && - !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { + !(0 < (this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[vocabTrustPrefix] ?? 0) || + this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/5711#likesOf"); @@ -47210,7 +50459,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { + !(0 < (this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[vocabTrustPrefix] ?? 0) || + this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -47560,7 +50810,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[0]; if (!(v instanceof URL) && - !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { + !(0 < (this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[vocabTrustPrefix] ?? 0) || + this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/5711#sharesOf"); @@ -47628,7 +50879,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { + !(0 < (this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[vocabTrustPrefix] ?? 0) || + this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -47978,7 +51230,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[0]; if (!(v instanceof URL) && - !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { + !(0 < (this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[vocabTrustPrefix] ?? 0) || + this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/5711#repliesOf"); @@ -48046,7 +51299,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { + !(0 < (this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[vocabTrustPrefix] ?? 0) || + this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -48396,7 +51650,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[0]; if (!(v instanceof URL) && - !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { + !(0 < (this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/5711#inboxOf"); @@ -48464,7 +51719,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { + !(0 < (this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -48814,7 +52070,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[0]; if (!(v instanceof URL) && - !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { + !(0 < (this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[vocabTrustPrefix] ?? 0) || + this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/5711#outboxOf"); @@ -48882,7 +52139,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { + !(0 < (this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[vocabTrustPrefix] ?? 0) || + this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -49232,7 +52490,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[0]; if (!(v instanceof URL) && - !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { + !(0 < (this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[vocabTrustPrefix] ?? 0) || + this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/5711#followersOf"); @@ -49300,7 +52559,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { + !(0 < (this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[vocabTrustPrefix] ?? 0) || + this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -49650,7 +52910,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[0]; if (!(v instanceof URL) && - !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { + !(0 < (this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/5711#followingOf"); @@ -49718,7 +52979,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { + !(0 < (this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -50068,7 +53330,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[0]; if (!(v instanceof URL) && - !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { + !(0 < (this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/5711#likedOf"); @@ -50136,7 +53399,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { + !(0 < (this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -51001,7 +54265,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_XDbmNDuWHmrhqH712zqtecdbv1V_totalItems = _XDbmNDuWHmrhqH712zqtecdbv1V_totalItems; const _3UyUdxnyn6cDn53QKrh4MBiearma_current: (CollectionPage | URL)[] = []; - const _trust_3UyUdxnyn6cDn53QKrh4MBiearma_current: Set = new Set(); + const _trust_3UyUdxnyn6cDn53QKrh4MBiearma_current: VocabTrustSet = new Set(); let _3UyUdxnyn6cDn53QKrh4MBiearma_current__array = values["https://www.w3.org/ns/activitystreams#current"]; @@ -51042,7 +54306,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_3UyUdxnyn6cDn53QKrh4MBiearma_current = _3UyUdxnyn6cDn53QKrh4MBiearma_current; const _J52RqweMe6hhv7RnLJMC8BExTE5_first: (CollectionPage | URL)[] = []; - const _trust_J52RqweMe6hhv7RnLJMC8BExTE5_first: Set = new Set(); + const _trust_J52RqweMe6hhv7RnLJMC8BExTE5_first: VocabTrustSet = new Set(); let _J52RqweMe6hhv7RnLJMC8BExTE5_first__array = values["https://www.w3.org/ns/activitystreams#first"]; @@ -51083,7 +54347,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_J52RqweMe6hhv7RnLJMC8BExTE5_first = _J52RqweMe6hhv7RnLJMC8BExTE5_first; const _gyJJnyEFnuNVi1HFZKfAn3Hfn26_last: (CollectionPage | URL)[] = []; - const _trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last: Set = new Set(); + const _trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last: VocabTrustSet = new Set(); let _gyJJnyEFnuNVi1HFZKfAn3Hfn26_last__array = values["https://www.w3.org/ns/activitystreams#last"]; @@ -51124,7 +54388,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last = _gyJJnyEFnuNVi1HFZKfAn3Hfn26_last; const _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: (Object | Link | URL)[] = []; - const _trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: Set = new Set(); + const _trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: VocabTrustSet = new Set(); let _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items__array = values["https://www.w3.org/ns/activitystreams#items"]; @@ -51172,7 +54436,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; const _4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf: (Object | URL)[] = []; - const _trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf: Set = new Set(); + const _trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf: VocabTrustSet = new Set(); let _4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf__array = values["https://w3id.org/fep/5711#likesOf"]; @@ -51213,7 +54477,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf = _4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf; const _3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf: (Object | URL)[] = []; - const _trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf: Set = new Set(); + const _trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf: VocabTrustSet = new Set(); let _3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf__array = values["https://w3id.org/fep/5711#sharesOf"]; @@ -51254,7 +54518,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf = _3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf; const _3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf: (Object | URL)[] = []; - const _trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf: Set = new Set(); + const _trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf: VocabTrustSet = new Set(); let _3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf__array = values["https://w3id.org/fep/5711#repliesOf"]; @@ -51295,7 +54559,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf = _3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf; const _2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf: (Object | URL)[] = []; - const _trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf: Set = new Set(); + const _trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf: VocabTrustSet = new Set(); let _2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf__array = values["https://w3id.org/fep/5711#inboxOf"]; @@ -51336,7 +54600,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf = _2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf; const _4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf: (Object | URL)[] = []; - const _trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf: Set = new Set(); + const _trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf: VocabTrustSet = new Set(); let _4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf__array = values["https://w3id.org/fep/5711#outboxOf"]; @@ -51377,7 +54641,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf = _4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf; const _41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf: (Object | URL)[] = []; - const _trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf: Set = new Set(); + const _trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf: VocabTrustSet = new Set(); let _41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf__array = values["https://w3id.org/fep/5711#followersOf"]; @@ -51418,7 +54682,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf = _41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf; const _2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf: (Object | URL)[] = []; - const _trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf: Set = new Set(); + const _trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf: VocabTrustSet = new Set(); let _2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf__array = values["https://w3id.org/fep/5711#followingOf"]; @@ -51459,7 +54723,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf = _2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf; const _2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf: (Object | URL)[] = []; - const _trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf: Set = new Set(); + const _trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf: VocabTrustSet = new Set(); let _2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf__array = values["https://w3id.org/fep/5711#likedOf"]; @@ -51833,7 +55097,7 @@ export class OrderedCollection extends Collection { } #_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: (Object | Link | URL)[] = []; - #_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: Set = new Set(); + #_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: VocabTrustSet = new Set(); /** * Constructs a new instance of OrderedCollection with the given values. @@ -51872,14 +55136,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu super(values, options); if ("items" in values && values.items != null) { - if (Array.isArray(values.items) && - values.items.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.items)) { + const array = values.items; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.items; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = values.items.slice(); + this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = copied; - for (let i = 0; i < values.items.length; i++) { - this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.add(i); - } + vocabSetTrustPrefix(this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length); } else { throw new TypeError( @@ -51954,18 +55240,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as OrderedCollection;clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.slice();clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = new Set(this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items); + const clone = super.clone(values, options) as unknown as OrderedCollection;clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length < vocabSparseArrayMinimumLength + ? this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.slice() : vocabCopyPropertyArray(this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items);clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = vocabCopyTrustSet( + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, + ); if ("items" in values && values.items != null) { - if (Array.isArray(values.items) && - values.items.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.items)) { + const array = values.items; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.items; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = values.items.slice(); + clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = copied; clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = new Set(); - for (let i = 0; i < values.items.length; i++) { - clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length); } else { throw new TypeError( @@ -52000,6 +55311,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -52049,10 +55366,25 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as OrderedCollection; - for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { - const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; - if (value != null && typeof value === "object") { - node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + { + const array = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { + const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; + if (value != null && typeof value === "object") { + node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + } + } } } } }); } @@ -52399,7 +55731,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { + !(i < (this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[vocabTrustPrefix] ?? 0) || + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#items"); @@ -52471,7 +55804,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { + !(i < (this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[vocabTrustPrefix] ?? 0) || + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -52814,7 +56148,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: (Object | Link | URL)[] = []; - const _trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: Set = new Set(); + const _trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: VocabTrustSet = new Set(); let _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items__array = values["https://www.w3.org/ns/activitystreams#items"]; @@ -53083,7 +56417,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as FeaturedCollection;clone.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic = this.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic.slice(); + const clone = super.clone(values, options) as unknown as FeaturedCollection;clone.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic = this.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic.length < vocabSparseArrayMinimumLength + ? this.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic.slice() : vocabCopyPropertyArray(this.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic); if ("topic" in values && values.topic != null) { if (values.topic instanceof Hashtag) { // @ts-ignore: type is checked above. @@ -53096,7 +56431,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice(); + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.length < vocabSparseArrayMinimumLength + ? this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice() : vocabCopyPropertyArray(this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable); if ("discoverable" in values && values.discoverable != null) { if (typeof values.discoverable === "boolean") { // @ts-ignore: type is checked above. @@ -53135,6 +56471,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -53184,10 +56526,25 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as FeaturedCollection; - for (let i = 0; i < node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic.length; i++) { - const value = node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic[i]; - if (value != null && typeof value === "object") { - node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic[i] = context.value(value); + { + const array = node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic.length; i++) { + const value = node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic[i]; + if (value != null && typeof value === "object") { + node.#_pc4UXYHNrYa2zyQ8Bh7zvdZRKnZ_topic[i] = context.value(value); + } + } } } } }); } @@ -53745,10 +57102,10 @@ export class FeaturedItem extends Object { } #_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject: (Object | URL)[] = []; - #_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject: Set = new Set(); + #_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject: VocabTrustSet = new Set(); #_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization: (FeatureAuthorization | URL)[] = []; - #_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization: Set = new Set(); + #_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization: VocabTrustSet = new Set(); /** * Constructs a new instance of FeaturedItem with the given values. @@ -53876,12 +57233,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as FeaturedItem;clone.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = this.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.slice();clone.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = new Set(this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject); + const clone = super.clone(values, options) as unknown as FeaturedItem;clone.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = this.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.length < vocabSparseArrayMinimumLength + ? this.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.slice() : vocabCopyPropertyArray(this.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject);clone.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = vocabCopyTrustSet( + this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject, clone.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject, + ); if ("featuredObject" in values && values.featuredObject != null) { if (values.featuredObject instanceof Object || values.featuredObject instanceof URL) { // @ts-ignore: type is checked above. clone.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = [values.featuredObject]; - clone.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = new Set([0]); + clone.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = new Set(); + clone.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[vocabTrustPrefix] = 1; } else { throw new TypeError( "The featuredObject must be of type " + @@ -53889,12 +57250,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = this.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.slice();clone.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = new Set(this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization); + clone.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = this.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.slice() : vocabCopyPropertyArray(this.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization);clone.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = vocabCopyTrustSet( + this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization, clone.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization, + ); if ("featureAuthorization" in values && values.featureAuthorization != null) { if (values.featureAuthorization instanceof FeatureAuthorization || values.featureAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = [values.featureAuthorization]; - clone.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = new Set([0]); + clone.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization = new Set(); + clone.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( "The featureAuthorization must be of type " + @@ -53928,6 +57293,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -53977,17 +57348,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as FeaturedItem; - for (let i = 0; i < node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.length; i++) { - const value = node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[i]; - if (value != null && typeof value === "object") { - node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[i] = context.value(value); + { + const array = node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.length; i++) { + const value = node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[i]; + if (value != null && typeof value === "object") { + node.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.length; i++) { - const value = node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[i]; - if (value != null && typeof value === "object") { - node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[i] = context.value(value); + { + const array = node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.length; i++) { + const value = node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[i]; + if (value != null && typeof value === "object") { + node.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[i] = context.value(value); + } + } } } } }); } @@ -54317,7 +57718,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[0]; if (!(v instanceof URL) && - !this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.has(0)) { + !(0 < (this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[vocabTrustPrefix] ?? 0) || + this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/7aa9#featuredObject"); @@ -54385,7 +57787,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.has(0)) { + !(0 < (this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject[vocabTrustPrefix] ?? 0) || + this.#_trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -54736,7 +58139,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.has(0)) { + !(0 < (this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/7aa9#featureAuthorization"); @@ -54804,7 +58208,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.has(0)) { + !(0 < (this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -55181,7 +58586,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject: (Object | URL)[] = []; - const _trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject: Set = new Set(); + const _trust_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject: VocabTrustSet = new Set(); let _Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject__array = values["https://w3id.org/fep/7aa9#featuredObject"]; @@ -55222,7 +58627,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject = _Ht5F1pFtcuyJkybWck37rPhwyQv_featuredObject; const _2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization: (FeatureAuthorization | URL)[] = []; - const _trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization: Set = new Set(); + const _trust_2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization: VocabTrustSet = new Set(); let _2gG5sxnwav2sb69C22RbERtJ8rba_featureAuthorization__array = values["https://w3id.org/fep/7aa9#featureAuthorization"]; @@ -55507,10 +58912,34 @@ endpoints?: (URL)[];} ); } - if (Array.isArray(values.endpoints) && - values.endpoints.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.endpoints)) { + const array = values.endpoints; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.endpoints; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = values.endpoints.slice(); + this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = copied; } else { throw new TypeError( @@ -55577,7 +59006,8 @@ endpoints?: (URL)[];} options ); copyPortableProvenance(this, clone); - clone.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.slice(); + clone.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.length < vocabSparseArrayMinimumLength + ? this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.slice() : vocabCopyPropertyArray(this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint); if ("endpoint" in values && values.endpoint != null) { if (values.endpoint instanceof URL) { // @ts-ignore: type is checked above. @@ -55601,10 +59031,34 @@ endpoints?: (URL)[];} ); } - if (Array.isArray(values.endpoints) && - values.endpoints.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.endpoints)) { + const array = values.endpoints; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.endpoints; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = values.endpoints.slice(); + clone.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint = copied; } else { throw new TypeError( @@ -55639,6 +59093,12 @@ endpoints?: (URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -55683,10 +59143,25 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.length; i++) { - const value = node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint[i]; - if (value != null && typeof value === "object") { - node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint[i] = context.value(value); + { + const array = node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.length; i++) { + const value = node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint[i]; + if (value != null && typeof value === "object") { + node.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint[i] = context.value(value); + } + } } } } }); } @@ -56202,6 +59677,12 @@ endpoints?: (URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -56613,7 +60094,7 @@ export class DataIntegrityProof { #_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite: ("eddsa-jcs-2022")[] = []; #_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod: (Multikey | URL)[] = []; - #_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod: Set = new Set(); + #_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod: VocabTrustSet = new Set(); #_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose: ("assertionMethod" | "authentication" | "capabilityInvocation" | "capabilityDelegation" | "keyAgreement")[] = []; #_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue: (Uint8Array)[] = []; #_3qzP3ukEZoUziK5FEiA1RhU4aqac: (Temporal.Instant)[] = []; @@ -56779,7 +60260,8 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null options ); copyPortableProvenance(this, clone); - clone.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite = this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite.slice(); + clone.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite = this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite.length < vocabSparseArrayMinimumLength + ? this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite.slice() : vocabCopyPropertyArray(this.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite); if ("cryptosuite" in values && values.cryptosuite != null) { if (values.cryptosuite == "eddsa-jcs-2022") { // @ts-ignore: type is checked above. @@ -56792,12 +60274,16 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null ); } } - clone.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.slice();clone.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = new Set(this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod); + clone.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.length < vocabSparseArrayMinimumLength + ? this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.slice() : vocabCopyPropertyArray(this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod);clone.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = vocabCopyTrustSet( + this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod, clone.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod, + ); if ("verificationMethod" in values && values.verificationMethod != null) { if (values.verificationMethod instanceof Multikey || values.verificationMethod instanceof URL) { // @ts-ignore: type is checked above. clone.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = [values.verificationMethod]; - clone.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = new Set([0]); + clone.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod = new Set(); + clone.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[vocabTrustPrefix] = 1; } else { throw new TypeError( "The verificationMethod must be of type " + @@ -56805,7 +60291,8 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null ); } } - clone.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose = this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose.slice(); + clone.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose = this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose.length < vocabSparseArrayMinimumLength + ? this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose.slice() : vocabCopyPropertyArray(this.#_2AeEnPcAvVrPEuKbpmn9ZKNmWHKb_proofPurpose); if ("proofPurpose" in values && values.proofPurpose != null) { if (values.proofPurpose === "assertionMethod" || values.proofPurpose === "authentication" || values.proofPurpose === "capabilityInvocation" || values.proofPurpose === "capabilityDelegation" || @@ -56820,7 +60307,8 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null ); } } - clone.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue = this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue.slice(); + clone.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue = this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue.length < vocabSparseArrayMinimumLength + ? this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue.slice() : vocabCopyPropertyArray(this.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue); if ("proofValue" in values && values.proofValue != null) { if (values.proofValue instanceof Uint8Array) { // @ts-ignore: type is checked above. @@ -56833,7 +60321,8 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null ); } } - clone.#_3qzP3ukEZoUziK5FEiA1RhU4aqac = this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac.slice(); + clone.#_3qzP3ukEZoUziK5FEiA1RhU4aqac = this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac.length < vocabSparseArrayMinimumLength + ? this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac.slice() : vocabCopyPropertyArray(this.#_3qzP3ukEZoUziK5FEiA1RhU4aqac); if ("created" in values && values.created != null) { if (isTemporalInstant(values.created)) { // @ts-ignore: type is checked above. @@ -56872,6 +60361,12 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -56915,17 +60410,47 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.length; i++) { - const value = node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[i]; - if (value != null && typeof value === "object") { - node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[i] = context.value(value); + { + const array = node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.length; i++) { + const value = node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[i]; + if (value != null && typeof value === "object") { + node.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue.length; i++) { - const value = node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue[i]; - if (value != null && typeof value === "object") { - node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue[i] = context.value(value); + { + const array = node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue.length; i++) { + const value = node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue[i]; + if (value != null && typeof value === "object") { + node.#_3CjFK5vfKpX4HQuNh2b18TykoVLq_proofValue[i] = context.value(value); + } + } } } } }); } @@ -57273,7 +60798,8 @@ deepCloneDescriptors.set(this.prototype, { } let v = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[0]; if (!(v instanceof URL) && - !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { + !(0 < (this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#verificationMethod"); @@ -57307,7 +60833,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { + !(0 < (this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -57743,7 +61270,7 @@ deepCloneDescriptors.set(this.prototype, { instance.#_3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite = _3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite; const _2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod: (Multikey | URL)[] = []; - const _trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod: Set = new Set(); + const _trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod: VocabTrustSet = new Set(); let _2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod__array = values["https://w3id.org/security#verificationMethod"]; @@ -58128,7 +61655,7 @@ export class CryptographicKey { } #_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner: Set = new Set(); + #_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner: VocabTrustSet = new Set(); #_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem: (CryptoKey)[] = []; /** @@ -58254,12 +61781,16 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi options ); copyPortableProvenance(this, clone); - clone.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.slice();clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = new Set(this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner); + clone.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length < vocabSparseArrayMinimumLength + ? this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.slice() : vocabCopyPropertyArray(this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner);clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = vocabCopyTrustSet( + this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner, clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner, + ); if ("owner" in values && values.owner != null) { if (values.owner instanceof Application || values.owner instanceof Group || values.owner instanceof Organization || values.owner instanceof Person || values.owner instanceof Service || values.owner instanceof URL) { // @ts-ignore: type is checked above. clone.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = [values.owner]; - clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = new Set([0]); + clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner = new Set(); + clone.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[vocabTrustPrefix] = 1; } else { throw new TypeError( "The owner must be of type " + @@ -58267,7 +61798,8 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi ); } } - clone.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem = this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem.slice(); + clone.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem = this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem.length < vocabSparseArrayMinimumLength + ? this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem.slice() : vocabCopyPropertyArray(this.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem); if ("publicKey" in values && values.publicKey != null) { if ( // @ts-ignore: CryptoKey exists in the global scope. @@ -58309,6 +61841,12 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -58352,10 +61890,25 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length; i++) { - const value = node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[i]; - if (value != null && typeof value === "object") { - node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[i] = context.value(value); + { + const array = node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length; i++) { + const value = node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[i]; + if (value != null && typeof value === "object") { + node.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[i] = context.value(value); + } + } } } } }); } @@ -58745,7 +62298,8 @@ deepCloneDescriptors.set(this.prototype, { } let v = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[0]; if (!(v instanceof URL) && - !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { + !(0 < (this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[vocabTrustPrefix] ?? 0) || + this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#owner"); @@ -58813,7 +62367,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { + !(0 < (this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[vocabTrustPrefix] ?? 0) || + this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -59184,7 +62739,7 @@ deepCloneDescriptors.set(this.prototype, { let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner: Set = new Set(); + const _trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner: VocabTrustSet = new Set(); let _5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner__array = values["https://w3id.org/security#owner"]; @@ -59468,7 +63023,7 @@ export class Multikey { } #_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller: Set = new Set(); + #_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller: VocabTrustSet = new Set(); #_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase: (CryptoKey)[] = []; /** @@ -59594,12 +63149,16 @@ controller?: Application | Group | Organization | Person | Service | URL | null; options ); copyPortableProvenance(this, clone); - clone.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.slice();clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = new Set(this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller); + clone.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length < vocabSparseArrayMinimumLength + ? this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.slice() : vocabCopyPropertyArray(this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller);clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = vocabCopyTrustSet( + this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller, clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller, + ); if ("controller" in values && values.controller != null) { if (values.controller instanceof Application || values.controller instanceof Group || values.controller instanceof Organization || values.controller instanceof Person || values.controller instanceof Service || values.controller instanceof URL) { // @ts-ignore: type is checked above. clone.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = [values.controller]; - clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = new Set([0]); + clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller = new Set(); + clone.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[vocabTrustPrefix] = 1; } else { throw new TypeError( "The controller must be of type " + @@ -59607,7 +63166,8 @@ controller?: Application | Group | Organization | Person | Service | URL | null; ); } } - clone.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase = this.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase.slice(); + clone.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase = this.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase.length < vocabSparseArrayMinimumLength + ? this.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase.slice() : vocabCopyPropertyArray(this.#_4XLHbsR2gLVWU3NpEqKt9wANzn4F_publicKeyMultibase); if ("publicKey" in values && values.publicKey != null) { if ( // @ts-ignore: CryptoKey exists in the global scope. @@ -59649,6 +63209,12 @@ controller?: Application | Group | Organization | Person | Service | URL | null; * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -59692,10 +63258,25 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length; i++) { - const value = node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[i]; - if (value != null && typeof value === "object") { - node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[i] = context.value(value); + { + const array = node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length; i++) { + const value = node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[i]; + if (value != null && typeof value === "object") { + node.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[i] = context.value(value); + } + } } } } }); } @@ -60085,7 +63666,8 @@ deepCloneDescriptors.set(this.prototype, { } let v = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[0]; if (!(v instanceof URL) && - !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { + !(0 < (this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[vocabTrustPrefix] ?? 0) || + this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#controller"); @@ -60153,7 +63735,8 @@ deepCloneDescriptors.set(this.prototype, { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { + !(0 < (this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[vocabTrustPrefix] ?? 0) || + this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -60531,7 +64114,7 @@ deepCloneDescriptors.set(this.prototype, { let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller: Set = new Set(); + const _trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller: VocabTrustSet = new Set(); let _2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller__array = values["https://w3id.org/security#controller"]; @@ -60881,7 +64464,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Agreement;clone.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates = this.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates.slice(); + const clone = super.clone(values, options) as unknown as Agreement;clone.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates = this.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates.length < vocabSparseArrayMinimumLength + ? this.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates.slice() : vocabCopyPropertyArray(this.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates); if ("stipulates" in values && values.stipulates != null) { if (values.stipulates instanceof Commitment) { // @ts-ignore: type is checked above. @@ -60894,7 +64478,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal = this.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal.slice(); + clone.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal = this.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal.length < vocabSparseArrayMinimumLength + ? this.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal.slice() : vocabCopyPropertyArray(this.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal); if ("stipulatesReciprocal" in values && values.stipulatesReciprocal != null) { if (values.stipulatesReciprocal instanceof Commitment) { // @ts-ignore: type is checked above. @@ -60933,6 +64518,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -60982,17 +64573,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Agreement; - for (let i = 0; i < node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates.length; i++) { - const value = node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates[i]; - if (value != null && typeof value === "object") { - node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates[i] = context.value(value); + { + const array = node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates.length; i++) { + const value = node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates[i]; + if (value != null && typeof value === "object") { + node.#_37zeAJ2NVyecrDdP8os69FGAn9Q6_stipulates[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal.length; i++) { - const value = node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal[i]; - if (value != null && typeof value === "object") { - node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal[i] = context.value(value); + { + const array = node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal.length; i++) { + const value = node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal[i]; + if (value != null && typeof value === "object") { + node.#_4Vhx9DcywF65XWUQ4KZ35475FaJm_stipulatesReciprocal[i] = context.value(value); + } + } } } } }); } @@ -61749,7 +65370,8 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} options ); copyPortableProvenance(this, clone); - clone.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies = this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.slice(); + clone.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies = this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.length < vocabSparseArrayMinimumLength + ? this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.slice() : vocabCopyPropertyArray(this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies); if ("satisfies" in values && values.satisfies != null) { if (values.satisfies instanceof URL) { // @ts-ignore: type is checked above. @@ -61762,7 +65384,8 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} ); } } - clone.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.slice(); + clone.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length < vocabSparseArrayMinimumLength + ? this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.slice() : vocabCopyPropertyArray(this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity); if ("resourceQuantity" in values && values.resourceQuantity != null) { if (values.resourceQuantity instanceof Measure) { // @ts-ignore: type is checked above. @@ -61801,6 +65424,12 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -61844,17 +65473,47 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.length; i++) { - const value = node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies[i]; - if (value != null && typeof value === "object") { - node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies[i] = context.value(value); + { + const array = node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.length; i++) { + const value = node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies[i]; + if (value != null && typeof value === "object") { + node.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length; i++) { - const value = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i]; - if (value != null && typeof value === "object") { - node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i] = context.value(value); + { + const array = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length; i++) { + const value = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i]; + if (value != null && typeof value === "object") { + node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i] = context.value(value); + } + } } } } }); } @@ -62630,7 +66289,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur options ); copyPortableProvenance(this, clone); - clone.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action = this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.slice(); + clone.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action = this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.length < vocabSparseArrayMinimumLength + ? this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.slice() : vocabCopyPropertyArray(this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action); if ("action" in values && values.action != null) { if (typeof values.action === "string") { // @ts-ignore: type is checked above. @@ -62643,7 +66303,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur ); } } - clone.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo = this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.slice(); + clone.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo = this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.length < vocabSparseArrayMinimumLength + ? this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.slice() : vocabCopyPropertyArray(this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo); if ("resourceConformsTo" in values && values.resourceConformsTo != null) { if (values.resourceConformsTo instanceof URL) { // @ts-ignore: type is checked above. @@ -62656,7 +66317,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur ); } } - clone.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.slice(); + clone.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length < vocabSparseArrayMinimumLength + ? this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.slice() : vocabCopyPropertyArray(this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity); if ("resourceQuantity" in values && values.resourceQuantity != null) { if (values.resourceQuantity instanceof Measure) { // @ts-ignore: type is checked above. @@ -62669,7 +66331,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur ); } } - clone.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity = this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.slice(); + clone.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity = this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.length < vocabSparseArrayMinimumLength + ? this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.slice() : vocabCopyPropertyArray(this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity); if ("availableQuantity" in values && values.availableQuantity != null) { if (values.availableQuantity instanceof Measure) { // @ts-ignore: type is checked above. @@ -62682,7 +66345,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur ); } } - clone.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.slice(); + clone.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.length < vocabSparseArrayMinimumLength + ? this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.slice() : vocabCopyPropertyArray(this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity); if ("minimumQuantity" in values && values.minimumQuantity != null) { if (values.minimumQuantity instanceof Measure) { // @ts-ignore: type is checked above. @@ -62721,6 +66385,12 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -62764,31 +66434,91 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.length; i++) { - const value = node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[i]; - if (value != null && typeof value === "object") { - node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[i] = context.value(value); + { + const array = node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.length; i++) { + const value = node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[i]; + if (value != null && typeof value === "object") { + node.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length; i++) { - const value = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i]; - if (value != null && typeof value === "object") { - node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i] = context.value(value); + { + const array = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length; i++) { + const value = node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i]; + if (value != null && typeof value === "object") { + node.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.length; i++) { - const value = node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[i]; - if (value != null && typeof value === "object") { - node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[i] = context.value(value); + { + const array = node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.length; i++) { + const value = node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[i]; + if (value != null && typeof value === "object") { + node.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.length; i++) { - const value = node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[i]; - if (value != null && typeof value === "object") { - node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[i] = context.value(value); + { + const array = node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.length; i++) { + const value = node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[i]; + if (value != null && typeof value === "object") { + node.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[i] = context.value(value); + } + } } } } }); } @@ -63803,7 +67533,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Proposal;clone.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose = this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose.slice(); + const clone = super.clone(values, options) as unknown as Proposal;clone.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose = this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose.length < vocabSparseArrayMinimumLength + ? this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose.slice() : vocabCopyPropertyArray(this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose); if ("purpose" in values && values.purpose != null) { if (typeof values.purpose === "string") { // @ts-ignore: type is checked above. @@ -63816,7 +67547,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes = this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.slice(); + clone.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes = this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.length < vocabSparseArrayMinimumLength + ? this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.slice() : vocabCopyPropertyArray(this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes); if ("publishes" in values && values.publishes != null) { if (values.publishes instanceof Intent) { // @ts-ignore: type is checked above. @@ -63829,7 +67561,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal = this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.slice(); + clone.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal = this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.length < vocabSparseArrayMinimumLength + ? this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.slice() : vocabCopyPropertyArray(this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal); if ("reciprocal" in values && values.reciprocal != null) { if (values.reciprocal instanceof Intent) { // @ts-ignore: type is checked above. @@ -63842,7 +67575,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased.slice(); + clone.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased.length < vocabSparseArrayMinimumLength + ? this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased.slice() : vocabCopyPropertyArray(this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased); if ("unitBased" in values && values.unitBased != null) { if (typeof values.unitBased === "boolean") { // @ts-ignore: type is checked above. @@ -63881,6 +67615,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -63930,17 +67670,47 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Proposal; - for (let i = 0; i < node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.length; i++) { - const value = node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[i]; - if (value != null && typeof value === "object") { - node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[i] = context.value(value); + { + const array = node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.length; i++) { + const value = node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[i]; + if (value != null && typeof value === "object") { + node.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.length; i++) { - const value = node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[i]; - if (value != null && typeof value === "object") { - node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[i] = context.value(value); + { + const array = node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.length; i++) { + const value = node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[i]; + if (value != null && typeof value === "object") { + node.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[i] = context.value(value); + } + } } } } }); } @@ -64840,6 +68610,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -65356,6 +69132,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -65867,6 +69649,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -66239,39 +70027,39 @@ export class Application extends Object { #_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername: ((string | LanguageString))[] = []; #_axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); #_41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); #_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); #_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); #_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); #_4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); #_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); #_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints: (Endpoints)[] = []; #_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable: (boolean)[] = []; #_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended: (boolean)[] = []; @@ -66279,13 +70067,13 @@ export class Application extends Object { #_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable: (boolean)[] = []; #_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); #_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); #_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); #_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage: (string)[] = []; #_2xEU4QtkC53RAun67T81Egqt9vmL_isCat: (boolean)[] = []; #_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense: (URL)[] = []; @@ -66354,10 +70142,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === "string" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === "string" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -66390,14 +70202,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; - for (let i = 0; i < values.publicKeys.length; i++) { - this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -66430,14 +70264,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; - for (let i = 0; i < values.assertionMethods.length; i++) { - this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -66470,10 +70326,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -66602,14 +70482,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | if ("streams" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; - for (let i = 0; i < values.streams.length; i++) { - this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -66720,14 +70622,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; - for (let i = 0; i < values.aliases.length; i++) { - this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -66760,14 +70684,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; - for (let i = 0; i < values.services.length; i++) { - this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -66887,7 +70833,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Application;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice(); + const clone = super.clone(values, options) as unknown as Application;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.length < vocabSparseArrayMinimumLength + ? this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice() : vocabCopyPropertyArray(this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername); if ("preferredUsername" in values && values.preferredUsername != null) { if (typeof values.preferredUsername === "string" || values.preferredUsername instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -66911,10 +70858,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === "string" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === "string" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -66923,12 +70894,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice();clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < vocabSparseArrayMinimumLength + ? this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice() : vocabCopyPropertyArray(this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey);clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = vocabCopyTrustSet( + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, + ); if ("publicKey" in values && values.publicKey != null) { if (values.publicKey instanceof CryptographicKey || values.publicKey instanceof URL) { // @ts-ignore: type is checked above. clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = [values.publicKey]; - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set([0]); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] = 1; } else { throw new TypeError( "The publicKey must be of type " + @@ -66947,15 +70922,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); - for (let i = 0; i < values.publicKeys.length; i++) { - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -66964,12 +70961,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice();clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < vocabSparseArrayMinimumLength + ? this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice() : vocabCopyPropertyArray(this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod);clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = vocabCopyTrustSet( + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, + ); if ("assertionMethod" in values && values.assertionMethod != null) { if (values.assertionMethod instanceof Multikey || values.assertionMethod instanceof URL) { // @ts-ignore: type is checked above. clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = [values.assertionMethod]; - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set([0]); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] = 1; } else { throw new TypeError( "The assertionMethod must be of type " + @@ -66988,15 +70989,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); - for (let i = 0; i < values.assertionMethods.length; i++) { - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -67005,7 +71028,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < vocabSparseArrayMinimumLength + ? this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice() : vocabCopyPropertyArray(this.#_hQiaHhZP8hqxckxTBrpsGNs57E3); if ("gateway" in values && values.gateway != null) { if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { // @ts-ignore: type is checked above. @@ -67029,10 +71053,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -67041,7 +71089,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice(); + clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.length < vocabSparseArrayMinimumLength + ? this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice() : vocabCopyPropertyArray(this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers); if ("manuallyApprovesFollowers" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === "boolean") { // @ts-ignore: type is checked above. @@ -67054,12 +71103,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice();clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox); + clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < vocabSparseArrayMinimumLength + ? this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice() : vocabCopyPropertyArray(this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox);clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = vocabCopyTrustSet( + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, + ); if ("inbox" in values && values.inbox != null) { if (values.inbox instanceof OrderedCollection || values.inbox instanceof OrderedCollectionPage || values.inbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox]; - clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set([0]); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] = 1; } else { throw new TypeError( "The inbox must be of type " + @@ -67067,12 +71120,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice();clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox); + clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < vocabSparseArrayMinimumLength + ? this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice() : vocabCopyPropertyArray(this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox);clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = vocabCopyTrustSet( + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, + ); if ("outbox" in values && values.outbox != null) { if (values.outbox instanceof OrderedCollection || values.outbox instanceof OrderedCollectionPage || values.outbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox]; - clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set([0]); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] = 1; } else { throw new TypeError( "The outbox must be of type " + @@ -67080,12 +71137,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice();clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following); + clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < vocabSparseArrayMinimumLength + ? this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice() : vocabCopyPropertyArray(this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following);clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = vocabCopyTrustSet( + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, + ); if ("following" in values && values.following != null) { if (values.following instanceof Collection || values.following instanceof URL) { // @ts-ignore: type is checked above. clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = [values.following]; - clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set([0]); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] = 1; } else { throw new TypeError( "The following must be of type " + @@ -67093,12 +71154,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice();clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers); + clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < vocabSparseArrayMinimumLength + ? this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice() : vocabCopyPropertyArray(this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers);clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = vocabCopyTrustSet( + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, + ); if ("followers" in values && values.followers != null) { if (values.followers instanceof Collection || values.followers instanceof URL) { // @ts-ignore: type is checked above. clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = [values.followers]; - clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set([0]); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] = 1; } else { throw new TypeError( "The followers must be of type " + @@ -67106,12 +71171,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice();clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked); + clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < vocabSparseArrayMinimumLength + ? this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice() : vocabCopyPropertyArray(this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked);clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = vocabCopyTrustSet( + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, + ); if ("liked" in values && values.liked != null) { if (values.liked instanceof Collection || values.liked instanceof URL) { // @ts-ignore: type is checked above. clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = [values.liked]; - clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set([0]); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] = 1; } else { throw new TypeError( "The liked must be of type " + @@ -67119,12 +71188,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice();clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured); + clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < vocabSparseArrayMinimumLength + ? this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice() : vocabCopyPropertyArray(this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured);clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = vocabCopyTrustSet( + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, + ); if ("featured" in values && values.featured != null) { if (values.featured instanceof Collection || values.featured instanceof URL) { // @ts-ignore: type is checked above. clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = [values.featured]; - clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set([0]); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] = 1; } else { throw new TypeError( "The featured must be of type " + @@ -67132,12 +71205,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice();clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags); + clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < vocabSparseArrayMinimumLength + ? this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice() : vocabCopyPropertyArray(this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags);clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = vocabCopyTrustSet( + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, + ); if ("featuredTags" in values && values.featuredTags != null) { if (values.featuredTags instanceof Collection || values.featuredTags instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = [values.featuredTags]; - clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set([0]); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] = 1; } else { throw new TypeError( "The featuredTags must be of type " + @@ -67145,12 +71222,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice();clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections); + clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length < vocabSparseArrayMinimumLength + ? this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice() : vocabCopyPropertyArray(this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections);clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = vocabCopyTrustSet( + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, + ); if ("featuredCollections" in values && values.featuredCollections != null) { if (values.featuredCollections instanceof Collection || values.featuredCollections instanceof URL) { // @ts-ignore: type is checked above. clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = [values.featuredCollections]; - clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set([0]); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] = 1; } else { throw new TypeError( "The featuredCollections must be of type " + @@ -67158,18 +71239,43 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice();clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length < vocabSparseArrayMinimumLength + ? this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice() : vocabCopyPropertyArray(this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams);clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = vocabCopyTrustSet( + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, + ); if ("streams" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(); - for (let i = 0; i < values.streams.length; i++) { - clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -67178,7 +71284,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice(); + clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length < vocabSparseArrayMinimumLength + ? this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice() : vocabCopyPropertyArray(this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints); if ("endpoints" in values && values.endpoints != null) { if (values.endpoints instanceof Endpoints) { // @ts-ignore: type is checked above. @@ -67191,7 +71298,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice(); + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.length < vocabSparseArrayMinimumLength + ? this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice() : vocabCopyPropertyArray(this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable); if ("discoverable" in values && values.discoverable != null) { if (typeof values.discoverable === "boolean") { // @ts-ignore: type is checked above. @@ -67204,7 +71312,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice(); + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.length < vocabSparseArrayMinimumLength + ? this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice() : vocabCopyPropertyArray(this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended); if ("suspended" in values && values.suspended != null) { if (typeof values.suspended === "boolean") { // @ts-ignore: type is checked above. @@ -67217,7 +71326,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice(); + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.length < vocabSparseArrayMinimumLength + ? this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice() : vocabCopyPropertyArray(this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial); if ("memorial" in values && values.memorial != null) { if (typeof values.memorial === "boolean") { // @ts-ignore: type is checked above. @@ -67230,7 +71340,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice(); + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.length < vocabSparseArrayMinimumLength + ? this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice() : vocabCopyPropertyArray(this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable); if ("indexable" in values && values.indexable != null) { if (typeof values.indexable === "boolean") { // @ts-ignore: type is checked above. @@ -67243,12 +71354,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice();clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo); + clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < vocabSparseArrayMinimumLength + ? this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice() : vocabCopyPropertyArray(this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo);clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = vocabCopyTrustSet( + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, + ); if ("successor" in values && values.successor != null) { if (values.successor instanceof Application || values.successor instanceof Group || values.successor instanceof Organization || values.successor instanceof Person || values.successor instanceof Service || values.successor instanceof URL) { // @ts-ignore: type is checked above. clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor]; - clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set([0]); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] = 1; } else { throw new TypeError( "The successor must be of type " + @@ -67256,12 +71371,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice();clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < vocabSparseArrayMinimumLength + ? this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice() : vocabCopyPropertyArray(this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs);clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = vocabCopyTrustSet( + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, + ); if ("alias" in values && values.alias != null) { if (values.alias instanceof Application || values.alias instanceof Group || values.alias instanceof Organization || values.alias instanceof Person || values.alias instanceof Service || values.alias instanceof URL) { // @ts-ignore: type is checked above. clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [values.alias]; - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set([0]); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] = 1; } else { throw new TypeError( "The alias must be of type " + @@ -67280,15 +71399,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); - for (let i = 0; i < values.aliases.length; i++) { - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -67297,12 +71438,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice();clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < vocabSparseArrayMinimumLength + ? this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice() : vocabCopyPropertyArray(this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service);clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = vocabCopyTrustSet( + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, + ); if ("service" in values && values.service != null) { if (values.service instanceof DidService || values.service instanceof URL) { // @ts-ignore: type is checked above. clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = [values.service]; - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set([0]); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] = 1; } else { throw new TypeError( "The service must be of type " + @@ -67321,15 +71466,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); - for (let i = 0; i < values.services.length; i++) { - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -67338,7 +71505,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice(); + clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.length < vocabSparseArrayMinimumLength + ? this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice() : vocabCopyPropertyArray(this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage); if ("followedMessage" in values && values.followedMessage != null) { if (typeof values.followedMessage === "string") { // @ts-ignore: type is checked above. @@ -67351,7 +71519,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice(); + clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.length < vocabSparseArrayMinimumLength + ? this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice() : vocabCopyPropertyArray(this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat); if ("cat" in values && values.cat != null) { if (typeof values.cat === "boolean") { // @ts-ignore: type is checked above. @@ -67364,7 +71533,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice(); + clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length < vocabSparseArrayMinimumLength + ? this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice() : vocabCopyPropertyArray(this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense); if ("preferredLicense" in values && values.preferredLicense != null) { if (values.preferredLicense instanceof URL) { // @ts-ignore: type is checked above. @@ -67403,6 +71573,12 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -67458,122 +71634,377 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Application; - for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { - const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; - if (value != null && typeof value === "object") { - node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + { + const array = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === "object") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { - const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; - if (value != null && typeof value === "object") { - node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + { + const array = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === "object") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { - const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; - if (value != null && typeof value === "object") { - node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + { + const array = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === "object") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { - const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; - if (value != null && typeof value === "object") { - node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + { + const array = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === "object") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { - const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; - if (value != null && typeof value === "object") { - node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + { + const array = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === "object") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { - const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; - if (value != null && typeof value === "object") { - node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + { + const array = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === "object") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { - const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; - if (value != null && typeof value === "object") { - node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + { + const array = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === "object") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { - const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; - if (value != null && typeof value === "object") { - node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + { + const array = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === "object") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { - const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; - if (value != null && typeof value === "object") { - node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + { + const array = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === "object") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { - const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; - if (value != null && typeof value === "object") { - node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + { + const array = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === "object") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { - const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; - if (value != null && typeof value === "object") { - node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + { + const array = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === "object") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { - const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; - if (value != null && typeof value === "object") { - node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + { + const array = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === "object") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { - const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; - if (value != null && typeof value === "object") { - node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + { + const array = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === "object") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { - const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; - if (value != null && typeof value === "object") { - node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + { + const array = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === "object") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { - const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; - if (value != null && typeof value === "object") { - node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + { + const array = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === "object") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { - const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; - if (value != null && typeof value === "object") { - node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + { + const array = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === "object") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { - const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; - if (value != null && typeof value === "object") { - node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + { + const array = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === "object") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } } } } }); } @@ -67926,7 +72357,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#publicKey"); @@ -67994,7 +72426,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -68081,7 +72514,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#publicKey"); @@ -68153,7 +72587,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -68507,7 +72942,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#assertionMethod"); @@ -68575,7 +73011,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -68666,7 +73103,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#assertionMethod"); @@ -68738,7 +73176,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -69162,7 +73601,8 @@ get gateways(): (URL)[] { } let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "http://www.w3.org/ns/ldp#inbox"); @@ -69230,7 +73670,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -69604,7 +74045,8 @@ get gateways(): (URL)[] { } let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#outbox"); @@ -69672,7 +74114,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -70026,7 +74469,8 @@ get gateways(): (URL)[] { } let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#following"); @@ -70094,7 +74538,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -70451,7 +74896,8 @@ get gateways(): (URL)[] { } let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#followers"); @@ -70519,7 +74965,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -70874,7 +75321,8 @@ get gateways(): (URL)[] { } let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#liked"); @@ -70942,7 +75390,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -71295,7 +75744,8 @@ get gateways(): (URL)[] { } let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "http://joinmastodon.org/ns#featured"); @@ -71363,7 +75813,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -71716,7 +76167,8 @@ get gateways(): (URL)[] { } let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "http://joinmastodon.org/ns#featuredTags"); @@ -71784,7 +76236,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -72134,7 +76587,8 @@ get gateways(): (URL)[] { } let v = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[0]; if (!(v instanceof URL) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/7aa9#featuredCollections"); @@ -72202,7 +76656,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -72552,7 +77007,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#streams"); @@ -72624,7 +77080,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -73109,7 +77566,8 @@ get gateways(): (URL)[] { } let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#movedTo"); @@ -73177,7 +77635,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -73590,7 +78049,8 @@ get gateways(): (URL)[] { } let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#alsoKnownAs"); @@ -73658,7 +78118,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -73749,7 +78210,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#alsoKnownAs"); @@ -73821,7 +78283,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -74175,7 +78638,8 @@ get gateways(): (URL)[] { } let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/did#service"); @@ -74243,7 +78707,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -74334,7 +78799,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/did#service"); @@ -74406,7 +78872,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -75805,7 +80272,7 @@ get gateways(): (URL)[] { instance.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = _3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; const _axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); let _axq166E2eZADq34V4MYUc8KMZdC_publicKey__array = values["https://w3id.org/security#publicKey"]; @@ -75846,7 +80313,7 @@ get gateways(): (URL)[] { instance.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = _axq166E2eZADq34V4MYUc8KMZdC_publicKey; const _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); let _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod__array = values["https://w3id.org/security#assertionMethod"]; @@ -75945,7 +80412,7 @@ get gateways(): (URL)[] { instance.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); let _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox__array = values["http://www.w3.org/ns/ldp#inbox"]; @@ -75992,7 +80459,7 @@ get gateways(): (URL)[] { instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; const _41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); let _41QwhqJouoLg3h8dRPKat21brynC_outbox__array = values["https://www.w3.org/ns/activitystreams#outbox"]; @@ -76039,7 +80506,7 @@ get gateways(): (URL)[] { instance.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = _41QwhqJouoLg3h8dRPKat21brynC_outbox; const _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); let _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following__array = values["https://www.w3.org/ns/activitystreams#following"]; @@ -76080,7 +80547,7 @@ get gateways(): (URL)[] { instance.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; const _BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); let _BBCTgfphhsFzpVfKTykGSpBNwoA_followers__array = values["https://www.w3.org/ns/activitystreams#followers"]; @@ -76121,7 +80588,7 @@ get gateways(): (URL)[] { instance.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = _BBCTgfphhsFzpVfKTykGSpBNwoA_followers; const _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); let _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked__array = values["https://www.w3.org/ns/activitystreams#liked"]; @@ -76162,7 +80629,7 @@ get gateways(): (URL)[] { instance.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; const _4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); let _4N1vBJzXDf8NbBumeECQMFvKetja_featured__array = values["http://joinmastodon.org/ns#featured"]; @@ -76203,7 +80670,7 @@ get gateways(): (URL)[] { instance.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = _4N1vBJzXDf8NbBumeECQMFvKetja_featured; const _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); let _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags__array = values["http://joinmastodon.org/ns#featuredTags"]; @@ -76244,7 +80711,7 @@ get gateways(): (URL)[] { instance.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; const _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); let _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections__array = values["https://w3id.org/fep/7aa9#featuredCollections"]; @@ -76285,7 +80752,7 @@ get gateways(): (URL)[] { instance.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); let _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams__array = values["https://www.w3.org/ns/activitystreams#streams"]; @@ -76474,7 +80941,7 @@ get gateways(): (URL)[] { instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); let _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array = values["https://www.w3.org/ns/activitystreams#movedTo"]; @@ -76532,7 +80999,7 @@ get gateways(): (URL)[] { instance.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); let _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array = values["https://www.w3.org/ns/activitystreams#alsoKnownAs"]; @@ -76590,7 +81057,7 @@ get gateways(): (URL)[] { instance.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; const _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); let _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service__array = values["https://www.w3.org/ns/did#service"]; @@ -77465,6 +81932,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -77988,6 +82461,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -78359,11 +82838,11 @@ export class Article extends Object { } #_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); #_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl: (URL)[] = []; #_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); /** * Constructs a new instance of Article with the given values. @@ -78504,12 +82983,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Article;clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice();clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote); + const clone = super.clone(values, options) as unknown as Article;clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < vocabSparseArrayMinimumLength + ? this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice() : vocabCopyPropertyArray(this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote);clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = vocabCopyTrustSet( + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, + ); if ("quote" in values && values.quote != null) { if (values.quote instanceof Object || values.quote instanceof URL) { // @ts-ignore: type is checked above. clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = [values.quote]; - clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set([0]); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] = 1; } else { throw new TypeError( "The quote must be of type " + @@ -78517,7 +83000,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice(); + clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length < vocabSparseArrayMinimumLength + ? this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice() : vocabCopyPropertyArray(this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl); if ("quoteUrl" in values && values.quoteUrl != null) { if (values.quoteUrl instanceof URL) { // @ts-ignore: type is checked above. @@ -78530,12 +83014,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice();clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization); + clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice() : vocabCopyPropertyArray(this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization);clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = vocabCopyTrustSet( + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, + ); if ("quoteAuthorization" in values && values.quoteAuthorization != null) { if (values.quoteAuthorization instanceof QuoteAuthorization || values.quoteAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = [values.quoteAuthorization]; - clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set([0]); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( "The quoteAuthorization must be of type " + @@ -78569,6 +83057,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -78618,24 +83112,69 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Article; - for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { - const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; - if (value != null && typeof value === "object") { - node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + { + const array = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === "object") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { - const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; - if (value != null && typeof value === "object") { - node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + { + const array = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === "object") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { - const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; - if (value != null && typeof value === "object") { - node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + { + const array = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === "object") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } } } } }); } @@ -78968,7 +83507,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/044f#quote"); @@ -79036,7 +83576,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -79410,7 +83951,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/044f#quoteAuthorization"); @@ -79478,7 +84020,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -79905,7 +84448,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); let _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote__array = values["https://w3id.org/fep/044f#quote"]; @@ -79985,7 +84528,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; const _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); let _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization__array = values["https://w3id.org/fep/044f#quoteAuthorization"]; @@ -80296,7 +84839,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Document;clone.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width = this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width.slice(); + const clone = super.clone(values, options) as unknown as Document;clone.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width = this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width.length < vocabSparseArrayMinimumLength + ? this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width.slice() : vocabCopyPropertyArray(this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width); if ("width" in values && values.width != null) { if (typeof values.width === "number" && Number.isInteger(values.width) && values.width >= 0) { // @ts-ignore: type is checked above. @@ -80309,7 +84853,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height = this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.slice(); + clone.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height = this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.length < vocabSparseArrayMinimumLength + ? this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.slice() : vocabCopyPropertyArray(this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height); if ("height" in values && values.height != null) { if (typeof values.height === "number" && Number.isInteger(values.height) && values.height >= 0) { // @ts-ignore: type is checked above. @@ -80322,7 +84867,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.slice(); + clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.length < vocabSparseArrayMinimumLength + ? this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.slice() : vocabCopyPropertyArray(this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase); if ("digestMultibase" in values && values.digestMultibase != null) { if (typeof values.digestMultibase === "string") { // @ts-ignore: type is checked above. @@ -80361,6 +84907,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -81194,6 +85746,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -81717,6 +86275,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -82233,6 +86797,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -82607,13 +87177,13 @@ export class CollectionPage extends Collection { } #_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf: (Collection | URL)[] = []; - #_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf: Set = new Set(); + #_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf: VocabTrustSet = new Set(); #_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next: (CollectionPage | URL)[] = []; - #_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next: Set = new Set(); + #_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next: VocabTrustSet = new Set(); #_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev: (CollectionPage | URL)[] = []; - #_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev: Set = new Set(); + #_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev: VocabTrustSet = new Set(); /** * Constructs a new instance of CollectionPage with the given values. @@ -82754,12 +87324,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as CollectionPage;clone.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.slice();clone.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = new Set(this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf); + const clone = super.clone(values, options) as unknown as CollectionPage;clone.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.length < vocabSparseArrayMinimumLength + ? this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.slice() : vocabCopyPropertyArray(this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf);clone.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = vocabCopyTrustSet( + this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf, clone.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf, + ); if ("partOf" in values && values.partOf != null) { if (values.partOf instanceof Collection || values.partOf instanceof URL) { // @ts-ignore: type is checked above. clone.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = [values.partOf]; - clone.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = new Set([0]); + clone.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = new Set(); + clone.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[vocabTrustPrefix] = 1; } else { throw new TypeError( "The partOf must be of type " + @@ -82767,12 +87341,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.slice();clone.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = new Set(this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next); + clone.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.length < vocabSparseArrayMinimumLength + ? this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.slice() : vocabCopyPropertyArray(this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next);clone.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = vocabCopyTrustSet( + this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next, clone.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next, + ); if ("next" in values && values.next != null) { if (values.next instanceof CollectionPage || values.next instanceof URL) { // @ts-ignore: type is checked above. clone.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = [values.next]; - clone.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = new Set([0]); + clone.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = new Set(); + clone.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[vocabTrustPrefix] = 1; } else { throw new TypeError( "The next must be of type " + @@ -82780,12 +87358,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.slice();clone.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = new Set(this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev); + clone.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.length < vocabSparseArrayMinimumLength + ? this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.slice() : vocabCopyPropertyArray(this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev);clone.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = vocabCopyTrustSet( + this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev, clone.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev, + ); if ("prev" in values && values.prev != null) { if (values.prev instanceof CollectionPage || values.prev instanceof URL) { // @ts-ignore: type is checked above. clone.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = [values.prev]; - clone.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = new Set([0]); + clone.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev = new Set(); + clone.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[vocabTrustPrefix] = 1; } else { throw new TypeError( "The prev must be of type " + @@ -82819,6 +87401,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -82868,24 +87456,69 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as CollectionPage; - for (let i = 0; i < node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.length; i++) { - const value = node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[i]; - if (value != null && typeof value === "object") { - node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[i] = context.value(value); + { + const array = node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.length; i++) { + const value = node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[i]; + if (value != null && typeof value === "object") { + node.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.length; i++) { - const value = node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[i]; - if (value != null && typeof value === "object") { - node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[i] = context.value(value); + { + const array = node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.length; i++) { + const value = node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[i]; + if (value != null && typeof value === "object") { + node.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.length; i++) { - const value = node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[i]; - if (value != null && typeof value === "object") { - node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[i] = context.value(value); + { + const array = node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.length; i++) { + const value = node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[i]; + if (value != null && typeof value === "object") { + node.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[i] = context.value(value); + } + } } } } }); } @@ -83217,7 +87850,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[0]; if (!(v instanceof URL) && - !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { + !(0 < (this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#partOf"); @@ -83285,7 +87919,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { + !(0 < (this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -83634,7 +88269,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[0]; if (!(v instanceof URL) && - !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { + !(0 < (this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[vocabTrustPrefix] ?? 0) || + this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#next"); @@ -83702,7 +88338,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { + !(0 < (this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[vocabTrustPrefix] ?? 0) || + this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -84052,7 +88689,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[0]; if (!(v instanceof URL) && - !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { + !(0 < (this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[vocabTrustPrefix] ?? 0) || + this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#prev"); @@ -84120,7 +88758,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { + !(0 < (this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[vocabTrustPrefix] ?? 0) || + this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -84541,7 +89180,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf: (Collection | URL)[] = []; - const _trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf: Set = new Set(); + const _trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf: VocabTrustSet = new Set(); let _2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf__array = values["https://www.w3.org/ns/activitystreams#partOf"]; @@ -84582,7 +89221,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf = _2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf; const _3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next: (CollectionPage | URL)[] = []; - const _trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next: Set = new Set(); + const _trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next: VocabTrustSet = new Set(); let _3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next__array = values["https://www.w3.org/ns/activitystreams#next"]; @@ -84623,7 +89262,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next = _3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next; const _3b8yG8tDNzQFFEnWhCc13G8eHooA_prev: (CollectionPage | URL)[] = []; - const _trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev: Set = new Set(); + const _trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev: VocabTrustSet = new Set(); let _3b8yG8tDNzQFFEnWhCc13G8eHooA_prev__array = values["https://www.w3.org/ns/activitystreams#prev"]; @@ -84930,6 +89569,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -85440,6 +90085,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -85948,6 +90599,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -86579,7 +91236,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint options ); copyPortableProvenance(this, clone); - clone.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl = this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.slice(); + clone.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl = this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.length < vocabSparseArrayMinimumLength + ? this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.slice() : vocabCopyPropertyArray(this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl); if ("proxyUrl" in values && values.proxyUrl != null) { if (values.proxyUrl instanceof URL) { // @ts-ignore: type is checked above. @@ -86592,7 +91250,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ); } } - clone.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint = this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.slice(); + clone.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint = this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.length < vocabSparseArrayMinimumLength + ? this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.slice() : vocabCopyPropertyArray(this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint); if ("oauthAuthorizationEndpoint" in values && values.oauthAuthorizationEndpoint != null) { if (values.oauthAuthorizationEndpoint instanceof URL) { // @ts-ignore: type is checked above. @@ -86605,7 +91264,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ); } } - clone.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint = this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.slice(); + clone.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint = this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.length < vocabSparseArrayMinimumLength + ? this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.slice() : vocabCopyPropertyArray(this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint); if ("oauthTokenEndpoint" in values && values.oauthTokenEndpoint != null) { if (values.oauthTokenEndpoint instanceof URL) { // @ts-ignore: type is checked above. @@ -86618,7 +91278,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ); } } - clone.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey = this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.slice(); + clone.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey = this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.length < vocabSparseArrayMinimumLength + ? this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.slice() : vocabCopyPropertyArray(this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey); if ("provideClientKey" in values && values.provideClientKey != null) { if (values.provideClientKey instanceof URL) { // @ts-ignore: type is checked above. @@ -86631,7 +91292,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ); } } - clone.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey = this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.slice(); + clone.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey = this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.length < vocabSparseArrayMinimumLength + ? this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.slice() : vocabCopyPropertyArray(this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey); if ("signClientKey" in values && values.signClientKey != null) { if (values.signClientKey instanceof URL) { // @ts-ignore: type is checked above. @@ -86644,7 +91306,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ); } } - clone.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox = this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.slice(); + clone.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox = this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.length < vocabSparseArrayMinimumLength + ? this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.slice() : vocabCopyPropertyArray(this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox); if ("sharedInbox" in values && values.sharedInbox != null) { if (values.sharedInbox instanceof URL) { // @ts-ignore: type is checked above. @@ -86657,7 +91320,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ); } } - clone.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia = this.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia.slice(); + clone.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia = this.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia.length < vocabSparseArrayMinimumLength + ? this.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia.slice() : vocabCopyPropertyArray(this.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia); if ("uploadMedia" in values && values.uploadMedia != null) { if (values.uploadMedia instanceof URL) { // @ts-ignore: type is checked above. @@ -86696,6 +91360,12 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -86739,52 +91409,157 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.length; i++) { - const value = node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl[i]; - if (value != null && typeof value === "object") { - node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl[i] = context.value(value); + { + const array = node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.length; i++) { + const value = node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl[i]; + if (value != null && typeof value === "object") { + node.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.length; i++) { - const value = node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint[i]; - if (value != null && typeof value === "object") { - node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint[i] = context.value(value); + { + const array = node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.length; i++) { + const value = node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint[i]; + if (value != null && typeof value === "object") { + node.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.length; i++) { - const value = node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint[i]; - if (value != null && typeof value === "object") { - node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint[i] = context.value(value); + { + const array = node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.length; i++) { + const value = node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint[i]; + if (value != null && typeof value === "object") { + node.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.length; i++) { - const value = node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey[i]; - if (value != null && typeof value === "object") { - node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey[i] = context.value(value); + { + const array = node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.length; i++) { + const value = node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey[i]; + if (value != null && typeof value === "object") { + node.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.length; i++) { - const value = node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey[i]; - if (value != null && typeof value === "object") { - node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey[i] = context.value(value); + { + const array = node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.length; i++) { + const value = node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey[i]; + if (value != null && typeof value === "object") { + node.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.length; i++) { - const value = node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox[i]; - if (value != null && typeof value === "object") { - node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox[i] = context.value(value); + { + const array = node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.length; i++) { + const value = node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox[i]; + if (value != null && typeof value === "object") { + node.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia.length; i++) { - const value = node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia[i]; - if (value != null && typeof value === "object") { - node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia[i] = context.value(value); + { + const array = node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia.length; i++) { + const value = node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia[i]; + if (value != null && typeof value === "object") { + node.#_KukVKGqFRETxAxXA15YCYAA7XAT_uploadMedia[i] = context.value(value); + } + } } } } }); } @@ -87961,6 +92736,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -88485,6 +93266,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -88997,6 +93784,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -89369,39 +94162,39 @@ export class Group extends Object { #_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername: ((string | LanguageString))[] = []; #_axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); #_41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); #_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); #_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); #_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); #_4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); #_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); #_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints: (Endpoints)[] = []; #_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable: (boolean)[] = []; #_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended: (boolean)[] = []; @@ -89409,13 +94202,13 @@ export class Group extends Object { #_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable: (boolean)[] = []; #_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); #_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); #_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); #_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage: (string)[] = []; #_2xEU4QtkC53RAun67T81Egqt9vmL_isCat: (boolean)[] = []; #_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense: (URL)[] = []; @@ -89484,10 +94277,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === "string" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === "string" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -89520,14 +94337,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; - for (let i = 0; i < values.publicKeys.length; i++) { - this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -89560,14 +94399,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; - for (let i = 0; i < values.assertionMethods.length; i++) { - this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -89600,10 +94461,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -89732,14 +94617,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | if ("streams" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; - for (let i = 0; i < values.streams.length; i++) { - this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -89850,14 +94757,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; - for (let i = 0; i < values.aliases.length; i++) { - this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -89890,14 +94819,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; - for (let i = 0; i < values.services.length; i++) { - this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -90017,7 +94968,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Group;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice(); + const clone = super.clone(values, options) as unknown as Group;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.length < vocabSparseArrayMinimumLength + ? this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice() : vocabCopyPropertyArray(this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername); if ("preferredUsername" in values && values.preferredUsername != null) { if (typeof values.preferredUsername === "string" || values.preferredUsername instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -90041,10 +94993,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === "string" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === "string" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -90053,12 +95029,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice();clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < vocabSparseArrayMinimumLength + ? this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice() : vocabCopyPropertyArray(this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey);clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = vocabCopyTrustSet( + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, + ); if ("publicKey" in values && values.publicKey != null) { if (values.publicKey instanceof CryptographicKey || values.publicKey instanceof URL) { // @ts-ignore: type is checked above. clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = [values.publicKey]; - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set([0]); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] = 1; } else { throw new TypeError( "The publicKey must be of type " + @@ -90077,15 +95057,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); - for (let i = 0; i < values.publicKeys.length; i++) { - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -90094,12 +95096,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice();clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < vocabSparseArrayMinimumLength + ? this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice() : vocabCopyPropertyArray(this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod);clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = vocabCopyTrustSet( + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, + ); if ("assertionMethod" in values && values.assertionMethod != null) { if (values.assertionMethod instanceof Multikey || values.assertionMethod instanceof URL) { // @ts-ignore: type is checked above. clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = [values.assertionMethod]; - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set([0]); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] = 1; } else { throw new TypeError( "The assertionMethod must be of type " + @@ -90118,15 +95124,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); - for (let i = 0; i < values.assertionMethods.length; i++) { - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -90135,7 +95163,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < vocabSparseArrayMinimumLength + ? this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice() : vocabCopyPropertyArray(this.#_hQiaHhZP8hqxckxTBrpsGNs57E3); if ("gateway" in values && values.gateway != null) { if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { // @ts-ignore: type is checked above. @@ -90159,10 +95188,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -90171,7 +95224,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice(); + clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.length < vocabSparseArrayMinimumLength + ? this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice() : vocabCopyPropertyArray(this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers); if ("manuallyApprovesFollowers" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === "boolean") { // @ts-ignore: type is checked above. @@ -90184,12 +95238,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice();clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox); + clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < vocabSparseArrayMinimumLength + ? this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice() : vocabCopyPropertyArray(this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox);clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = vocabCopyTrustSet( + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, + ); if ("inbox" in values && values.inbox != null) { if (values.inbox instanceof OrderedCollection || values.inbox instanceof OrderedCollectionPage || values.inbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox]; - clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set([0]); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] = 1; } else { throw new TypeError( "The inbox must be of type " + @@ -90197,12 +95255,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice();clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox); + clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < vocabSparseArrayMinimumLength + ? this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice() : vocabCopyPropertyArray(this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox);clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = vocabCopyTrustSet( + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, + ); if ("outbox" in values && values.outbox != null) { if (values.outbox instanceof OrderedCollection || values.outbox instanceof OrderedCollectionPage || values.outbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox]; - clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set([0]); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] = 1; } else { throw new TypeError( "The outbox must be of type " + @@ -90210,12 +95272,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice();clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following); + clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < vocabSparseArrayMinimumLength + ? this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice() : vocabCopyPropertyArray(this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following);clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = vocabCopyTrustSet( + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, + ); if ("following" in values && values.following != null) { if (values.following instanceof Collection || values.following instanceof URL) { // @ts-ignore: type is checked above. clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = [values.following]; - clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set([0]); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] = 1; } else { throw new TypeError( "The following must be of type " + @@ -90223,12 +95289,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice();clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers); + clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < vocabSparseArrayMinimumLength + ? this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice() : vocabCopyPropertyArray(this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers);clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = vocabCopyTrustSet( + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, + ); if ("followers" in values && values.followers != null) { if (values.followers instanceof Collection || values.followers instanceof URL) { // @ts-ignore: type is checked above. clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = [values.followers]; - clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set([0]); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] = 1; } else { throw new TypeError( "The followers must be of type " + @@ -90236,12 +95306,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice();clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked); + clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < vocabSparseArrayMinimumLength + ? this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice() : vocabCopyPropertyArray(this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked);clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = vocabCopyTrustSet( + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, + ); if ("liked" in values && values.liked != null) { if (values.liked instanceof Collection || values.liked instanceof URL) { // @ts-ignore: type is checked above. clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = [values.liked]; - clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set([0]); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] = 1; } else { throw new TypeError( "The liked must be of type " + @@ -90249,12 +95323,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice();clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured); + clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < vocabSparseArrayMinimumLength + ? this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice() : vocabCopyPropertyArray(this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured);clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = vocabCopyTrustSet( + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, + ); if ("featured" in values && values.featured != null) { if (values.featured instanceof Collection || values.featured instanceof URL) { // @ts-ignore: type is checked above. clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = [values.featured]; - clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set([0]); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] = 1; } else { throw new TypeError( "The featured must be of type " + @@ -90262,12 +95340,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice();clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags); + clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < vocabSparseArrayMinimumLength + ? this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice() : vocabCopyPropertyArray(this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags);clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = vocabCopyTrustSet( + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, + ); if ("featuredTags" in values && values.featuredTags != null) { if (values.featuredTags instanceof Collection || values.featuredTags instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = [values.featuredTags]; - clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set([0]); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] = 1; } else { throw new TypeError( "The featuredTags must be of type " + @@ -90275,12 +95357,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice();clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections); + clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length < vocabSparseArrayMinimumLength + ? this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice() : vocabCopyPropertyArray(this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections);clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = vocabCopyTrustSet( + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, + ); if ("featuredCollections" in values && values.featuredCollections != null) { if (values.featuredCollections instanceof Collection || values.featuredCollections instanceof URL) { // @ts-ignore: type is checked above. clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = [values.featuredCollections]; - clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set([0]); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] = 1; } else { throw new TypeError( "The featuredCollections must be of type " + @@ -90288,18 +95374,43 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice();clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length < vocabSparseArrayMinimumLength + ? this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice() : vocabCopyPropertyArray(this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams);clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = vocabCopyTrustSet( + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, + ); if ("streams" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(); - for (let i = 0; i < values.streams.length; i++) { - clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -90308,7 +95419,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice(); + clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length < vocabSparseArrayMinimumLength + ? this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice() : vocabCopyPropertyArray(this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints); if ("endpoints" in values && values.endpoints != null) { if (values.endpoints instanceof Endpoints) { // @ts-ignore: type is checked above. @@ -90321,7 +95433,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice(); + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.length < vocabSparseArrayMinimumLength + ? this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice() : vocabCopyPropertyArray(this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable); if ("discoverable" in values && values.discoverable != null) { if (typeof values.discoverable === "boolean") { // @ts-ignore: type is checked above. @@ -90334,7 +95447,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice(); + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.length < vocabSparseArrayMinimumLength + ? this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice() : vocabCopyPropertyArray(this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended); if ("suspended" in values && values.suspended != null) { if (typeof values.suspended === "boolean") { // @ts-ignore: type is checked above. @@ -90347,7 +95461,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice(); + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.length < vocabSparseArrayMinimumLength + ? this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice() : vocabCopyPropertyArray(this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial); if ("memorial" in values && values.memorial != null) { if (typeof values.memorial === "boolean") { // @ts-ignore: type is checked above. @@ -90360,7 +95475,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice(); + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.length < vocabSparseArrayMinimumLength + ? this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice() : vocabCopyPropertyArray(this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable); if ("indexable" in values && values.indexable != null) { if (typeof values.indexable === "boolean") { // @ts-ignore: type is checked above. @@ -90373,12 +95489,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice();clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo); + clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < vocabSparseArrayMinimumLength + ? this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice() : vocabCopyPropertyArray(this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo);clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = vocabCopyTrustSet( + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, + ); if ("successor" in values && values.successor != null) { if (values.successor instanceof Application || values.successor instanceof Group || values.successor instanceof Organization || values.successor instanceof Person || values.successor instanceof Service || values.successor instanceof URL) { // @ts-ignore: type is checked above. clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor]; - clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set([0]); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] = 1; } else { throw new TypeError( "The successor must be of type " + @@ -90386,12 +95506,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice();clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < vocabSparseArrayMinimumLength + ? this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice() : vocabCopyPropertyArray(this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs);clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = vocabCopyTrustSet( + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, + ); if ("alias" in values && values.alias != null) { if (values.alias instanceof Application || values.alias instanceof Group || values.alias instanceof Organization || values.alias instanceof Person || values.alias instanceof Service || values.alias instanceof URL) { // @ts-ignore: type is checked above. clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [values.alias]; - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set([0]); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] = 1; } else { throw new TypeError( "The alias must be of type " + @@ -90410,15 +95534,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); - for (let i = 0; i < values.aliases.length; i++) { - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -90427,12 +95573,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice();clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < vocabSparseArrayMinimumLength + ? this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice() : vocabCopyPropertyArray(this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service);clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = vocabCopyTrustSet( + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, + ); if ("service" in values && values.service != null) { if (values.service instanceof DidService || values.service instanceof URL) { // @ts-ignore: type is checked above. clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = [values.service]; - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set([0]); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] = 1; } else { throw new TypeError( "The service must be of type " + @@ -90451,15 +95601,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); - for (let i = 0; i < values.services.length; i++) { - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -90468,7 +95640,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice(); + clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.length < vocabSparseArrayMinimumLength + ? this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice() : vocabCopyPropertyArray(this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage); if ("followedMessage" in values && values.followedMessage != null) { if (typeof values.followedMessage === "string") { // @ts-ignore: type is checked above. @@ -90481,7 +95654,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice(); + clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.length < vocabSparseArrayMinimumLength + ? this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice() : vocabCopyPropertyArray(this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat); if ("cat" in values && values.cat != null) { if (typeof values.cat === "boolean") { // @ts-ignore: type is checked above. @@ -90494,7 +95668,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice(); + clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length < vocabSparseArrayMinimumLength + ? this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice() : vocabCopyPropertyArray(this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense); if ("preferredLicense" in values && values.preferredLicense != null) { if (values.preferredLicense instanceof URL) { // @ts-ignore: type is checked above. @@ -90533,6 +95708,12 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -90588,122 +95769,377 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Group; - for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { - const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; - if (value != null && typeof value === "object") { - node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + { + const array = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === "object") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { - const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; - if (value != null && typeof value === "object") { - node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + { + const array = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === "object") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { - const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; - if (value != null && typeof value === "object") { - node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + { + const array = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === "object") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { - const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; - if (value != null && typeof value === "object") { - node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + { + const array = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === "object") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { - const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; - if (value != null && typeof value === "object") { - node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + { + const array = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === "object") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { - const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; - if (value != null && typeof value === "object") { - node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + { + const array = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === "object") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { - const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; - if (value != null && typeof value === "object") { - node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + { + const array = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === "object") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { - const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; - if (value != null && typeof value === "object") { - node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + { + const array = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === "object") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { - const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; - if (value != null && typeof value === "object") { - node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + { + const array = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === "object") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { - const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; - if (value != null && typeof value === "object") { - node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + { + const array = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === "object") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { - const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; - if (value != null && typeof value === "object") { - node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + { + const array = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === "object") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { - const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; - if (value != null && typeof value === "object") { - node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + { + const array = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === "object") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { - const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; - if (value != null && typeof value === "object") { - node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + { + const array = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === "object") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { - const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; - if (value != null && typeof value === "object") { - node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + { + const array = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === "object") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { - const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; - if (value != null && typeof value === "object") { - node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + { + const array = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === "object") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { - const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; - if (value != null && typeof value === "object") { - node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + { + const array = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === "object") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { - const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; - if (value != null && typeof value === "object") { - node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + { + const array = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === "object") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } } } } }); } @@ -91056,7 +96492,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#publicKey"); @@ -91124,7 +96561,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -91211,7 +96649,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#publicKey"); @@ -91283,7 +96722,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -91637,7 +97077,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#assertionMethod"); @@ -91705,7 +97146,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -91796,7 +97238,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#assertionMethod"); @@ -91868,7 +97311,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -92292,7 +97736,8 @@ get gateways(): (URL)[] { } let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "http://www.w3.org/ns/ldp#inbox"); @@ -92360,7 +97805,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -92734,7 +98180,8 @@ get gateways(): (URL)[] { } let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#outbox"); @@ -92802,7 +98249,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -93156,7 +98604,8 @@ get gateways(): (URL)[] { } let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#following"); @@ -93224,7 +98673,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -93581,7 +99031,8 @@ get gateways(): (URL)[] { } let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#followers"); @@ -93649,7 +99100,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -94004,7 +99456,8 @@ get gateways(): (URL)[] { } let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#liked"); @@ -94072,7 +99525,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -94425,7 +99879,8 @@ get gateways(): (URL)[] { } let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "http://joinmastodon.org/ns#featured"); @@ -94493,7 +99948,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -94846,7 +100302,8 @@ get gateways(): (URL)[] { } let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "http://joinmastodon.org/ns#featuredTags"); @@ -94914,7 +100371,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -95264,7 +100722,8 @@ get gateways(): (URL)[] { } let v = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[0]; if (!(v instanceof URL) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/7aa9#featuredCollections"); @@ -95332,7 +100791,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -95682,7 +101142,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#streams"); @@ -95754,7 +101215,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -96239,7 +101701,8 @@ get gateways(): (URL)[] { } let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#movedTo"); @@ -96307,7 +101770,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -96720,7 +102184,8 @@ get gateways(): (URL)[] { } let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#alsoKnownAs"); @@ -96788,7 +102253,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -96879,7 +102345,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#alsoKnownAs"); @@ -96951,7 +102418,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -97305,7 +102773,8 @@ get gateways(): (URL)[] { } let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/did#service"); @@ -97373,7 +102842,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -97464,7 +102934,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/did#service"); @@ -97536,7 +103007,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -98935,7 +104407,7 @@ get gateways(): (URL)[] { instance.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = _3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; const _axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); let _axq166E2eZADq34V4MYUc8KMZdC_publicKey__array = values["https://w3id.org/security#publicKey"]; @@ -98976,7 +104448,7 @@ get gateways(): (URL)[] { instance.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = _axq166E2eZADq34V4MYUc8KMZdC_publicKey; const _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); let _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod__array = values["https://w3id.org/security#assertionMethod"]; @@ -99075,7 +104547,7 @@ get gateways(): (URL)[] { instance.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); let _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox__array = values["http://www.w3.org/ns/ldp#inbox"]; @@ -99122,7 +104594,7 @@ get gateways(): (URL)[] { instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; const _41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); let _41QwhqJouoLg3h8dRPKat21brynC_outbox__array = values["https://www.w3.org/ns/activitystreams#outbox"]; @@ -99169,7 +104641,7 @@ get gateways(): (URL)[] { instance.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = _41QwhqJouoLg3h8dRPKat21brynC_outbox; const _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); let _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following__array = values["https://www.w3.org/ns/activitystreams#following"]; @@ -99210,7 +104682,7 @@ get gateways(): (URL)[] { instance.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; const _BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); let _BBCTgfphhsFzpVfKTykGSpBNwoA_followers__array = values["https://www.w3.org/ns/activitystreams#followers"]; @@ -99251,7 +104723,7 @@ get gateways(): (URL)[] { instance.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = _BBCTgfphhsFzpVfKTykGSpBNwoA_followers; const _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); let _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked__array = values["https://www.w3.org/ns/activitystreams#liked"]; @@ -99292,7 +104764,7 @@ get gateways(): (URL)[] { instance.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; const _4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); let _4N1vBJzXDf8NbBumeECQMFvKetja_featured__array = values["http://joinmastodon.org/ns#featured"]; @@ -99333,7 +104805,7 @@ get gateways(): (URL)[] { instance.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = _4N1vBJzXDf8NbBumeECQMFvKetja_featured; const _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); let _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags__array = values["http://joinmastodon.org/ns#featuredTags"]; @@ -99374,7 +104846,7 @@ get gateways(): (URL)[] { instance.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; const _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); let _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections__array = values["https://w3id.org/fep/7aa9#featuredCollections"]; @@ -99415,7 +104887,7 @@ get gateways(): (URL)[] { instance.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); let _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams__array = values["https://www.w3.org/ns/activitystreams#streams"]; @@ -99604,7 +105076,7 @@ get gateways(): (URL)[] { instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); let _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array = values["https://www.w3.org/ns/activitystreams#movedTo"]; @@ -99662,7 +105134,7 @@ get gateways(): (URL)[] { instance.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); let _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array = values["https://www.w3.org/ns/activitystreams#alsoKnownAs"]; @@ -99720,7 +105192,7 @@ get gateways(): (URL)[] { instance.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; const _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); let _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service__array = values["https://www.w3.org/ns/did#service"]; @@ -100540,7 +106012,7 @@ export class Link { #_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width: (number)[] = []; #_gCVTegXxWWCw6wWRxa1QF65zusg_preview: (Link | Object | URL)[] = []; - #_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: Set = new Set(); + #_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: VocabTrustSet = new Set(); #_2rzkBRS4gNPrkJk9DohHAMUAxA2d: (URL)[] = []; /** @@ -100619,10 +106091,34 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } - if (Array.isArray(values.rels) && - values.rels.every(v => typeof v === "string")) { + let copied!: (string)[]; + let valid = false; + if (Array.isArray(values.rels)) { + const array = values.rels; + const test = (v: string): boolean => typeof v === "string"; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.rels; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel = values.rels.slice(); + this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel = copied; } else { throw new TypeError( @@ -100681,10 +106177,34 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } - if (Array.isArray(values.names) && - values.names.every(v => typeof v === "string" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.names)) { + const array = values.names; + const test = (v: string | LanguageString): boolean => typeof v === "string" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.names; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = values.names.slice(); + this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = copied; } else { throw new TypeError( @@ -100735,14 +106255,36 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if ("previews" in values && values.previews != null) { - if (Array.isArray(values.previews) && - values.previews.every(v => v instanceof Link || v instanceof Object || v instanceof URL)) { + let copied!: (Link | Object | URL)[]; + let valid = false; + if (Array.isArray(values.previews)) { + const array = values.previews; + const test = (v: Link | Object | URL): boolean => v instanceof Link || v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.previews; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = values.previews.slice(); + this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = copied; - for (let i = 0; i < values.previews.length; i++) { - this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.add(i); - } + vocabSetTrustPrefix(this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length); } else { throw new TypeError( @@ -100754,10 +106296,34 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if ("licenses" in values && values.licenses != null) { - if (Array.isArray(values.licenses) && - values.licenses.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.licenses)) { + const array = values.licenses; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.licenses; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = values.licenses.slice(); + this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = copied; } else { throw new TypeError( @@ -100825,7 +106391,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num options ); copyPortableProvenance(this, clone); - clone.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href = this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.slice(); + clone.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href = this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.length < vocabSparseArrayMinimumLength + ? this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.slice() : vocabCopyPropertyArray(this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href); if ("href" in values && values.href != null) { if (values.href instanceof URL) { // @ts-ignore: type is checked above. @@ -100838,7 +106405,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel = this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel.slice(); + clone.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel = this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel.length < vocabSparseArrayMinimumLength + ? this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel.slice() : vocabCopyPropertyArray(this.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel); if ("rel" in values && values.rel != null) { if (typeof values.rel === "string") { // @ts-ignore: type is checked above. @@ -100862,10 +106430,34 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } - if (Array.isArray(values.rels) && - values.rels.every(v => typeof v === "string")) { + let copied!: (string)[]; + let valid = false; + if (Array.isArray(values.rels)) { + const array = values.rels; + const test = (v: string): boolean => typeof v === "string"; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.rels; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel = values.rels.slice(); + clone.#_2a1c5GkfkQsnyyLybF8UXBQfFuHZ_rel = copied; } else { throw new TypeError( @@ -100874,7 +106466,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.slice(); + clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.length < vocabSparseArrayMinimumLength + ? this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.slice() : vocabCopyPropertyArray(this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType); if ("mediaType" in values && values.mediaType != null) { if (typeof values.mediaType === "string") { // @ts-ignore: type is checked above. @@ -100887,7 +106480,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.slice(); + clone.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase = this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.length < vocabSparseArrayMinimumLength + ? this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase.slice() : vocabCopyPropertyArray(this.#_2ydcBe182LRq82jFGE6Rxw6VfvEM_digestMultibase); if ("digestMultibase" in values && values.digestMultibase != null) { if (typeof values.digestMultibase === "string") { // @ts-ignore: type is checked above. @@ -100900,7 +106494,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice(); + clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.length < vocabSparseArrayMinimumLength + ? this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name.slice() : vocabCopyPropertyArray(this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name); if ("name" in values && values.name != null) { if (typeof values.name === "string" || values.name instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -100924,10 +106519,34 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } - if (Array.isArray(values.names) && - values.names.every(v => typeof v === "string" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.names)) { + const array = values.names; + const test = (v: string | LanguageString): boolean => typeof v === "string" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.names; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = values.names.slice(); + clone.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name = copied; } else { throw new TypeError( @@ -100936,7 +106555,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang = this.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang.slice(); + clone.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang = this.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang.length < vocabSparseArrayMinimumLength + ? this.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang.slice() : vocabCopyPropertyArray(this.#_f57HKWCp1YRBbTJE8PF12RbDJGf_hreflang); if ("language" in values && values.language != null) { if (values.language instanceof Intl.Locale) { // @ts-ignore: type is checked above. @@ -100949,7 +106569,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height = this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.slice(); + clone.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height = this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.length < vocabSparseArrayMinimumLength + ? this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height.slice() : vocabCopyPropertyArray(this.#_2cGKFeFJMmiNpGZFEF75mCwFQsKb_height); if ("height" in values && values.height != null) { if (typeof values.height === "number" && Number.isInteger(values.height) && values.height >= 0) { // @ts-ignore: type is checked above. @@ -100962,7 +106583,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width = this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width.slice(); + clone.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width = this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width.length < vocabSparseArrayMinimumLength + ? this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width.slice() : vocabCopyPropertyArray(this.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width); if ("width" in values && values.width != null) { if (typeof values.width === "number" && Number.isInteger(values.width) && values.width >= 0) { // @ts-ignore: type is checked above. @@ -100975,18 +106597,43 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.slice();clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = new Set(this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview); + clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length < vocabSparseArrayMinimumLength + ? this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.slice() : vocabCopyPropertyArray(this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview);clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = vocabCopyTrustSet( + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, + ); if ("previews" in values && values.previews != null) { - if (Array.isArray(values.previews) && - values.previews.every(v => v instanceof Link || v instanceof Object || v instanceof URL)) { + let copied!: (Link | Object | URL)[]; + let valid = false; + if (Array.isArray(values.previews)) { + const array = values.previews; + const test = (v: Link | Object | URL): boolean => v instanceof Link || v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.previews; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = values.previews.slice(); + clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview = copied; clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview = new Set(); - for (let i = 0; i < values.previews.length; i++) { - clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.add(i); - } + vocabSetTrustPrefix(clone.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview, clone.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length); } else { throw new TypeError( @@ -100995,13 +106642,38 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num ); } } - clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.slice(); + clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length < vocabSparseArrayMinimumLength + ? this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.slice() : vocabCopyPropertyArray(this.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d); if ("licenses" in values && values.licenses != null) { - if (Array.isArray(values.licenses) && - values.licenses.every(v => v instanceof URL)) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.licenses)) { + const array = values.licenses; + const test = (v: URL): boolean => v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.licenses; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = values.licenses.slice(); + clone.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d = copied; } else { throw new TypeError( @@ -101036,6 +106708,12 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -101081,24 +106759,69 @@ deepCloneDescriptors.set(this.prototype, { const identified = node as { id: URL | null }; identified.id = context.value(identified.id); - for (let i = 0; i < node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.length; i++) { - const value = node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href[i]; - if (value != null && typeof value === "object") { - node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href[i] = context.value(value); + { + const array = node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href.length; i++) { + const value = node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href[i]; + if (value != null && typeof value === "object") { + node.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length; i++) { - const value = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i]; - if (value != null && typeof value === "object") { - node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i] = context.value(value); + { + const array = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length; i++) { + const value = node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i]; + if (value != null && typeof value === "object") { + node.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length; i++) { - const value = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i]; - if (value != null && typeof value === "object") { - node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i] = context.value(value); + { + const array = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d.length; i++) { + const value = node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i]; + if (value != null && typeof value === "object") { + node.#_2rzkBRS4gNPrkJk9DohHAMUAxA2d[i] = context.value(value); + } + } } } } }); } @@ -101588,7 +107311,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { + !(i < (this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] ?? 0) || + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#preview"); @@ -101660,7 +107384,8 @@ get names(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { + !(i < (this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview[vocabTrustPrefix] ?? 0) || + this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -102579,7 +108304,7 @@ get licenses(): (URL)[] { instance.#_2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width = _2e9AP7WdHBJYAgXG6GEyq7nSkNMe_width; const _gCVTegXxWWCw6wWRxa1QF65zusg_preview: (Link | Object | URL)[] = []; - const _trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: Set = new Set(); + const _trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview: VocabTrustSet = new Set(); let _gCVTegXxWWCw6wWRxa1QF65zusg_preview__array = values["https://www.w3.org/ns/activitystreams#preview"]; @@ -103064,6 +108789,12 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -103548,6 +109279,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -104072,6 +109809,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -104586,6 +110329,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -105096,6 +110845,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -105606,6 +111361,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -106116,6 +111877,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -106624,6 +112391,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -107092,6 +112865,12 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -107591,6 +113370,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -107964,11 +113749,11 @@ export class Note extends Object { } #_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); #_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl: (URL)[] = []; #_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); /** * Constructs a new instance of Note with the given values. @@ -108109,12 +113894,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Note;clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice();clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote); + const clone = super.clone(values, options) as unknown as Note;clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < vocabSparseArrayMinimumLength + ? this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice() : vocabCopyPropertyArray(this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote);clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = vocabCopyTrustSet( + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, + ); if ("quote" in values && values.quote != null) { if (values.quote instanceof Object || values.quote instanceof URL) { // @ts-ignore: type is checked above. clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = [values.quote]; - clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set([0]); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] = 1; } else { throw new TypeError( "The quote must be of type " + @@ -108122,7 +113911,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice(); + clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length < vocabSparseArrayMinimumLength + ? this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice() : vocabCopyPropertyArray(this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl); if ("quoteUrl" in values && values.quoteUrl != null) { if (values.quoteUrl instanceof URL) { // @ts-ignore: type is checked above. @@ -108135,12 +113925,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice();clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization); + clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice() : vocabCopyPropertyArray(this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization);clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = vocabCopyTrustSet( + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, + ); if ("quoteAuthorization" in values && values.quoteAuthorization != null) { if (values.quoteAuthorization instanceof QuoteAuthorization || values.quoteAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = [values.quoteAuthorization]; - clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set([0]); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( "The quoteAuthorization must be of type " + @@ -108174,6 +113968,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -108223,24 +114023,69 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Note; - for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { - const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; - if (value != null && typeof value === "object") { - node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + { + const array = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === "object") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { - const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; - if (value != null && typeof value === "object") { - node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + { + const array = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === "object") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { - const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; - if (value != null && typeof value === "object") { - node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + { + const array = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === "object") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } } } } }); } @@ -108573,7 +114418,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/044f#quote"); @@ -108641,7 +114487,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -109015,7 +114862,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/044f#quoteAuthorization"); @@ -109083,7 +114931,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -109510,7 +115359,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); let _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote__array = values["https://w3id.org/fep/044f#quote"]; @@ -109590,7 +115439,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; const _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); let _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization__array = values["https://w3id.org/fep/044f#quoteAuthorization"]; @@ -109763,7 +115612,7 @@ export class OrderedCollectionPage extends CollectionPage { } #_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: (Object | Link | URL)[] = []; - #_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: Set = new Set(); + #_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: VocabTrustSet = new Set(); #_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex: (number)[] = []; /** @@ -109803,14 +115652,36 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu super(values, options); if ("items" in values && values.items != null) { - if (Array.isArray(values.items) && - values.items.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.items)) { + const array = values.items; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.items; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = values.items.slice(); + this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = copied; - for (let i = 0; i < values.items.length; i++) { - this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.add(i); - } + vocabSetTrustPrefix(this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length); } else { throw new TypeError( @@ -109898,18 +115769,43 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as OrderedCollectionPage;clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.slice();clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = new Set(this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items); + const clone = super.clone(values, options) as unknown as OrderedCollectionPage;clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length < vocabSparseArrayMinimumLength + ? this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.slice() : vocabCopyPropertyArray(this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items);clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = vocabCopyTrustSet( + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, + ); if ("items" in values && values.items != null) { - if (Array.isArray(values.items) && - values.items.every(v => v instanceof Object || v instanceof Link || v instanceof URL)) { + let copied!: (Object | Link | URL)[]; + let valid = false; + if (Array.isArray(values.items)) { + const array = values.items; + const test = (v: Object | Link | URL): boolean => v instanceof Object || v instanceof Link || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.items; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = values.items.slice(); + clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = copied; clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items = new Set(); - for (let i = 0; i < values.items.length; i++) { - clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items, clone.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length); } else { throw new TypeError( @@ -109918,7 +115814,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex = this.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex.slice(); + clone.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex = this.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex.length < vocabSparseArrayMinimumLength + ? this.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex.slice() : vocabCopyPropertyArray(this.#_2W4yinFwqmpneu2h4m1mZ3pcLADd_startIndex); if ("startIndex" in values && values.startIndex != null) { if (typeof values.startIndex === "number" && Number.isInteger(values.startIndex) && values.startIndex >= 0) { // @ts-ignore: type is checked above. @@ -109957,6 +115854,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -110006,10 +115909,25 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as OrderedCollectionPage; - for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { - const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; - if (value != null && typeof value === "object") { - node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + { + const array = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.length; i++) { + const value = node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i]; + if (value != null && typeof value === "object") { + node.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[i] = context.value(value); + } + } } } } }); } @@ -110356,7 +116274,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { + !(i < (this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[vocabTrustPrefix] ?? 0) || + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#items"); @@ -110428,7 +116347,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { + !(i < (this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items[vocabTrustPrefix] ?? 0) || + this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -110821,7 +116741,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: (Object | Link | URL)[] = []; - const _trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: Set = new Set(); + const _trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items: VocabTrustSet = new Set(); let _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items__array = values["https://www.w3.org/ns/activitystreams#items"]; @@ -111010,39 +116930,39 @@ export class Organization extends Object { #_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername: ((string | LanguageString))[] = []; #_axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); #_41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); #_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); #_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); #_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); #_4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); #_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); #_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints: (Endpoints)[] = []; #_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable: (boolean)[] = []; #_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended: (boolean)[] = []; @@ -111050,13 +116970,13 @@ export class Organization extends Object { #_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable: (boolean)[] = []; #_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); #_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); #_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); #_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage: (string)[] = []; #_2xEU4QtkC53RAun67T81Egqt9vmL_isCat: (boolean)[] = []; #_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense: (URL)[] = []; @@ -111125,10 +117045,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === "string" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === "string" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -111161,14 +117105,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; - for (let i = 0; i < values.publicKeys.length; i++) { - this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -111201,14 +117167,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; - for (let i = 0; i < values.assertionMethods.length; i++) { - this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -111241,10 +117229,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -111373,14 +117385,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | if ("streams" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; - for (let i = 0; i < values.streams.length; i++) { - this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -111491,14 +117525,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; - for (let i = 0; i < values.aliases.length; i++) { - this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -111531,14 +117587,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; - for (let i = 0; i < values.services.length; i++) { - this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -111658,7 +117736,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Organization;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice(); + const clone = super.clone(values, options) as unknown as Organization;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.length < vocabSparseArrayMinimumLength + ? this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice() : vocabCopyPropertyArray(this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername); if ("preferredUsername" in values && values.preferredUsername != null) { if (typeof values.preferredUsername === "string" || values.preferredUsername instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -111682,10 +117761,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === "string" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === "string" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -111694,12 +117797,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice();clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < vocabSparseArrayMinimumLength + ? this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice() : vocabCopyPropertyArray(this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey);clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = vocabCopyTrustSet( + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, + ); if ("publicKey" in values && values.publicKey != null) { if (values.publicKey instanceof CryptographicKey || values.publicKey instanceof URL) { // @ts-ignore: type is checked above. clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = [values.publicKey]; - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set([0]); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] = 1; } else { throw new TypeError( "The publicKey must be of type " + @@ -111718,15 +117825,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); - for (let i = 0; i < values.publicKeys.length; i++) { - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -111735,12 +117864,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice();clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < vocabSparseArrayMinimumLength + ? this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice() : vocabCopyPropertyArray(this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod);clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = vocabCopyTrustSet( + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, + ); if ("assertionMethod" in values && values.assertionMethod != null) { if (values.assertionMethod instanceof Multikey || values.assertionMethod instanceof URL) { // @ts-ignore: type is checked above. clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = [values.assertionMethod]; - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set([0]); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] = 1; } else { throw new TypeError( "The assertionMethod must be of type " + @@ -111759,15 +117892,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); - for (let i = 0; i < values.assertionMethods.length; i++) { - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -111776,7 +117931,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < vocabSparseArrayMinimumLength + ? this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice() : vocabCopyPropertyArray(this.#_hQiaHhZP8hqxckxTBrpsGNs57E3); if ("gateway" in values && values.gateway != null) { if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { // @ts-ignore: type is checked above. @@ -111800,10 +117956,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -111812,7 +117992,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice(); + clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.length < vocabSparseArrayMinimumLength + ? this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice() : vocabCopyPropertyArray(this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers); if ("manuallyApprovesFollowers" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === "boolean") { // @ts-ignore: type is checked above. @@ -111825,12 +118006,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice();clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox); + clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < vocabSparseArrayMinimumLength + ? this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice() : vocabCopyPropertyArray(this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox);clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = vocabCopyTrustSet( + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, + ); if ("inbox" in values && values.inbox != null) { if (values.inbox instanceof OrderedCollection || values.inbox instanceof OrderedCollectionPage || values.inbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox]; - clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set([0]); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] = 1; } else { throw new TypeError( "The inbox must be of type " + @@ -111838,12 +118023,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice();clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox); + clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < vocabSparseArrayMinimumLength + ? this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice() : vocabCopyPropertyArray(this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox);clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = vocabCopyTrustSet( + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, + ); if ("outbox" in values && values.outbox != null) { if (values.outbox instanceof OrderedCollection || values.outbox instanceof OrderedCollectionPage || values.outbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox]; - clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set([0]); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] = 1; } else { throw new TypeError( "The outbox must be of type " + @@ -111851,12 +118040,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice();clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following); + clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < vocabSparseArrayMinimumLength + ? this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice() : vocabCopyPropertyArray(this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following);clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = vocabCopyTrustSet( + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, + ); if ("following" in values && values.following != null) { if (values.following instanceof Collection || values.following instanceof URL) { // @ts-ignore: type is checked above. clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = [values.following]; - clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set([0]); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] = 1; } else { throw new TypeError( "The following must be of type " + @@ -111864,12 +118057,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice();clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers); + clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < vocabSparseArrayMinimumLength + ? this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice() : vocabCopyPropertyArray(this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers);clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = vocabCopyTrustSet( + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, + ); if ("followers" in values && values.followers != null) { if (values.followers instanceof Collection || values.followers instanceof URL) { // @ts-ignore: type is checked above. clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = [values.followers]; - clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set([0]); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] = 1; } else { throw new TypeError( "The followers must be of type " + @@ -111877,12 +118074,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice();clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked); + clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < vocabSparseArrayMinimumLength + ? this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice() : vocabCopyPropertyArray(this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked);clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = vocabCopyTrustSet( + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, + ); if ("liked" in values && values.liked != null) { if (values.liked instanceof Collection || values.liked instanceof URL) { // @ts-ignore: type is checked above. clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = [values.liked]; - clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set([0]); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] = 1; } else { throw new TypeError( "The liked must be of type " + @@ -111890,12 +118091,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice();clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured); + clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < vocabSparseArrayMinimumLength + ? this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice() : vocabCopyPropertyArray(this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured);clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = vocabCopyTrustSet( + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, + ); if ("featured" in values && values.featured != null) { if (values.featured instanceof Collection || values.featured instanceof URL) { // @ts-ignore: type is checked above. clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = [values.featured]; - clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set([0]); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] = 1; } else { throw new TypeError( "The featured must be of type " + @@ -111903,12 +118108,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice();clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags); + clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < vocabSparseArrayMinimumLength + ? this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice() : vocabCopyPropertyArray(this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags);clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = vocabCopyTrustSet( + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, + ); if ("featuredTags" in values && values.featuredTags != null) { if (values.featuredTags instanceof Collection || values.featuredTags instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = [values.featuredTags]; - clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set([0]); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] = 1; } else { throw new TypeError( "The featuredTags must be of type " + @@ -111916,12 +118125,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice();clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections); + clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length < vocabSparseArrayMinimumLength + ? this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice() : vocabCopyPropertyArray(this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections);clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = vocabCopyTrustSet( + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, + ); if ("featuredCollections" in values && values.featuredCollections != null) { if (values.featuredCollections instanceof Collection || values.featuredCollections instanceof URL) { // @ts-ignore: type is checked above. clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = [values.featuredCollections]; - clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set([0]); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] = 1; } else { throw new TypeError( "The featuredCollections must be of type " + @@ -111929,18 +118142,43 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice();clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length < vocabSparseArrayMinimumLength + ? this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice() : vocabCopyPropertyArray(this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams);clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = vocabCopyTrustSet( + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, + ); if ("streams" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(); - for (let i = 0; i < values.streams.length; i++) { - clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -111949,7 +118187,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice(); + clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length < vocabSparseArrayMinimumLength + ? this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice() : vocabCopyPropertyArray(this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints); if ("endpoints" in values && values.endpoints != null) { if (values.endpoints instanceof Endpoints) { // @ts-ignore: type is checked above. @@ -111962,7 +118201,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice(); + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.length < vocabSparseArrayMinimumLength + ? this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice() : vocabCopyPropertyArray(this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable); if ("discoverable" in values && values.discoverable != null) { if (typeof values.discoverable === "boolean") { // @ts-ignore: type is checked above. @@ -111975,7 +118215,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice(); + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.length < vocabSparseArrayMinimumLength + ? this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice() : vocabCopyPropertyArray(this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended); if ("suspended" in values && values.suspended != null) { if (typeof values.suspended === "boolean") { // @ts-ignore: type is checked above. @@ -111988,7 +118229,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice(); + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.length < vocabSparseArrayMinimumLength + ? this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice() : vocabCopyPropertyArray(this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial); if ("memorial" in values && values.memorial != null) { if (typeof values.memorial === "boolean") { // @ts-ignore: type is checked above. @@ -112001,7 +118243,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice(); + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.length < vocabSparseArrayMinimumLength + ? this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice() : vocabCopyPropertyArray(this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable); if ("indexable" in values && values.indexable != null) { if (typeof values.indexable === "boolean") { // @ts-ignore: type is checked above. @@ -112014,12 +118257,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice();clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo); + clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < vocabSparseArrayMinimumLength + ? this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice() : vocabCopyPropertyArray(this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo);clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = vocabCopyTrustSet( + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, + ); if ("successor" in values && values.successor != null) { if (values.successor instanceof Application || values.successor instanceof Group || values.successor instanceof Organization || values.successor instanceof Person || values.successor instanceof Service || values.successor instanceof URL) { // @ts-ignore: type is checked above. clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor]; - clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set([0]); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] = 1; } else { throw new TypeError( "The successor must be of type " + @@ -112027,12 +118274,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice();clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < vocabSparseArrayMinimumLength + ? this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice() : vocabCopyPropertyArray(this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs);clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = vocabCopyTrustSet( + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, + ); if ("alias" in values && values.alias != null) { if (values.alias instanceof Application || values.alias instanceof Group || values.alias instanceof Organization || values.alias instanceof Person || values.alias instanceof Service || values.alias instanceof URL) { // @ts-ignore: type is checked above. clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [values.alias]; - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set([0]); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] = 1; } else { throw new TypeError( "The alias must be of type " + @@ -112051,15 +118302,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); - for (let i = 0; i < values.aliases.length; i++) { - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -112068,12 +118341,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice();clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < vocabSparseArrayMinimumLength + ? this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice() : vocabCopyPropertyArray(this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service);clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = vocabCopyTrustSet( + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, + ); if ("service" in values && values.service != null) { if (values.service instanceof DidService || values.service instanceof URL) { // @ts-ignore: type is checked above. clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = [values.service]; - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set([0]); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] = 1; } else { throw new TypeError( "The service must be of type " + @@ -112092,15 +118369,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); - for (let i = 0; i < values.services.length; i++) { - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -112109,7 +118408,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice(); + clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.length < vocabSparseArrayMinimumLength + ? this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice() : vocabCopyPropertyArray(this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage); if ("followedMessage" in values && values.followedMessage != null) { if (typeof values.followedMessage === "string") { // @ts-ignore: type is checked above. @@ -112122,7 +118422,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice(); + clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.length < vocabSparseArrayMinimumLength + ? this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice() : vocabCopyPropertyArray(this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat); if ("cat" in values && values.cat != null) { if (typeof values.cat === "boolean") { // @ts-ignore: type is checked above. @@ -112135,7 +118436,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice(); + clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length < vocabSparseArrayMinimumLength + ? this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice() : vocabCopyPropertyArray(this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense); if ("preferredLicense" in values && values.preferredLicense != null) { if (values.preferredLicense instanceof URL) { // @ts-ignore: type is checked above. @@ -112174,6 +118476,12 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -112229,122 +118537,377 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Organization; - for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { - const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; - if (value != null && typeof value === "object") { - node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + { + const array = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === "object") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { - const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; - if (value != null && typeof value === "object") { - node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + { + const array = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === "object") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { - const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; - if (value != null && typeof value === "object") { - node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + { + const array = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === "object") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { - const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; - if (value != null && typeof value === "object") { - node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + { + const array = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === "object") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { - const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; - if (value != null && typeof value === "object") { - node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + { + const array = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === "object") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { - const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; - if (value != null && typeof value === "object") { - node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + { + const array = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === "object") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { - const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; - if (value != null && typeof value === "object") { - node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + { + const array = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === "object") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { - const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; - if (value != null && typeof value === "object") { - node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + { + const array = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === "object") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { - const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; - if (value != null && typeof value === "object") { - node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + { + const array = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === "object") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { - const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; - if (value != null && typeof value === "object") { - node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + { + const array = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === "object") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { - const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; - if (value != null && typeof value === "object") { - node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + { + const array = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === "object") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { - const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; - if (value != null && typeof value === "object") { - node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + { + const array = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === "object") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { - const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; - if (value != null && typeof value === "object") { - node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + { + const array = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === "object") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { - const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; - if (value != null && typeof value === "object") { - node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + { + const array = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === "object") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { - const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; - if (value != null && typeof value === "object") { - node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + { + const array = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === "object") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { - const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; - if (value != null && typeof value === "object") { - node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + { + const array = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === "object") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { - const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; - if (value != null && typeof value === "object") { - node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + { + const array = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === "object") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } } } } }); } @@ -112697,7 +119260,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#publicKey"); @@ -112765,7 +119329,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -112852,7 +119417,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#publicKey"); @@ -112924,7 +119490,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -113278,7 +119845,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#assertionMethod"); @@ -113346,7 +119914,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -113437,7 +120006,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#assertionMethod"); @@ -113509,7 +120079,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -113933,7 +120504,8 @@ get gateways(): (URL)[] { } let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "http://www.w3.org/ns/ldp#inbox"); @@ -114001,7 +120573,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -114375,7 +120948,8 @@ get gateways(): (URL)[] { } let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#outbox"); @@ -114443,7 +121017,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -114797,7 +121372,8 @@ get gateways(): (URL)[] { } let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#following"); @@ -114865,7 +121441,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -115222,7 +121799,8 @@ get gateways(): (URL)[] { } let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#followers"); @@ -115290,7 +121868,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -115645,7 +122224,8 @@ get gateways(): (URL)[] { } let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#liked"); @@ -115713,7 +122293,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -116066,7 +122647,8 @@ get gateways(): (URL)[] { } let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "http://joinmastodon.org/ns#featured"); @@ -116134,7 +122716,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -116487,7 +123070,8 @@ get gateways(): (URL)[] { } let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "http://joinmastodon.org/ns#featuredTags"); @@ -116555,7 +123139,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -116905,7 +123490,8 @@ get gateways(): (URL)[] { } let v = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[0]; if (!(v instanceof URL) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/7aa9#featuredCollections"); @@ -116973,7 +123559,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -117323,7 +123910,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#streams"); @@ -117395,7 +123983,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -117880,7 +124469,8 @@ get gateways(): (URL)[] { } let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#movedTo"); @@ -117948,7 +124538,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -118361,7 +124952,8 @@ get gateways(): (URL)[] { } let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#alsoKnownAs"); @@ -118429,7 +125021,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -118520,7 +125113,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#alsoKnownAs"); @@ -118592,7 +125186,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -118946,7 +125541,8 @@ get gateways(): (URL)[] { } let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/did#service"); @@ -119014,7 +125610,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -119105,7 +125702,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/did#service"); @@ -119177,7 +125775,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -120576,7 +127175,7 @@ get gateways(): (URL)[] { instance.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = _3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; const _axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); let _axq166E2eZADq34V4MYUc8KMZdC_publicKey__array = values["https://w3id.org/security#publicKey"]; @@ -120617,7 +127216,7 @@ get gateways(): (URL)[] { instance.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = _axq166E2eZADq34V4MYUc8KMZdC_publicKey; const _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); let _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod__array = values["https://w3id.org/security#assertionMethod"]; @@ -120716,7 +127315,7 @@ get gateways(): (URL)[] { instance.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); let _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox__array = values["http://www.w3.org/ns/ldp#inbox"]; @@ -120763,7 +127362,7 @@ get gateways(): (URL)[] { instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; const _41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); let _41QwhqJouoLg3h8dRPKat21brynC_outbox__array = values["https://www.w3.org/ns/activitystreams#outbox"]; @@ -120810,7 +127409,7 @@ get gateways(): (URL)[] { instance.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = _41QwhqJouoLg3h8dRPKat21brynC_outbox; const _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); let _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following__array = values["https://www.w3.org/ns/activitystreams#following"]; @@ -120851,7 +127450,7 @@ get gateways(): (URL)[] { instance.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; const _BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); let _BBCTgfphhsFzpVfKTykGSpBNwoA_followers__array = values["https://www.w3.org/ns/activitystreams#followers"]; @@ -120892,7 +127491,7 @@ get gateways(): (URL)[] { instance.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = _BBCTgfphhsFzpVfKTykGSpBNwoA_followers; const _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); let _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked__array = values["https://www.w3.org/ns/activitystreams#liked"]; @@ -120933,7 +127532,7 @@ get gateways(): (URL)[] { instance.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; const _4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); let _4N1vBJzXDf8NbBumeECQMFvKetja_featured__array = values["http://joinmastodon.org/ns#featured"]; @@ -120974,7 +127573,7 @@ get gateways(): (URL)[] { instance.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = _4N1vBJzXDf8NbBumeECQMFvKetja_featured; const _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); let _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags__array = values["http://joinmastodon.org/ns#featuredTags"]; @@ -121015,7 +127614,7 @@ get gateways(): (URL)[] { instance.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; const _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); let _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections__array = values["https://w3id.org/fep/7aa9#featuredCollections"]; @@ -121056,7 +127655,7 @@ get gateways(): (URL)[] { instance.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); let _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams__array = values["https://www.w3.org/ns/activitystreams#streams"]; @@ -121245,7 +127844,7 @@ get gateways(): (URL)[] { instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); let _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array = values["https://www.w3.org/ns/activitystreams#movedTo"]; @@ -121303,7 +127902,7 @@ get gateways(): (URL)[] { instance.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); let _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array = values["https://www.w3.org/ns/activitystreams#alsoKnownAs"]; @@ -121361,7 +127960,7 @@ get gateways(): (URL)[] { instance.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; const _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); let _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service__array = values["https://www.w3.org/ns/did#service"]; @@ -122221,6 +128820,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -122606,39 +129211,39 @@ export class Person extends Object { #_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername: ((string | LanguageString))[] = []; #_axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); #_41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); #_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); #_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); #_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); #_4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); #_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); #_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints: (Endpoints)[] = []; #_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable: (boolean)[] = []; #_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended: (boolean)[] = []; @@ -122646,13 +129251,13 @@ export class Person extends Object { #_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable: (boolean)[] = []; #_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); #_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); #_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); #_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage: (string)[] = []; #_2xEU4QtkC53RAun67T81Egqt9vmL_isCat: (boolean)[] = []; #_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense: (URL)[] = []; @@ -122721,10 +129326,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === "string" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === "string" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -122757,14 +129386,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; - for (let i = 0; i < values.publicKeys.length; i++) { - this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -122797,14 +129448,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; - for (let i = 0; i < values.assertionMethods.length; i++) { - this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -122837,10 +129510,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -122969,14 +129666,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | if ("streams" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; - for (let i = 0; i < values.streams.length; i++) { - this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -123087,14 +129806,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; - for (let i = 0; i < values.aliases.length; i++) { - this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -123127,14 +129868,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; - for (let i = 0; i < values.services.length; i++) { - this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -123254,7 +130017,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Person;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice(); + const clone = super.clone(values, options) as unknown as Person;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.length < vocabSparseArrayMinimumLength + ? this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice() : vocabCopyPropertyArray(this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername); if ("preferredUsername" in values && values.preferredUsername != null) { if (typeof values.preferredUsername === "string" || values.preferredUsername instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -123278,10 +130042,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === "string" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === "string" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -123290,12 +130078,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice();clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < vocabSparseArrayMinimumLength + ? this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice() : vocabCopyPropertyArray(this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey);clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = vocabCopyTrustSet( + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, + ); if ("publicKey" in values && values.publicKey != null) { if (values.publicKey instanceof CryptographicKey || values.publicKey instanceof URL) { // @ts-ignore: type is checked above. clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = [values.publicKey]; - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set([0]); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] = 1; } else { throw new TypeError( "The publicKey must be of type " + @@ -123314,15 +130106,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); - for (let i = 0; i < values.publicKeys.length; i++) { - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -123331,12 +130145,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice();clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < vocabSparseArrayMinimumLength + ? this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice() : vocabCopyPropertyArray(this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod);clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = vocabCopyTrustSet( + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, + ); if ("assertionMethod" in values && values.assertionMethod != null) { if (values.assertionMethod instanceof Multikey || values.assertionMethod instanceof URL) { // @ts-ignore: type is checked above. clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = [values.assertionMethod]; - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set([0]); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] = 1; } else { throw new TypeError( "The assertionMethod must be of type " + @@ -123355,15 +130173,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); - for (let i = 0; i < values.assertionMethods.length; i++) { - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -123372,7 +130212,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < vocabSparseArrayMinimumLength + ? this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice() : vocabCopyPropertyArray(this.#_hQiaHhZP8hqxckxTBrpsGNs57E3); if ("gateway" in values && values.gateway != null) { if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { // @ts-ignore: type is checked above. @@ -123396,10 +130237,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -123408,7 +130273,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice(); + clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.length < vocabSparseArrayMinimumLength + ? this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice() : vocabCopyPropertyArray(this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers); if ("manuallyApprovesFollowers" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === "boolean") { // @ts-ignore: type is checked above. @@ -123421,12 +130287,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice();clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox); + clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < vocabSparseArrayMinimumLength + ? this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice() : vocabCopyPropertyArray(this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox);clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = vocabCopyTrustSet( + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, + ); if ("inbox" in values && values.inbox != null) { if (values.inbox instanceof OrderedCollection || values.inbox instanceof OrderedCollectionPage || values.inbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox]; - clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set([0]); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] = 1; } else { throw new TypeError( "The inbox must be of type " + @@ -123434,12 +130304,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice();clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox); + clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < vocabSparseArrayMinimumLength + ? this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice() : vocabCopyPropertyArray(this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox);clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = vocabCopyTrustSet( + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, + ); if ("outbox" in values && values.outbox != null) { if (values.outbox instanceof OrderedCollection || values.outbox instanceof OrderedCollectionPage || values.outbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox]; - clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set([0]); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] = 1; } else { throw new TypeError( "The outbox must be of type " + @@ -123447,12 +130321,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice();clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following); + clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < vocabSparseArrayMinimumLength + ? this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice() : vocabCopyPropertyArray(this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following);clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = vocabCopyTrustSet( + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, + ); if ("following" in values && values.following != null) { if (values.following instanceof Collection || values.following instanceof URL) { // @ts-ignore: type is checked above. clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = [values.following]; - clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set([0]); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] = 1; } else { throw new TypeError( "The following must be of type " + @@ -123460,12 +130338,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice();clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers); + clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < vocabSparseArrayMinimumLength + ? this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice() : vocabCopyPropertyArray(this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers);clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = vocabCopyTrustSet( + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, + ); if ("followers" in values && values.followers != null) { if (values.followers instanceof Collection || values.followers instanceof URL) { // @ts-ignore: type is checked above. clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = [values.followers]; - clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set([0]); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] = 1; } else { throw new TypeError( "The followers must be of type " + @@ -123473,12 +130355,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice();clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked); + clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < vocabSparseArrayMinimumLength + ? this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice() : vocabCopyPropertyArray(this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked);clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = vocabCopyTrustSet( + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, + ); if ("liked" in values && values.liked != null) { if (values.liked instanceof Collection || values.liked instanceof URL) { // @ts-ignore: type is checked above. clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = [values.liked]; - clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set([0]); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] = 1; } else { throw new TypeError( "The liked must be of type " + @@ -123486,12 +130372,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice();clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured); + clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < vocabSparseArrayMinimumLength + ? this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice() : vocabCopyPropertyArray(this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured);clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = vocabCopyTrustSet( + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, + ); if ("featured" in values && values.featured != null) { if (values.featured instanceof Collection || values.featured instanceof URL) { // @ts-ignore: type is checked above. clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = [values.featured]; - clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set([0]); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] = 1; } else { throw new TypeError( "The featured must be of type " + @@ -123499,12 +130389,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice();clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags); + clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < vocabSparseArrayMinimumLength + ? this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice() : vocabCopyPropertyArray(this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags);clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = vocabCopyTrustSet( + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, + ); if ("featuredTags" in values && values.featuredTags != null) { if (values.featuredTags instanceof Collection || values.featuredTags instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = [values.featuredTags]; - clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set([0]); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] = 1; } else { throw new TypeError( "The featuredTags must be of type " + @@ -123512,12 +130406,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice();clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections); + clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length < vocabSparseArrayMinimumLength + ? this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice() : vocabCopyPropertyArray(this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections);clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = vocabCopyTrustSet( + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, + ); if ("featuredCollections" in values && values.featuredCollections != null) { if (values.featuredCollections instanceof Collection || values.featuredCollections instanceof URL) { // @ts-ignore: type is checked above. clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = [values.featuredCollections]; - clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set([0]); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] = 1; } else { throw new TypeError( "The featuredCollections must be of type " + @@ -123525,18 +130423,43 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice();clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length < vocabSparseArrayMinimumLength + ? this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice() : vocabCopyPropertyArray(this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams);clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = vocabCopyTrustSet( + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, + ); if ("streams" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(); - for (let i = 0; i < values.streams.length; i++) { - clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -123545,7 +130468,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice(); + clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length < vocabSparseArrayMinimumLength + ? this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice() : vocabCopyPropertyArray(this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints); if ("endpoints" in values && values.endpoints != null) { if (values.endpoints instanceof Endpoints) { // @ts-ignore: type is checked above. @@ -123558,7 +130482,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice(); + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.length < vocabSparseArrayMinimumLength + ? this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice() : vocabCopyPropertyArray(this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable); if ("discoverable" in values && values.discoverable != null) { if (typeof values.discoverable === "boolean") { // @ts-ignore: type is checked above. @@ -123571,7 +130496,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice(); + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.length < vocabSparseArrayMinimumLength + ? this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice() : vocabCopyPropertyArray(this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended); if ("suspended" in values && values.suspended != null) { if (typeof values.suspended === "boolean") { // @ts-ignore: type is checked above. @@ -123584,7 +130510,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice(); + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.length < vocabSparseArrayMinimumLength + ? this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice() : vocabCopyPropertyArray(this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial); if ("memorial" in values && values.memorial != null) { if (typeof values.memorial === "boolean") { // @ts-ignore: type is checked above. @@ -123597,7 +130524,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice(); + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.length < vocabSparseArrayMinimumLength + ? this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice() : vocabCopyPropertyArray(this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable); if ("indexable" in values && values.indexable != null) { if (typeof values.indexable === "boolean") { // @ts-ignore: type is checked above. @@ -123610,12 +130538,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice();clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo); + clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < vocabSparseArrayMinimumLength + ? this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice() : vocabCopyPropertyArray(this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo);clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = vocabCopyTrustSet( + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, + ); if ("successor" in values && values.successor != null) { if (values.successor instanceof Application || values.successor instanceof Group || values.successor instanceof Organization || values.successor instanceof Person || values.successor instanceof Service || values.successor instanceof URL) { // @ts-ignore: type is checked above. clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor]; - clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set([0]); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] = 1; } else { throw new TypeError( "The successor must be of type " + @@ -123623,12 +130555,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice();clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < vocabSparseArrayMinimumLength + ? this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice() : vocabCopyPropertyArray(this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs);clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = vocabCopyTrustSet( + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, + ); if ("alias" in values && values.alias != null) { if (values.alias instanceof Application || values.alias instanceof Group || values.alias instanceof Organization || values.alias instanceof Person || values.alias instanceof Service || values.alias instanceof URL) { // @ts-ignore: type is checked above. clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [values.alias]; - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set([0]); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] = 1; } else { throw new TypeError( "The alias must be of type " + @@ -123647,15 +130583,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); - for (let i = 0; i < values.aliases.length; i++) { - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -123664,12 +130622,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice();clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < vocabSparseArrayMinimumLength + ? this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice() : vocabCopyPropertyArray(this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service);clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = vocabCopyTrustSet( + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, + ); if ("service" in values && values.service != null) { if (values.service instanceof DidService || values.service instanceof URL) { // @ts-ignore: type is checked above. clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = [values.service]; - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set([0]); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] = 1; } else { throw new TypeError( "The service must be of type " + @@ -123688,15 +130650,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); - for (let i = 0; i < values.services.length; i++) { - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -123705,7 +130689,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice(); + clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.length < vocabSparseArrayMinimumLength + ? this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice() : vocabCopyPropertyArray(this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage); if ("followedMessage" in values && values.followedMessage != null) { if (typeof values.followedMessage === "string") { // @ts-ignore: type is checked above. @@ -123718,7 +130703,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice(); + clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.length < vocabSparseArrayMinimumLength + ? this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice() : vocabCopyPropertyArray(this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat); if ("cat" in values && values.cat != null) { if (typeof values.cat === "boolean") { // @ts-ignore: type is checked above. @@ -123731,7 +130717,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice(); + clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length < vocabSparseArrayMinimumLength + ? this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice() : vocabCopyPropertyArray(this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense); if ("preferredLicense" in values && values.preferredLicense != null) { if (values.preferredLicense instanceof URL) { // @ts-ignore: type is checked above. @@ -123770,6 +130757,12 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -123825,122 +130818,377 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Person; - for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { - const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; - if (value != null && typeof value === "object") { - node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + { + const array = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === "object") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { - const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; - if (value != null && typeof value === "object") { - node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + { + const array = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === "object") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { - const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; - if (value != null && typeof value === "object") { - node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + { + const array = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === "object") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { - const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; - if (value != null && typeof value === "object") { - node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + { + const array = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === "object") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { - const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; - if (value != null && typeof value === "object") { - node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + { + const array = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === "object") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { - const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; - if (value != null && typeof value === "object") { - node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + { + const array = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === "object") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { - const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; - if (value != null && typeof value === "object") { - node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + { + const array = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === "object") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { - const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; - if (value != null && typeof value === "object") { - node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + { + const array = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === "object") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { - const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; - if (value != null && typeof value === "object") { - node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + { + const array = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === "object") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { - const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; - if (value != null && typeof value === "object") { - node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + { + const array = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === "object") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { - const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; - if (value != null && typeof value === "object") { - node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + { + const array = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === "object") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { - const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; - if (value != null && typeof value === "object") { - node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + { + const array = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === "object") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { - const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; - if (value != null && typeof value === "object") { - node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + { + const array = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === "object") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { - const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; - if (value != null && typeof value === "object") { - node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + { + const array = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === "object") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { - const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; - if (value != null && typeof value === "object") { - node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + { + const array = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === "object") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { - const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; - if (value != null && typeof value === "object") { - node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + { + const array = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === "object") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { - const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; - if (value != null && typeof value === "object") { - node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + { + const array = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === "object") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } } } } }); } @@ -124293,7 +131541,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#publicKey"); @@ -124361,7 +131610,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -124448,7 +131698,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#publicKey"); @@ -124520,7 +131771,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -124874,7 +132126,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#assertionMethod"); @@ -124942,7 +132195,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -125033,7 +132287,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#assertionMethod"); @@ -125105,7 +132360,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -125529,7 +132785,8 @@ get gateways(): (URL)[] { } let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "http://www.w3.org/ns/ldp#inbox"); @@ -125597,7 +132854,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -125971,7 +133229,8 @@ get gateways(): (URL)[] { } let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#outbox"); @@ -126039,7 +133298,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -126393,7 +133653,8 @@ get gateways(): (URL)[] { } let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#following"); @@ -126461,7 +133722,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -126818,7 +134080,8 @@ get gateways(): (URL)[] { } let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#followers"); @@ -126886,7 +134149,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -127241,7 +134505,8 @@ get gateways(): (URL)[] { } let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#liked"); @@ -127309,7 +134574,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -127662,7 +134928,8 @@ get gateways(): (URL)[] { } let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "http://joinmastodon.org/ns#featured"); @@ -127730,7 +134997,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -128083,7 +135351,8 @@ get gateways(): (URL)[] { } let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "http://joinmastodon.org/ns#featuredTags"); @@ -128151,7 +135420,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -128501,7 +135771,8 @@ get gateways(): (URL)[] { } let v = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[0]; if (!(v instanceof URL) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/7aa9#featuredCollections"); @@ -128569,7 +135840,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -128919,7 +136191,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#streams"); @@ -128991,7 +136264,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -129476,7 +136750,8 @@ get gateways(): (URL)[] { } let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#movedTo"); @@ -129544,7 +136819,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -129957,7 +137233,8 @@ get gateways(): (URL)[] { } let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#alsoKnownAs"); @@ -130025,7 +137302,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -130116,7 +137394,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#alsoKnownAs"); @@ -130188,7 +137467,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -130542,7 +137822,8 @@ get gateways(): (URL)[] { } let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/did#service"); @@ -130610,7 +137891,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -130701,7 +137983,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/did#service"); @@ -130773,7 +138056,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -132172,7 +139456,7 @@ get gateways(): (URL)[] { instance.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = _3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; const _axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); let _axq166E2eZADq34V4MYUc8KMZdC_publicKey__array = values["https://w3id.org/security#publicKey"]; @@ -132213,7 +139497,7 @@ get gateways(): (URL)[] { instance.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = _axq166E2eZADq34V4MYUc8KMZdC_publicKey; const _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); let _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod__array = values["https://w3id.org/security#assertionMethod"]; @@ -132312,7 +139596,7 @@ get gateways(): (URL)[] { instance.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); let _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox__array = values["http://www.w3.org/ns/ldp#inbox"]; @@ -132359,7 +139643,7 @@ get gateways(): (URL)[] { instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; const _41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); let _41QwhqJouoLg3h8dRPKat21brynC_outbox__array = values["https://www.w3.org/ns/activitystreams#outbox"]; @@ -132406,7 +139690,7 @@ get gateways(): (URL)[] { instance.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = _41QwhqJouoLg3h8dRPKat21brynC_outbox; const _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); let _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following__array = values["https://www.w3.org/ns/activitystreams#following"]; @@ -132447,7 +139731,7 @@ get gateways(): (URL)[] { instance.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; const _BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); let _BBCTgfphhsFzpVfKTykGSpBNwoA_followers__array = values["https://www.w3.org/ns/activitystreams#followers"]; @@ -132488,7 +139772,7 @@ get gateways(): (URL)[] { instance.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = _BBCTgfphhsFzpVfKTykGSpBNwoA_followers; const _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); let _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked__array = values["https://www.w3.org/ns/activitystreams#liked"]; @@ -132529,7 +139813,7 @@ get gateways(): (URL)[] { instance.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; const _4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); let _4N1vBJzXDf8NbBumeECQMFvKetja_featured__array = values["http://joinmastodon.org/ns#featured"]; @@ -132570,7 +139854,7 @@ get gateways(): (URL)[] { instance.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = _4N1vBJzXDf8NbBumeECQMFvKetja_featured; const _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); let _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags__array = values["http://joinmastodon.org/ns#featuredTags"]; @@ -132611,7 +139895,7 @@ get gateways(): (URL)[] { instance.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; const _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); let _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections__array = values["https://w3id.org/fep/7aa9#featuredCollections"]; @@ -132652,7 +139936,7 @@ get gateways(): (URL)[] { instance.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); let _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams__array = values["https://www.w3.org/ns/activitystreams#streams"]; @@ -132841,7 +140125,7 @@ get gateways(): (URL)[] { instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); let _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array = values["https://www.w3.org/ns/activitystreams#movedTo"]; @@ -132899,7 +140183,7 @@ get gateways(): (URL)[] { instance.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); let _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array = values["https://www.w3.org/ns/activitystreams#alsoKnownAs"]; @@ -132957,7 +140241,7 @@ get gateways(): (URL)[] { instance.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; const _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); let _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service__array = values["https://www.w3.org/ns/did#service"]; @@ -133878,7 +141162,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Place;clone.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy = this.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy.slice(); + const clone = super.clone(values, options) as unknown as Place;clone.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy = this.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy.length < vocabSparseArrayMinimumLength + ? this.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy.slice() : vocabCopyPropertyArray(this.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne_accuracy); if ("accuracy" in values && values.accuracy != null) { if (typeof values.accuracy === "number" && !Number.isNaN(values.accuracy)) { // @ts-ignore: type is checked above. @@ -133891,7 +141176,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude = this.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude.slice(); + clone.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude = this.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude.length < vocabSparseArrayMinimumLength + ? this.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude.slice() : vocabCopyPropertyArray(this.#_3Q6KDcFQUJRRaBux1BL2yp5QWiBi_altitude); if ("altitude" in values && values.altitude != null) { if (typeof values.altitude === "number" && !Number.isNaN(values.altitude)) { // @ts-ignore: type is checked above. @@ -133904,7 +141190,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude = this.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude.slice(); + clone.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude = this.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude.length < vocabSparseArrayMinimumLength + ? this.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude.slice() : vocabCopyPropertyArray(this.#_3g85RoKRnaNjP7DFyLSvsWDg7HGM_latitude); if ("latitude" in values && values.latitude != null) { if (typeof values.latitude === "number" && !Number.isNaN(values.latitude)) { // @ts-ignore: type is checked above. @@ -133917,7 +141204,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude = this.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude.slice(); + clone.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude = this.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude.length < vocabSparseArrayMinimumLength + ? this.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude.slice() : vocabCopyPropertyArray(this.#_B2GEYdS9yBAF3ho1pm1rcRg7cSf_longitude); if ("longitude" in values && values.longitude != null) { if (typeof values.longitude === "number" && !Number.isNaN(values.longitude)) { // @ts-ignore: type is checked above. @@ -133930,7 +141218,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius = this.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius.slice(); + clone.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius = this.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius.length < vocabSparseArrayMinimumLength + ? this.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius.slice() : vocabCopyPropertyArray(this.#_3ga86BKHUtRkGx5PHBjRiUXXzwnw_radius); if ("radius" in values && values.radius != null) { if (typeof values.radius === "number" && !Number.isNaN(values.radius)) { // @ts-ignore: type is checked above. @@ -133943,7 +141232,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ); } } - clone.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units = this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units.slice(); + clone.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units = this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units.length < vocabSparseArrayMinimumLength + ? this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units.slice() : vocabCopyPropertyArray(this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units); if ("units" in values && values.units != null) { if (values.units == "cm" || values.units == "feet" || values.units == "inches" || values.units == "km" || values.units == "m" || values.units == "miles" || values.units instanceof URL) { // @ts-ignore: type is checked above. @@ -133982,6 +141272,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -134031,10 +141327,25 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Place; - for (let i = 0; i < node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units.length; i++) { - const value = node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units[i]; - if (value != null && typeof value === "object") { - node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units[i] = context.value(value); + { + const array = node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units.length; i++) { + const value = node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units[i]; + if (value != null && typeof value === "object") { + node.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units[i] = context.value(value); + } + } } } } }); } @@ -135004,7 +142315,7 @@ export class Profile extends Object { } #_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes: (Object | URL)[] = []; - #_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes: Set = new Set(); + #_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes: VocabTrustSet = new Set(); /** * Constructs a new instance of Profile with the given values. @@ -135119,12 +142430,16 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Profile;clone.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.slice();clone.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = new Set(this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes); + const clone = super.clone(values, options) as unknown as Profile;clone.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.length < vocabSparseArrayMinimumLength + ? this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.slice() : vocabCopyPropertyArray(this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes);clone.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = vocabCopyTrustSet( + this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes, clone.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes, + ); if ("describes" in values && values.describes != null) { if (values.describes instanceof Object || values.describes instanceof URL) { // @ts-ignore: type is checked above. clone.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = [values.describes]; - clone.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = new Set([0]); + clone.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes = new Set(); + clone.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[vocabTrustPrefix] = 1; } else { throw new TypeError( "The describes must be of type " + @@ -135158,6 +142473,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -135207,10 +142528,25 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Profile; - for (let i = 0; i < node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.length; i++) { - const value = node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[i]; - if (value != null && typeof value === "object") { - node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[i] = context.value(value); + { + const array = node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.length; i++) { + const value = node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[i]; + if (value != null && typeof value === "object") { + node.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[i] = context.value(value); + } + } } } } }); } @@ -135542,7 +142878,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[0]; if (!(v instanceof URL) && - !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { + !(0 < (this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[vocabTrustPrefix] ?? 0) || + this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#describes"); @@ -135610,7 +142947,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { + !(0 < (this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[vocabTrustPrefix] ?? 0) || + this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -135947,7 +143285,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes: (Object | URL)[] = []; - const _trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes: Set = new Set(); + const _trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes: VocabTrustSet = new Set(); let _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes__array = values["https://www.w3.org/ns/activitystreams#describes"]; @@ -136085,19 +143423,19 @@ export class Question extends IntransitiveActivity { } #_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf: (Object | URL)[] = []; - #_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf: Set = new Set(); + #_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf: VocabTrustSet = new Set(); #_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf: (Object | URL)[] = []; - #_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf: Set = new Set(); + #_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf: VocabTrustSet = new Set(); #_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed: ((Temporal.Instant | boolean))[] = []; #_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount: (number)[] = []; #_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + #_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); #_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl: (URL)[] = []; #_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + #_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); /** * Constructs a new instance of Question with the given values. @@ -136142,14 +143480,36 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti super(values, options); if ("exclusiveOptions" in values && values.exclusiveOptions != null) { - if (Array.isArray(values.exclusiveOptions) && - values.exclusiveOptions.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.exclusiveOptions)) { + const array = values.exclusiveOptions; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.exclusiveOptions; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = values.exclusiveOptions.slice(); + this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = copied; - for (let i = 0; i < values.exclusiveOptions.length; i++) { - this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.add(i); - } + vocabSetTrustPrefix(this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf, this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.length); } else { throw new TypeError( @@ -136161,14 +143521,36 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if ("inclusiveOptions" in values && values.inclusiveOptions != null) { - if (Array.isArray(values.inclusiveOptions) && - values.inclusiveOptions.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.inclusiveOptions)) { + const array = values.inclusiveOptions; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.inclusiveOptions; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = values.inclusiveOptions.slice(); + this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = copied; - for (let i = 0; i < values.inclusiveOptions.length; i++) { - this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.add(i); - } + vocabSetTrustPrefix(this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf, this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.length); } else { throw new TypeError( @@ -136314,18 +143696,43 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Question;clone.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.slice();clone.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = new Set(this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf); + const clone = super.clone(values, options) as unknown as Question;clone.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.length < vocabSparseArrayMinimumLength + ? this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.slice() : vocabCopyPropertyArray(this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf);clone.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = vocabCopyTrustSet( + this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf, clone.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf, + ); if ("exclusiveOptions" in values && values.exclusiveOptions != null) { - if (Array.isArray(values.exclusiveOptions) && - values.exclusiveOptions.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.exclusiveOptions)) { + const array = values.exclusiveOptions; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.exclusiveOptions; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = values.exclusiveOptions.slice(); + clone.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = copied; clone.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = new Set(); - for (let i = 0; i < values.exclusiveOptions.length; i++) { - clone.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf, clone.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.length); } else { throw new TypeError( @@ -136334,18 +143741,43 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ); } } - clone.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.slice();clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = new Set(this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf); + clone.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.length < vocabSparseArrayMinimumLength + ? this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.slice() : vocabCopyPropertyArray(this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf);clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = vocabCopyTrustSet( + this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf, clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf, + ); if ("inclusiveOptions" in values && values.inclusiveOptions != null) { - if (Array.isArray(values.inclusiveOptions) && - values.inclusiveOptions.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.inclusiveOptions)) { + const array = values.inclusiveOptions; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.inclusiveOptions; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = values.inclusiveOptions.slice(); + clone.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = copied; clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf = new Set(); - for (let i = 0; i < values.inclusiveOptions.length; i++) { - clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf, clone.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.length); } else { throw new TypeError( @@ -136354,7 +143786,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ); } } - clone.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed = this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed.slice(); + clone.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed = this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed.length < vocabSparseArrayMinimumLength + ? this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed.slice() : vocabCopyPropertyArray(this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6_closed); if ("closed" in values && values.closed != null) { if (isTemporalInstant(values.closed) || typeof values.closed === "boolean") { // @ts-ignore: type is checked above. @@ -136367,7 +143800,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ); } } - clone.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount = this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount.slice(); + clone.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount = this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount.length < vocabSparseArrayMinimumLength + ? this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount.slice() : vocabCopyPropertyArray(this.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount); if ("voters" in values && values.voters != null) { if (typeof values.voters === "number" && Number.isInteger(values.voters) && values.voters >= 0) { // @ts-ignore: type is checked above. @@ -136380,12 +143814,16 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ); } } - clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice();clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote); + clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < vocabSparseArrayMinimumLength + ? this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.slice() : vocabCopyPropertyArray(this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote);clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = vocabCopyTrustSet( + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote, + ); if ("quote" in values && values.quote != null) { if (values.quote instanceof Object || values.quote instanceof URL) { // @ts-ignore: type is checked above. clone.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = [values.quote]; - clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set([0]); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote = new Set(); + clone.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] = 1; } else { throw new TypeError( "The quote must be of type " + @@ -136393,7 +143831,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ); } } - clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice(); + clone.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length < vocabSparseArrayMinimumLength + ? this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.slice() : vocabCopyPropertyArray(this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl); if ("quoteUrl" in values && values.quoteUrl != null) { if (values.quoteUrl instanceof URL) { // @ts-ignore: type is checked above. @@ -136406,12 +143845,16 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ); } } - clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice();clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization); + clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < vocabSparseArrayMinimumLength + ? this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.slice() : vocabCopyPropertyArray(this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization);clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = vocabCopyTrustSet( + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization, + ); if ("quoteAuthorization" in values && values.quoteAuthorization != null) { if (values.quoteAuthorization instanceof QuoteAuthorization || values.quoteAuthorization instanceof URL) { // @ts-ignore: type is checked above. clone.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = [values.quoteAuthorization]; - clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set([0]); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization = new Set(); + clone.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] = 1; } else { throw new TypeError( "The quoteAuthorization must be of type " + @@ -136445,6 +143888,12 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -136500,38 +143949,113 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Question; - for (let i = 0; i < node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.length; i++) { - const value = node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[i]; - if (value != null && typeof value === "object") { - node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[i] = context.value(value); + { + const array = node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.length; i++) { + const value = node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[i]; + if (value != null && typeof value === "object") { + node.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.length; i++) { - const value = node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[i]; - if (value != null && typeof value === "object") { - node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[i] = context.value(value); + { + const array = node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.length; i++) { + const value = node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[i]; + if (value != null && typeof value === "object") { + node.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { - const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; - if (value != null && typeof value === "object") { - node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + { + const array = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length; i++) { + const value = node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i]; + if (value != null && typeof value === "object") { + node.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { - const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; - if (value != null && typeof value === "object") { - node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + { + const array = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.length; i++) { + const value = node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i]; + if (value != null && typeof value === "object") { + node.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { - const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; - if (value != null && typeof value === "object") { - node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + { + const array = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length; i++) { + const value = node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i]; + if (value != null && typeof value === "object") { + node.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[i] = context.value(value); + } + } } } } }); } @@ -136864,7 +144388,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { + !(i < (this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#oneOf"); @@ -136936,7 +144461,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { + !(i < (this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -137289,7 +144815,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { + !(i < (this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#anyOf"); @@ -137361,7 +144888,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { + !(i < (this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf[vocabTrustPrefix] ?? 0) || + this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -137744,7 +145272,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/044f#quote"); @@ -137812,7 +145341,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { + !(0 < (this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[vocabTrustPrefix] ?? 0) || + this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -138186,7 +145716,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/044f#quoteAuthorization"); @@ -138254,7 +145785,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { + !(0 < (this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[vocabTrustPrefix] ?? 0) || + this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -138682,7 +146214,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf: (Object | URL)[] = []; - const _trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf: Set = new Set(); + const _trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf: VocabTrustSet = new Set(); let _2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf__array = values["https://www.w3.org/ns/activitystreams#oneOf"]; @@ -138723,7 +146255,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf = _2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf; const _2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf: (Object | URL)[] = []; - const _trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf: Set = new Set(); + const _trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf: VocabTrustSet = new Set(); let _2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf__array = values["https://www.w3.org/ns/activitystreams#anyOf"]; @@ -138832,7 +146364,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount = _3H4RdST7dxfmghccvE3rKD3KgcxG_votersCount; const _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: (Object | URL)[] = []; - const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: Set = new Set(); + const _trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote: VocabTrustSet = new Set(); let _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote__array = values["https://w3id.org/fep/044f#quote"]; @@ -138912,7 +146444,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl = _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl; const _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: (QuoteAuthorization | URL)[] = []; - const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: Set = new Set(); + const _trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization: VocabTrustSet = new Set(); let _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization__array = values["https://w3id.org/fep/044f#quoteAuthorization"]; @@ -139304,6 +146836,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -139814,6 +147352,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -140196,13 +147740,13 @@ export class Relationship extends Object { } #_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject: (Object | URL)[] = []; - #_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject: Set = new Set(); + #_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject: VocabTrustSet = new Set(); #_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: (Object | URL)[] = []; - #_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: Set = new Set(); + #_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: VocabTrustSet = new Set(); #_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship: (Object | URL)[] = []; - #_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship: Set = new Set(); + #_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship: VocabTrustSet = new Set(); /** * Constructs a new instance of Relationship with the given values. @@ -140277,14 +147821,36 @@ relationships?: (Object | URL)[];} ); } - if (Array.isArray(values.objects) && - values.objects.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.objects)) { + const array = values.objects; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.objects; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = values.objects.slice(); + this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = copied; - for (let i = 0; i < values.objects.length; i++) { - this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.add(i); - } + vocabSetTrustPrefix(this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length); } else { throw new TypeError( @@ -140317,14 +147883,36 @@ relationships?: (Object | URL)[];} ); } - if (Array.isArray(values.relationships) && - values.relationships.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.relationships)) { + const array = values.relationships; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.relationships; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = values.relationships.slice(); + this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = copied; - for (let i = 0; i < values.relationships.length; i++) { - this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.add(i); - } + vocabSetTrustPrefix(this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship, this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length); } else { throw new TypeError( @@ -140401,12 +147989,16 @@ relationships?: (Object | URL)[];} // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Relationship;clone.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.slice();clone.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = new Set(this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject); + const clone = super.clone(values, options) as unknown as Relationship;clone.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.length < vocabSparseArrayMinimumLength + ? this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.slice() : vocabCopyPropertyArray(this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject);clone.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = vocabCopyTrustSet( + this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject, clone.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject, + ); if ("subject" in values && values.subject != null) { if (values.subject instanceof Object || values.subject instanceof URL) { // @ts-ignore: type is checked above. clone.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = [values.subject]; - clone.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = new Set([0]); + clone.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = new Set(); + clone.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[vocabTrustPrefix] = 1; } else { throw new TypeError( "The subject must be of type " + @@ -140414,12 +148006,16 @@ relationships?: (Object | URL)[];} ); } } - clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.slice();clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set(this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object); + clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length < vocabSparseArrayMinimumLength + ? this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.slice() : vocabCopyPropertyArray(this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object);clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = vocabCopyTrustSet( + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, + ); if ("object" in values && values.object != null) { if (values.object instanceof Object || values.object instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = [values.object]; - clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set([0]); + clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set(); + clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] = 1; } else { throw new TypeError( "The object must be of type " + @@ -140438,15 +148034,37 @@ relationships?: (Object | URL)[];} ); } - if (Array.isArray(values.objects) && - values.objects.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.objects)) { + const array = values.objects; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.objects; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = values.objects.slice(); + clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = copied; clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = new Set(); - for (let i = 0; i < values.objects.length; i++) { - clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.add(i); - } + vocabSetTrustPrefix(clone.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object, clone.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length); } else { throw new TypeError( @@ -140455,12 +148073,16 @@ relationships?: (Object | URL)[];} ); } } - clone.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.slice();clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = new Set(this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship); + clone.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length < vocabSparseArrayMinimumLength + ? this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.slice() : vocabCopyPropertyArray(this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship);clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = vocabCopyTrustSet( + this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship, clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship, + ); if ("relationship" in values && values.relationship != null) { if (values.relationship instanceof Object || values.relationship instanceof URL) { // @ts-ignore: type is checked above. clone.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = [values.relationship]; - clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = new Set([0]); + clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = new Set(); + clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[vocabTrustPrefix] = 1; } else { throw new TypeError( "The relationship must be of type " + @@ -140479,15 +148101,37 @@ relationships?: (Object | URL)[];} ); } - if (Array.isArray(values.relationships) && - values.relationships.every(v => v instanceof Object || v instanceof URL)) { + let copied!: (Object | URL)[]; + let valid = false; + if (Array.isArray(values.relationships)) { + const array = values.relationships; + const test = (v: Object | URL): boolean => v instanceof Object || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.relationships; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = values.relationships.slice(); + clone.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = copied; clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship = new Set(); - for (let i = 0; i < values.relationships.length; i++) { - clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship, clone.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length); } else { throw new TypeError( @@ -140522,6 +148166,12 @@ relationships?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -140573,24 +148223,69 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Relationship; - for (let i = 0; i < node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.length; i++) { - const value = node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[i]; - if (value != null && typeof value === "object") { - node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[i] = context.value(value); + { + const array = node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.length; i++) { + const value = node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[i]; + if (value != null && typeof value === "object") { + node.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length; i++) { - const value = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i]; - if (value != null && typeof value === "object") { - node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i] = context.value(value); + { + const array = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length; i++) { + const value = node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i]; + if (value != null && typeof value === "object") { + node.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length; i++) { - const value = node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[i]; - if (value != null && typeof value === "object") { - node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[i] = context.value(value); + { + const array = node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length; i++) { + const value = node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[i]; + if (value != null && typeof value === "object") { + node.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[i] = context.value(value); + } + } } } } }); } @@ -140924,7 +148619,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[0]; if (!(v instanceof URL) && - !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { + !(0 < (this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[vocabTrustPrefix] ?? 0) || + this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#subject"); @@ -140992,7 +148688,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { + !(0 < (this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[vocabTrustPrefix] ?? 0) || + this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -141342,7 +149039,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (!(v instanceof URL) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { + !(0 < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#object"); @@ -141410,7 +149108,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { + !(0 < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -141498,7 +149197,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { + !(i < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#object"); @@ -141570,7 +149270,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { + !(i < (this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[vocabTrustPrefix] ?? 0) || + this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -141923,7 +149624,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; } let v = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[0]; if (!(v instanceof URL) && - !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { + !(0 < (this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[vocabTrustPrefix] ?? 0) || + this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#relationship"); @@ -141991,7 +149693,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { + !(0 < (this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[vocabTrustPrefix] ?? 0) || + this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -142081,7 +149784,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { + !(i < (this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[vocabTrustPrefix] ?? 0) || + this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#relationship"); @@ -142153,7 +149857,8 @@ const base = getDeepCloneDescriptor(this.prototype)!; mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { + !(i < (this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[vocabTrustPrefix] ?? 0) || + this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -142571,7 +150276,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; let shouldCacheJsonLd = instance._shouldCacheJsonLd; const _2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject: (Object | URL)[] = []; - const _trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject: Set = new Set(); + const _trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject: VocabTrustSet = new Set(); let _2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject__array = values["https://www.w3.org/ns/activitystreams#subject"]; @@ -142612,7 +150317,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject = _2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject; const _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: (Object | URL)[] = []; - const _trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: Set = new Set(); + const _trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object: VocabTrustSet = new Set(); let _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object__array = values["https://www.w3.org/ns/activitystreams#object"]; @@ -142653,7 +150358,7 @@ const base = getDeepCloneDescriptor(this.prototype)!; instance.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object = _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; const _4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship: (Object | URL)[] = []; - const _trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship: Set = new Set(); + const _trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship: VocabTrustSet = new Set(); let _4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship__array = values["https://www.w3.org/ns/activitystreams#relationship"]; @@ -142974,6 +150679,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -143346,39 +151057,39 @@ export class Service extends Object { #_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername: ((string | LanguageString))[] = []; #_axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + #_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); #_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + #_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); #_hQiaHhZP8hqxckxTBrpsGNs57E3: (URL)[] = []; #_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers: (boolean)[] = []; #_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + #_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); #_41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + #_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); #_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + #_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); #_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + #_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); #_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + #_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); #_4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + #_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); #_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + #_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); #_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + #_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); #_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + #_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); #_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints: (Endpoints)[] = []; #_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable: (boolean)[] = []; #_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended: (boolean)[] = []; @@ -143386,13 +151097,13 @@ export class Service extends Object { #_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable: (boolean)[] = []; #_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + #_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); #_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + #_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); #_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + #_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); #_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage: (string)[] = []; #_2xEU4QtkC53RAun67T81Egqt9vmL_isCat: (boolean)[] = []; #_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense: (URL)[] = []; @@ -143461,10 +151172,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === "string" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === "string" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -143497,14 +151232,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; - for (let i = 0; i < values.publicKeys.length; i++) { - this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -143537,14 +151294,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; - for (let i = 0; i < values.assertionMethods.length; i++) { - this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -143577,10 +151356,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + this.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -143709,14 +151512,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | if ("streams" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; - for (let i = 0; i < values.streams.length; i++) { - this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -143827,14 +151652,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; - for (let i = 0; i < values.aliases.length; i++) { - this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -143867,14 +151714,36 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; - for (let i = 0; i < values.services.length; i++) { - this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -143994,7 +151863,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Service;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice(); + const clone = super.clone(values, options) as unknown as Service;clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.length < vocabSparseArrayMinimumLength + ? this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername.slice() : vocabCopyPropertyArray(this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername); if ("preferredUsername" in values && values.preferredUsername != null) { if (typeof values.preferredUsername === "string" || values.preferredUsername instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -144018,10 +151888,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.preferredUsernames) && - values.preferredUsernames.every(v => typeof v === "string" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.preferredUsernames)) { + const array = values.preferredUsernames; + const test = (v: string | LanguageString): boolean => typeof v === "string" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.preferredUsernames; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = values.preferredUsernames.slice(); + clone.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = copied; } else { throw new TypeError( @@ -144030,12 +151924,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice();clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < vocabSparseArrayMinimumLength + ? this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.slice() : vocabCopyPropertyArray(this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey);clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = vocabCopyTrustSet( + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, + ); if ("publicKey" in values && values.publicKey != null) { if (values.publicKey instanceof CryptographicKey || values.publicKey instanceof URL) { // @ts-ignore: type is checked above. clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = [values.publicKey]; - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set([0]); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); + clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] = 1; } else { throw new TypeError( "The publicKey must be of type " + @@ -144054,15 +151952,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.publicKeys) && - values.publicKeys.every(v => v instanceof CryptographicKey || v instanceof URL)) { + let copied!: (CryptographicKey | URL)[]; + let valid = false; + if (Array.isArray(values.publicKeys)) { + const array = values.publicKeys; + const test = (v: CryptographicKey | URL): boolean => v instanceof CryptographicKey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.publicKeys; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = values.publicKeys.slice(); + clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = copied; clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey = new Set(); - for (let i = 0; i < values.publicKeys.length; i++) { - clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.add(i); - } + vocabSetTrustPrefix(clone.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey, clone.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length); } else { throw new TypeError( @@ -144071,12 +151991,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice();clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < vocabSparseArrayMinimumLength + ? this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.slice() : vocabCopyPropertyArray(this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod);clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = vocabCopyTrustSet( + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, + ); if ("assertionMethod" in values && values.assertionMethod != null) { if (values.assertionMethod instanceof Multikey || values.assertionMethod instanceof URL) { // @ts-ignore: type is checked above. clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = [values.assertionMethod]; - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set([0]); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); + clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] = 1; } else { throw new TypeError( "The assertionMethod must be of type " + @@ -144095,15 +152019,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.assertionMethods) && - values.assertionMethods.every(v => v instanceof Multikey || v instanceof URL)) { + let copied!: (Multikey | URL)[]; + let valid = false; + if (Array.isArray(values.assertionMethods)) { + const array = values.assertionMethods; + const test = (v: Multikey | URL): boolean => v instanceof Multikey || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.assertionMethods; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = values.assertionMethods.slice(); + clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = copied; clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = new Set(); - for (let i = 0; i < values.assertionMethods.length; i++) { - clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod, clone.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length); } else { throw new TypeError( @@ -144112,7 +152058,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length < vocabSparseArrayMinimumLength + ? this.#_hQiaHhZP8hqxckxTBrpsGNs57E3.slice() : vocabCopyPropertyArray(this.#_hQiaHhZP8hqxckxTBrpsGNs57E3); if ("gateway" in values && values.gateway != null) { if (values.gateway instanceof URL && isGatewayUrl(values.gateway)) { // @ts-ignore: type is checked above. @@ -144136,10 +152083,34 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.gateways) && - values.gateways.every(v => v instanceof URL && isGatewayUrl(v))) { + let copied!: (URL)[]; + let valid = false; + if (Array.isArray(values.gateways)) { + const array = values.gateways; + const test = (v: URL): boolean => v instanceof URL && isGatewayUrl(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.gateways; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = values.gateways.slice(); + clone.#_hQiaHhZP8hqxckxTBrpsGNs57E3 = copied; } else { throw new TypeError( @@ -144148,7 +152119,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice(); + clone.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.length < vocabSparseArrayMinimumLength + ? this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers.slice() : vocabCopyPropertyArray(this.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers); if ("manuallyApprovesFollowers" in values && values.manuallyApprovesFollowers != null) { if (typeof values.manuallyApprovesFollowers === "boolean") { // @ts-ignore: type is checked above. @@ -144161,12 +152133,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice();clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox); + clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < vocabSparseArrayMinimumLength + ? this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.slice() : vocabCopyPropertyArray(this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox);clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = vocabCopyTrustSet( + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox, + ); if ("inbox" in values && values.inbox != null) { if (values.inbox instanceof OrderedCollection || values.inbox instanceof OrderedCollectionPage || values.inbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = [values.inbox]; - clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set([0]); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = new Set(); + clone.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] = 1; } else { throw new TypeError( "The inbox must be of type " + @@ -144174,12 +152150,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice();clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox); + clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < vocabSparseArrayMinimumLength + ? this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.slice() : vocabCopyPropertyArray(this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox);clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = vocabCopyTrustSet( + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox, + ); if ("outbox" in values && values.outbox != null) { if (values.outbox instanceof OrderedCollection || values.outbox instanceof OrderedCollectionPage || values.outbox instanceof URL) { // @ts-ignore: type is checked above. clone.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = [values.outbox]; - clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set([0]); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox = new Set(); + clone.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] = 1; } else { throw new TypeError( "The outbox must be of type " + @@ -144187,12 +152167,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice();clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following); + clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < vocabSparseArrayMinimumLength + ? this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.slice() : vocabCopyPropertyArray(this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following);clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = vocabCopyTrustSet( + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following, + ); if ("following" in values && values.following != null) { if (values.following instanceof Collection || values.following instanceof URL) { // @ts-ignore: type is checked above. clone.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = [values.following]; - clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set([0]); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = new Set(); + clone.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] = 1; } else { throw new TypeError( "The following must be of type " + @@ -144200,12 +152184,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice();clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers); + clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < vocabSparseArrayMinimumLength + ? this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.slice() : vocabCopyPropertyArray(this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers);clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = vocabCopyTrustSet( + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers, + ); if ("followers" in values && values.followers != null) { if (values.followers instanceof Collection || values.followers instanceof URL) { // @ts-ignore: type is checked above. clone.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = [values.followers]; - clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set([0]); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = new Set(); + clone.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] = 1; } else { throw new TypeError( "The followers must be of type " + @@ -144213,12 +152201,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice();clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked); + clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < vocabSparseArrayMinimumLength + ? this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.slice() : vocabCopyPropertyArray(this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked);clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = vocabCopyTrustSet( + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked, + ); if ("liked" in values && values.liked != null) { if (values.liked instanceof Collection || values.liked instanceof URL) { // @ts-ignore: type is checked above. clone.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = [values.liked]; - clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set([0]); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = new Set(); + clone.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] = 1; } else { throw new TypeError( "The liked must be of type " + @@ -144226,12 +152218,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice();clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured); + clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < vocabSparseArrayMinimumLength + ? this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.slice() : vocabCopyPropertyArray(this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured);clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = vocabCopyTrustSet( + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured, + ); if ("featured" in values && values.featured != null) { if (values.featured instanceof Collection || values.featured instanceof URL) { // @ts-ignore: type is checked above. clone.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = [values.featured]; - clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set([0]); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured = new Set(); + clone.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] = 1; } else { throw new TypeError( "The featured must be of type " + @@ -144239,12 +152235,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice();clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags); + clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < vocabSparseArrayMinimumLength + ? this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.slice() : vocabCopyPropertyArray(this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags);clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = vocabCopyTrustSet( + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags, + ); if ("featuredTags" in values && values.featuredTags != null) { if (values.featuredTags instanceof Collection || values.featuredTags instanceof URL) { // @ts-ignore: type is checked above. clone.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = [values.featuredTags]; - clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set([0]); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = new Set(); + clone.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] = 1; } else { throw new TypeError( "The featuredTags must be of type " + @@ -144252,12 +152252,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice();clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections); + clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length < vocabSparseArrayMinimumLength + ? this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.slice() : vocabCopyPropertyArray(this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections);clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = vocabCopyTrustSet( + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections, + ); if ("featuredCollections" in values && values.featuredCollections != null) { if (values.featuredCollections instanceof Collection || values.featuredCollections instanceof URL) { // @ts-ignore: type is checked above. clone.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = [values.featuredCollections]; - clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set([0]); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = new Set(); + clone.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] = 1; } else { throw new TypeError( "The featuredCollections must be of type " + @@ -144265,18 +152269,43 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice();clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length < vocabSparseArrayMinimumLength + ? this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.slice() : vocabCopyPropertyArray(this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams);clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = vocabCopyTrustSet( + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, + ); if ("streams" in values && values.streams != null) { - if (Array.isArray(values.streams) && - values.streams.every(v => v instanceof Collection || v instanceof URL)) { + let copied!: (Collection | URL)[]; + let valid = false; + if (Array.isArray(values.streams)) { + const array = values.streams; + const test = (v: Collection | URL): boolean => v instanceof Collection || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.streams; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = values.streams.slice(); + clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = copied; clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams = new Set(); - for (let i = 0; i < values.streams.length; i++) { - clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams, clone.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length); } else { throw new TypeError( @@ -144285,7 +152314,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice(); + clone.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints = this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length < vocabSparseArrayMinimumLength + ? this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.slice() : vocabCopyPropertyArray(this.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints); if ("endpoints" in values && values.endpoints != null) { if (values.endpoints instanceof Endpoints) { // @ts-ignore: type is checked above. @@ -144298,7 +152328,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice(); + clone.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable = this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.length < vocabSparseArrayMinimumLength + ? this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable.slice() : vocabCopyPropertyArray(this.#_gAJzg1QDc4rcefFsUzGSYmyXvNH_discoverable); if ("discoverable" in values && values.discoverable != null) { if (typeof values.discoverable === "boolean") { // @ts-ignore: type is checked above. @@ -144311,7 +152342,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice(); + clone.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.length < vocabSparseArrayMinimumLength + ? this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended.slice() : vocabCopyPropertyArray(this.#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended); if ("suspended" in values && values.suspended != null) { if (typeof values.suspended === "boolean") { // @ts-ignore: type is checked above. @@ -144324,7 +152356,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice(); + clone.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.length < vocabSparseArrayMinimumLength + ? this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial.slice() : vocabCopyPropertyArray(this.#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial); if ("memorial" in values && values.memorial != null) { if (typeof values.memorial === "boolean") { // @ts-ignore: type is checked above. @@ -144337,7 +152370,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice(); + clone.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.length < vocabSparseArrayMinimumLength + ? this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.slice() : vocabCopyPropertyArray(this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable); if ("indexable" in values && values.indexable != null) { if (typeof values.indexable === "boolean") { // @ts-ignore: type is checked above. @@ -144350,12 +152384,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice();clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo); + clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < vocabSparseArrayMinimumLength + ? this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.slice() : vocabCopyPropertyArray(this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo);clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = vocabCopyTrustSet( + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo, + ); if ("successor" in values && values.successor != null) { if (values.successor instanceof Application || values.successor instanceof Group || values.successor instanceof Organization || values.successor instanceof Person || values.successor instanceof Service || values.successor instanceof URL) { // @ts-ignore: type is checked above. clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor]; - clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set([0]); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = new Set(); + clone.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] = 1; } else { throw new TypeError( "The successor must be of type " + @@ -144363,12 +152401,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice();clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < vocabSparseArrayMinimumLength + ? this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.slice() : vocabCopyPropertyArray(this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs);clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = vocabCopyTrustSet( + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, + ); if ("alias" in values && values.alias != null) { if (values.alias instanceof Application || values.alias instanceof Group || values.alias instanceof Organization || values.alias instanceof Person || values.alias instanceof Service || values.alias instanceof URL) { // @ts-ignore: type is checked above. clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [values.alias]; - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set([0]); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); + clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] = 1; } else { throw new TypeError( "The alias must be of type " + @@ -144387,15 +152429,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.aliases) && - values.aliases.every(v => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL)) { + let copied!: (Application | Group | Organization | Person | Service | URL)[]; + let valid = false; + if (Array.isArray(values.aliases)) { + const array = values.aliases; + const test = (v: Application | Group | Organization | Person | Service | URL): boolean => v instanceof Application || v instanceof Group || v instanceof Organization || v instanceof Person || v instanceof Service || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.aliases; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = values.aliases.slice(); + clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = copied; clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = new Set(); - for (let i = 0; i < values.aliases.length; i++) { - clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.add(i); - } + vocabSetTrustPrefix(clone.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs, clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length); } else { throw new TypeError( @@ -144404,12 +152468,16 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice();clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < vocabSparseArrayMinimumLength + ? this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.slice() : vocabCopyPropertyArray(this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service);clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = vocabCopyTrustSet( + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, + ); if ("service" in values && values.service != null) { if (values.service instanceof DidService || values.service instanceof URL) { // @ts-ignore: type is checked above. clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = [values.service]; - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set([0]); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); + clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] = 1; } else { throw new TypeError( "The service must be of type " + @@ -144428,15 +152496,37 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } - if (Array.isArray(values.services) && - values.services.every(v => v instanceof DidService || v instanceof URL)) { + let copied!: (DidService | URL)[]; + let valid = false; + if (Array.isArray(values.services)) { + const array = values.services; + const test = (v: DidService | URL): boolean => v instanceof DidService || v instanceof URL; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.services; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = values.services.slice(); + clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = copied; clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = new Set(); - for (let i = 0; i < values.services.length; i++) { - clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.add(i); - } + vocabSetTrustPrefix(clone.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service, clone.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length); } else { throw new TypeError( @@ -144445,7 +152535,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice(); + clone.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage = this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.length < vocabSparseArrayMinimumLength + ? this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage.slice() : vocabCopyPropertyArray(this.#_QuxorEK1txp7jGjq8BRQfTPvUwp__misskey_followedMessage); if ("followedMessage" in values && values.followedMessage != null) { if (typeof values.followedMessage === "string") { // @ts-ignore: type is checked above. @@ -144458,7 +152549,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice(); + clone.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.length < vocabSparseArrayMinimumLength + ? this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat.slice() : vocabCopyPropertyArray(this.#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat); if ("cat" in values && values.cat != null) { if (typeof values.cat === "boolean") { // @ts-ignore: type is checked above. @@ -144471,7 +152563,8 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | ); } } - clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice(); + clone.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense = this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length < vocabSparseArrayMinimumLength + ? this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.slice() : vocabCopyPropertyArray(this.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense); if ("preferredLicense" in values && values.preferredLicense != null) { if (values.preferredLicense instanceof URL) { // @ts-ignore: type is checked above. @@ -144510,6 +152603,12 @@ services?: (DidService | URL)[];followedMessage?: string | null;cat?: boolean | * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -144565,122 +152664,377 @@ const base = getDeepCloneDescriptor(this.prototype)!; base.copy(value, context); const node = value as Service; - for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { - const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; - if (value != null && typeof value === "object") { - node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + { + const array = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length; i++) { + const value = node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i]; + if (value != null && typeof value === "object") { + node.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { - const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; - if (value != null && typeof value === "object") { - node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + { + const array = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length; i++) { + const value = node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i]; + if (value != null && typeof value === "object") { + node.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { - const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; - if (value != null && typeof value === "object") { - node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + { + const array = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_hQiaHhZP8hqxckxTBrpsGNs57E3.length; i++) { + const value = node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i]; + if (value != null && typeof value === "object") { + node.#_hQiaHhZP8hqxckxTBrpsGNs57E3[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { - const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; - if (value != null && typeof value === "object") { - node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + { + const array = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length; i++) { + const value = node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i]; + if (value != null && typeof value === "object") { + node.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { - const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; - if (value != null && typeof value === "object") { - node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + { + const array = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length; i++) { + const value = node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i]; + if (value != null && typeof value === "object") { + node.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { - const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; - if (value != null && typeof value === "object") { - node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + { + const array = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length; i++) { + const value = node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i]; + if (value != null && typeof value === "object") { + node.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { - const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; - if (value != null && typeof value === "object") { - node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + { + const array = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length; i++) { + const value = node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i]; + if (value != null && typeof value === "object") { + node.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { - const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; - if (value != null && typeof value === "object") { - node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + { + const array = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length; i++) { + const value = node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i]; + if (value != null && typeof value === "object") { + node.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { - const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; - if (value != null && typeof value === "object") { - node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + { + const array = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length; i++) { + const value = node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i]; + if (value != null && typeof value === "object") { + node.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { - const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; - if (value != null && typeof value === "object") { - node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + { + const array = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length; i++) { + const value = node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i]; + if (value != null && typeof value === "object") { + node.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { - const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; - if (value != null && typeof value === "object") { - node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + { + const array = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.length; i++) { + const value = node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i]; + if (value != null && typeof value === "object") { + node.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { - const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; - if (value != null && typeof value === "object") { - node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + { + const array = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.length; i++) { + const value = node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i]; + if (value != null && typeof value === "object") { + node.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { - const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; - if (value != null && typeof value === "object") { - node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + { + const array = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.length; i++) { + const value = node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i]; + if (value != null && typeof value === "object") { + node.#_sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { - const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; - if (value != null && typeof value === "object") { - node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + { + const array = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length; i++) { + const value = node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i]; + if (value != null && typeof value === "object") { + node.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { - const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; - if (value != null && typeof value === "object") { - node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + { + const array = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length; i++) { + const value = node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i]; + if (value != null && typeof value === "object") { + node.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { - const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; - if (value != null && typeof value === "object") { - node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + { + const array = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length; i++) { + const value = node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i]; + if (value != null && typeof value === "object") { + node.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[i] = context.value(value); + } + } } } - for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { - const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; - if (value != null && typeof value === "object") { - node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + { + const array = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense.length; i++) { + const value = node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i]; + if (value != null && typeof value === "object") { + node.#_248SCMQLVt8i7L4vUstp5SmQQFH6_preferredLicense[i] = context.value(value); + } + } } } } }); } @@ -145033,7 +153387,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#publicKey"); @@ -145101,7 +153456,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !(0 < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -145188,7 +153544,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#publicKey"); @@ -145260,7 +153617,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { + !(i < (this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey[vocabTrustPrefix] ?? 0) || + this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -145614,7 +153972,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#assertionMethod"); @@ -145682,7 +154041,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !(0 < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -145773,7 +154133,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/security#assertionMethod"); @@ -145845,7 +154206,8 @@ get preferredUsernames(): ((string | LanguageString))[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { + !(i < (this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[vocabTrustPrefix] ?? 0) || + this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -146269,7 +154631,8 @@ get gateways(): (URL)[] { } let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "http://www.w3.org/ns/ldp#inbox"); @@ -146337,7 +154700,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { + !(0 < (this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[vocabTrustPrefix] ?? 0) || + this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -146711,7 +155075,8 @@ get gateways(): (URL)[] { } let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#outbox"); @@ -146779,7 +155144,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { + !(0 < (this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox[vocabTrustPrefix] ?? 0) || + this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -147133,7 +155499,8 @@ get gateways(): (URL)[] { } let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#following"); @@ -147201,7 +155568,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { + !(0 < (this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[vocabTrustPrefix] ?? 0) || + this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -147558,7 +155926,8 @@ get gateways(): (URL)[] { } let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#followers"); @@ -147626,7 +155995,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { + !(0 < (this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[vocabTrustPrefix] ?? 0) || + this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -147981,7 +156351,8 @@ get gateways(): (URL)[] { } let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#liked"); @@ -148049,7 +156420,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { + !(0 < (this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[vocabTrustPrefix] ?? 0) || + this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -148402,7 +156774,8 @@ get gateways(): (URL)[] { } let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "http://joinmastodon.org/ns#featured"); @@ -148470,7 +156843,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { + !(0 < (this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured[vocabTrustPrefix] ?? 0) || + this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -148823,7 +157197,8 @@ get gateways(): (URL)[] { } let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "http://joinmastodon.org/ns#featuredTags"); @@ -148891,7 +157266,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { + !(0 < (this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[vocabTrustPrefix] ?? 0) || + this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -149241,7 +157617,8 @@ get gateways(): (URL)[] { } let v = this.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[0]; if (!(v instanceof URL) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://w3id.org/fep/7aa9#featuredCollections"); @@ -149309,7 +157686,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0)) { + !(0 < (this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections[vocabTrustPrefix] ?? 0) || + this.#_trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -149659,7 +158037,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#streams"); @@ -149731,7 +158110,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { + !(i < (this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams[vocabTrustPrefix] ?? 0) || + this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -150216,7 +158596,8 @@ get gateways(): (URL)[] { } let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#movedTo"); @@ -150284,7 +158665,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { + !(0 < (this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[vocabTrustPrefix] ?? 0) || + this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -150697,7 +159079,8 @@ get gateways(): (URL)[] { } let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#alsoKnownAs"); @@ -150765,7 +159148,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !(0 < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -150856,7 +159240,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/activitystreams#alsoKnownAs"); @@ -150928,7 +159313,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { + !(i < (this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[vocabTrustPrefix] ?? 0) || + this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -151282,7 +159668,8 @@ get gateways(): (URL)[] { } let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/did#service"); @@ -151350,7 +159737,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !(0 < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -151441,7 +159829,8 @@ get gateways(): (URL)[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, "https://www.w3.org/ns/did#service"); @@ -151513,7 +159902,8 @@ get gateways(): (URL)[] { mustDereferencePortableObject( this, this.id, v.id, options, )) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { + !(i < (this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[vocabTrustPrefix] ?? 0) || + this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -152912,7 +161302,7 @@ get gateways(): (URL)[] { instance.#_3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername = _3isuDgRAKSntq9XdbjiNxjwyPZAf_preferredUsername; const _axq166E2eZADq34V4MYUc8KMZdC_publicKey: (CryptographicKey | URL)[] = []; - const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: Set = new Set(); + const _trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey: VocabTrustSet = new Set(); let _axq166E2eZADq34V4MYUc8KMZdC_publicKey__array = values["https://w3id.org/security#publicKey"]; @@ -152953,7 +161343,7 @@ get gateways(): (URL)[] { instance.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey = _axq166E2eZADq34V4MYUc8KMZdC_publicKey; const _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: (Multikey | URL)[] = []; - const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: Set = new Set(); + const _trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod: VocabTrustSet = new Set(); let _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod__array = values["https://w3id.org/security#assertionMethod"]; @@ -153052,7 +161442,7 @@ get gateways(): (URL)[] { instance.#_36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers = _36QNc9MxfkKf6h8sEUQSHnV9NZA_manuallyApprovesFollowers; const _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: Set = new Set(); + const _trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox: VocabTrustSet = new Set(); let _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox__array = values["http://www.w3.org/ns/ldp#inbox"]; @@ -153099,7 +161489,7 @@ get gateways(): (URL)[] { instance.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox = _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox; const _41QwhqJouoLg3h8dRPKat21brynC_outbox: (OrderedCollection | OrderedCollectionPage | URL)[] = []; - const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: Set = new Set(); + const _trust_41QwhqJouoLg3h8dRPKat21brynC_outbox: VocabTrustSet = new Set(); let _41QwhqJouoLg3h8dRPKat21brynC_outbox__array = values["https://www.w3.org/ns/activitystreams#outbox"]; @@ -153146,7 +161536,7 @@ get gateways(): (URL)[] { instance.#_41QwhqJouoLg3h8dRPKat21brynC_outbox = _41QwhqJouoLg3h8dRPKat21brynC_outbox; const _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: (Collection | URL)[] = []; - const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: Set = new Set(); + const _trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following: VocabTrustSet = new Set(); let _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following__array = values["https://www.w3.org/ns/activitystreams#following"]; @@ -153187,7 +161577,7 @@ get gateways(): (URL)[] { instance.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following = _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following; const _BBCTgfphhsFzpVfKTykGSpBNwoA_followers: (Collection | URL)[] = []; - const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: Set = new Set(); + const _trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers: VocabTrustSet = new Set(); let _BBCTgfphhsFzpVfKTykGSpBNwoA_followers__array = values["https://www.w3.org/ns/activitystreams#followers"]; @@ -153228,7 +161618,7 @@ get gateways(): (URL)[] { instance.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers = _BBCTgfphhsFzpVfKTykGSpBNwoA_followers; const _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: (Collection | URL)[] = []; - const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: Set = new Set(); + const _trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked: VocabTrustSet = new Set(); let _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked__array = values["https://www.w3.org/ns/activitystreams#liked"]; @@ -153269,7 +161659,7 @@ get gateways(): (URL)[] { instance.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked = _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked; const _4N1vBJzXDf8NbBumeECQMFvKetja_featured: (Collection | URL)[] = []; - const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: Set = new Set(); + const _trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured: VocabTrustSet = new Set(); let _4N1vBJzXDf8NbBumeECQMFvKetja_featured__array = values["http://joinmastodon.org/ns#featured"]; @@ -153310,7 +161700,7 @@ get gateways(): (URL)[] { instance.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured = _4N1vBJzXDf8NbBumeECQMFvKetja_featured; const _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: (Collection | URL)[] = []; - const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: Set = new Set(); + const _trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags: VocabTrustSet = new Set(); let _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags__array = values["http://joinmastodon.org/ns#featuredTags"]; @@ -153351,7 +161741,7 @@ get gateways(): (URL)[] { instance.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags = _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags; const _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: (Collection | URL)[] = []; - const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: Set = new Set(); + const _trust_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections: VocabTrustSet = new Set(); let _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections__array = values["https://w3id.org/fep/7aa9#featuredCollections"]; @@ -153392,7 +161782,7 @@ get gateways(): (URL)[] { instance.#_43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections = _43Vdn8myiwHqPANJwoAEF3Yy3vsd_featuredCollections; const _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: (Collection | URL)[] = []; - const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: Set = new Set(); + const _trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams: VocabTrustSet = new Set(); let _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams__array = values["https://www.w3.org/ns/activitystreams#streams"]; @@ -153581,7 +161971,7 @@ get gateways(): (URL)[] { instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk_indexable; const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: Set = new Set(); + const _trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo: VocabTrustSet = new Set(); let _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array = values["https://www.w3.org/ns/activitystreams#movedTo"]; @@ -153639,7 +162029,7 @@ get gateways(): (URL)[] { instance.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo; const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: (Application | Group | Organization | Person | Service | URL)[] = []; - const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: Set = new Set(); + const _trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs: VocabTrustSet = new Set(); let _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array = values["https://www.w3.org/ns/activitystreams#alsoKnownAs"]; @@ -153697,7 +162087,7 @@ get gateways(): (URL)[] { instance.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; const _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: (DidService | URL)[] = []; - const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: Set = new Set(); + const _trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service: VocabTrustSet = new Set(); let _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service__array = values["https://www.w3.org/ns/did#service"]; @@ -154564,10 +162954,34 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} ); } - if (Array.isArray(values.contents) && - values.contents.every(v => typeof v === "string" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.contents)) { + const array = values.contents; + const test = (v: string | LanguageString): boolean => typeof v === "string" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.contents; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = values.contents.slice(); + this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = copied; } else { throw new TypeError( @@ -154647,7 +163061,8 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} options ); copyPortableProvenance(this, clone); - clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.slice(); + clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.length < vocabSparseArrayMinimumLength + ? this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content.slice() : vocabCopyPropertyArray(this.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content); if ("content" in values && values.content != null) { if (typeof values.content === "string" || values.content instanceof LanguageString) { // @ts-ignore: type is checked above. @@ -154671,10 +163086,34 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} ); } - if (Array.isArray(values.contents) && - values.contents.every(v => typeof v === "string" || v instanceof LanguageString)) { + let copied!: (string | LanguageString)[]; + let valid = false; + if (Array.isArray(values.contents)) { + const array = values.contents; + const test = (v: string | LanguageString): boolean => typeof v === "string" || v instanceof LanguageString; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.contents; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = values.contents.slice(); + clone.#_4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content = copied; } else { throw new TypeError( @@ -154683,7 +163122,8 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} ); } } - clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.slice(); + clone.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType = this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.length < vocabSparseArrayMinimumLength + ? this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType.slice() : vocabCopyPropertyArray(this.#_3BLrzmscsjHCw8TF5BHRW9WkPnX8_mediaType); if ("mediaType" in values && values.mediaType != null) { if (typeof values.mediaType === "string") { // @ts-ignore: type is checked above. @@ -154722,6 +163162,12 @@ contents?: ((string | LanguageString))[];mediaType?: string | null;} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -155455,6 +163901,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -155965,6 +164417,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -156399,10 +164857,34 @@ formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} ); } - if (Array.isArray(values.formerTypes) && - values.formerTypes.every(v => isEntityType(v))) { + let copied!: ($EntityType)[]; + let valid = false; + if (Array.isArray(values.formerTypes)) { + const array = values.formerTypes; + const test = (v: $EntityType): boolean => isEntityType(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.formerTypes; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = values.formerTypes.slice(); + this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = copied; } else { throw new TypeError( @@ -156491,7 +164973,8 @@ formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} // @ts-ignore: $warning is not recognized as a property, but it is. options = { ...options, $warning: this._warning }; } - const clone = super.clone(values, options) as unknown as Tombstone;clone.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.slice(); + const clone = super.clone(values, options) as unknown as Tombstone;clone.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.length < vocabSparseArrayMinimumLength + ? this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType.slice() : vocabCopyPropertyArray(this.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType); if ("formerType" in values && values.formerType != null) { if (isEntityType(values.formerType)) { // @ts-ignore: type is checked above. @@ -156515,10 +164998,34 @@ formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} ); } - if (Array.isArray(values.formerTypes) && - values.formerTypes.every(v => isEntityType(v))) { + let copied!: ($EntityType)[]; + let valid = false; + if (Array.isArray(values.formerTypes)) { + const array = values.formerTypes; + const test = (v: $EntityType): boolean => isEntityType(v); + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.formerTypes; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + // @ts-ignore: type is checked above. - clone.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = values.formerTypes.slice(); + clone.#_Pn8kdUztYSt4nyoAkVsMcQaLo9U_formerType = copied; } else { throw new TypeError( @@ -156527,7 +165034,8 @@ formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} ); } } - clone.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.slice(); + clone.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.length < vocabSparseArrayMinimumLength + ? this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.slice() : vocabCopyPropertyArray(this.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted); if ("deleted" in values && values.deleted != null) { if (isTemporalInstant(values.deleted)) { // @ts-ignore: type is checked above. @@ -156566,6 +165074,12 @@ formerTypes?: ($EntityType)[];deleted?: Temporal.Instant | null;} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -157331,6 +165845,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -157846,6 +166366,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -158359,6 +166885,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -158855,6 +167387,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options @@ -159377,6 +167915,12 @@ instruments?: (Object | URL)[];} * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index 9dbd57dae..ef1d497ad 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -11,6 +11,7 @@ import { import { generateFields } from "./field.ts"; import { generateInspector, generateInspectorPostClass } from "./inspector.ts"; import { generateProperties } from "./property.ts"; +import { generatePropertyArrayHelpers } from "./property-array.ts"; import { type PropertySchema, type TypeSchema, @@ -345,6 +346,7 @@ function inspectIri(iri: URL): string { try { return formatIri(iri); } catch { return iri.href; } } `; + yield generatePropertyArrayHelpers(); yield generateDeepCloneHelpers(); yield ` function isValidLanguageTag(language: string): boolean { diff --git a/packages/vocab-tools/src/constructor.ts b/packages/vocab-tools/src/constructor.ts index 6aa1c21f4..5d14e7eaf 100644 --- a/packages/vocab-tools/src/constructor.ts +++ b/packages/vocab-tools/src/constructor.ts @@ -69,6 +69,40 @@ async function* generateParametersType( if (parentheses) yield "}\n"; } +function generateValidatedArrayCopy( + name: string, + typeNames: string, + typeGuards: string, +): string { + return ` + let copied!: (${typeNames})[]; + let valid = false; + if (Array.isArray(values.${name})) { + const array = values.${name}; + const test = (v: ${typeNames}): boolean => ${typeGuards}; + let checked: VocabArrayValidation | undefined; + if (array.length < vocabSparseArrayMinimumLength + ? array.every(test) + : (checked = vocabValidatePropertyArray(array, test)).valid) { + const input = values.${name}; + if (input.length < vocabSparseArrayMinimumLength && !checked?.sparse) { + copied = input.slice(); + valid = true; + } else { + const result = vocabCopyValidatedPropertyArray( + input, test, checked ?? { valid: true, sparse: false }, + ); + if (result.ok) { + copied = result.array; + valid = true; + } + } + } + } + if (valid) { + `.trimEnd() + "\n"; +} + export async function* generateConstructor( typeUri: string, types: Record, @@ -175,17 +209,18 @@ export async function* generateConstructor( } `; } + yield generateValidatedArrayCopy( + property.pluralName, + typeNames, + typeGuards, + ); yield ` - if (Array.isArray(values.${property.pluralName}) && - values.${property.pluralName}.every(v => ${typeGuards})) { // @ts-ignore: type is checked above. - this.${fieldName} = values.${property.pluralName}.slice(); + this.${fieldName} = copied; `; if (!allScalarTypes) { yield ` - for (let i = 0; i < values.${property.pluralName}.length; i++) { - this.${trustFieldName}.add(i); - } + vocabSetTrustPrefix(this.${trustFieldName}, this.${fieldName}.length); `; } yield ` @@ -272,9 +307,12 @@ export async function* generateCloner( const fieldName = await getFieldName(property.uri); const trustFieldName = await getFieldName(property.uri, "#_trust"); const allScalarTypes = areAllScalarTypes(property.range, types); - yield `clone.${fieldName} = this.${fieldName}.slice();`; + yield `clone.${fieldName} = this.${fieldName}.length < vocabSparseArrayMinimumLength + ? this.${fieldName}.slice() : vocabCopyPropertyArray(this.${fieldName});`; if (!allScalarTypes) { - yield `clone.${trustFieldName} = new Set(this.${trustFieldName});`; + yield `clone.${trustFieldName} = vocabCopyTrustSet( + this.${trustFieldName}, clone.${trustFieldName}, + );`; } if (hasSingularAccessor(property)) { let typeGuards = getTypeGuards( @@ -297,7 +335,8 @@ export async function* generateCloner( clone.${fieldName} = [values.${property.singularName}]; `; if (!allScalarTypes) { - yield `clone.${trustFieldName} = new Set([0]);`; + yield `clone.${trustFieldName} = new Set(); + clone.${trustFieldName}[vocabTrustPrefix] = 1;`; } yield ` } else { @@ -332,18 +371,19 @@ export async function* generateCloner( } `; } + yield generateValidatedArrayCopy( + property.pluralName, + typeNames, + typeGuards, + ); yield ` - if (Array.isArray(values.${property.pluralName}) && - values.${property.pluralName}.every(v => ${typeGuards})) { // @ts-ignore: type is checked above. - clone.${fieldName} = values.${property.pluralName}.slice(); + clone.${fieldName} = copied; `; if (!allScalarTypes) { yield ` clone.${trustFieldName} = new Set(); - for (let i = 0; i < values.${property.pluralName}.length; i++) { - clone.${trustFieldName}.add(i); - } + vocabSetTrustPrefix(clone.${trustFieldName}, clone.${fieldName}.length); `; } yield ` @@ -391,6 +431,12 @@ export async function* generateDeepCloner( * referrers outside the graph still point at the original external objects. * Custom clone() overrides must return fresh, compatible instances and * remain responsible for their own constructor and cloning side effects. + * Large sparse property arrays with ordinary data entries are copied using + * a snapshot of their length and present indices. Entries added after a + * snapshot are not visited; deleted entries are skipped, and values changed + * after the snapshot are read when reached. Custom + * clone() overrides must avoid structurally changing a field being copied + * if they need all its nested objects to be independent of the source. * * @param values The values to replace before copying the graph. * @param options Root loader and verifier overrides. Undefined options diff --git a/packages/vocab-tools/src/deep-clone.ts b/packages/vocab-tools/src/deep-clone.ts index 300cbd7ed..508aae063 100644 --- a/packages/vocab-tools/src/deep-clone.ts +++ b/packages/vocab-tools/src/deep-clone.ts @@ -148,10 +148,25 @@ export async function* generateDeepCloneDescriptor( for (const property of properties) { const field = await getFieldName(property.uri); yield ` - for (let i = 0; i < node.${field}.length; i++) { - const value = node.${field}[i]; - if (value != null && typeof value === "object") { - node.${field}[i] = context.value(value); + { + const array = node.${field}; + const snapshot = array.length < vocabSparseArrayMinimumLength + ? undefined : vocabSparseArraySnapshot(array); + if (snapshot != null) { + for (const i of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, i)) continue; + const value = array[i]; + if (value != null && typeof value === "object") { + array[i] = context.value(value); + } + } + } else { + for (let i = 0; i < node.${field}.length; i++) { + const value = node.${field}[i]; + if (value != null && typeof value === "object") { + node.${field}[i] = context.value(value); + } + } } } `; diff --git a/packages/vocab-tools/src/field.ts b/packages/vocab-tools/src/field.ts index 3bacdb3c2..27d78a2cc 100644 --- a/packages/vocab-tools/src/field.ts +++ b/packages/vocab-tools/src/field.ts @@ -30,7 +30,7 @@ export async function generateField( const trustFieldName = await getFieldName(property.uri, `${prefix}_trust`); return ` ${fieldName}: (${typeNames} | URL)[] = []; - ${trustFieldName}: Set = new Set(); + ${trustFieldName}: VocabTrustSet = new Set(); `; } } diff --git a/packages/vocab-tools/src/property-array.ts b/packages/vocab-tools/src/property-array.ts new file mode 100644 index 000000000..6794339b6 --- /dev/null +++ b/packages/vocab-tools/src/property-array.ts @@ -0,0 +1,198 @@ +/** Emits module-private sparse property-array validation and copying helpers. */ +export function generatePropertyArrayHelpers(): string { + return ` +interface VocabSparseArraySnapshot { + length: number; + indices: number[]; +} + +interface VocabArrayValidation { + valid: boolean; + sparse: boolean; +} + +type VocabArrayCopy = { ok: true; array: T[] } | { ok: false }; + +// Most fields have no trusted prefix. Keep that metadata on the existing Set +// so empty fields need neither another object nor another instance slot. +const vocabTrustPrefix: unique symbol = Symbol("vocabulary trust prefix"); +type VocabTrustSet = Set & { [vocabTrustPrefix]?: number }; + +function vocabSetTrustPrefix(trust: VocabTrustSet, prefix: number): void { + if (prefix > 0) trust[vocabTrustPrefix] = prefix; +} + +function vocabCopyTrustSet( + trust: VocabTrustSet, + destination: VocabTrustSet, +): VocabTrustSet { + // clone() already constructed the destination. Reuse its empty Set only + // when constructor defaults cannot contribute trust to the copied field. + const copy: VocabTrustSet = trust !== destination && trust.size === 0 && + destination.size === 0 && destination[vocabTrustPrefix] == null + ? destination : new Set(trust); + const prefix = trust[vocabTrustPrefix]; + if (prefix != null && prefix > 0) copy[vocabTrustPrefix] = prefix; + return copy; +} + +// These thresholds select an optimization, not a limit on property arrays. +const vocabSparseArrayMinimumLength = 4096; +const vocabSparseArrayProbeCount = 8; +const vocabSparseArrayPresentProbeLimit = 4; +const vocabArrayPrototype = Array.prototype; +const vocabObjectPrototype = globalThis.Object.prototype; +const vocabArrayDescriptors = ["constructor", "every", "slice"].map( + key => globalThis.Object.getOwnPropertyDescriptor(vocabArrayPrototype, key), +); +const vocabArraySpeciesDescriptor = globalThis.Object.getOwnPropertyDescriptor( + Array, Symbol.species, +); + +function vocabSameArrayDescriptor( + actual: PropertyDescriptor | undefined, + expected: PropertyDescriptor | undefined, +): boolean { + return actual?.value === expected?.value && actual?.get === expected?.get && + actual?.set === expected?.set && actual?.writable === expected?.writable && + actual?.enumerable === expected?.enumerable && + actual?.configurable === expected?.configurable; +} + +function vocabArrayIndex(key: string): number | undefined { + const index = Number(key); + return Number.isInteger(index) && index >= 0 && index < 0xffffffff && + String(index) === key + ? index + : undefined; +} + +function vocabSparseArraySnapshot( + array: unknown[], +): VocabSparseArraySnapshot | undefined { + if (!Array.isArray(array)) return undefined; + const length = array.length; + // Small dense fields take no prototype or key-enumeration overhead. + if (length < vocabSparseArrayMinimumLength) return undefined; + if (!Number.isInteger(length) || length > 0xffffffff || + globalThis.Object.getPrototypeOf(array) !== vocabArrayPrototype || + globalThis.Object.getPrototypeOf(vocabArrayPrototype) !== + vocabObjectPrototype || + globalThis.Object.getPrototypeOf(vocabObjectPrototype) !== null) { + return undefined; + } + const methods = ["constructor", "every", "slice"]; + for (let i = 0; i < methods.length; i++) { + const key = methods[i]; + if (globalThis.Object.hasOwn(array, key) || + !vocabSameArrayDescriptor( + globalThis.Object.getOwnPropertyDescriptor(vocabArrayPrototype, key), + vocabArrayDescriptors[i], + )) return undefined; + } + if (!vocabSameArrayDescriptor( + globalThis.Object.getOwnPropertyDescriptor(Array, Symbol.species), + vocabArraySpeciesDescriptor, + )) return undefined; + + // Descriptor probes do not invoke element getters. Plainly dense arrays + // keep native iteration without enumerating all their keys. + let present = 0; + for (let i = 0; i < vocabSparseArrayProbeCount; i++) { + const index = Math.floor(i * (length - 1) / (vocabSparseArrayProbeCount - 1)); + if (globalThis.Object.getOwnPropertyDescriptor(array, index) != null && + ++present >= vocabSparseArrayPresentProbeLimit) return undefined; + } + for (const prototype of [vocabArrayPrototype, vocabObjectPrototype]) { + for (const key of globalThis.Object.getOwnPropertyNames(prototype)) { + if (vocabArrayIndex(key) != null) return undefined; + } + } + const indices: number[] = []; + for (const key of globalThis.Object.getOwnPropertyNames(array)) { + const index = vocabArrayIndex(key); + if (index != null && index < length) indices.push(index); + } + if (indices.length >= length / 2) return undefined; + for (const index of indices) { + const descriptor = globalThis.Object.getOwnPropertyDescriptor(array, index); + if (descriptor == null || !("value" in descriptor)) return undefined; + } + // Ordinary array keys already have canonical index order. This guard is + // not a Proxy detector; reflection traps and errors remain observable. + return { length, indices }; +} + +function vocabValidatePropertyArray( + array: T[], + test: (value: T) => boolean, +): VocabArrayValidation { + const snapshot = vocabSparseArraySnapshot(array); + if (snapshot == null) return { valid: array.every(test), sparse: false }; + for (const index of snapshot.indices) { + if (globalThis.Object.hasOwn(array, index) && !test(array[index])) { + return { valid: false, sparse: true }; + } + } + return { valid: true, sparse: true }; +} + +function vocabDefineArrayEntry(array: T[], index: number, value: T): void { + globalThis.Object.defineProperty(array, index, { + value, writable: true, enumerable: true, configurable: true, + }); +} + +function vocabCopySparsePropertyArray( + array: T[], + snapshot: VocabSparseArraySnapshot, + test?: (value: T) => boolean, +): VocabArrayCopy { + const copy: T[] = []; + // Seed dictionary storage before low indices or the final length can + // allocate storage for every hole. The temporary entry stays private. + if (snapshot.indices[snapshot.indices.length - 1] !== snapshot.length - 1) { + globalThis.Object.defineProperty(copy, snapshot.length - 1, { + value: undefined, writable: true, enumerable: true, configurable: true, + }); + delete copy[snapshot.length - 1]; + } + for (const index of snapshot.indices) { + if (!globalThis.Object.hasOwn(array, index)) continue; + const value = array[index]; + if (test != null && !test(value)) return { ok: false }; + vocabDefineArrayEntry(copy, index, value); + } + // A validation callback may have deleted the last snapshot entry. + if (copy.length < snapshot.length) { + globalThis.Object.defineProperty(copy, snapshot.length - 1, { + value: undefined, writable: true, enumerable: true, configurable: true, + }); + delete copy[snapshot.length - 1]; + } + copy.length = snapshot.length; + return { ok: true, array: copy }; +} + +function vocabCopyPropertyArray(array: T[]): T[] { + const snapshot = vocabSparseArraySnapshot(array); + if (snapshot == null) return array.slice(); + const copied = vocabCopySparsePropertyArray(array, snapshot); + // Without a predicate the private copy cannot fail validation. + return (copied as { ok: true; array: T[] }).array; +} + +function vocabCopyValidatedPropertyArray( + array: T[], + test: (value: T) => boolean, + previous: VocabArrayValidation, +): VocabArrayCopy { + const snapshot = vocabSparseArraySnapshot(array); + if (snapshot != null) return vocabCopySparsePropertyArray(array, snapshot, test); + // Sparse validation may have changed the next input's density, descriptors + // or prototype. Validate that native-copy input before falling back. + if (previous.sparse && !array.every(test)) return { ok: false }; + return { ok: true, array: array.slice() }; +} +`; +} diff --git a/packages/vocab-tools/src/property.ts b/packages/vocab-tools/src/property.ts index d7adbb9da..4d2a9e7b7 100644 --- a/packages/vocab-tools/src/property.ts +++ b/packages/vocab-tools/src/property.ts @@ -442,7 +442,11 @@ async function* generateProperty( } let v = this.${await getFieldName(property.uri)}[0]; if (!(v instanceof URL) && - !this.${await getFieldName(property.uri, "#_trust")}.has(0)) { + !(0 < (this.${await getFieldName( + property.uri, + "#_trust", + )}[vocabTrustPrefix] ?? 0) || + this.${await getFieldName(property.uri, "#_trust")}.has(0))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, ${ @@ -514,7 +518,11 @@ async function* generateProperty( mustDereferencePortableObject( this, ${trustOwner}, v.id, options, )) && - !this.${await getFieldName(property.uri, "#_trust")}.has(0)) { + !(0 < (this.${await getFieldName( + property.uri, + "#_trust", + )}[vocabTrustPrefix] ?? 0) || + this.${await getFieldName(property.uri, "#_trust")}.has(0))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -611,7 +619,11 @@ async function* generateProperty( for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (!(v instanceof URL) && - !this.${await getFieldName(property.uri, "#_trust")}.has(i)) { + !(i < (this.${await getFieldName( + property.uri, + "#_trust", + )}[vocabTrustPrefix] ?? 0) || + this.${await getFieldName(property.uri, "#_trust")}.has(i))) { if (v.id == null) { if (isUnsecuredPortableObject(this)) { warnUnverifiableEmbeddedObject(this, ${ @@ -689,7 +701,11 @@ async function* generateProperty( mustDereferencePortableObject( this, ${trustOwner}, v.id, options, )) && - !this.${await getFieldName(property.uri, "#_trust")}.has(i)) { + !(i < (this.${await getFieldName( + property.uri, + "#_trust", + )}[vocabTrustPrefix] ?? 0) || + this.${await getFieldName(property.uri, "#_trust")}.has(i))) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + diff --git a/packages/vocab/src/sparse-arrays.test.ts b/packages/vocab/src/sparse-arrays.test.ts new file mode 100644 index 000000000..bbbd9a64a --- /dev/null +++ b/packages/vocab/src/sparse-arrays.test.ts @@ -0,0 +1,507 @@ +import { mockDocumentLoader, test } from "@fedify/fixture"; +import { + deepStrictEqual, + notStrictEqual, + ok, + strictEqual, + throws, +} from "node:assert/strict"; +import { Create, Note, Translation } from "./vocab.ts"; + +const sparseLength = 8192; + +test("sparse scalar copies preserve own indices and omit metadata", () => { + const names = new Array(sparseLength); + globalThis.Object.defineProperty(names, 2, { value: "hidden" }); + names[6000] = "visible"; + globalThis.Object.assign(names, { + "01": "metadata", + "-1": "metadata", + "4294967295": "metadata", + extra: "metadata", + [Symbol("metadata")]: "metadata", + }); + const before = globalThis.Object.getOwnPropertyDescriptors(names); + const source = new Note({ names }); + for (const copy of [source, source.clone(), source.deepClone()]) { + strictEqual(copy.names.length, sparseLength); + deepStrictEqual(Reflect.ownKeys(copy.names), ["2", "6000", "length"]); + deepStrictEqual(globalThis.Object.getOwnPropertyDescriptor(copy.names, 2), { + value: "hidden", + writable: true, + enumerable: true, + configurable: true, + }); + strictEqual(copy.names[6000], "visible"); + strictEqual(0 in copy.names, false); + strictEqual((sparseLength - 1) in copy.names, false); + notStrictEqual(copy.names, names); + } + deepStrictEqual(globalThis.Object.getOwnPropertyDescriptors(names), before); +}); + +test("sparse copies preserve empty and trailing-hole arrays", () => { + for (const index of [undefined, 0, sparseLength - 1]) { + const names = new Array(sparseLength); + if (index != null) names[index] = "kept"; + const source = new Note({ names }); + for (const copy of [source, source.clone(), source.deepClone()]) { + strictEqual(copy.names.length, sparseLength); + deepStrictEqual( + globalThis.Object.getOwnPropertyNames(copy.names), + index == null ? ["length"] : [String(index), "length"], + ); + } + } +}); + +test("sparse inputs distinguish holes from explicit undefined", () => { + const names = new Array(sparseLength); + new Note({ names }); + globalThis.Object.defineProperty(names, 100, { value: undefined }); + throws(() => new Note({ names }), TypeError); + throws(() => new Note({}).clone({ names }), TypeError); +}); + +test("sparse URL copies preserve aliases and isolate mutable leaves", () => { + const url = new URL("https://example.com/license"); + const licenses = new Array(sparseLength); + licenses[0] = licenses[6000] = url; + globalThis.Object.freeze(licenses); + const source = new Note({ licenses }); + const shallow = source.clone(); + const deep = source.deepClone(); + const replaced = new Note({}).deepClone({ licenses }); + for (const copy of [source, shallow, deep, replaced]) { + strictEqual(copy.licenses.length, sparseLength); + deepStrictEqual(globalThis.Object.keys(copy.licenses), ["0", "6000"]); + notStrictEqual(copy.licenses, licenses); + strictEqual(copy.licenses[0], copy.licenses[6000]); + copy.licenses[1] = new URL("https://example.com/copy-only"); + } + strictEqual(shallow.licenses[0], url); + notStrictEqual(deep.licenses[0], url); + notStrictEqual(replaced.licenses[0], url); + deep.licenses[0].pathname = "/deep-only"; + strictEqual(url.pathname, "/license"); + strictEqual(replaced.licenses[0].pathname, "/license"); + strictEqual(1 in licenses, false); +}); + +test("sparse non-entity arrays deep-copy aliases and nested URLs", () => { + const url = new URL("https://example.com/original"); + const translation = new Translation({ original: url, basis: url }); + const translations = new Array(sparseLength); + globalThis.Object.defineProperty(translations, 0, { value: translation }); + translations[6000] = translation; + const source = new Note({ translations }); + const shallow = source.clone(); + const copy = source.deepClone(); + const replacement = source.deepClone({ translations }); + strictEqual(shallow.translations[0], translation); + for (const deep of [copy, replacement]) { + strictEqual(deep.translations.length, sparseLength); + deepStrictEqual(globalThis.Object.keys(deep.translations), ["0", "6000"]); + strictEqual(deep.translations[0], deep.translations[6000]); + notStrictEqual(deep.translations[0], translation); + strictEqual(deep.translations[0].original, deep.translations[0].basis); + notStrictEqual(deep.translations[0].original, url); + } + copy.translations[0].original!.pathname = "/copy-only"; + strictEqual(url.pathname, "/original"); + strictEqual(replacement.translations[0].original!.pathname, "/original"); + copy.translations.length = 1; + strictEqual(source.translations.length, sparseLength); +}); + +test("sparse object arrays copy embedded graphs without fetching holes", async () => { + const child = new Note({ content: "child" }); + const objects = new Array(sparseLength); + objects[0] = child; + objects[6000] = child; + const source = new Create({ objects, attachments: [child] }); + const shallow = source.clone(); + const copy = source.deepClone(); + const copiedChild = await copy.getObject(); + ok(copiedChild instanceof Note); + notStrictEqual(copiedChild, child); + strictEqual(await shallow.getObject(), child); + strictEqual((await Array.fromAsync(copy.getAttachments()))[0], copiedChild); + // Only inspect the first two positions: accessor traversal is unchanged. + const iterator = copy.getObjects()[Symbol.asyncIterator](); + strictEqual((await iterator.next()).value, copiedChild); + strictEqual((await iterator.next()).value, undefined); + await iterator.return?.(); +}); + +test("exposed scalar arrays recheck accessors, prototypes, and freezing", () => { + const source = new Note({ names: new Array(sparseLength) }); + let reads = 0; + globalThis.Object.defineProperty(source.names, 2, { + get() { + reads++; + return "getter"; + }, + configurable: true, + }); + const accessorCopy = source.clone(); + strictEqual(accessorCopy.names[2], "getter"); + strictEqual(reads, 1); + globalThis.Object.defineProperty(source.names, 2, { + value: "own", + writable: true, + configurable: true, + }); + const prototype = globalThis.Object.create(Array.prototype, { + 1: { get: () => "inherited", configurable: true }, + }); + globalThis.Object.setPrototypeOf(source.names, prototype); + const inheritedCopy = source.clone(); + strictEqual(inheritedCopy.names[1], "inherited"); + strictEqual(globalThis.Object.hasOwn(inheritedCopy.names, 1), true); + globalThis.Object.setPrototypeOf(source.names, Array.prototype); + globalThis.Object.freeze(source.names); + const frozenCopy = source.deepClone(); + frozenCopy.names[2] = "changed"; + strictEqual(source.names[2], "own"); +}); + +test("source shallow copies retain scalar getter mutations", () => { + const source = new Note({ names: new Array(sparseLength) }); + globalThis.Object.defineProperty(source.names, 2, { get: () => 123 }); + strictEqual(source.clone().names[2], 123); + strictEqual(source.deepClone().names[2], 123); + throws(() => new Note({ names: source.names }), TypeError); +}); + +test("array subclasses, species, and own methods retain native fallback", () => { + class Names extends Array { + static override get [Symbol.species](): ArrayConstructor { + return Array; + } + } + const names = new Names(sparseLength); + names[2] = "kept"; + const source = new Note({ names }); + strictEqual(globalThis.Object.getPrototypeOf(source.names), Array.prototype); + strictEqual(source.names[2], "kept"); + strictEqual(source.names.length, sparseLength); + + let everyCalls = 0; + let sliceCalls = 0; + const custom = new Array(sparseLength); + custom[2] = "kept"; + globalThis.Object.defineProperty(custom, "every", { + value( + this: string[], + callback: (value: string, index: number, array: string[]) => unknown, + thisArg?: unknown, + ): boolean { + everyCalls++; + return Array.prototype.every.call(this, callback, thisArg); + }, + configurable: true, + writable: true, + }); + custom.slice = function (start, end) { + sliceCalls++; + return Array.prototype.slice.call(this, start, end); + }; + strictEqual(new Note({ names: custom }).names[2], "kept"); + strictEqual(everyCalls, 1); + strictEqual(sliceCalls, 1); +}); + +test("sparse validation rejects invalid keys injected by element proxies", () => { + for (const replace of [false, true]) { + const licenses = new Array(sparseLength); + licenses[0] = new Proxy(new URL("https://example.com/license"), { + getPrototypeOf(target) { + licenses[6000] = 123 as unknown as URL; + return Reflect.getPrototypeOf(target); + }, + }); + throws( + () => replace ? new Note({}).clone({ licenses }) : new Note({ licenses }), + TypeError, + ); + } +}); + +test("sparse validation rejects keys injected by Symbol.hasInstance", () => { + const translations = new Array(sparseLength); + translations[0] = new Translation({}); + const previous = globalThis.Object.getOwnPropertyDescriptor( + Translation, + Symbol.hasInstance, + ); + // The hook is synchronous and restored before another test can run. + globalThis.Object.defineProperty(Translation, Symbol.hasInstance, { + configurable: true, + value(value: unknown) { + translations[6000] = 123 as unknown as Translation; + return Function.prototype[Symbol.hasInstance].call(Translation, value); + }, + }); + try { + throws(() => new Note({ translations }), TypeError); + } finally { + if (previous == null) { + Reflect.deleteProperty(Translation, Symbol.hasInstance); + } else { + globalThis.Object.defineProperty( + Translation, + Symbol.hasInstance, + previous, + ); + } + } +}); + +test("sparse validation rechecks inputs that switch to native copying", () => { + for (const transition of ["density", "accessor"] as const) { + const licenses = new Array(sparseLength); + const url = new URL("https://example.com/license"); + licenses[0] = new Proxy(url, { + getPrototypeOf(target) { + if (transition === "density") { + licenses.fill(url, 1, sparseLength / 2 + 1); + licenses[6000] = 123 as unknown as URL; + } else { + globalThis.Object.defineProperty(licenses, 6000, { + get: () => 123, + configurable: true, + }); + } + return Reflect.getPrototypeOf(target); + }, + }); + throws(() => new Note({ licenses }), TypeError); + } +}); + +test("sparse copying omits invalid keys injected after its snapshot", () => { + const licenses = new Array(sparseLength); + let checks = 0; + licenses[0] = new Proxy(new URL("https://example.com/license"), { + getPrototypeOf(target) { + if (++checks === 2) licenses[6000] = 123 as unknown as URL; + return Reflect.getPrototypeOf(target); + }, + }); + const source = new Note({ licenses }); + strictEqual(licenses[6000], 123); + strictEqual(6000 in source.licenses, false); + strictEqual(source.licenses[0], licenses[0]); +}); + +test("sparse validation propagates element reflection errors", () => { + const failure = new Error("element reflection failed"); + const licenses = new Array(sparseLength); + licenses[0] = new Proxy(new URL("https://example.com/license"), { + getPrototypeOf() { + throw failure; + }, + }); + throws(() => new Note({ licenses }), (error) => error === failure); +}); + +test("sparse deep traversal snapshots keys and reads later current values", () => { + let destination: Note | undefined; + const added = new Translation({ + original: new URL("https://example.com/new"), + }); + const updated = new Translation({ + original: new URL("https://example.com/updated"), + }); + class CapturesCopy extends Note { + override clone(): Note { + return destination = super.clone(); + } + } + class ChangesLaterEntries extends Translation { + override clone(): Translation { + destination!.translations[100] = added; + delete destination!.translations[6000]; + destination!.translations[7000] = updated; + return super.clone(); + } + } + const translations = new Array(sparseLength); + translations[0] = new ChangesLaterEntries({}); + translations[6000] = new Translation({}); + translations[7000] = new Translation({}); + const source = new CapturesCopy({ translations }); + const copy = source.deepClone(); + strictEqual(copy.translations.length, sparseLength); + strictEqual(copy.translations[100], added); + strictEqual(6000 in copy.translations, false); + notStrictEqual(copy.translations[7000], updated); + notStrictEqual(copy.translations[7000].original, updated.original); + strictEqual(copy.translations[7000].original!.href, updated.original!.href); + strictEqual(100 in source.translations, false); + strictEqual(source.translations[6000], translations[6000]); + strictEqual(source.translations[7000], translations[7000]); +}); + +test("plural getters establish trust for the array actually stored", async () => { + let reads = 0; + const first = new Array(2); + const stored = new Array(3); + stored[2] = new Note({ content: "stored" }); + const source = new Create({ + get objects() { + reads++; + return reads < 4 ? first : stored; + }, + }); + strictEqual(reads, 4); + for (const copy of [source, source.clone(), source.deepClone()]) { + const values = await Array.fromAsync(copy.getObjects()); + strictEqual(values.length, 3); + strictEqual(values[0], undefined); + strictEqual(values[1], undefined); + strictEqual(values[2].content, "stored"); + } + strictEqual(reads, 4); +}); + +test("small sparse object replacements retain trusted holes", async () => { + const child = new Note({ content: "trusted" }); + const objects = new Array(3); + objects[1] = child; + const source = new Create({ objects }); + for ( + const copy of [ + source, + source.clone(), + source.clone({ objects }), + source.deepClone({ objects }), + ] + ) { + const values = await Array.fromAsync(copy.getObjects()); + deepStrictEqual(values.map((value) => value?.content), [ + undefined, + "trusted", + undefined, + ]); + } + deepStrictEqual( + await Array.fromAsync(source.clone({ object: child }).getObjects()), + [child], + ); + deepStrictEqual( + await Array.fromAsync(source.clone({ objects: [] }).getObjects()), + [], + ); +}); + +test("decoded and warmed object trust stays local across clones", async () => { + let fetches = 0; + const original = await Create.fromJsonLd({ + "@context": "https://www.w3.org/ns/activitystreams", + id: "https://a.example/create", + type: "Create", + object: { + id: "https://b.example/note", + type: "Note", + content: "embedded", + }, + }, { contextLoader: mockDocumentLoader }); + // deno-lint-ignore require-await + const documentLoader = async (url: string) => { + fetches++; + return { + contextUrl: null, + documentUrl: url, + document: { + "@context": "https://www.w3.org/ns/activitystreams", + id: url, + type: "Note", + content: "fetched", + }, + }; + }; + const options = { documentLoader, contextLoader: mockDocumentLoader }; + const cold = original.clone(); + const fetched = await original.getObject(options); + strictEqual(fetched?.content, "fetched"); + const warmed = original.clone(); + strictEqual(await warmed.getObject(options), fetched); + strictEqual(fetches, 1); + strictEqual((await cold.getObject(options))?.content, "fetched"); + strictEqual(fetches, 2); + const replacement = new Note({ + id: new URL("https://c.example/note"), + content: "replacement", + }); + strictEqual( + await warmed.clone({ objects: [replacement] }).getObject(options), + replacement, + ); + strictEqual(fetches, 2); +}); + +for (const defaultKind of ["singular", "plural"] as const) { + test(`clone trust replaces ${defaultKind} subclass constructor defaults`, async () => { + let enableDefaults = false; + const defaultObject = new Note({ + id: new URL("https://c.example/default"), + content: "constructor default", + }); + class StatefulCreate extends Create { + constructor( + values: ConstructorParameters[0], + options: ConstructorParameters[1] = {}, + ) { + const defaults = enableDefaults && values.object == null && + values.objects == null + ? defaultKind === "singular" + ? { object: defaultObject } + : { objects: [defaultObject] } + : {}; + super({ ...defaults, ...values }, options); + } + } + const original = await StatefulCreate.fromJsonLd({ + "@context": "https://www.w3.org/ns/activitystreams", + id: "https://a.example/create", + type: "Create", + object: { + id: "https://b.example/note", + type: "Note", + content: "untrusted embedded", + }, + }, { contextLoader: mockDocumentLoader }); + ok(original instanceof StatefulCreate); + enableDefaults = true; + strictEqual(await new StatefulCreate({}).getObject(), defaultObject); + const copies = [original, original.clone(), original.deepClone()]; + let fetches = 0; + // deno-lint-ignore require-await + const documentLoader = async (url: string) => { + fetches++; + return { + contextUrl: null, + documentUrl: url, + document: { + "@context": "https://www.w3.org/ns/activitystreams", + id: url, + type: "Note", + content: "fetched", + }, + }; + }; + for (const copy of copies) { + ok(copy instanceof StatefulCreate); + strictEqual( + (await copy.getObject({ + documentLoader, + contextLoader: mockDocumentLoader, + }))?.content, + "fetched", + ); + } + strictEqual(fetches, 3); + }); +} diff --git a/packages/vocab/src/vocab.bench.ts b/packages/vocab/src/vocab.bench.ts index c68355cc5..d9f7bf5cc 100644 --- a/packages/vocab/src/vocab.bench.ts +++ b/packages/vocab/src/vocab.bench.ts @@ -241,3 +241,26 @@ Deno.bench({ await Create.fromJsonLd(await activity.toJsonLd()); }, }); + +// Low-only entries also exercise output arrays with long trailing holes. +for (const position of [0, 99_999]) { + const names = new Array(100_000); + names[position] = "Sparse"; + const note = new Note({ names }); + for (const method of ["clone", "deepClone"] as const) { + Deno.bench({ + name: `Note.${method}() sparse names at ${position}`, + group: "sparse property copy", + fn() { + note[method](); + }, + }); + } + Deno.bench({ + name: `new Note() sparse names at ${position}`, + group: "sparse property copy", + fn() { + new Note({ names }); + }, + }); +}