@prisma/orm-target-mongo 8.0.0-rc.24-dev.22 → 8.0.0-rc.24-dev.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-D2tbWwPF.mjs","names":["#target","#groups","#nodes","#modelsWithVariants","#pathsOfMember","#reaches","#pathsBelow"],"sources":["../../../../3-targets/mongo/1-target/dist/control.mjs"],"sourcesContent":["import { t as mongoTargetDescriptorMeta } from \"./descriptor-meta-BWjqdX8D.mjs\";\nimport { t as mongoTargetError } from \"./mongo-target-errors-Btf3ML1w.mjs\";\nimport { A as storedKeyPath, C as unrewritableKeyReason, D as jsonPathText, E as documentsWithObject, M as isConvertTarget, O as keysOf, S as unrewritableFieldNameReason, _ as renameCollection, b as replaceStoredValue, c as documentsNotOfType, d as fillField, f as fillStoredKey, g as removeStoredValue, h as removeStoredKey, i as createIndex, j as castsFrom, k as lacksKey, l as dropCollection, n as collMod, o as deleteDocuments, r as createCollection, s as documentsMissingOrNull, t as castField, u as dropIndex, v as renameField, w as unsetField, y as renameStoredKey } from \"./migration-factories-RJZq8NhE.mjs\";\nimport { assembleDataTypes } from \"@internal/framework-components/codec\";\nimport { bsonTypesOfCodec, temporaryValueOfCodec } from \"@internal/mongo-contract/data-type\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { type } from \"arktype\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { setFallbackTemporal } from \"@internal/type-implementations/temporal\";\nimport { NamespaceBase, UNBOUND_NAMESPACE_ID, elementCoordinates, freezeNode, hydrateNamespaceEntities } from \"@internal/framework-components/ir\";\nimport { canonicalizeSchemasForVerification, contractToMongoSchemaIR, diffMongoSchemas, fieldRewriteOf, markerSwapFailure } from \"@internal/family-mongo/control\";\nimport { APP_SPACE_ID, VERIFY_CODE_SCHEMA_FAILURE, compareMarkerDatabasePolicies, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, databasePoliciesMovedFailure, describeMigrationStatement, enumValueCoordinateFromJson, enumValueCoordinateJson, enumValueStatementText, expectAbsent, expectPresent, extractCodecLookup, failedPostcheckWhy, failedPrecheckWhy, fieldStatementText, issueOutcome, migrationRunnerFailure, migrationSubjectKey, modelDisplayName, modelStatementText, schemaCheckWhy, valueObjectFieldStatementText, withDatabaseUnchanged, withFailingSpace } from \"@internal/framework-components/control\";\nimport { notOk, ok, okVoid } from \"@internal/utils/result\";\nimport { Temporal } from \"temporal-polyfill/full/implementation\";\nimport { MongoContractSerializerBase, MongoSchemaVerifierBase } from \"@internal/family-mongo/ir\";\nimport { MongoCollection, MongoStorage, canonicalize, collectionControlPoliciesOf, collectionControlPolicyOf, collectionOfModel, defaultMongoIndexName, embeddingModelOf, hasOwnFieldStoredAs, indexLookupKey, isEmbedRelation, modelAndBasesOf, modelFieldStoredAs, modelKey, mongoModelsOf, otherModelsReached, ownEmbedStoredNamesOf, ownStoredNameOf, ownStoredNamesOf, propertyBsonTypesOf, recursiveGroupsOf, sameKindOfDocumentIn, selectedVariantOf, validatorDocumentShapesOf, validatorFieldNamesOf, validatorRootShapesOf, valueObjectKey, valueObjectStoredNamesOf, variantFilter } from \"@internal/mongo-contract\";\nimport { composeMongoEntityKinds } from \"@internal/mongo-contract/entity-kinds\";\nimport { asNamespaceId, governingControlPolicy, valueObjectAt, valueObjectsWithCoordinates } from \"@internal/contract/types\";\nimport { MongoSchemaCollection, MongoSchemaIR, deepEqual } from \"@internal/mongo-schema-ir\";\nimport { CollModCommand, CreateCollectionCommand, CreateIndexCommand, DropCollectionCommand, DropIndexCommand, ListCollectionsCommand, ListIndexesCommand, MongoAndExpr, MongoExistsExpr, MongoFieldFilter, MongoNotExpr, MongoOrExpr, RenameCollectionCommand, isInspectionCheckSource, isMongoDmlOperation } from \"@internal/mongo-query-ast/control\";\nimport { AggregateCommand, MongoAddFieldsStage, MongoLimitStage, MongoLookupStage, MongoMatchStage, MongoMergeStage, MongoProjectStage, MongoSortStage, RawAggregateCommand, RawDeleteManyCommand, RawDeleteOneCommand, RawFindOneAndDeleteCommand, RawFindOneAndUpdateCommand, RawInsertManyCommand, RawInsertOneCommand, RawUpdateManyCommand, RawUpdateOneCommand } from \"@internal/mongo-query-ast/execution\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { CliStructuredError } from \"@internal/errors/control\";\nimport { errorUnfilledPlaceholder } from \"@internal/errors/migration\";\nimport { TsExpression, jsonToTsSource, renderImports, tsObjectSource, tsStringLiteral } from \"@internal/ts-render\";\nimport { Migration } from \"@internal/migration-tools/migration\";\nimport { resolveRequirementSpecifiers } from \"@internal/framework-components/emission\";\nimport { detectScaffoldRuntime, shebangLineFor } from \"@internal/migration-tools/migration-ts\";\nimport { errorMarkerPoliciesCorrupt } from \"@internal/errors/execution\";\nimport { verifyMongoSchema } from \"@internal/family-mongo/schema-verify\";\n//#region src/core/mongo-target-database.ts\n/**\n* Mongo target `Namespace` concretion. In Mongo the \"namespace\" concept\n* binds to the connection's `db` field — a `MongoTargetDatabase` instance\n* names the database the collections live under. `entries['collection']`\n* holds collection IR. The unbound singleton (below) is the late-bound\n* namespace whose binding the connection's `db` resolves at runtime rather\n* than at authoring time.\n*\n* Qualifier emission is the rendering seam: query / DDL emission asks the\n* namespace for its qualifier (e.g. `\"<db>.<collection>\"`) and consumes\n* the result polymorphically. The unbound singleton overrides these\n* methods to elide the prefix entirely — call sites stay polymorphic and\n* never branch on `id === UNBOUND_NAMESPACE_ID`.\n*/\nvar MongoTargetDatabase = class extends NamespaceBase {\n\tid;\n\tentries;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.id = input.id;\n\t\tconst rawEntries = {\n\t\t\tcollection: {},\n\t\t\t...input.entries\n\t\t};\n\t\tthis.entries = Object.freeze(blindCast(hydrateNamespaceEntities(rawEntries, composeMongoEntityKinds(), \"carry\")));\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"database\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true\n\t\t});\n\t\tfreezeNode(this);\n\t}\n\tget collection() {\n\t\treturn this.entries.collection ?? Object.freeze({});\n\t}\n\t/**\n\t* The bare qualifier as it would appear in a rendered string. The\n\t* unbound-database singleton overrides this to return `''`.\n\t*/\n\tqualifier() {\n\t\treturn this.id;\n\t}\n\t/**\n\t* Qualify a collection name with the database prefix. The\n\t* unbound-database singleton overrides this to emit just the\n\t* collection name. Used by emission/introspection paths that need a\n\t* fully-qualified reference.\n\t*/\n\tqualifyCollection(collectionName) {\n\t\treturn `${this.id}.${collectionName}`;\n\t}\n};\n/**\n* Singleton subclass for the reserved sentinel namespace id\n* (`UNBOUND_NAMESPACE_ID`) — the late-bound namespace whose binding the\n* connection's `db` resolves at runtime. Overrides qualifier emission\n* to elide the database prefix; call sites that consume `qualifier()`\n* / `qualifyCollection()` get unqualified output without branching on\n* the namespace id.\n*\n* This is the target-side materialization of \"the framework provides\n* affordances; targets implement specifics\": the framework names the\n* sentinel; Mongo decides what late-bound means here (the collection\n* name, naked — the database is supplied by the live connection).\n*/\nvar MongoTargetUnboundDatabase = class MongoTargetUnboundDatabase extends MongoTargetDatabase {\n\tstatic instance = new MongoTargetUnboundDatabase();\n\tconstructor() {\n\t\tsuper({ id: UNBOUND_NAMESPACE_ID });\n\t}\n\tqualifier() {\n\t\treturn \"\";\n\t}\n\tqualifyCollection(collectionName) {\n\t\treturn collectionName;\n\t}\n};\n//#endregion\n//#region src/core/mongo-target-contract-serializer.ts\nvar MongoTargetContractSerializer = class extends MongoContractSerializerBase {\n\tconstructTargetContract(validated) {\n\t\tconst { storage, ...rest } = validated;\n\t\tconst namespaces = Object.fromEntries(Object.entries(storage.namespaces).map(([nsId, nsData]) => {\n\t\t\tconst hasEntities = Object.values(nsData.entries).some((slot) => Object.keys(slot).length > 0);\n\t\t\tif (nsId === UNBOUND_NAMESPACE_ID && !hasEntities) return [nsId, MongoTargetUnboundDatabase.instance];\n\t\t\treturn [nsId, new MongoTargetDatabase({\n\t\t\t\tid: nsData.id,\n\t\t\t\tentries: {\n\t\t\t\t\t...nsData.entries,\n\t\t\t\t\tcollection: blindCast(nsData.entries[\"collection\"] ?? {})\n\t\t\t\t}\n\t\t\t})];\n\t\t}));\n\t\tconst targetStorage = new MongoStorage({\n\t\t\tstorageHash: storage.storageHash,\n\t\t\tnamespaces\n\t\t});\n\t\treturn {\n\t\t\t...rest,\n\t\t\tstorage: targetStorage\n\t\t};\n\t}\n\tserializeContract(contract) {\n\t\tconst { storage, ...rest } = contract;\n\t\tconst namespacesJson = {};\n\t\tfor (const [nsId, ns] of Object.entries(storage.namespaces)) {\n\t\t\tconst entries = { collection: blindCast(JSON.parse(JSON.stringify(ns.entries.collection ?? {}))) };\n\t\t\tfor (const [kind, slot] of Object.entries(ns.entries)) {\n\t\t\t\tif (kind === \"collection\" || Object.keys(slot).length === 0) continue;\n\t\t\t\tentries[kind] = blindCast(JSON.parse(JSON.stringify(slot)));\n\t\t\t}\n\t\t\tnamespacesJson[nsId] = {\n\t\t\t\tid: ns.id,\n\t\t\t\tkind: \"mongo-database\",\n\t\t\t\tentries\n\t\t\t};\n\t\t}\n\t\treturn blindCast({\n\t\t\t...rest,\n\t\t\tstorage: {\n\t\t\t\tstorageHash: String(storage.storageHash),\n\t\t\t\tnamespaces: namespacesJson\n\t\t\t}\n\t\t});\n\t}\n};\n//#endregion\n//#region src/core/migrations/mongo-statement-flags.ts\nconst SHELL_SAFE = /^[A-Za-z0-9_.:/@%+,-]+$/;\n/** A statement written as the CLI writes its flag: the text single-quoted when a shell would read one of its characters. */\nfunction statementFlag(verb, text) {\n\treturn `--${verb} ${SHELL_SAFE.test(text) ? text : `'${text.replaceAll(\"'\", `'\\\\''`)}'`}`;\n}\n//#endregion\n//#region src/core/migrations/mongo-unanswered-changes.ts\n/** A subject as the question names it: a field through the name a rename statement gives its model, as `subjectText` in the CLI's `plan-questions.ts` writes it. */\nfunction subjectText(subject, contracts) {\n\tswitch (subject.kind) {\n\t\tcase \"model\": return modelStatementText(contracts.fromContract, subject);\n\t\tcase \"field\": {\n\t\t\tconst renamed = renamedModelOf(subject, contracts);\n\t\t\treturn renamed === void 0 ? fieldStatementText(contracts.fromContract, subject) : fieldStatementText(contracts.contract, {\n\t\t\t\t...renamed,\n\t\t\t\tfield: subject.field\n\t\t\t});\n\t\t}\n\t\tcase \"enumValue\": return enumValueStatementText(contracts.fromContract, subject);\n\t\tcase \"valueObjectField\": return valueObjectFieldStatementText(contracts.fromContract, subject);\n\t\tcase \"storage\": return subject.name;\n\t}\n}\nfunction newFieldText(subject, contract) {\n\tswitch (subject.kind) {\n\t\tcase \"field\": return fieldStatementText(contract, subject);\n\t\tcase \"valueObjectField\": return valueObjectFieldStatementText(contract, subject);\n\t\tcase \"model\": return modelStatementText(contract, subject);\n\t\tcase \"enumValue\": return enumValueStatementText(contract, subject);\n\t\tcase \"storage\": return subject.name;\n\t}\n}\nfunction removalText(subject, text) {\n\tswitch (subject.kind) {\n\t\tcase \"model\": return `model \"${text}\", whose documents the plan deletes`;\n\t\tcase \"field\": return `field \"${text}\", which the plan removes`;\n\t\tcase \"enumValue\": return `enum value \"${text}\", which the plan removes from the data`;\n\t\tcase \"valueObjectField\": return `value object field \"${text}\", which the plan removes`;\n\t\tcase \"storage\": return `\"${text}\", which the plan removes`;\n\t}\n}\n/** The model a rename statement gives an origin model, if any. */\nfunction renamedModelOf(origin, contracts) {\n\tfor (const statement of contracts.statements) if (statement.kind === \"rename\" && statement.entity === \"model\" && statement.from.namespaceId === origin.namespaceId && statement.from.model === origin.model) return statement.to;\n}\n/** The destination model an origin model is, under the name a rename statement gives it, when the destination has it. */\nfunction destinationModelOf$1(origin, contracts) {\n\tconst destination = renamedModelOf(origin, contracts) ?? origin;\n\treturn modelAt(contracts.contract, destination) === void 0 ? void 0 : destination;\n}\nfunction membersOf$1(contract, value) {\n\treturn (contract.domain.namespaces[value.namespaceId]?.enum?.[value.enum]?.members ?? []).map(({ name }) => name);\n}\nfunction valueObjectFieldsOf(contract, field) {\n\tconst valueObject = valueObjectAt(contract.storage, {\n\t\tplane: \"storage\",\n\t\tnamespaceId: field.namespaceId,\n\t\tentityKind: \"valueObject\",\n\t\tentityName: field.valueObject\n\t});\n\treturn Object.keys(valueObject?.fields ?? {});\n}\n/** The names of `destination` that `origin` does not have and no rename statement names. */\nfunction added(destination, origin, renamedTo) {\n\treturn destination.filter((name) => !origin.includes(name) && !renamedTo.includes(name));\n}\n/** The fields of the destination model a removed field can have been renamed to: those the origin model does not have and no rename names, as `newModelFields` in the CLI's `plan-questions.ts` finds them. */\nfunction newModelFields(subject, contracts) {\n\tconst destination = destinationModelOf$1(subject, contracts);\n\tif (destination === void 0) return [];\n\treturn added(Object.keys(modelAt(contracts.contract, destination)?.fields ?? {}), Object.keys(modelAt(contracts.fromContract, subject)?.fields ?? {}), contracts.statements.flatMap((statement) => statement.kind === \"rename\" && statement.entity === \"field\" && statement.to.namespaceId === destination.namespaceId && statement.to.model === destination.model ? [statement.to.field] : []));\n}\n/** The members a removed enum value can have been renamed to, as `onlyNewMember` in the CLI's `plan-questions.ts` finds them. */\nfunction newMembers(subject, contracts) {\n\treturn added(membersOf$1(contracts.contract, subject), membersOf$1(contracts.fromContract, subject), contracts.statements.flatMap((statement) => statement.kind === \"rename\" && statement.entity === \"enumValue\" ? [statement.to.member] : []));\n}\n/** The fields a removed value object field can have been renamed to, as `newValueObjectFields` in the CLI's `plan-questions.ts` finds them. */\nfunction newValueObjectFields(subject, contracts) {\n\treturn added(valueObjectFieldsOf(contracts.contract, subject), valueObjectFieldsOf(contracts.fromContract, subject), contracts.statements.flatMap((statement) => statement.kind === \"rename\" && statement.entity === \"valueObjectField\" ? [statement.to.field] : []));\n}\n/** The variants a removed variant can have been renamed to, as `newVariantsOfBase` in the CLI's `variants.ts` finds them. */\nfunction newVariants(subject, contracts) {\n\tconst base = modelAt(contracts.fromContract, subject)?.base;\n\tif (base === void 0) return [];\n\tconst coordinate = {\n\t\tnamespaceId: asNamespaceId(base.namespace),\n\t\tmodel: base.model\n\t};\n\tconst variantsOf = (contract) => Object.values(modelAt(contract, coordinate)?.variants ?? {}).map((variant) => ({\n\t\tnamespaceId: asNamespaceId(variant.namespace),\n\t\tmodel: variant.model\n\t}));\n\tconst key = ({ namespaceId, model }) => `${namespaceId}\\0${model}`;\n\tconst renamedTo = contracts.statements.flatMap((statement) => statement.kind === \"rename\" && statement.entity === \"model\" ? [key(statement.to)] : []);\n\tconst before = variantsOf(contracts.fromContract).map(key);\n\treturn variantsOf(contracts.contract).filter((variant) => !before.includes(key(variant)) && !renamedTo.includes(key(variant)));\n}\nfunction only(candidates) {\n\treturn candidates.length === 1 ? candidates[0] : void 0;\n}\n/** The statement the question offers first for a removal, and whether the destination can keep its data, as `renameForm` in the CLI's `plan-questions.ts` writes it. */\nfunction answerOf(subject, text, contracts) {\n\tconst parent = text.slice(0, text.lastIndexOf(\".\"));\n\tconst renaming = (to) => statementFlag(\"rename\", `${text}:${parent}.${to ?? \"<new name>\"}`);\n\tswitch (subject.kind) {\n\t\tcase \"field\": {\n\t\t\tconst candidates = newModelFields(subject, contracts);\n\t\t\treturn {\n\t\t\t\tcanKeep: candidates.length > 0,\n\t\t\t\tkeeping: renaming(only(candidates))\n\t\t\t};\n\t\t}\n\t\tcase \"model\": {\n\t\t\tconst destination = destinationModelOf$1(subject, contracts);\n\t\t\tif (destination !== void 0) return {\n\t\t\t\tcanKeep: true,\n\t\t\t\tkeeping: statementFlag(\"convert\", modelStatementText(contracts.contract, destination))\n\t\t\t};\n\t\t\tconst variant = only(newVariants(subject, contracts));\n\t\t\treturn {\n\t\t\t\tcanKeep: variant !== void 0,\n\t\t\t\tkeeping: statementFlag(\"rename\", `${text}:${variant === void 0 ? \"<new name>\" : modelStatementText(contracts.contract, variant)}`)\n\t\t\t};\n\t\t}\n\t\tcase \"enumValue\": return {\n\t\t\tcanKeep: false,\n\t\t\tkeeping: renaming(only(newMembers(subject, contracts)))\n\t\t};\n\t\tcase \"valueObjectField\": return {\n\t\t\tcanKeep: false,\n\t\t\tkeeping: renaming(only(newValueObjectFields(subject, contracts)))\n\t\t};\n\t\tcase \"storage\": return {\n\t\t\tcanKeep: false,\n\t\t\tkeeping: statementFlag(\"rename\", `${text}:<new name>`)\n\t\t};\n\t}\n}\nconst ORDER = {\n\tfield: 0,\n\tvalueObjectField: 1,\n\tenumValue: 2,\n\tstorage: 3,\n\tmodel: 4\n};\n/**\n* What a plan-wide refusal leads with when the plan holds changes no statement carries: those\n* changes, as their questions name them, and the statements that keep their data, as the questions\n* offer them first. The planner cannot tell an unanswered change from one answered with\n* `--delete`, so it says only that no `--rename` or `--convert` carries them. A field of a model the\n* destination does not have is left out, since no field statement can keep its data. `undefined` when no\n* removal has a field or model in the destination to keep its data in.\n*/\nfunction unansweredChangesAdvice(changes, contracts) {\n\tconst unique = changes.filter((change, index) => changes.findIndex((other) => other.kind === change.kind && migrationSubjectKey(other.subject) === migrationSubjectKey(change.subject)) === index);\n\tconst removed = unique.filter(({ kind, subject }) => kind === \"removed\" && (subject.kind !== \"field\" || destinationModelOf$1(subject, contracts) !== void 0)).sort((a, b) => ORDER[a.subject.kind] - ORDER[b.subject.kind]).map(({ subject }) => {\n\t\tconst text = subjectText(subject, contracts);\n\t\treturn {\n\t\t\tdescription: removalText(subject, text),\n\t\t\tanswer: answerOf(subject, text, contracts)\n\t\t};\n\t});\n\tif (!removed.some(({ answer }) => answer.canKeep)) return void 0;\n\tconst filled = unique.filter((change) => change.kind === \"newRequired\").map(({ subject }) => `new required ${subject.kind === \"valueObjectField\" ? \"value object field\" : \"field\"} \"${newFieldText(subject, contracts.contract)}\", which the plan fills with a temporary value`);\n\tconst named = [...removed.map(({ description }) => description), ...filled];\n\tconst keeping = removed.map(({ answer }) => answer.keeping);\n\treturn `The plan holds changes that no --rename or --convert statement carries: ${named.join(\"; \")}. To keep their data, run the command again with: ${keeping.join(\"; \")}.`;\n}\n//#endregion\n//#region src/core/migrations/mongo-rewrite-overlaps.ts\nconst ONE_AT_A_TIME = \"MongoDB applies a migration's operations one at a time, without a transaction, and knows that an operation already ran only from the documents.\";\n/** Advice to make a change as two changes to the contract, the first applied before the second is made. */\nfunction inTwoSteps(first, second) {\n\treturn `Make the change as two changes to the contract, and apply the first, by a migration or by db update, before you make the second: first ${first}; then ${second}.`;\n}\nconst RENAME_ADVICE = inTwoSteps(\"rename the keys or fields to names nothing else uses\", \"rename them to their final names\");\nconst FILL_ADVICE = inTwoSteps(\"make the rename, without the new required field\", \"add the new field\");\nconst fillAfterRemovalAdvice = (noun) => inTwoSteps(`remove the old ${noun}`, \"add the new one\");\nconst removeBeforeRenameAdvice = (noun) => inTwoSteps(`remove the ${noun} whose name the rename takes`, \"make the rename\");\nfunction variantDiscriminatorFilter(variant) {\n\treturn variant === void 0 ? void 0 : {\n\t\tkind: \"variant\",\n\t\t...variant\n\t};\n}\nfunction key(collection, field, path = void 0) {\n\treturn {\n\t\tkind: \"key\",\n\t\tcollection,\n\t\tfield,\n\t\tpath: path === void 0 ? void 0 : parsedPath(field, path).text\n\t};\n}\nfunction parsedPath(field, path) {\n\tconst parsed = storedKeyPath(field, path);\n\tif (!parsed.ok) throw new InternalError(`The planner wrote path \"${path}\" for field ${field}, which does not parse`);\n\treturn {\n\t\t...parsed.value,\n\t\ttext: jsonPathText(parsed.value.path.steps)\n\t};\n}\nfunction renamedPath(field, path, to) {\n\treturn jsonPathText([...parsedPath(field, path).objects, {\n\t\tkind: \"member\",\n\t\tname: to\n\t}]);\n}\nfunction value(at, stored) {\n\treturn {\n\t\tkind: \"value\",\n\t\tcollection: at.collection,\n\t\tfield: at.field,\n\t\tpath: at.path === void 0 ? void 0 : parsedPath(at.field, at.path).text,\n\t\tvalue: stored\n\t};\n}\nfunction filterReadsOf(collection, filter) {\n\tif (filter === void 0) return [];\n\tconst values = filter.kind === \"variant\" ? [filter.value] : filter.values;\n\treturn [key(collection, filter.field), ...values.map((each) => value({\n\t\tcollection,\n\t\tfield: filter.field\n\t}, each))];\n}\nfunction accessOf(rewrite) {\n\tif (rewrite.kind === \"deleteDocuments\") {\n\t\tconst { collection } = rewrite.call.options;\n\t\tconst { field, value: deleted } = rewrite.deletedVariant;\n\t\treturn {\n\t\t\trole: \"empties\",\n\t\t\tempties: [value({\n\t\t\t\tcollection,\n\t\t\t\tfield\n\t\t\t}, deleted)],\n\t\t\twrites: [],\n\t\t\tfilterReads: [key(collection, field)]\n\t\t};\n\t}\n\tconst selecting = (role, collection, empties, writes) => ({\n\t\trole,\n\t\tempties,\n\t\twrites,\n\t\tfilterReads: filterReadsOf(collection, rewrite.discriminatorFilter)\n\t});\n\tswitch (rewrite.kind) {\n\t\tcase \"renameField\": {\n\t\t\tconst { collection, from, to } = rewrite.call;\n\t\t\treturn selecting(\"moves\", collection, [key(collection, from)], [key(collection, to)]);\n\t\t}\n\t\tcase \"unsetField\": {\n\t\t\tconst { collection, field } = rewrite.call;\n\t\t\treturn selecting(\"empties\", collection, [key(collection, field)], []);\n\t\t}\n\t\tcase \"fillField\":\n\t\tcase \"castField\": {\n\t\t\tconst { collection, field } = rewrite.call;\n\t\t\treturn selecting(\"writes\", collection, [], [key(collection, field)]);\n\t\t}\n\t\tcase \"dataTransform\": {\n\t\t\tconst { collection } = rewrite.call;\n\t\t\treturn selecting(\"writes\", collection, [], [key(collection, rewrite.transformedField)]);\n\t\t}\n\t\tcase \"renameStoredKey\": {\n\t\t\tconst { collection, field, path, to } = rewrite.call.options;\n\t\t\treturn selecting(\"moves\", collection, [key(collection, field, path)], [key(collection, field, renamedPath(field, path, to))]);\n\t\t}\n\t\tcase \"removeStoredKey\": {\n\t\t\tconst { collection, field, path } = rewrite.call.options;\n\t\t\treturn selecting(\"empties\", collection, [key(collection, field, path)], []);\n\t\t}\n\t\tcase \"fillStoredKey\": {\n\t\t\tconst { collection, field, path } = rewrite.call.options;\n\t\t\treturn selecting(\"writes\", collection, [], [key(collection, field, path)]);\n\t\t}\n\t\tcase \"replaceStoredValue\": {\n\t\t\tconst { options } = rewrite.call;\n\t\t\treturn selecting(\"moves\", options.collection, [value(options, options.from)], [value(options, rewrite.writtenValue)]);\n\t\t}\n\t\tcase \"removeStoredValue\": {\n\t\t\tconst { options } = rewrite.call;\n\t\t\treturn selecting(\"empties\", options.collection, [value(options, options.value)], []);\n\t\t}\n\t\tdefault: throw new InternalError(`No reads and writes are known for ${String(rewrite)}`);\n\t}\n}\nfunction samePlace(write, read) {\n\tif (write.kind !== read.kind || write.collection !== read.collection || write.field !== read.field || write.path !== read.path) return false;\n\treturn write.kind === \"key\" || read.kind === \"value\" && write.value === read.value;\n}\nfunction placeNoun(place) {\n\tif (place.kind === \"value\") return \"value\";\n\treturn place.path === void 0 ? \"field\" : \"key\";\n}\nfunction touchedFieldsOf(accessed) {\n\treturn new Set(accessed.flatMap(({ access }) => [...access.empties, ...access.writes].flatMap((place) => place.path === void 0 ? [`${place.collection}\\0${place.field}`] : [])));\n}\nfunction discriminatorFilterOf(rewrite) {\n\treturn rewrite.kind === \"deleteDocuments\" ? {\n\t\tkind: \"variant\",\n\t\t...rewrite.deletedVariant\n\t} : rewrite.discriminatorFilter;\n}\n/**\n* Whether two operations select documents of different variants by the same discriminator field,\n* in a collection where no operation of the plan changes that field or its values, so that they\n* never act on the same documents.\n*/\nfunction selectDifferentVariants(a, b, collection, touched) {\n\tconst first = discriminatorFilterOf(a);\n\tconst second = discriminatorFilterOf(b);\n\treturn first?.kind === \"variant\" && second?.kind === \"variant\" && first.field === second.field && first.value !== second.value && !touched.has(`${collection}\\0${first.field}`);\n}\nfunction overlapsOf(accessed) {\n\tconst touched = touchedFieldsOf(accessed);\n\treturn accessed.flatMap((writer) => accessed.flatMap((reader) => {\n\t\tif (writer.rewrite.call === reader.rewrite.call) return [];\n\t\tconst place = writer.access.writes.find((write) => reader.access.empties.some((emptied) => samePlace(write, emptied)) && !selectDifferentVariants(writer.rewrite, reader.rewrite, write.collection, touched));\n\t\treturn place === void 0 ? [] : [{\n\t\t\twriter,\n\t\t\treader,\n\t\t\tplace\n\t\t}];\n\t}));\n}\nfunction adviceOf(overlap) {\n\tconst noun = placeNoun(overlap.place);\n\tif (overlap.place.kind === \"value\") return overlap.reader.rewrite.twoMigrationsAdvice ?? overlap.writer.rewrite.twoMigrationsAdvice ?? RENAME_ADVICE;\n\tconst writer = overlap.writer.access.role;\n\tconst reader = overlap.reader.access.role;\n\tif (writer === \"writes\") return reader === \"empties\" ? fillAfterRemovalAdvice(noun) : FILL_ADVICE;\n\treturn reader === \"empties\" ? removeBeforeRenameAdvice(noun) : RENAME_ADVICE;\n}\n/** Whether `before` must run before `after`, because `before` writes what `after`'s filter reads, or `after` empties what `before`'s filter reads. */\nfunction filterNeedsFirst(before, after) {\n\treturn before !== after && (before.access.writes.some((write) => after.access.filterReads.some((read) => samePlace(write, read))) || after.access.empties.some((emptied) => before.access.filterReads.some((read) => samePlace(emptied, read))));\n}\n/** The first pair in which an operation runs before another that must run first, because of what their filters read. */\nfunction filterConflictOf(accessed) {\n\tfor (const [index, later] of accessed.entries()) {\n\t\tconst earlier = accessed.slice(0, index).find((each) => filterNeedsFirst(later, each));\n\t\tif (earlier !== void 0) return {\n\t\t\tearlier,\n\t\t\tlater\n\t\t};\n\t}\n}\nfunction refusal(involved, reason, why, contracts) {\n\tconst [refused] = involved.flatMap((rewrite) => rewrite.statements);\n\tif (refused === void 0) return {\n\t\tkind: \"unsupportedOperation\",\n\t\tsummary: `Cannot plan the migration: ${reason}`,\n\t\twhy\n\t};\n\treturn {\n\t\tkind: \"statementRefused\",\n\t\tsummary: `Cannot ${describeMigrationStatement(refused, contracts.fromContract, contracts.contract)}: ${reason}`,\n\t\twhy,\n\t\trefusedStatement: refused\n\t};\n}\n/**\n* The refusal of a plan in which one operation writes a field, key or value that another operation\n* of the same plan empties: a chain or a swap of renames or replacements, a fill of a key a rename\n* moves away, a rename onto a name whose field the plan removes, or a delete of documents whose\n* discriminator value a replacement writes. MongoDB applies a migration's operations one at a\n* time, without a transaction, and a re-run after a later operation stops runs again every\n* operation whose postcheck does not hold, so such an operation would act on what the other wrote.\n* Two operations that select different variants by a discriminator field the plan does not change\n* never meet. Also refused: an operation whose filter reads what an earlier operation empties or a\n* later one writes, which the planner's order of the rewrites does not avoid. The refusal names the first statement\n* involved and lists the operations. It does not offer to leave the statements out and write the\n* operations by hand, since one hand-written migration would meet the same re-run. When an operation\n* involved makes a change no statement answers, and a statement could keep the data of a removal,\n* the refusal leads with the plan's unanswered changes and the statements that keep their data, and\n* ends with the route that works when every answer is `--delete`, which the planner cannot see.\n*/\nfunction overlapRefusal(rewrites, contracts) {\n\tconst accessed = rewrites.map((rewrite) => ({\n\t\trewrite,\n\t\taccess: accessOf(rewrite)\n\t}));\n\tconst why = (involved, reason, advice) => {\n\t\tconst unanswered = involved.some(({ unanswered }) => unanswered !== void 0) ? unansweredChangesAdvice(rewrites.flatMap(({ unanswered }) => unanswered === void 0 ? [] : [unanswered]), contracts) : void 0;\n\t\treturn unanswered === void 0 ? `${reason} ${advice}` : `${unanswered} ${reason} If every answer is --delete, the plan stays as it is: ${advice.charAt(0).toLowerCase()}${advice.slice(1)}`;\n\t};\n\tconst overlaps = overlapsOf(accessed);\n\tconst [first] = overlaps;\n\tif (first !== void 0) {\n\t\tconst involved = rewrites.filter((rewrite) => overlaps.some(({ writer, reader }) => writer.rewrite === rewrite || reader.rewrite === rewrite));\n\t\tconst noun = placeNoun(first.place);\n\t\treturn refusal(involved, `the migration writes a ${noun} that another of its operations reads (${involved.map(({ call }) => call.label).join(\"; \")})`, why(involved, `${ONE_AT_A_TIME} An operation that reads a ${noun} another operation of the same migration writes acts on what that operation wrote: at once when it runs later, and when the migration runs again after a later operation stops.`, adviceOf(first)), contracts);\n\t}\n\tconst conflict = filterConflictOf(accessed);\n\tif (conflict === void 0) return void 0;\n\tconst involved = [conflict.earlier.rewrite, conflict.later.rewrite];\n\treturn refusal(involved, `the filter of one of its operations reads what another changes (${involved.map(({ call }) => call.label).join(\"; \")})`, why(involved, \"One of these operations finds its documents by what another changes, and the order the plan needs runs it on the wrong side of that change.\", inTwoSteps(`make only the part of the change that \"${conflict.later.rewrite.call.label}\" carries out`, \"the rest\")), contracts);\n}\n//#endregion\n//#region src/core/migrations/mongo-rewrite-refusals.ts\nconst SEPARATE_THE_MODELS = \"move the models to separate collections, or carry out the change yourself, with a filter that selects only their documents, in a dataTransform operation of the migration.ts that migration plan writes or in mongosh\";\nfunction sharedCollectionWhy(collection, others, change) {\n\tconst names = others.map((name) => JSON.stringify(name)).join(\", \");\n\treturn `Collection ${JSON.stringify(collection)} stores several models and no discriminator tells their documents apart, so ${change} of ${names} too.`;\n}\nconst TIME_SERIES_UPDATES = \"MongoDB updates the documents of a time-series collection only through its metaField\";\nconst WORDS = {\n\tremoval: {\n\t\tkeyVerb: void 0,\n\t\tconflictKind: \"fieldRemovalRefused\",\n\t\tverb: \"remove\",\n\t\tpreposition: \"from\",\n\t\treaches: \"holding\",\n\t\ttimeSeries: \"so the field cannot be removed from the documents that hold it. Keep the field in the contract, as an optional field if new documents leave it out, then run this command again.\",\n\t\tsharedChange: \"removing the field would remove it from the documents\",\n\t\tsharedGoal: (_model, others) => `To keep it in ${others} documents only`\n\t},\n\tcast: {\n\t\tkeyVerb: void 0,\n\t\tconflictKind: \"typeChangeRefused\",\n\t\tverb: \"cast\",\n\t\tpreposition: \"in\",\n\t\treaches: \"holding\",\n\t\ttimeSeries: \"so the values of the field cannot be cast. Keep the field's type in the contract, then run this command again.\",\n\t\tsharedChange: \"casting the field would cast it in the documents\",\n\t\tsharedGoal: (model) => `To change it in ${model} documents only`\n\t},\n\tconversion: {\n\t\tkeyVerb: void 0,\n\t\tconflictKind: \"typeChangeRefused\",\n\t\tverb: \"convert\",\n\t\tpreposition: \"in\",\n\t\treaches: \"holding\",\n\t\ttimeSeries: \"so a data transform cannot convert the values of the field. Keep the field's type in the contract, then run this command again.\",\n\t\tsharedChange: \"the data transform would convert it in the documents\",\n\t\tsharedGoal: (model) => `To change it in ${model} documents only`\n\t},\n\tfill: {\n\t\tkeyVerb: void 0,\n\t\tconflictKind: \"fieldFillRefused\",\n\t\tverb: \"fill\",\n\t\tpreposition: \"in\",\n\t\treaches: \"selected\",\n\t\ttimeSeries: \"so the field cannot be filled in the documents. Make the field optional in the contract, then run this command again.\",\n\t\tsharedChange: \"filling the field would add it to the documents\",\n\t\tsharedGoal: (model) => `To fill it in ${model} documents only`\n\t},\n\tbackfill: {\n\t\tkeyVerb: void 0,\n\t\tconflictKind: \"fieldFillRefused\",\n\t\tverb: \"backfill\",\n\t\tpreposition: \"in\",\n\t\treaches: \"selected\",\n\t\ttimeSeries: \"so a data transform cannot fill the field. Make the field optional in the contract, then run this command again.\",\n\t\tsharedChange: \"the data transform would fill it in the documents\",\n\t\tsharedGoal: (model) => `To fill it in ${model} documents only`\n\t},\n\trenameStoredKey: {\n\t\tkeyVerb: \"rename\",\n\t\tconflictKind: \"statementRefused\",\n\t\tverb: \"rename a key inside\",\n\t\tpreposition: \"in\",\n\t\treaches: \"holding\",\n\t\ttimeSeries: \"so the key cannot be renamed in the documents. Keep the key's name in the contract, then run this command again.\",\n\t\tsharedChange: \"renaming the key would rename it in the documents\",\n\t\tsharedGoal: (model) => `To rename it in ${model} documents only`\n\t},\n\tremoveStoredKey: {\n\t\tkeyVerb: \"remove\",\n\t\tconflictKind: \"fieldRemovalRefused\",\n\t\tverb: \"remove a key inside\",\n\t\tpreposition: \"in\",\n\t\treaches: \"holding\",\n\t\ttimeSeries: \"so the key cannot be removed from the documents that hold it. Keep the key in the contract, as an optional field if new documents leave it out, then run this command again.\",\n\t\tsharedChange: \"removing the key would remove it from the documents\",\n\t\tsharedGoal: (_model, others) => `To keep it in ${others} documents only`\n\t},\n\treplaceStoredValue: {\n\t\tkeyVerb: \"replace\",\n\t\tconflictKind: \"statementRefused\",\n\t\tverb: \"replace a value inside\",\n\t\tpreposition: \"in\",\n\t\treaches: \"holding\",\n\t\ttimeSeries: \"so the stored value cannot be replaced in the documents. Keep the enum value's stored value in the contract, then run this command again.\",\n\t\tsharedChange: \"replacing the value would replace it in the documents\",\n\t\tsharedGoal: (model) => `To replace it in ${model} documents only`\n\t},\n\tremoveStoredValue: {\n\t\tkeyVerb: \"remove\",\n\t\tconflictKind: \"fieldRemovalRefused\",\n\t\tverb: \"remove a value inside\",\n\t\tpreposition: \"from\",\n\t\treaches: \"holding\",\n\t\ttimeSeries: \"so the stored value cannot be removed from the documents that hold it. Keep the enum value in the contract, then run this command again.\",\n\t\tsharedChange: \"removing the value would remove it from the documents\",\n\t\tsharedGoal: (_model, others) => `To keep it in ${others} documents only`\n\t},\n\tfillStoredKey: {\n\t\tkeyVerb: \"fill\",\n\t\tconflictKind: \"fieldFillRefused\",\n\t\tverb: \"fill a key inside\",\n\t\tpreposition: \"in\",\n\t\treaches: \"holding\",\n\t\ttimeSeries: \"so the key cannot be filled in the documents. Make the key optional in the contract, then run this command again.\",\n\t\tsharedChange: \"filling the key would fill it in the documents\",\n\t\tsharedGoal: (model) => `To fill it in ${model} documents only`\n\t}\n};\nfunction quoted$1(names) {\n\treturn names.map((name) => JSON.stringify(name)).join(\", \");\n}\n/** What a rewrite does, as a refusal names it: the key it rewrites inside the field, when it names one. */\nfunction action(rewrite) {\n\tconst words = WORDS[rewrite.kind];\n\treturn rewrite.storedKey !== void 0 && words.keyVerb !== void 0 ? `${words.keyVerb} ${rewrite.storedKey.key} inside` : words.verb;\n}\nfunction timeSeriesRefusal(rewrite) {\n\tconst words = WORDS[rewrite.kind];\n\treturn {\n\t\tkind: words.conflictKind,\n\t\tsummary: `Cannot ${action(rewrite)} field ${JSON.stringify(rewrite.field)} ${words.preposition} collection ${JSON.stringify(rewrite.collection)}: it is a time-series collection`,\n\t\twhy: `${TIME_SERIES_UPDATES}, ${words.timeSeries}`\n\t};\n}\n/**\n* The refusal of a rewrite whose documents another model stored in the same collection shares:\n* another root model when no discriminator value selects the rewrite's documents, or another root\n* model's variant with the same discriminator field and value. A removal, cast or conversion reaches\n* the models that hold the field; a fill or backfill reaches every model its filter selects. Without\n* an origin contract, a cast in a collection whose validator describes several root models is\n* refused, since nothing tells their documents apart.\n*/\nfunction sharedCollectionRefusal$1(rewrite, contract, validator) {\n\tconst words = WORDS[rewrite.kind];\n\tconst { collection, field, model } = rewrite;\n\tif (model === void 0) {\n\t\tif (rewrite.kind === \"removal\" || rewrite.kind === \"removeStoredKey\" || validatorRootShapesOf(validator).length <= 1) return;\n\t\treturn {\n\t\t\tkind: words.conflictKind,\n\t\t\tsummary: `Cannot ${action(rewrite)} field ${JSON.stringify(field)} ${words.preposition} collection ${JSON.stringify(collection)}: the collection stores several root models`,\n\t\t\twhy: \"No discriminator tells their documents apart, and without the origin contract the plan cannot tell which documents belong to the model that changed. Plan the change with migration plan --from <hash of the migration the database is at>.\"\n\t\t};\n\t}\n\tconst others = otherModelsReached(contract.domain, model, collection, rewrite.variant, words.reaches === \"holding\" ? field : void 0).filter((name) => !(rewrite.storedKey?.together.includes(name) ?? false));\n\tif (others.length === 0) return void 0;\n\tconst named = quoted$1(others);\n\tconst modelName = JSON.stringify(model.model);\n\treturn {\n\t\tkind: words.conflictKind,\n\t\tsummary: `Cannot ${action(rewrite)} field ${JSON.stringify(field)} of model ${modelName} ${words.preposition} collection ${JSON.stringify(collection)}: model ${named} ${words.reaches === \"holding\" ? \"stores it\" : \"is stored\"} in the same collection`,\n\t\twhy: `${sharedCollectionWhy(collection, others, words.sharedChange)} ${words.sharedGoal(modelName, named)}, ${SEPARATE_THE_MODELS}.`\n\t};\n}\n/**\n* Why the plan refuses a rewrite of its collection's documents: MongoDB does not let an update change\n* a time-series collection's documents except through the metaField, and a rewrite must not change\n* the documents of another model stored in the same collection. The planner refuses every rewrite it\n* plans with these; the runner asks them before it names a statement that would plan one.\n*/\nfunction rewriteRefusals(rewrite, contract, collection) {\n\tconst shared = sharedCollectionRefusal$1(rewrite, contract, collection.validator);\n\treturn [...collection.timeSeries ? [timeSeriesRefusal(rewrite)] : [], ...shared === void 0 ? [] : [shared]];\n}\n//#endregion\n//#region src/core/migrations/unfilled-value.ts\n/** A value a planner-written operation takes from the user: its `migration.ts` writes `placeholder(slot)` where the value goes. */\nvar UnfilledValue = class {\n\tslot;\n\tconstructor(slot) {\n\t\tthis.slot = slot;\n\t\tObject.freeze(this);\n\t}\n};\n//#endregion\n//#region src/core/migrations/op-factory-call.ts\n/**\n* The single module a scaffolded Mongo `migration.ts` imports from: the\n* operation factories below, plus the `Migration` base and `MigrationCLI`\n* that `render-typescript.ts` adds. The authored name; `render-typescript.ts`\n* maps it to whatever the consuming application's import root calls it,\n* once over the whole assembled import list.\n*/\nconst TARGET_MIGRATION_MODULE = \"@internal/target-mongo/migration\";\nvar OpFactoryCallNode = class extends TsExpression {\n\timportRequirements() {\n\t\treturn [{\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol: this.factoryName\n\t\t}];\n\t}\n\tfreeze() {\n\t\tObject.freeze(this);\n\t}\n};\nfunction formatKeys(keys) {\n\treturn keys.map((k) => `${k.field}:${k.direction}`).join(\", \");\n}\nvar CreateIndexCall = class extends OpFactoryCallNode {\n\tfactoryName = \"createIndex\";\n\toperationClass = \"additive\";\n\tcollection;\n\tkeys;\n\toptions;\n\tlabel;\n\tconstructor(collection, keys, options) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.keys = keys;\n\t\tthis.options = options;\n\t\tthis.label = `Create index ${options.name} on ${collection} (${formatKeys(keys)})`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn createIndex(this.collection, this.keys, this.options);\n\t}\n\trenderTypeScript() {\n\t\treturn `createIndex(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.keys)}, ${jsonToTsSource(this.options)})`;\n\t}\n};\nvar DropIndexCall = class extends OpFactoryCallNode {\n\tfactoryName = \"dropIndex\";\n\toperationClass = \"widening\";\n\tcollection;\n\tkeys;\n\toptions;\n\tlabel;\n\tconstructor(collection, keys, options) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.keys = keys;\n\t\tthis.options = options;\n\t\tthis.label = `Drop index ${options.name} on ${collection} (${formatKeys(keys)})`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn dropIndex(this.collection, this.keys, this.options);\n\t}\n\trenderTypeScript() {\n\t\treturn `dropIndex(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.keys)}, ${jsonToTsSource(this.options)})`;\n\t}\n};\nvar CreateCollectionCall = class extends OpFactoryCallNode {\n\tfactoryName = \"createCollection\";\n\toperationClass = \"additive\";\n\tcollection;\n\toptions;\n\tlabel;\n\tconstructor(collection, options) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.options = options;\n\t\tthis.label = `Create collection ${collection}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn createCollection(this.collection, this.options);\n\t}\n\trenderTypeScript() {\n\t\treturn this.options ? `createCollection(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.options)})` : `createCollection(${jsonToTsSource(this.collection)})`;\n\t}\n};\nvar DropCollectionCall = class extends OpFactoryCallNode {\n\tfactoryName = \"dropCollection\";\n\toperationClass = \"destructive\";\n\tcollection;\n\tlabel;\n\tconstructor(collection) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.label = `Drop collection ${collection}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn dropCollection(this.collection);\n\t}\n\trenderTypeScript() {\n\t\treturn `dropCollection(${jsonToTsSource(this.collection)})`;\n\t}\n};\nvar RenameCollectionCall = class extends OpFactoryCallNode {\n\tfactoryName = \"renameCollection\";\n\toperationClass = \"widening\";\n\tfrom;\n\tto;\n\tlabel;\n\tconstructor(from, to) {\n\t\tsuper();\n\t\tthis.from = from;\n\t\tthis.to = to;\n\t\tthis.label = `Rename collection ${from} to ${to}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn renameCollection(this.from, this.to);\n\t}\n\trenderTypeScript() {\n\t\treturn `renameCollection(${jsonToTsSource(this.from)}, ${jsonToTsSource(this.to)})`;\n\t}\n};\nfunction renderFilterOption(filter) {\n\treturn filter === void 0 ? \"\" : `, ${jsonToTsSource({ filter })}`;\n}\nvar RenameFieldCall = class extends OpFactoryCallNode {\n\tfactoryName = \"renameField\";\n\toperationClass = \"widening\";\n\tcollection;\n\tfrom;\n\tto;\n\tfilter;\n\tlabel;\n\tconstructor(collection, from, to, filter) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.from = from;\n\t\tthis.to = to;\n\t\tthis.filter = filter;\n\t\tthis.label = this.toOp().label;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn renameField(this.collection, this.from, this.to, ifDefined(\"filter\", this.filter));\n\t}\n\trenderTypeScript() {\n\t\treturn `renameField(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.from)}, ${jsonToTsSource(this.to)}${renderFilterOption(this.filter)})`;\n\t}\n};\nvar UnsetFieldCall = class extends OpFactoryCallNode {\n\tfactoryName = \"unsetField\";\n\toperationClass = \"destructive\";\n\tcollection;\n\tfield;\n\tfilter;\n\tlabel;\n\tconstructor(collection, field, filter) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.field = field;\n\t\tthis.filter = filter;\n\t\tthis.label = this.toOp().label;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn unsetField(this.collection, this.field, ifDefined(\"filter\", this.filter));\n\t}\n\trenderTypeScript() {\n\t\treturn `unsetField(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.field)}${renderFilterOption(this.filter)})`;\n\t}\n};\nvar CastFieldCall = class extends OpFactoryCallNode {\n\tfactoryName = \"castField\";\n\tcollection;\n\tfield;\n\toptions;\n\toperationClass;\n\tlabel;\n\tconstructor(options) {\n\t\tsuper();\n\t\tthis.collection = options.collection;\n\t\tthis.field = options.field;\n\t\tthis.options = options;\n\t\tconst op = this.toOp();\n\t\tthis.operationClass = op.operationClass;\n\t\tthis.label = op.label;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn castField(this.options);\n\t}\n\trenderTypeScript() {\n\t\treturn `castField(${jsonToTsSource(this.options)})`;\n\t}\n};\n/**\n* The operation of a call whose value is an unfilled placeholder: a promise that rejects with\n* `MIGRATION.UNFILLED_PLACEHOLDER`, whose meta names the operation it stands for, so that a plan can\n* list it before the user fills the value.\n*/\nfunction unfilledOperation(slot, standsFor) {\n\tconst unfilled = errorUnfilledPlaceholder(slot);\n\tconst operation = Promise.reject(new CliStructuredError(unfilled.code, unfilled.message, {\n\t\t...ifDefined(\"why\", unfilled.why),\n\t\t...ifDefined(\"fix\", unfilled.fix),\n\t\tmeta: {\n\t\t\tslot,\n\t\t\toperation: {\n\t\t\t\tid: standsFor.id,\n\t\t\t\tlabel: standsFor.label,\n\t\t\t\toperationClass: standsFor.operationClass\n\t\t\t}\n\t\t}\n\t}));\n\toperation.catch(() => void 0);\n\treturn operation;\n}\n/**\n* A data transform the planner scaffolds for a field: its check and its run's filter select the\n* documents still to change, and its update is a placeholder the user fills in `migration.ts`.\n* Until then `toOp()` rejects with `MIGRATION.UNFILLED_PLACEHOLDER`, naming the operation it stands\n* for, so the plan's other operations still list.\n*/\nvar DataTransformCall = class extends OpFactoryCallNode {\n\tfactoryName = \"dataTransform\";\n\toperationClass = \"data\";\n\tname;\n\tcollection;\n\tfilter;\n\tlabel;\n\tconstructor(name, collection, filter) {\n\t\tsuper();\n\t\tthis.name = name;\n\t\tthis.collection = collection;\n\t\tthis.filter = filter;\n\t\tthis.label = `Data transform: ${name}`;\n\t\tthis.freeze();\n\t}\n\tget slot() {\n\t\treturn `${this.name}:update`;\n\t}\n\ttoOp() {\n\t\treturn unfilledOperation(this.slot, {\n\t\t\tid: `data_transform.${this.name}`,\n\t\t\tlabel: this.label,\n\t\t\toperationClass: this.operationClass\n\t\t});\n\t}\n\trenderTypeScript() {\n\t\tconst collection = jsonToTsSource(this.collection);\n\t\tconst filter = jsonToTsSource(this.filter);\n\t\treturn [\n\t\t\t`dataTransform(${jsonToTsSource(this.name)}, {`,\n\t\t\t` check: { source: () => rawAggregate(${collection}, [{ $match: ${filter} }, { $limit: 1 }]) },`,\n\t\t\t` run: () => rawUpdateMany(${collection}, ${filter}, placeholder(${jsonToTsSource(this.slot)}), { bypassDocumentValidation: true }),`,\n\t\t\t\"})\"\n\t\t].join(\"\\n\");\n\t}\n\timportRequirements() {\n\t\treturn [\n\t\t\t\"dataTransform\",\n\t\t\t\"rawAggregate\",\n\t\t\t\"rawUpdateMany\",\n\t\t\t\"placeholder\"\n\t\t].map((symbol) => ({\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol\n\t\t}));\n\t}\n};\nvar FillFieldCall = class extends OpFactoryCallNode {\n\tfactoryName = \"fillField\";\n\toperationClass = \"widening\";\n\tcollection;\n\tfield;\n\toptions;\n\tlabel;\n\tconstructor(options) {\n\t\tsuper();\n\t\tthis.collection = options.collection;\n\t\tthis.field = options.field;\n\t\tthis.options = options;\n\t\tthis.label = this.toOp().label;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn fillField(this.options);\n\t}\n\trenderTypeScript() {\n\t\treturn `fillField(${jsonToTsSource(this.options)})`;\n\t}\n};\nvar RenameStoredKeyCall = class extends OpFactoryCallNode {\n\tfactoryName = \"renameStoredKey\";\n\toperationClass = \"widening\";\n\toptions;\n\tlabel;\n\tconstructor(options) {\n\t\tsuper();\n\t\tthis.options = options;\n\t\tthis.label = this.toOp().label;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn renameStoredKey(this.options);\n\t}\n\trenderTypeScript() {\n\t\treturn `renameStoredKey(${jsonToTsSource(this.options)})`;\n\t}\n};\nvar RemoveStoredKeyCall = class extends OpFactoryCallNode {\n\tfactoryName = \"removeStoredKey\";\n\toperationClass = \"destructive\";\n\toptions;\n\tlabel;\n\tconstructor(options) {\n\t\tsuper();\n\t\tthis.options = options;\n\t\tthis.label = this.toOp().label;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn removeStoredKey(this.options);\n\t}\n\trenderTypeScript() {\n\t\treturn `removeStoredKey(${jsonToTsSource(this.options)})`;\n\t}\n};\n/**\n* Sets a key inside a field's value where it is missing or `null`. An unfilled value is a placeholder\n* the user fills in `migration.ts`; until then `toOp()` rejects with `MIGRATION.UNFILLED_PLACEHOLDER`.\n*/\nvar FillStoredKeyCall = class extends OpFactoryCallNode {\n\tfactoryName = \"fillStoredKey\";\n\toperationClass = \"widening\";\n\toptions;\n\tlabel;\n\tconstructor(options) {\n\t\tsuper();\n\t\tthis.options = options;\n\t\tthis.label = fillStoredKey({\n\t\t\t...options,\n\t\t\tvalue: null\n\t\t}).label;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\tconst { value, ...at } = this.options;\n\t\tif (value instanceof UnfilledValue) return unfilledOperation(value.slot, fillStoredKey({\n\t\t\t...at,\n\t\t\tvalue: null\n\t\t}));\n\t\treturn fillStoredKey({\n\t\t\t...at,\n\t\t\tvalue\n\t\t});\n\t}\n\trenderTypeScript() {\n\t\treturn `fillStoredKey(${tsObjectSource(Object.entries(this.options).map(([key, value]) => [key, value instanceof UnfilledValue ? `placeholder(${jsonToTsSource(value.slot)})` : jsonToTsSource(value)]))})`;\n\t}\n\timportRequirements() {\n\t\treturn [...super.importRequirements(), ...this.options.value instanceof UnfilledValue ? [{\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol: \"placeholder\"\n\t\t}] : []];\n\t}\n};\nvar ReplaceStoredValueCall = class extends OpFactoryCallNode {\n\tfactoryName = \"replaceStoredValue\";\n\toperationClass = \"widening\";\n\toptions;\n\tlabel;\n\tconstructor(options) {\n\t\tsuper();\n\t\tthis.options = options;\n\t\tthis.label = this.toOp().label;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn replaceStoredValue(this.options);\n\t}\n\trenderTypeScript() {\n\t\treturn `replaceStoredValue(${jsonToTsSource(this.options)})`;\n\t}\n};\n/** A call as an edit names it inside a sentence: on one line, without trailing commas. */\nfunction callInSentence(call) {\n\treturn `${call.factoryName}(${sourceOnOneLine(call.options)})`;\n}\nfunction sourceOnOneLine(value) {\n\tif (Array.isArray(value)) return `[${value.map(sourceOnOneLine).join(\", \")}]`;\n\tif (typeof value === \"object\" && value !== null) {\n\t\tconst entries = Object.entries(value).filter(([, entry]) => entry !== void 0);\n\t\tif (entries.length === 0) return \"{}\";\n\t\treturn `{ ${entries.map(([key, entry]) => `${propertyName(key)}: ${sourceOnOneLine(entry)}`).join(\", \")} }`;\n\t}\n\treturn jsonToTsSource(value);\n}\nfunction propertyName(key) {\n\treturn /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key) && key !== \"__proto__\" ? key : tsStringLiteral(key);\n}\nvar RemoveStoredValueCall = class extends OpFactoryCallNode {\n\tfactoryName = \"removeStoredValue\";\n\toperationClass = \"destructive\";\n\toptions;\n\timports;\n\tlabel;\n\tconstructor(options, imports = { importsReplacement: false }) {\n\t\tsuper();\n\t\tthis.options = options;\n\t\tthis.imports = imports;\n\t\tthis.label = this.toOp().label;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn removeStoredValue(this.options);\n\t}\n\trenderTypeScript() {\n\t\treturn `removeStoredValue(${jsonToTsSource(this.options)})`;\n\t}\n\timportRequirements() {\n\t\treturn [...super.importRequirements(), ...this.imports.importsReplacement ? [{\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol: \"replaceStoredValue\"\n\t\t}] : []];\n\t}\n};\nvar DeleteDocumentsCall = class extends OpFactoryCallNode {\n\tfactoryName = \"deleteDocuments\";\n\toperationClass = \"destructive\";\n\toptions;\n\tlabel;\n\tconstructor(options) {\n\t\tsuper();\n\t\tthis.options = options;\n\t\tthis.label = this.toOp().label;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn deleteDocuments(this.options);\n\t}\n\trenderTypeScript() {\n\t\treturn `deleteDocuments(${jsonToTsSource(this.options)})`;\n\t}\n};\nvar CollModCall = class extends OpFactoryCallNode {\n\tfactoryName = \"collMod\";\n\tcollection;\n\toptions;\n\tmeta;\n\toperationClass;\n\tlabel;\n\tconstructor(collection, options, meta) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.options = options;\n\t\tthis.meta = meta;\n\t\tthis.operationClass = meta?.operationClass ?? \"widening\";\n\t\tthis.label = meta?.label ?? `Modify collection ${collection}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn collMod(this.collection, this.options, this.meta);\n\t}\n\trenderTypeScript() {\n\t\treturn this.meta ? `collMod(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.options)}, ${jsonToTsSource(this.meta)})` : `collMod(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.options)})`;\n\t}\n};\nfunction schemaIndexToCreateIndexOptions(index) {\n\treturn {\n\t\tname: index.name,\n\t\t...index.unique ? { unique: true } : {},\n\t\t...ifDefined(\"sparse\", index.sparse),\n\t\t...ifDefined(\"expireAfterSeconds\", index.expireAfterSeconds),\n\t\t...ifDefined(\"partialFilterExpression\", index.partialFilterExpression),\n\t\t...ifDefined(\"wildcardProjection\", index.wildcardProjection),\n\t\t...ifDefined(\"collation\", index.collation),\n\t\t...ifDefined(\"weights\", index.weights),\n\t\t...ifDefined(\"default_language\", index.default_language),\n\t\t...ifDefined(\"language_override\", index.language_override)\n\t};\n}\nfunction schemaCollectionToCreateCollectionOptions(coll) {\n\tconst opts = coll.options;\n\tconst validator = coll.validator;\n\tif (!opts && !validator) return void 0;\n\treturn {\n\t\t...opts?.capped ? { capped: true } : {},\n\t\t...ifDefined(\"size\", opts?.capped?.size),\n\t\t...ifDefined(\"max\", opts?.capped?.max),\n\t\t...ifDefined(\"timeseries\", opts?.timeseries),\n\t\t...ifDefined(\"collation\", opts?.collation),\n\t\t...opts?.clusteredIndex ? { clusteredIndex: {\n\t\t\tkey: { _id: 1 },\n\t\t\tunique: true,\n\t\t\t...opts.clusteredIndex.name != null ? { name: opts.clusteredIndex.name } : {}\n\t\t} } : {},\n\t\t...validator ? { validator: { $jsonSchema: validator.jsonSchema } } : {},\n\t\t...ifDefined(\"validationLevel\", validator?.validationLevel),\n\t\t...ifDefined(\"validationAction\", validator?.validationAction),\n\t\t...ifDefined(\"changeStreamPreAndPostImages\", opts?.changeStreamPreAndPostImages)\n\t};\n}\n//#endregion\n//#region src/core/migrations/mongo-statement-planning.ts\n/** Why the plan does not rewrite the fields of the model at `coordinate`: its documents are embedded in another model's, if they are. */\nfunction embeddedModelReason(contract, coordinate) {\n\tconst owner = embeddingModelOf(contract.domain, coordinate);\n\treturn owner === void 0 ? void 0 : `model \"${modelDisplayName(coordinate)}\" is embedded in the documents of model \"${owner}\"`;\n}\n/** Why a statement on `model` cannot be planned when no collection holds its documents. */\nfunction noCollectionReason(model) {\n\treturn `model \"${modelDisplayName(model)}\" names no collection, and neither does a base or an owner`;\n}\nfunction modelAt(contract, coordinate) {\n\tconst models = mongoModelsOf(contract.domain, coordinate.namespaceId);\n\treturn Object.hasOwn(models, coordinate.model) ? models[coordinate.model] : void 0;\n}\n/** The stored name of `field` of the model at `coordinate`, or undefined when the model does not declare it. */\nfunction storedFieldNameAt(contract, coordinate) {\n\tconst model = modelAt(contract, coordinate);\n\treturn model === void 0 || !Object.hasOwn(model.fields, coordinate.field) ? void 0 : ownStoredNameOf(model, coordinate.field);\n}\n/** The stored name of a field the statement's resolution found on the model at `coordinate`. */\nfunction resolvedStoredNameAt(contract, coordinate) {\n\tconst storedName = storedFieldNameAt(contract, coordinate);\n\tif (storedName === void 0) throw new InternalError(`Field \"${coordinate.model}.${coordinate.field}\" a statement names has no stored name`);\n\treturn storedName;\n}\nfunction declaredCollection(contract, collection) {\n\treturn Object.values(contract.storage.namespaces).map((namespace) => namespace.entries[\"collection\"]?.[collection]).find((entry) => entry instanceof MongoCollection);\n}\n/**\n* The control policy of `collection`. A collection the contract leaves out keeps the policy `fromContract` gave it, when that was not `managed`, so leaving an `external` collection out of the contract does not drop it.\n*/\nfunction collectionControlOf(contract, fromContract, collection) {\n\tconst declared = declaredCollection(contract, collection);\n\tconst original = declared === void 0 && fromContract !== null ? declaredCollection(fromContract, collection) : void 0;\n\tconst policy = collectionControlPolicyOf(collection, collectionControlPoliciesOf(contract));\n\tif (original === void 0 || fromContract === null) return {\n\t\tpolicy,\n\t\tdeclared: declared?.control\n\t};\n\tconst originalPolicy = governingControlPolicy({ explicitNodeControlPolicy: original.control }, fromContract.defaultControlPolicy);\n\treturn {\n\t\tpolicy: originalPolicy === \"managed\" ? policy : originalPolicy,\n\t\tdeclared: original.control\n\t};\n}\nfunction collectionControlPolicy(contract, collection) {\n\treturn collectionControlOf(contract, null, collection).policy;\n}\n/** Why MongoDB would refuse a collection name, if it would. */\nfunction invalidCollectionNameReason(name) {\n\tif (name === \"\") return \"it is empty\";\n\tif (name.includes(\"$\")) return \"it contains \\\"$\\\"\";\n\tif (name.includes(\"\\0\")) return \"it contains a null character\";\n\tif (name.startsWith(\"system.\")) return \"it starts with \\\"system.\\\", which MongoDB reserves\";\n}\nfunction isEmbedRelation$1(relation) {\n\treturn !(\"on\" in relation) && !(\"through\" in relation);\n}\nfunction storedField(model, field) {\n\tif (model === void 0) return { kind: \"absent\" };\n\tif (Object.hasOwn(model.fields, field)) return { kind: \"field\" };\n\tconst relation = Object.hasOwn(model.relations, field) ? model.relations[field] : void 0;\n\tif (relation === void 0) return { kind: \"absent\" };\n\treturn isEmbedRelation$1(relation) ? { kind: \"embed\" } : { kind: \"reference\" };\n}\nfunction refused$3(statement, label, reason, why) {\n\treturn {\n\t\tkind: \"statementRefused\",\n\t\tsummary: `${label}: ${reason}`,\n\t\twhy,\n\t\trefusedStatement: statement\n\t};\n}\nconst LEAVE_OUT = \"Leave out this statement.\";\n/**\n* Plans the rename each statement states, in order: a model statement whose collection changes renames the\n* collection in the schema the diff then starts from, and a field statement whose stored name\n* changes renames the field in the documents that hold it.\n*/\nfunction planStatements(input) {\n\tlet schema = input.schema;\n\tconst collectionRenames = [];\n\tconst fieldRenames = [];\n\tconst callOfStatement = [];\n\tconst conflicts = [];\n\tconst renamedCollections = /* @__PURE__ */ new Map();\n\tfor (const statement of input.statements) {\n\t\tconst label = `Cannot ${describeMigrationStatement(statement, input.fromContract, input.contract)}`;\n\t\tconst outcome = statement.entity === \"namespace\" ? {\n\t\t\tkind: \"refused\",\n\t\t\tconflict: refused$3(statement, label, \"MongoDB does not rename namespaces in this release\", LEAVE_OUT)\n\t\t} : statement.entity === \"enumValue\" || statement.entity === \"valueObjectField\" ? { kind: \"unchanged\" } : statement.entity === \"model\" ? planModelStatement(statement, label, schema, input) : planFieldStatement(statement, label, renamedCollections, schema, input);\n\t\tif (outcome.kind === \"refused\") {\n\t\t\tconflicts.push(outcome.conflict);\n\t\t\tcallOfStatement.push(void 0);\n\t\t\tcontinue;\n\t\t}\n\t\tif (outcome.kind === \"renameCollection\") {\n\t\t\tschema = renameInSchema(schema, outcome.call.from, outcome.call.to);\n\t\t\trenamedCollections.set(outcome.call.from, outcome.call.to);\n\t\t\tcollectionRenames.push(outcome.call);\n\t\t}\n\t\tif (outcome.kind === \"renameField\") {\n\t\t\tconst same = fieldRenames.find(({ call }) => sameFieldRename(call, outcome.rename.call));\n\t\t\tif (same !== void 0) {\n\t\t\t\tcallOfStatement.push(same.call);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfieldRenames.push(outcome.rename);\n\t\t}\n\t\tcallOfStatement.push(outcome.kind === \"unchanged\" ? void 0 : outcome.kind === \"renameField\" ? outcome.rename.call : outcome.call);\n\t}\n\treturn conflicts.length > 0 ? notOk(conflicts) : ok({\n\t\tschema,\n\t\tcollectionRenames,\n\t\tfieldRenames,\n\t\tcallOfStatement\n\t});\n}\n/** Whether two field renames rewrite the same documents the same way, as when every root model of a shared collection renames a field together. */\nfunction sameFieldRename(a, b) {\n\treturn a.collection === b.collection && a.from === b.from && a.to === b.to && JSON.stringify(a.filter) === JSON.stringify(b.filter);\n}\nfunction renameInSchema(schema, from, to) {\n\treturn new MongoSchemaIR(schema.collections.map((collection) => collection.name === from ? new MongoSchemaCollection({\n\t\tname: to,\n\t\tindexes: collection.indexes,\n\t\t...collection.validator === void 0 ? {} : { validator: collection.validator },\n\t\t...collection.options === void 0 ? {} : { options: collection.options }\n\t}) : collection), { fromDatabase: schema.fromDatabase });\n}\nfunction controlPolicyRefusal(statement, label, contract, collection) {\n\tconst policy = collectionControlPolicy(contract, collection);\n\tif (policy === \"managed\") return void 0;\n\treturn {\n\t\tkind: \"refused\",\n\t\tconflict: refused$3(statement, label, `collection \"${collection}\" has control policy \"${policy}\"`, `Statements rename only collections, and fields of collections, whose control policy is \"managed\". Make the change in the database yourself and leave out this statement.`)\n\t};\n}\nfunction planModelStatement(statement, label, schema, input) {\n\tconst embedded = embeddedModelReason(input.fromContract, statement.from) ?? embeddedModelReason(input.contract, statement.to);\n\tif (embedded !== void 0) return {\n\t\tkind: \"refused\",\n\t\tconflict: refused$3(statement, label, embedded, `Embedded models are not renamed in this release. ${LEAVE_OUT}`)\n\t};\n\tconst from = collectionOfModel(input.fromContract.domain, statement.from);\n\tconst to = collectionOfModel(input.contract.domain, statement.to);\n\tif (from === void 0 || to === void 0) return {\n\t\tkind: \"refused\",\n\t\tconflict: refused$3(statement, label, noCollectionReason(from === void 0 ? statement.from : statement.to), `A statement renames the documents of a model in its collection. Give the model a collection, then run this command again, or ${LEAVE_OUT.toLowerCase()}`)\n\t};\n\tif (from === to) return { kind: \"unchanged\" };\n\tconst policyRefusal = controlPolicyRefusal(statement, label, input.contract, to);\n\tif (policyRefusal !== void 0) return policyRefusal;\n\tconst refuse = (reason, why) => ({\n\t\tkind: \"refused\",\n\t\tconflict: refused$3(statement, label, reason, why)\n\t});\n\tconst source = schema.collection(from);\n\tif (source === void 0) return refuse(`the schema being planned from has no collection \"${from}\"`, `The database has no collection \"${from}\", or \"${from}\" is a view, which MongoDB cannot rename. Inspect it with prisma db schema, or ${LEAVE_OUT.toLowerCase()}`);\n\tif (source.options?.timeseries !== void 0) return refuse(`collection \"${from}\" is a time-series collection`, `MongoDB cannot rename a time-series collection. Leave out this statement. To keep the documents, first create collection \"${to}\" yourself with the same time-series options and copy them into it; the plan then drops \"${from}\" once --delete names the model.`);\n\tconst invalid = invalidCollectionNameReason(to);\n\tif (invalid !== void 0) return refuse(`MongoDB does not accept the collection name \"${to}\": ${invalid}`, \"Give the model a collection name MongoDB accepts with @@map, then run this command again.\");\n\tif (schema.collection(to) !== void 0) return refuse(`the schema being planned from already has a collection \"${to}\"`, `A rename cannot replace a collection that already exists. Rename or drop collection \"${to}\" first, or ${LEAVE_OUT.toLowerCase()}`);\n\treturn {\n\t\tkind: \"renameCollection\",\n\t\tcall: new RenameCollectionCall(from, to)\n\t};\n}\nfunction planFieldStatement(statement, label, renamedCollections, schema, input) {\n\tconst refuse = (reason, why) => ({\n\t\tkind: \"refused\",\n\t\tconflict: refused$3(statement, label, reason, why)\n\t});\n\tconst embeddedFrom = embeddedModelReason(input.fromContract, statement.from);\n\tconst embeddedTo = embeddedModelReason(input.contract, statement.to);\n\tif (embeddedFrom !== void 0 && embeddedTo !== void 0) return { kind: \"unchanged\" };\n\tconst embedded = embeddedFrom ?? embeddedTo;\n\tif (embedded !== void 0) return refuse(embedded, `A statement renames a field of an embedded model only while the model stays embedded. ${LEAVE_OUT}`);\n\tconst fromField = storedField(modelAt(input.fromContract, statement.from), statement.from.field);\n\tconst toField = storedField(modelAt(input.contract, statement.to), statement.to.field);\n\tif (fromField.kind === \"embed\" || toField.kind === \"embed\") return refuse(\"the field is an embedded relation\", `Renaming an embedded relation is not supported in this release. ${LEAVE_OUT}`);\n\tif (fromField.kind !== \"field\" && toField.kind !== \"field\") return { kind: \"unchanged\" };\n\tif (fromField.kind !== \"field\" || toField.kind !== \"field\") return refuse(\"the field is stored in documents on one side of the statement only\", `A relation is not stored in documents, so a statement cannot rename a field to or from one. ${LEAVE_OUT}`);\n\tconst fromStored = resolvedStoredNameAt(input.fromContract, statement.from);\n\tconst toStored = resolvedStoredNameAt(input.contract, statement.to);\n\tconst originCollection = collectionOfModel(input.fromContract.domain, statement.from);\n\tconst destinationCollection = collectionOfModel(input.contract.domain, statement.to);\n\tif (originCollection === void 0 || destinationCollection === void 0) return refuse(noCollectionReason(originCollection === void 0 ? statement.from : statement.to), `A statement renames a field in the documents of its model's collection. ${LEAVE_OUT}`);\n\tconst collection = renamedCollections.get(originCollection) ?? originCollection;\n\tif (fromStored === toStored && collection === destinationCollection) return { kind: \"unchanged\" };\n\tif (fromStored === \"_id\" || toStored === \"_id\") return refuse(\"it renames _id\", `MongoDB does not let a document change its _id. ${LEAVE_OUT}`);\n\tconst unsafeFrom = unrewritableFieldNameReason(fromStored);\n\tif (unsafeFrom !== void 0) return refuse(`the stored name \"${fromStored}\" cannot be rewritten`, `${unsafeFrom}, so a statement cannot move its values. Rename it in the database yourself, or ${LEAVE_OUT.toLowerCase()}`);\n\tconst unsafeTo = unrewritableFieldNameReason(toStored);\n\tif (unsafeTo !== void 0) return refuse(`the stored name \"${toStored}\" cannot be written`, `${unsafeTo}. Give the field a stored name without \".\" that does not start with \"$\" (with @map), or ${LEAVE_OUT.toLowerCase()}`);\n\tif (collection !== destinationCollection) return refuse(`the model's collection changes from \"${originCollection}\" to \"${destinationCollection}\", and no statement renames it`, collectionChangeAdvice(statement, originCollection, destinationCollection));\n\tif (schema.collection(collection)?.options?.timeseries !== void 0) return refuse(`collection \"${collection}\" is a time-series collection`, `${TIME_SERIES_UPDATES}, so a statement cannot move the values of a field in them. Keep the stored name: store the field as ${JSON.stringify(fromStored)} (with @map(${JSON.stringify(fromStored)}) in PSL), then run this command again without this statement.`);\n\tconst policyRefusal = controlPolicyRefusal(statement, label, input.contract, collection);\n\tif (policyRefusal !== void 0) return policyRefusal;\n\tconst variant = selectedVariantOf(input.fromContract.domain, statement.from);\n\tconst renamedTogether = new Set(input.statements.flatMap((other) => other.entity === \"field\" && other.from.namespaceId === statement.from.namespaceId && storedFieldNameAt(input.fromContract, other.from) === fromStored && storedFieldNameAt(input.contract, other.to) === toStored ? [other.from.model] : []));\n\tconst others = otherModelsReached(input.fromContract.domain, statement.from, originCollection, variant, fromStored).filter((name) => !renamedTogether.has(name));\n\tif (others.length > 0) return refuse(`model ${others.map((name) => JSON.stringify(name)).join(\", \")} stores field ${JSON.stringify(fromStored)} in the same collection, ${JSON.stringify(collection)}`, `${sharedCollectionWhy(collection, others, \"renaming the field would rename it in the documents\")} To change it, ${SEPARATE_THE_MODELS}.`);\n\tconst selected = variant === void 0 ? rootDocumentsLosing(input.contract, statement.to, fromStored) : {\n\t\tfilter: variantFilter(variant),\n\t\tdiscriminatorFilter: variantDiscriminatorFilter(variant)\n\t};\n\treturn {\n\t\tkind: \"renameField\",\n\t\trename: {\n\t\t\tcall: new RenameFieldCall(collection, fromStored, toStored, selected?.filter),\n\t\t\tdiscriminatorFilter: selected?.discriminatorFilter\n\t\t}\n\t};\n}\nfunction collectionChangeAdvice(statement, from, to) {\n\tif (!sameModel$1(statement.from, statement.to)) return `Add --rename ${modelDisplayName(statement.from)}:${modelDisplayName(statement.to)} before this statement, so the collection is renamed with its documents.`;\n\treturn `A statement cannot rename the collection of a model that keeps its name. Rename the collection in a step of its own first: change only @@map and emit the contract. ${renameCollectionByHandSteps(statement.from, from, to)} Then change the field and run this statement again.`;\n}\nfunction renameCollectionByHandSteps(model, from, to) {\n\treturn `With db update, rename the collection in the database yourself, for example db.getCollection(${JSON.stringify(from)}).renameCollection(${JSON.stringify(to)}) in mongosh, then run db update. With migration plan, plan it, passing --delete ${modelDisplayName(model)} to answer its question; in its migration.ts make renameCollection(${JSON.stringify(from)}, ${JSON.stringify(to)}) the first operation, imported with the other operations, delete the drop of \"${from}\", and delete the create of \"${to}\" if there is one; run node on that migration.ts so it writes ops.json again; then apply it with prisma db migrate.`;\n}\n/**\n* How to keep the documents of a model that keeps its name while its collection changes from\n* `from` to `to`: no statement can rename that collection, so the user renames it by hand.\n*/\nfunction keepCollectionByHandAdvice(model, from, to) {\n\treturn `To keep its documents, rename collection \"${from}\" to \"${to}\" instead; a statement cannot rename the collection of a model that keeps its name. ${renameCollectionByHandSteps(model, from, to)}`;\n}\nfunction modelCoordinates(contract) {\n\treturn Object.entries(contract.domain?.namespaces ?? {}).flatMap(([namespaceId, namespace]) => Object.keys(namespace.models).map((model) => ({\n\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\tmodel\n\t})));\n}\nfunction sameModel$1(a, b) {\n\treturn a.namespaceId === b.namespaceId && a.model === b.model;\n}\n/**\n* The destination model an origin model became: the one a statement renamed it to, else the one of\n* the same name, else the only new model stored the same way (same collection, same variant value)\n* that no statement names and that no other origin model is stored like, so no two origin models\n* become one.\n*/\nfunction destinationModelOf(origin, input) {\n\tconst renames = input.statements.filter((statement) => statement.entity === \"model\");\n\tconst renamed = renames.find((statement) => sameModel$1(statement.from, origin));\n\tif (renamed !== void 0) return renamed.to;\n\tif (!unmatchedByName(origin, renames, input)) return origin;\n\tconst unmatched = modelCoordinates(input.fromContract).filter((other) => unmatchedByName(other, renames, input));\n\tconst stored = modelCoordinates(input.contract).filter((candidate) => modelAt(input.fromContract, candidate) === void 0 && !renames.some((statement) => sameModel$1(statement.to, candidate)) && storedAlike(origin, candidate, input) && unmatched.filter((other) => storedAlike(other, candidate, input)).length === 1);\n\tconst [only] = stored;\n\treturn stored.length === 1 ? only : void 0;\n}\n/** Whether an origin model has no destination by statement or by name. */\nfunction unmatchedByName(origin, renames, input) {\n\treturn modelAt(input.contract, origin) === void 0 && !renames.some((statement) => sameModel$1(statement.from, origin));\n}\n/** Whether an origin model and a destination model are stored the same way: neither embedded, the same collection after renames, the same variant value. */\nfunction storedAlike(origin, candidate, input) {\n\tif (embeddingModelOf(input.fromContract.domain, origin) !== void 0) return false;\n\tif (embeddingModelOf(input.contract.domain, candidate) !== void 0) return false;\n\tconst originCollection = collectionOfModel(input.fromContract.domain, origin);\n\treturn originCollection !== void 0 && collectionOfModel(input.contract.domain, candidate) === input.collectionAfterRenames(originCollection) && sameVariant(selectedVariantOf(input.contract.domain, candidate), selectedVariantOf(input.fromContract.domain, origin));\n}\nfunction sameVariant(a, b) {\n\treturn a === void 0 || b === void 0 ? a === b : a.field === b.field && a.value === b.value;\n}\n/** The origin model a destination model was, by the rules of `destinationModelOf`, read the other way. */\nfunction originModelOf(destination, input) {\n\treturn modelCoordinates(input.fromContract).find((origin) => {\n\t\tconst matched = destinationModelOf(origin, input);\n\t\treturn matched !== void 0 && sameModel$1(matched, destination);\n\t});\n}\nfunction sameField$3(a, b) {\n\treturn sameModel$1(a, b) && a.field === b.field;\n}\n/** The name a field of the origin has in the destination: its rename statement's new name, else its own. */\nfunction destinationFieldOf(origin, statements) {\n\treturn statements.find((statement) => statement.entity === \"field\" && sameField$3(statement.from, origin))?.to.field ?? origin.field;\n}\n/** The name a field of the destination had in the origin: its rename statement's old name, else its own. */\nfunction originFieldOf(destination, statements) {\n\treturn statements.find((statement) => statement.entity === \"field\" && sameField$3(statement.to, destination))?.from.field ?? destination.field;\n}\nfunction renamedByStatement(input, field) {\n\treturn input.statements.some((statement) => statement.entity === \"field\" && sameModel$1(statement.from, field) && statement.from.field === field.field);\n}\n/** Whether one of `model`'s own fields or embed relations is stored under `storedName`. */\nfunction ownStores(model, storedName) {\n\treturn hasOwnFieldStoredAs(model, storedName) || Object.values(ownEmbedStoredNamesOf(model)).includes(storedName);\n}\n/** The stored names of the documents of the model at `coordinate`: its fields and embed relations, its own and those it inherits. */\nfunction storedFieldsOf(contract, coordinate) {\n\tconst models = mongoModelsOf(contract.domain, coordinate.namespaceId);\n\treturn new Set(modelAndBasesOf(models, coordinate.model).flatMap((model) => [...Object.values(ownStoredNamesOf(model)), ...Object.values(ownEmbedStoredNamesOf(model))]));\n}\n/**\n* The documents of a root model that lose `field`: all of them, or, when some of its destination\n* variants now store the field themselves, those whose discriminator value is none of theirs.\n* `undefined` when the root model itself still stores it.\n*/\nfunction rootDocumentsLosing(contract, root, storedName) {\n\tconst model = modelAt(contract, root);\n\tif (model === void 0 || ownStores(model, storedName)) return void 0;\n\tconst discriminator = model.discriminator?.field;\n\tconst keeping = Object.entries(model.variants ?? {}).filter(([, variant]) => {\n\t\tconst variantModel = modelAt(contract, {\n\t\t\tnamespaceId: variant.namespace,\n\t\t\tmodel: variant.model\n\t\t});\n\t\treturn variantModel !== void 0 && ownStores(variantModel, storedName);\n\t}).map(([value]) => value).sort();\n\tif (discriminator === void 0 || keeping.length === 0) return {\n\t\tfilter: void 0,\n\t\tdiscriminatorFilter: void 0\n\t};\n\tconst field = ownStoredNameOf(model, discriminator);\n\treturn {\n\t\tfilter: { [field]: { $nin: keeping } },\n\t\tdiscriminatorFilter: {\n\t\t\tkind: \"noneOf\",\n\t\t\tfield,\n\t\t\tvalues: keeping\n\t\t}\n\t};\n}\n/**\n* The renames that move a field the documents of the origin model at `origin` store, from the\n* origin's stored name to the destination's: of its own fields, and of its bases' fields unless its\n* destination model stores the field itself, so the rename leaves its documents alone.\n*/\nfunction storedNameMoves(input, origin) {\n\tconst bases = modelAndBasesOf(mongoModelsOf(input.fromContract.domain, origin.namespaceId), origin.model).slice(1);\n\tconst destination = destinationModelOf(origin, input);\n\tconst destinationModel = destination === void 0 ? void 0 : modelAt(input.contract, destination);\n\treturn input.statements.flatMap((statement) => {\n\t\tif (statement.entity !== \"field\") return [];\n\t\tconst from = storedFieldNameAt(input.fromContract, statement.from);\n\t\tconst to = storedFieldNameAt(input.contract, statement.to);\n\t\tif (from === void 0 || to === void 0 || from === to) return [];\n\t\tif (sameModel$1(statement.from, origin)) return [{\n\t\t\tfrom,\n\t\t\tto\n\t\t}];\n\t\tconst fromModel = modelAt(input.fromContract, statement.from);\n\t\tconst ofABase = fromModel !== void 0 && bases.includes(fromModel);\n\t\tconst keptByDestination = destinationModel !== void 0 && ownStores(destinationModel, from);\n\t\treturn ofABase && !keptByDestination ? [{\n\t\t\tfrom,\n\t\t\tto\n\t\t}] : [];\n\t});\n}\n/** The stored names of the documents of the origin model at `origin`, without those a rename of one of its own fields moves to another stored name. */\nfunction storedFieldsKeptOf(input, origin) {\n\tconst movedAway = new Set(storedNameMoves(input, origin).map(({ from }) => from));\n\treturn new Set([...storedFieldsOf(input.fromContract, origin)].filter((name) => !movedAway.has(name)));\n}\n/**\n* The stored names that field rename statements move a field of `origin`'s documents into from\n* another stored name. The origin's own field under such a name no longer has a place in the\n* destination's documents, so it is removed.\n*/\nfunction storedNamesRenamedInto(input, origin) {\n\treturn new Set(storedNameMoves(input, origin).map(({ to }) => to));\n}\n/**\n* Each field an origin model stores that its destination model no longer stores, or whose stored\n* name a rename statement gives to another of its fields, in a collection\n* the plan keeps: removing it is data loss, carried out by unsetting it from the documents that\n* hold it, in a collection whose control policy is `managed`. A variant's field is unset only from that variant's documents, by the discriminator value they hold once the plan's replacements ran, unless its destination\n* base now stores it. A base field is unset from the documents of every variant that does not now\n* store it itself.\n*/\nfunction planFieldRemovals(input) {\n\treturn modelCoordinates(input.fromContract).flatMap((origin) => {\n\t\tif (embeddingModelOf(input.fromContract.domain, origin) !== void 0) return [];\n\t\tconst originCollection = collectionOfModel(input.fromContract.domain, origin);\n\t\tif (originCollection === void 0) return [];\n\t\tconst collection = input.collectionAfterRenames(originCollection);\n\t\tif (!input.keptCollections.has(collection)) return [];\n\t\tif (collectionControlPolicy(input.contract, collection) !== \"managed\") return [];\n\t\tconst destination = destinationModelOf(origin, input);\n\t\tif (destination === void 0) return [];\n\t\tconst model = modelAt(input.fromContract, origin);\n\t\tif (model === void 0) return [];\n\t\tconst variant = selectedVariantOf(input.contract.domain, destination) ?? selectedVariantOf(input.fromContract.domain, origin);\n\t\tconst ofVariant = variant === void 0 ? void 0 : {\n\t\t\tfilter: variantFilter(variant),\n\t\t\tdiscriminatorFilter: variantDiscriminatorFilter(variant)\n\t\t};\n\t\tconst takenByRename = storedNamesRenamedInto(input, origin);\n\t\tconst losing = (storedName) => {\n\t\t\tif (takenByRename.has(storedName)) return ofVariant ?? {\n\t\t\t\tfilter: void 0,\n\t\t\t\tdiscriminatorFilter: void 0\n\t\t\t};\n\t\t\tif (ofVariant !== void 0) return storedFieldsOf(input.contract, destination).has(storedName) ? void 0 : ofVariant;\n\t\t\treturn rootDocumentsLosing(input.contract, destination, storedName);\n\t\t};\n\t\treturn Object.entries(ownStoredNamesOf(model)).filter(([field, storedName]) => unrewritableFieldNameReason(storedName) === void 0 && !renamedByStatement(input, {\n\t\t\t...origin,\n\t\t\tfield\n\t\t})).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).flatMap(([field, storedName]) => {\n\t\t\tconst lost = losing(storedName);\n\t\t\treturn lost === void 0 ? [] : [{\n\t\t\t\tcall: new UnsetFieldCall(collection, storedName, lost.filter),\n\t\t\t\tsubject: {\n\t\t\t\t\tkind: \"field\",\n\t\t\t\t\t...origin,\n\t\t\t\t\tfield\n\t\t\t\t},\n\t\t\t\tdestination,\n\t\t\t\tvariant,\n\t\t\t\tdiscriminatorFilter: lost.discriminatorFilter\n\t\t\t}];\n\t\t});\n\t});\n}\n/**\n* Without an origin contract, a field is known removed when the origin validator declares it for a\n* root model and the destination validator declares it nowhere. It is named by its storage name.\n*/\nfunction planValidatorFieldRemovals(input) {\n\treturn input.origin.collections.flatMap((originCollection) => {\n\t\tif (collectionControlPolicy(input.contract, originCollection.name) !== \"managed\") return [];\n\t\tconst destination = input.destination.collection(originCollection.name);\n\t\tif (destination?.validator === void 0 || originCollection.validator === void 0) return [];\n\t\tconst kept = validatorFieldNamesOf(destination.validator.jsonSchema);\n\t\treturn [...new Set(validatorRootShapesOf(originCollection.validator.jsonSchema).flatMap((root) => Object.keys(root.properties)))].filter((field) => unrewritableFieldNameReason(field) === void 0 && !kept.has(field)).sort().map((field) => ({\n\t\t\tcall: new UnsetFieldCall(originCollection.name, field),\n\t\t\tsubject: {\n\t\t\t\tkind: \"storage\",\n\t\t\t\tname: `${originCollection.name}.${field}`\n\t\t\t},\n\t\t\tdestination: void 0,\n\t\t\tvariant: void 0,\n\t\t\tdiscriminatorFilter: void 0\n\t\t}));\n\t});\n}\n//#endregion\n//#region src/core/migrations/mongo-data-transforms.ts\nfunction refuse(statement, reason, why, contracts) {\n\treturn {\n\t\tkind: \"refused\",\n\t\tconflict: {\n\t\t\tkind: \"statementRefused\",\n\t\t\tsummary: `Cannot ${describeMigrationStatement(statement, contracts.fromContract, contracts.contract)}: ${reason}`,\n\t\t\twhy,\n\t\t\trefusedStatement: statement\n\t\t}\n\t};\n}\nconst NESTED_CONVERT_WHY = \"A --convert statement converts a field of a model or a variant. Converting a field inside a value object or an embedded model is not a statement on any database in this release: rewrite the values yourself, in a dataTransform operation of the migration.ts that migration plan writes or in mongosh, and leave out this statement.\";\nfunction withVariant(variant, condition) {\n\treturn variant === void 0 ? condition : { $and: [variantFilter(variant), condition] };\n}\n/** Why the plan cannot rewrite a field of the destination contract, if it cannot. */\nfunction unrewritableReason(contract, field) {\n\tconst model = modelAt(contract, field);\n\tif (model === void 0 || !Object.hasOwn(model.fields, field.field)) return void 0;\n\tconst collection = collectionOfModel(contract.domain, field);\n\tif (collection === void 0) return noCollectionReason(field);\n\tconst storedName = ownStoredNameOf(model, field.field);\n\tconst nameReason = unrewritableFieldNameReason(storedName);\n\tif (nameReason !== void 0) return `its stored name ${JSON.stringify(storedName)} cannot be rewritten: ${nameReason}`;\n\tconst policy = collectionControlPolicy(contract, collection);\n\treturn policy === \"managed\" ? void 0 : `collection ${JSON.stringify(collection)} has control policy ${JSON.stringify(policy)}`;\n}\n/**\n* The data transform of `--convert`: its check and its run select the documents whose field holds\n* a type the new field does not allow, and the user writes the update.\n*/\nfunction convertTransform(statement, change, contracts) {\n\tconst embedded = embeddedModelReason(contracts.contract, statement.field);\n\tif (embedded !== void 0) return refuse(statement, embedded, NESTED_CONVERT_WHY, contracts);\n\tconst unrewritable = unrewritableReason(contracts.contract, statement.field);\n\tif (unrewritable !== void 0) return refuse(statement, unrewritable, \"Leave out this statement.\", contracts);\n\tif (change === void 0) return refuse(statement, \"its type does not change\", \"Leave out this statement.\", contracts);\n\tconst notOfType = documentsNotOfType(change.field, {\n\t\ttypes: change.to.list && !change.from.list ? [\"array\"] : change.to.types,\n\t\tlist: change.to.list && change.from.list\n\t});\n\treturn {\n\t\tkind: \"transform\",\n\t\tcall: new DataTransformCall(fieldStatementText(contracts.contract, statement.field), change.collection, withVariant(change.variant, notOfType)),\n\t\trewrite: {\n\t\t\tkind: \"conversion\",\n\t\t\tcollection: change.collection,\n\t\t\tfield: change.field,\n\t\t\tvariant: change.variant,\n\t\t\tmodel: change.destination,\n\t\t\tstoredKey: void 0\n\t\t}\n\t};\n}\n/** Whether the origin already had the field and made it required. */\nfunction requiredInOrigin(input, collection, field, storedName) {\n\tif (input.match === void 0) {\n\t\tconst declaring = validatorDocumentShapesOf(input.schema.collection(collection)?.validator?.jsonSchema).filter((shape) => Object.hasOwn(shape.properties, storedName));\n\t\treturn declaring.length > 0 && declaring.every((shape) => shape.required.includes(storedName));\n\t}\n\tconst origin = originModelOf(field, input.match);\n\tconst model = origin === void 0 ? void 0 : modelAt(input.match.fromContract, origin);\n\tconst originField = originFieldOf(field, input.match.statements);\n\treturn model !== void 0 && Object.hasOwn(model.fields, originField) ? model.fields[originField]?.nullable === false : false;\n}\n/**\n* The data transform of `--backfill`: a required field that is new on an existing collection, or\n* was optional. Its check and its run select the documents where the field is missing or `null`,\n* and the user writes the update.\n*/\nfunction backfillTransform(statement, input) {\n\tconst contracts = {\n\t\tfromContract: input.match?.fromContract ?? input.contract,\n\t\tcontract: input.contract\n\t};\n\tconst model = modelAt(input.contract, statement.field);\n\tconst definition = model?.fields[statement.field.field];\n\tif (model === void 0 || definition === void 0) return refuse(statement, \"the destination has no such field\", \"Leave out this statement.\", contracts);\n\tif (definition.nullable) return refuse(statement, \"it is optional\", \"Only a required field needs a value in every document. Leave out this statement.\", contracts);\n\tconst unrewritable = unrewritableReason(input.contract, statement.field);\n\tif (unrewritable !== void 0) return refuse(statement, unrewritable, \"Leave out this statement.\", contracts);\n\tconst collection = collectionOfModel(input.contract.domain, statement.field);\n\tif (collection === void 0) return refuse(statement, noCollectionReason(statement.field), \"Leave out this statement.\", contracts);\n\tif (input.schema.collection(collection) === void 0) return refuse(statement, `collection \"${collection}\" is new, so it has no documents to fill`, \"Leave out this statement.\", contracts);\n\tconst storedName = ownStoredNameOf(model, statement.field.field);\n\tif (requiredInOrigin(input, collection, statement.field, storedName)) return refuse(statement, \"it was already required\", \"Every document already has a value for it. Leave out this statement.\", contracts);\n\tconst variant = selectedVariantOf(input.contract.domain, statement.field);\n\treturn {\n\t\tkind: \"transform\",\n\t\tcall: new DataTransformCall(fieldStatementText(input.contract, statement.field), collection, withVariant(variant, documentsMissingOrNull(storedName))),\n\t\trewrite: {\n\t\t\tkind: \"backfill\",\n\t\t\tcollection,\n\t\t\tfield: storedName,\n\t\t\tvariant,\n\t\t\tmodel: statement.field,\n\t\t\tstoredKey: void 0\n\t\t}\n\t};\n}\n//#endregion\n//#region src/core/migrations/mongo-documents-not-rewritten.ts\nconst NOT_A_STATEMENT = \"No statement (--rename, --delete, --convert, --backfill) covers this change, so the plan does not rewrite the documents. Write a dataTransform in migration.ts, before the validator change, that rewrites them to fit; until they fit, the validator change checks the documents and fails the apply. With db update, plan the change with migration plan instead.\";\nfunction warning(summary) {\n\treturn {\n\t\tkind: \"documentsNotRewritten\",\n\t\tsummary,\n\t\twhy: NOT_A_STATEMENT\n\t};\n}\nfunction typeKey(field) {\n\tconst { type } = field;\n\tconst many = field.many !== void 0 && field.many !== false;\n\tif (type.kind === \"scalar\") return JSON.stringify([\n\t\t\"scalar\",\n\t\ttype.codecId,\n\t\tmany\n\t]);\n\tif (type.kind === \"valueObject\") return JSON.stringify([\n\t\t\"valueObject\",\n\t\ttype.namespaceId,\n\t\ttype.entityName,\n\t\tmany\n\t]);\n\treturn JSON.stringify([\"union\", many]);\n}\nfunction valueSetName(field) {\n\treturn field.valueSet?.entityName;\n}\nfunction valueObjectName(field) {\n\treturn field.type.kind === \"valueObject\" ? field.type.entityName : void 0;\n}\n/** What changes for a field kept by both contracts that the plan does not rewrite, in words. */\nfunction untouchedChange(name, before, after) {\n\tconst enumBefore = valueSetName(before);\n\tconst enumAfter = valueSetName(after);\n\tif (enumAfter !== void 0 && enumBefore === void 0) return `Field \"${name}\" gains enum \"${enumAfter}\"`;\n\tif (enumAfter !== void 0 && enumBefore !== void 0 && enumAfter !== enumBefore) return `Field \"${name}\" changes from enum \"${enumBefore}\" to enum \"${enumAfter}\"`;\n\tconst objectBefore = valueObjectName(before);\n\tconst objectAfter = valueObjectName(after);\n\tif (objectBefore !== void 0 && objectAfter !== void 0 && objectBefore !== objectAfter) return `Field \"${name}\" moves from value object \"${objectBefore}\" to value object \"${objectAfter}\"`;\n\tif (objectBefore === void 0 && objectAfter !== void 0 && before.type.kind === \"scalar\") return `Field \"${name}\" changes from a scalar to value object \"${objectAfter}\"`;\n\tif (objectBefore !== void 0 && objectAfter === void 0 && after.type.kind === \"scalar\") return `Field \"${name}\" changes from value object \"${objectBefore}\" to a scalar`;\n}\n/**\n* What changes for each field of an embedded model kept by both contracts that the plan does not rewrite: a field whose type changes. A removed or renamed field is a statement, and a required field that is new or was optional is filled, which the plan rewrites.\n*/\nfunction embeddedModelChanges$1(fieldName, originField, model, before, after) {\n\treturn Object.entries(after.fields).flatMap(([field, definition]) => {\n\t\tconst origin = originField(field);\n\t\tconst previous = Object.hasOwn(before.fields, origin) ? before.fields[origin] : void 0;\n\t\treturn previous !== void 0 && typeKey(previous) !== typeKey(definition) ? [`Field \"${fieldName(field)}\" of embedded model \"${model}\" changes type`] : [];\n\t});\n}\n/**\n* The changes the plan does not rewrite the documents for, and that are not statements: a type change of a field of an embedded model, a field of a value object whose type changes, a field that moves to\n* another value object or between a scalar and a value object, and a field that gains an enum or\n* changes enum. Each is a warning that names the field; the validator change's document check then\n* fails the apply until the documents fit.\n*/\nfunction documentsNotRewrittenWarnings(input) {\n\tconst modelFields = modelCoordinates(input.contract).flatMap((model) => {\n\t\tconst after = modelAt(input.contract, model);\n\t\tconst origin = originModelOf(model, input);\n\t\tconst before = origin === void 0 ? void 0 : modelAt(input.fromContract, origin);\n\t\tif (after === void 0 || before === void 0) return [];\n\t\tif (embeddedModelReason(input.contract, model) !== void 0) {\n\t\t\tconst fieldName = (field) => fieldStatementText(input.contract, {\n\t\t\t\t...model,\n\t\t\t\tfield\n\t\t\t});\n\t\t\tconst originField = (field) => originFieldOf({\n\t\t\t\t...model,\n\t\t\t\tfield\n\t\t\t}, input.statements);\n\t\t\treturn embeddedModelChanges$1(fieldName, originField, model.model, before, after).map(warning);\n\t\t}\n\t\treturn Object.entries(after.fields).flatMap(([field, definition]) => {\n\t\t\tconst originField = originFieldOf({\n\t\t\t\t...model,\n\t\t\t\tfield\n\t\t\t}, input.statements);\n\t\t\tif (!Object.hasOwn(before.fields, originField)) return [];\n\t\t\tconst previous = before.fields[originField];\n\t\t\tconst change = previous === void 0 ? void 0 : untouchedChange(fieldStatementText(input.contract, {\n\t\t\t\t...model,\n\t\t\t\tfield\n\t\t\t}), previous, definition);\n\t\t\treturn change === void 0 ? [] : [warning(change)];\n\t\t});\n\t});\n\tconst valueObjectFields = valueObjectsWithCoordinates(input.contract.storage).flatMap(({ coordinate, valueObject }) => {\n\t\tconst before = valueObjectAt(input.fromContract.storage, coordinate);\n\t\tif (before === void 0) return [];\n\t\treturn Object.entries(valueObject.fields).flatMap(([field, definition]) => {\n\t\t\tconst previous = Object.hasOwn(before.fields, field) ? before.fields[field] : void 0;\n\t\t\tif (previous === void 0) return [];\n\t\t\tconst name = `${coordinate.entityName}.${field}`;\n\t\t\tconst change = untouchedChange(name, previous, definition) ?? (typeKey(previous) === typeKey(definition) ? void 0 : `Field \"${name}\" of a value object changes type`);\n\t\t\treturn change === void 0 ? [] : [warning(change)];\n\t\t});\n\t});\n\treturn [...modelFields, ...valueObjectFields];\n}\n//#endregion\n//#region src/core/migrations/mongo-stored-places.ts\nfunction isMany(many) {\n\treturn many !== void 0 && many !== false;\n}\nfunction fieldMember(storedName, field) {\n\tconst { type } = field;\n\tif (type.kind === \"union\") {\n\t\tconst types = type.members.flatMap((member) => member.kind === \"valueObject\" ? [valueObjectKey(member)] : []);\n\t\treturn {\n\t\t\tstoredName,\n\t\t\tmany: isMany(field.many),\n\t\t\tholds: void 0,\n\t\t\tunlisted: {\n\t\t\t\tkind: \"union\",\n\t\t\t\ttypes\n\t\t\t}\n\t\t};\n\t}\n\tif (type.kind !== \"valueObject\") return {\n\t\tstoredName,\n\t\tmany: false,\n\t\tholds: void 0,\n\t\tunlisted: void 0\n\t};\n\tif (field.dict === true) return {\n\t\tstoredName,\n\t\tmany: false,\n\t\tholds: void 0,\n\t\tunlisted: {\n\t\t\tkind: \"dictionary\",\n\t\t\ttypes: [valueObjectKey(type)]\n\t\t}\n\t};\n\treturn {\n\t\tstoredName,\n\t\tmany: isMany(field.many),\n\t\tholds: valueObjectKey(type),\n\t\tunlisted: void 0\n\t};\n}\nfunction membersOf(fields, storedNames) {\n\treturn Object.entries(fields).flatMap(([name, field]) => {\n\t\tconst storedName = storedNames[name];\n\t\treturn storedName === void 0 ? [] : [fieldMember(storedName, field)];\n\t});\n}\nfunction modelMembers(model) {\n\tconst embedStoredNames = ownEmbedStoredNamesOf(model);\n\treturn [...membersOf(model.fields, ownStoredNamesOf(model)), ...Object.entries(model.relations).flatMap(([name, relation]) => {\n\t\tconst storedName = embedStoredNames[name];\n\t\treturn isEmbedRelation(relation) && storedName !== void 0 ? [{\n\t\t\tstoredName,\n\t\t\tmany: relation.cardinality === \"1:N\",\n\t\t\tholds: modelKey(relation.to.model),\n\t\t\tunlisted: void 0\n\t\t}] : [];\n\t})];\n}\n/** The walk over one namespace's models and the value objects their documents hold. */\nvar PlaceWalk = class {\n\t#nodes = /* @__PURE__ */ new Map();\n\t#modelsWithVariants = /* @__PURE__ */ new Set();\n\t#groups;\n\t#target;\n\tconstructor(contract, models, target) {\n\t\tthis.#target = target;\n\t\tthis.#groups = recursiveGroupsOf(contract.storage, models);\n\t\tfor (const { coordinate, valueObject } of valueObjectsWithCoordinates(contract.storage)) this.#nodes.set(valueObjectKey(coordinate), {\n\t\t\tname: coordinate.entityName,\n\t\t\tmembers: membersOf(valueObject.fields, valueObjectStoredNamesOf(valueObject))\n\t\t});\n\t\tfor (const [name, model] of Object.entries(models)) {\n\t\t\tthis.#nodes.set(modelKey(name), {\n\t\t\t\tname,\n\t\t\t\tmembers: modelMembers(model)\n\t\t\t});\n\t\t\tif (Object.keys(model.variants ?? {}).length > 0) this.#modelsWithVariants.add(modelKey(name));\n\t\t}\n\t}\n\t/** Whether an object of type `key` is, or holds at any depth, an object of the target type. */\n\t#reaches(key) {\n\t\tconst seen = /* @__PURE__ */ new Set();\n\t\tconst pending = [key];\n\t\tfor (let next = pending.pop(); next !== void 0; next = pending.pop()) {\n\t\t\tif (next === this.#target) return true;\n\t\t\tif (seen.has(next)) continue;\n\t\t\tseen.add(next);\n\t\t\tfor (const member of this.#nodes.get(next)?.members ?? []) {\n\t\t\t\tif (member.holds !== void 0) pending.push(member.holds);\n\t\t\t\tpending.push(...member.unlisted?.types ?? []);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\t/** The paths from an object with `members`, reached by `steps`, to each object of the target type below it. */\n\t#pathsBelow(members, steps) {\n\t\tconst paths = [];\n\t\tfor (const member of members) {\n\t\t\tconst found = this.#pathsOfMember(member, steps);\n\t\t\tif (!found.ok) return found;\n\t\t\tpaths.push(...found.value);\n\t\t}\n\t\treturn ok(paths);\n\t}\n\t#pathsOfMember(member, steps) {\n\t\tif (member.unlisted !== void 0) return member.unlisted.types.some((type) => this.#reaches(type)) ? notOk({ kind: member.unlisted.kind }) : ok([]);\n\t\tconst { holds } = member;\n\t\tif (holds === void 0) return ok([]);\n\t\tif (this.#groups.has(holds)) return this.#reaches(holds) ? notOk({\n\t\t\tkind: \"containsItself\",\n\t\t\ttype: this.#nodes.get(holds)?.name ?? holds\n\t\t}) : ok([]);\n\t\tif (this.#modelsWithVariants.has(holds)) throw new InternalError(`Embedded model \"${this.#nodes.get(holds)?.name ?? holds}\" has variants, which contract validation refuses`);\n\t\tconst memberSteps = [\n\t\t\t...steps,\n\t\t\t{\n\t\t\t\tkind: \"member\",\n\t\t\t\tname: member.storedName\n\t\t\t},\n\t\t\t...member.many ? [{ kind: \"wildcard\" }] : []\n\t\t];\n\t\tconst own = holds === this.#target ? [memberSteps] : [];\n\t\tconst nested = this.#pathsBelow(this.#nodes.get(holds)?.members ?? [], memberSteps);\n\t\treturn nested.ok ? ok([...own, ...nested.value]) : nested;\n\t}\n\t/** The places the documents of a root model or variant hold objects of the target type in its own fields and embed relations. */\n\tplacesOf(model, root) {\n\t\tconst places = [];\n\t\tfor (const member of modelMembers(model)) {\n\t\t\tconst found = this.#pathsOfMember(member, []);\n\t\t\tif (!found.ok) return notOk({\n\t\t\t\t...root,\n\t\t\t\tfield: member.storedName,\n\t\t\t\treach: found.failure\n\t\t\t});\n\t\t\tplaces.push(...found.value.map((steps) => ({\n\t\t\t\t...root,\n\t\t\t\tfield: member.storedName,\n\t\t\t\tsteps: steps.slice(1)\n\t\t\t})));\n\t\t}\n\t\treturn ok(places);\n\t}\n};\nfunction targetKey(type) {\n\treturn type.kind === \"valueObject\" ? valueObjectKey(type.valueObject) : modelKey(type.model.model);\n}\n/**\n* Finds every place a contract's documents hold objects of a value object or an embedded model: for each root field of a root model or variant, the steps from the field's value to each object, through value object fields and embed relations (a list step for a list), at any depth. Steps use stored names. A root field that holds the type through a value object or embedded model that contains itself, a union or a dictionary has no list of paths, and is the failure.\n*/\nfunction storedPlacesOf(contract) {\n\treturn (type) => {\n\t\tconst target = targetKey(type);\n\t\tconst places = [];\n\t\tfor (const namespaceId of Object.keys(contract.domain.namespaces)) {\n\t\t\tconst models = mongoModelsOf(contract.domain, namespaceId);\n\t\t\tconst walk = new PlaceWalk(contract, models, target);\n\t\t\tfor (const [name, model] of Object.entries(models)) {\n\t\t\t\tconst coordinate = {\n\t\t\t\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\t\t\t\tmodel: name\n\t\t\t\t};\n\t\t\t\tif (embeddingModelOf(contract.domain, coordinate) !== void 0) continue;\n\t\t\t\tconst collection = collectionOfModel(contract.domain, coordinate);\n\t\t\t\tif (collection === void 0) continue;\n\t\t\t\tconst found = walk.placesOf(model, {\n\t\t\t\t\tcollection,\n\t\t\t\t\tmodel: coordinate,\n\t\t\t\t\tvariant: selectedVariantOf(contract.domain, coordinate)\n\t\t\t\t});\n\t\t\t\tif (!found.ok) return found;\n\t\t\t\tplaces.push(...found.value);\n\t\t\t}\n\t\t}\n\t\treturn ok(places);\n\t};\n}\n//#endregion\n//#region src/core/migrations/mongo-stored-key-planning.ts\nfunction valueObjectChanges(fromContract, contract, statements) {\n\treturn valueObjectsWithCoordinates(fromContract.storage).flatMap(({ coordinate, valueObject }) => {\n\t\tconst destination = valueObjectAt(contract.storage, coordinate);\n\t\tif (destination === void 0) return [];\n\t\treturn Object.keys(valueObject.fields).flatMap((field) => {\n\t\t\tconst subject = {\n\t\t\t\tkind: \"valueObjectField\",\n\t\t\t\tnamespaceId: asNamespaceId(coordinate.namespaceId),\n\t\t\t\tvalueObject: coordinate.entityName,\n\t\t\t\tfield\n\t\t\t};\n\t\t\tconst type = {\n\t\t\t\tkind: \"valueObject\",\n\t\t\t\tvalueObject: coordinate\n\t\t\t};\n\t\t\tconst statement = statements.find((each) => each.entity === \"valueObjectField\" && each.from.namespaceId === subject.namespaceId && each.from.valueObject === subject.valueObject && each.from.field === field);\n\t\t\tif (statement !== void 0) return [{\n\t\t\t\ttype,\n\t\t\t\tsubject,\n\t\t\t\tfrom: field,\n\t\t\t\tto: statement.to.field,\n\t\t\t\tstatement\n\t\t\t}];\n\t\t\tconst takenByRename = statements.some((each) => each.entity === \"valueObjectField\" && each.from.namespaceId === subject.namespaceId && each.from.valueObject === subject.valueObject && each.from.field !== field && each.to.field === field);\n\t\t\treturn Object.hasOwn(destination.fields, field) && !takenByRename ? [] : [{\n\t\t\t\ttype,\n\t\t\t\tsubject,\n\t\t\t\tfrom: field,\n\t\t\t\tto: void 0,\n\t\t\t\tstatement: void 0\n\t\t\t}];\n\t\t});\n\t});\n}\nfunction sameModelAs(a, b) {\n\treturn a.namespaceId === b.namespaceId && a.model === b.model;\n}\nfunction sameField$2(a, b) {\n\treturn sameModelAs(a, b) && a.field === b.field;\n}\nfunction embeddedModelChanges(fromContract, contract, statements) {\n\treturn modelCoordinates(fromContract).flatMap((coordinate) => {\n\t\tif (embeddingModelOf(fromContract.domain, coordinate) === void 0) return [];\n\t\tif (embeddingModelOf(contract.domain, coordinate) === void 0) return [];\n\t\tconst origin = modelAt(fromContract, coordinate);\n\t\tconst destination = modelAt(contract, coordinate);\n\t\tif (origin === void 0 || destination === void 0) return [];\n\t\tconst kept = /* @__PURE__ */ new Set([...Object.values(ownStoredNamesOf(destination)), ...Object.values(ownEmbedStoredNamesOf(destination))]);\n\t\tconst type = {\n\t\t\tkind: \"embeddedModel\",\n\t\t\tmodel: coordinate\n\t\t};\n\t\tconst takenByRename = new Set(statements.flatMap((each) => {\n\t\t\tif (each.entity !== \"field\" || !sameModelAs(each.from, coordinate)) return [];\n\t\t\tconst from = Object.hasOwn(origin.fields, each.from.field) ? ownStoredNameOf(origin, each.from.field) : void 0;\n\t\t\tconst to = Object.hasOwn(destination.fields, each.to.field) ? ownStoredNameOf(destination, each.to.field) : void 0;\n\t\t\treturn to === void 0 || to === from ? [] : [to];\n\t\t}));\n\t\treturn Object.entries(ownStoredNamesOf(origin)).flatMap(([field, from]) => {\n\t\t\tconst subject = {\n\t\t\t\tkind: \"field\",\n\t\t\t\t...coordinate,\n\t\t\t\tfield\n\t\t\t};\n\t\t\tconst statement = statements.find((each) => each.entity === \"field\" && sameField$2(each.from, subject));\n\t\t\tif (statement !== void 0) {\n\t\t\t\tconst to = Object.hasOwn(destination.fields, statement.to.field) ? ownStoredNameOf(destination, statement.to.field) : void 0;\n\t\t\t\treturn to === void 0 || to === from ? [] : [{\n\t\t\t\t\ttype,\n\t\t\t\t\tsubject,\n\t\t\t\t\tfrom,\n\t\t\t\t\tto,\n\t\t\t\t\tstatement\n\t\t\t\t}];\n\t\t\t}\n\t\t\treturn kept.has(from) && !takenByRename.has(from) ? [] : [{\n\t\t\t\ttype,\n\t\t\t\tsubject,\n\t\t\t\tfrom,\n\t\t\t\tto: void 0,\n\t\t\t\tstatement: void 0\n\t\t\t}];\n\t\t});\n\t});\n}\n/** The field a key change is about, as a refusal names it. */\nfunction fieldText$2(change, contracts) {\n\treturn change.subject.kind === \"valueObjectField\" ? `value object field \"${valueObjectFieldStatementText(contracts.fromContract, change.subject)}\"` : `field \"${fieldStatementText(contracts.fromContract, change.subject)}\"`;\n}\nfunction refused$2(change, contracts, reason, why) {\n\tif (change.statement === void 0) return {\n\t\tkind: \"fieldRemovalRefused\",\n\t\tsummary: `Cannot remove ${fieldText$2(change, contracts)}: ${reason}`,\n\t\twhy: why(\"keep the field in the contract\")\n\t};\n\treturn {\n\t\tkind: \"statementRefused\",\n\t\tsummary: `Cannot ${describeMigrationStatement(change.statement, contracts.fromContract, contracts.contract)}: ${reason}`,\n\t\twhy: why(\"leave out this statement\"),\n\t\trefusedStatement: change.statement\n\t};\n}\nfunction placeText$1(place) {\n\treturn `field \"${place.field}\" of collection \"${place.collection}\"`;\n}\nfunction unlistedRefusal$2(change, place, contracts) {\n\tconst byHand = (advice) => `Rewrite ${placeText$1(place)} yourself, in a dataTransform operation of the migration.ts that migration plan writes or in mongosh, or ${advice}.`;\n\tif (place.reach.kind === \"containsItself\") return refused$2(change, contracts, `${placeText$1(place)} holds it inside \"${place.reach.type}\", which contains itself, so the documents can hold it at any depth`, (advice) => `The plan rewrites a key at every path from a field to its objects, and a type that contains itself has no last path. ${byHand(advice)}`);\n\treturn refused$2(change, contracts, `${placeText$1(place)} holds a ${place.reach.kind} of value objects`, (advice) => `The plan rewrites a key only in a field that holds a value object, a list of them, or an embedded model. ${byHand(advice)}`);\n}\nfunction unrewritableKeyRefusal(change, keys, contracts) {\n\tfor (const key of keys) {\n\t\tconst reason = unrewritableKeyReason(key);\n\t\tif (reason === void 0) continue;\n\t\treturn refused$2(change, contracts, `the stored name \"${key}\" cannot be rewritten`, (advice) => `${reason}, so the plan cannot rewrite the key. Rewrite it in the database yourself, or ${advice}.`);\n\t}\n\tif (change.to === void 0) return void 0;\n\tconst reason = unrewritableKeyReason(change.to);\n\treturn reason === void 0 ? void 0 : refused$2(change, contracts, `the stored name \"${change.to}\" cannot be written`, (advice) => `${reason}. Give the field a stored name without \".\" that does not start with \"$\", or ${advice}.`);\n}\nfunction rewriteKey(place, path) {\n\treturn JSON.stringify([\n\t\tplace.collection,\n\t\tplace.field,\n\t\tjsonPathText(path),\n\t\tplace.variant ?? null\n\t]);\n}\nfunction callOf$1(planned) {\n\tconst { change, place, path } = planned;\n\tconst at = {\n\t\tcollection: place.collection,\n\t\tfield: place.field,\n\t\tpath: jsonPathText(path)\n\t};\n\tconst filter = place.variant === void 0 ? {} : { filter: variantFilter(place.variant) };\n\treturn change.to === void 0 ? new RemoveStoredKeyCall({\n\t\t...at,\n\t\t...filter\n\t}) : new RenameStoredKeyCall({\n\t\t...at,\n\t\tto: change.to,\n\t\t...filter\n\t});\n}\nfunction plannedRewriteOf$1(planned, contracts) {\n\treturn {\n\t\tkind: planned.change.to === void 0 ? \"removeStoredKey\" : \"renameStoredKey\",\n\t\tcollection: planned.place.collection,\n\t\tfield: planned.place.field,\n\t\tvariant: planned.place.variant,\n\t\tmodel: planned.place.model,\n\t\tstoredKey: {\n\t\t\tkey: fieldText$2(planned.change, contracts),\n\t\t\ttogether: planned.models\n\t\t}\n\t};\n}\nfunction policyRefusal(change, place, policy, contracts) {\n\treturn refused$2(change, contracts, `collection \"${place.collection}\" has control policy \"${policy}\"`, () => \"Statements rename only collections, and fields of collections, whose control policy is \\\"managed\\\". Make the change in the database yourself and leave out this statement.\");\n}\nfunction rewriteCollectionOf(schema, name) {\n\tconst collection = schema.collection(name);\n\treturn {\n\t\ttimeSeries: collection?.options?.timeseries !== void 0,\n\t\tvalidator: collection?.validator?.jsonSchema\n\t};\n}\n/**\n* The key rewrites of the fields of value objects and embedded models a plan makes. A value object or embedded model of the origin is compared, field by field, with the one of the same name in the destination: a rename statement renames a field's key, and a field whose stored name the destination no longer has, which no statement renames, is removed, which the plan asks about. Each rewrite acts at every place the destination's documents hold the type, in a collection the plan keeps, with the destination's names on the path; renames run outer keys first. A rename in a collection whose control policy is not `managed` is refused, and a removal there is left out, as top-level removals are. With no origin contract, the removals are read from the two validators.\n*/\nfunction planStoredKeyRewrites(input) {\n\tconst { fromContract, contract } = input;\n\tif (fromContract === null) {\n\t\tconst removals = validatorKeyRemovals(input);\n\t\tconst refusals = removals.flatMap(({ call, key }) => rewriteRefusals({\n\t\t\tkind: \"removeStoredKey\",\n\t\t\tcollection: call.options.collection,\n\t\t\tfield: call.options.field,\n\t\t\tvariant: void 0,\n\t\t\tmodel: void 0,\n\t\t\tstoredKey: {\n\t\t\t\tkey: `key ${JSON.stringify(key)}`,\n\t\t\t\ttogether: []\n\t\t\t}\n\t\t}, contract, rewriteCollectionOf(input.schema, call.options.collection)));\n\t\treturn refusals.length > 0 ? notOk(dedupe(refusals)) : ok({\n\t\t\trenames: [],\n\t\t\tremovals: removals.map(({ key: _, ...removal }) => removal)\n\t\t});\n\t}\n\tconst contracts = {\n\t\tfromContract,\n\t\tcontract\n\t};\n\tconst changes = [...valueObjectChanges(fromContract, contract, input.statements), ...embeddedModelChanges(fromContract, contract, input.statements)];\n\tconst placesOf = storedPlacesOf(contract);\n\tconst conflicts = [];\n\tconst planned = /* @__PURE__ */ new Map();\n\tfor (const change of changes) {\n\t\tconst places = placesOf(change.type);\n\t\tif (!places.ok) {\n\t\t\tconflicts.push(unlistedRefusal$2(change, places.failure, contracts));\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const place of places.value) {\n\t\t\tif (input.schema.collection(place.collection) === void 0) continue;\n\t\t\tconst policy = collectionControlPolicy(contract, place.collection);\n\t\t\tif (policy !== \"managed\" && change.statement === void 0) continue;\n\t\t\tconst refusal = policy !== \"managed\" ? policyRefusal(change, place, policy, contracts) : unrewritableKeyRefusal(change, [\n\t\t\t\tplace.field,\n\t\t\t\t...place.steps.flatMap((step) => step.kind === \"member\" ? [step.name] : []),\n\t\t\t\tchange.from\n\t\t\t], contracts);\n\t\t\tif (refusal !== void 0) {\n\t\t\t\tconflicts.push(refusal);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst path = [...place.steps, {\n\t\t\t\tkind: \"member\",\n\t\t\t\tname: change.from\n\t\t\t}];\n\t\t\tconst key = JSON.stringify([rewriteKey(place, path), change.to ?? null]);\n\t\t\tconst known = planned.get(key);\n\t\t\tif (known !== void 0) {\n\t\t\t\tknown.models.push(place.model.model);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tplanned.set(key, {\n\t\t\t\tchange,\n\t\t\t\tplace,\n\t\t\t\tpath,\n\t\t\t\tmodels: [place.model.model]\n\t\t\t});\n\t\t}\n\t}\n\tfor (const each of planned.values()) conflicts.push(...rewriteRefusals(plannedRewriteOf$1(each, contracts), contract, rewriteCollectionOf(input.schema, each.place.collection)));\n\tif (conflicts.length > 0) return notOk(dedupe(conflicts));\n\tconst rewrites = [...planned.values()].map((each, order) => ({\n\t\teach,\n\t\torder\n\t})).sort((a, b) => a.each.path.length - b.each.path.length || a.order - b.order).map(({ each }) => ({\n\t\tcall: callOf$1(each),\n\t\tsubject: each.change.subject,\n\t\tstatement: each.change.statement,\n\t\tvariant: each.place.variant\n\t}));\n\treturn ok({\n\t\trenames: rewrites.flatMap(({ call, ...rewrite }) => call instanceof RenameStoredKeyCall ? [{\n\t\t\t...rewrite,\n\t\t\tcall\n\t\t}] : []),\n\t\tremovals: rewrites.flatMap(({ call, ...rewrite }) => call instanceof RemoveStoredKeyCall ? [{\n\t\t\t...rewrite,\n\t\t\tcall\n\t\t}] : [])\n\t});\n}\nfunction dedupe(conflicts) {\n\tconst seen = /* @__PURE__ */ new Set();\n\treturn conflicts.filter((conflict) => {\n\t\tconst key = JSON.stringify([\n\t\t\tconflict.kind,\n\t\t\tconflict.summary,\n\t\t\tconflict.why\n\t\t]);\n\t\tif (seen.has(key)) return false;\n\t\tseen.add(key);\n\t\treturn true;\n\t});\n}\nfunction isRecord$3(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/** The keys a validator's property schema declares for each object below its field, by the path to those objects. */\nfunction declaredKeys(schema, steps, found) {\n\tif (!isRecord$3(schema)) return;\n\tconst { properties, items } = schema;\n\tif (isRecord$3(properties)) {\n\t\tconst text = jsonPathText(steps);\n\t\tconst entry = found.get(text) ?? {\n\t\t\tsteps,\n\t\t\tkeys: /* @__PURE__ */ new Set()\n\t\t};\n\t\tfound.set(text, entry);\n\t\tfor (const [key, property] of Object.entries(properties)) {\n\t\t\tentry.keys.add(key);\n\t\t\tdeclaredKeys(property, [...steps, {\n\t\t\t\tkind: \"member\",\n\t\t\t\tname: key\n\t\t\t}], found);\n\t\t}\n\t}\n\tif (items !== void 0) declaredKeys(items, [...steps, { kind: \"wildcard\" }], found);\n\tfor (const branch of [schema[\"oneOf\"], schema[\"anyOf\"]].flat()) declaredKeys(branch, steps, found);\n}\n/** The keys each root field's objects are declared with, over every kind of document a validator describes. */\nfunction declaredKeysOf(jsonSchema) {\n\tconst byField = /* @__PURE__ */ new Map();\n\tfor (const shape of validatorDocumentShapesOf(jsonSchema)) for (const [field, schema] of Object.entries(shape.properties)) {\n\t\tconst found = byField.get(field) ?? /* @__PURE__ */ new Map();\n\t\tbyField.set(field, found);\n\t\tdeclaredKeys(schema, [], found);\n\t}\n\treturn byField;\n}\n/**\n* Without an origin contract, a key inside a root field is known removed when the origin validator declares it on the objects at a path and the destination validator declares those objects without it. It is named by its storage name, the collection, field and keys joined by dots.\n*/\nfunction validatorKeyRemovals(input) {\n\treturn input.schema.collections.flatMap((origin) => {\n\t\tconst collection = origin.name;\n\t\tif (collectionControlPolicy(input.contract, collection) !== \"managed\") return [];\n\t\tconst after = input.destination.collection(collection)?.validator?.jsonSchema;\n\t\tif (after === void 0 || origin.validator === void 0) return [];\n\t\tconst kept = declaredKeysOf(after);\n\t\treturn [...declaredKeysOf(origin.validator.jsonSchema)].flatMap(([field, objects]) => {\n\t\t\tconst keptObjects = kept.get(field);\n\t\t\tif (keptObjects === void 0 || unrewritableKeyReason(field) !== void 0) return [];\n\t\t\treturn [...objects].flatMap(([text, { steps, keys }]) => {\n\t\t\t\tconst keptKeys = keptObjects.get(text)?.keys;\n\t\t\t\tif (keptKeys === void 0) return [];\n\t\t\t\tconst members = steps.flatMap((step) => step.kind === \"member\" ? [step.name] : []);\n\t\t\t\tif (members.some((key) => unrewritableKeyReason(key) !== void 0)) return [];\n\t\t\t\treturn [...keys].filter((key) => !keptKeys.has(key) && unrewritableKeyReason(key) === void 0).sort().map((key) => ({\n\t\t\t\t\tcall: new RemoveStoredKeyCall({\n\t\t\t\t\t\tcollection,\n\t\t\t\t\t\tfield,\n\t\t\t\t\t\tpath: jsonPathText([...steps, {\n\t\t\t\t\t\t\tkind: \"member\",\n\t\t\t\t\t\t\tname: key\n\t\t\t\t\t\t}])\n\t\t\t\t\t}),\n\t\t\t\t\tsubject: {\n\t\t\t\t\t\tkind: \"storage\",\n\t\t\t\t\t\tname: [\n\t\t\t\t\t\t\tcollection,\n\t\t\t\t\t\t\tfield,\n\t\t\t\t\t\t\t...members,\n\t\t\t\t\t\t\tkey\n\t\t\t\t\t\t].join(\".\")\n\t\t\t\t\t},\n\t\t\t\t\tstatement: void 0,\n\t\t\t\t\tvariant: void 0,\n\t\t\t\t\tkey\n\t\t\t\t}));\n\t\t\t});\n\t\t});\n\t});\n}\n//#endregion\n//#region src/core/migrations/mongo-enum-value-planning.ts\nfunction sameValue(left, right) {\n\treturn JSON.stringify(left) === JSON.stringify(right);\n}\nfunction isStoredValue(value) {\n\treturn typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\";\n}\n/** Whether the field takes the enum's values: a model field names the enum, and a value object field its storage value set, which has the enum's name. */\nfunction typedBy(field, namespaceId, enumName) {\n\tconst ref = field.valueSet;\n\treturn ref !== void 0 && ref.spaceId === void 0 && ref.namespaceId === namespaceId && ref.entityName === enumName;\n}\nfunction isRequired(field) {\n\treturn !field.nullable && (field.many === void 0 || field.many === false);\n}\n/**\n* Every place the destination's documents hold values of the enum: each root field of a root model\n* or variant it types, and each key of a value object or an embedded model it types, at every path\n* the documents hold that type.\n*/\nfunction placesOfEnum(contract, namespaceId, enumName) {\n\tconst places = [];\n\tconst nestedTypes = [];\n\tfor (const coordinate of modelCoordinates(contract)) {\n\t\tconst model = mongoModelsOf(contract.domain, coordinate.namespaceId)[coordinate.model];\n\t\tif (model === void 0) continue;\n\t\tconst storedNames = ownStoredNamesOf(model);\n\t\tconst typed = Object.entries(model.fields).flatMap(([name, field]) => {\n\t\t\tconst storedName = storedNames[name];\n\t\t\treturn storedName !== void 0 && typedBy(field, namespaceId, enumName) ? [[storedName, field]] : [];\n\t\t});\n\t\tif (typed.length === 0) continue;\n\t\tif (embeddingModelOf(contract.domain, coordinate) !== void 0) {\n\t\t\tnestedTypes.push({\n\t\t\t\ttype: {\n\t\t\t\t\tkind: \"embeddedModel\",\n\t\t\t\t\tmodel: coordinate\n\t\t\t\t},\n\t\t\t\tfields: typed\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst collection = collectionOfModel(contract.domain, coordinate);\n\t\tif (collection === void 0) continue;\n\t\tconst variant = selectedVariantOf(contract.domain, coordinate);\n\t\tfor (const [storedName, field] of typed) places.push({\n\t\t\tplace: {\n\t\t\t\tcollection,\n\t\t\t\tfield: storedName,\n\t\t\t\tmodel: coordinate,\n\t\t\t\tvariant\n\t\t\t},\n\t\t\tpath: void 0,\n\t\t\tkeys: [storedName],\n\t\t\trequired: isRequired(field)\n\t\t});\n\t}\n\tfor (const { coordinate, valueObject } of valueObjectsWithCoordinates(contract.storage)) {\n\t\tconst storedNames = valueObjectStoredNamesOf(valueObject);\n\t\tconst typed = Object.entries(valueObject.fields).flatMap(([name, field]) => {\n\t\t\tconst storedName = storedNames[name];\n\t\t\treturn storedName !== void 0 && typedBy(field, namespaceId, enumName) ? [[storedName, field]] : [];\n\t\t});\n\t\tif (typed.length > 0) nestedTypes.push({\n\t\t\ttype: {\n\t\t\t\tkind: \"valueObject\",\n\t\t\t\tvalueObject: coordinate\n\t\t\t},\n\t\t\tfields: typed\n\t\t});\n\t}\n\tconst placesOf = storedPlacesOf(contract);\n\tfor (const { type, fields } of nestedTypes) {\n\t\tconst found = placesOf(type);\n\t\tif (!found.ok) return notOk(found.failure);\n\t\tfor (const { steps, ...place } of found.value) for (const [storedName, field] of fields) {\n\t\t\tconst path = [...steps, {\n\t\t\t\tkind: \"member\",\n\t\t\t\tname: storedName\n\t\t\t}];\n\t\t\tplaces.push({\n\t\t\t\tplace,\n\t\t\t\tpath: jsonPathText(path),\n\t\t\t\tkeys: [place.field, ...path.flatMap((step) => step.kind === \"member\" ? [step.name] : [])],\n\t\t\t\trequired: isRequired(field)\n\t\t\t});\n\t\t}\n\t}\n\treturn ok(places);\n}\n/**\n* What changes for each member of the origin enum, as SQL compares enums: a rename statement gives\n* a member the stored value of the member it names; a member the destination has under the same\n* name takes that member's stored value; a member the destination lacks is kept when the\n* destination still stores its value, and otherwise its value is removed.\n*/\nfunction valueChanges(enums, enumValueOf, statementOf) {\n\treturn enums.originEnum.members.flatMap((member) => {\n\t\tconst enumValue = enumValueOf(member.name);\n\t\tconst statement = statementOf(member.name);\n\t\tconst named = statement?.to.member ?? member.name;\n\t\tconst target = enums.destinationEnum.members.find(({ name }) => name === named);\n\t\tif (target !== void 0) return sameValue(target.value, member.value) ? [] : [{\n\t\t\tenumValue,\n\t\t\tfrom: member.value,\n\t\t\tto: target.value,\n\t\t\tstatement\n\t\t}];\n\t\tif (statement !== void 0) return [];\n\t\tif (enums.destinationEnum.members.some(({ value }) => sameValue(value, member.value))) return [];\n\t\treturn [{\n\t\t\tenumValue,\n\t\t\tfrom: member.value,\n\t\t\tto: void 0,\n\t\t\tstatement: void 0\n\t\t}];\n\t});\n}\n/**\n* The changes of an enum whose new value another change reads, or whose old value another change\n* writes: swaps and chains. A removal among them cannot keep its data with a replacement in the\n* same migration, which the plan would refuse.\n*/\nfunction overlappingChanges(changes) {\n\tconst replacing = changes.filter((change) => change.to !== void 0);\n\treturn replacing.filter((change) => replacing.some((other) => other !== change && (other.to !== void 0 && sameValue(other.to, change.from) || change.to !== void 0 && sameValue(change.to, other.from))));\n}\nfunction isBooleanEnum(enums) {\n\treturn enums.originEnum.members.some(({ value }) => typeof value === \"boolean\");\n}\nconst NO_THIRD_BOOLEAN = \"A boolean enum has no third value to move a stored value to, so the change cannot be split into two steps.\";\nconst SWAP_IN_ONE_UPDATE = \"swap the stored values yourself in one update of the database, such as an updateMany whose pipeline sets each field that holds the enum to its negation with $not\";\nfunction twoMigrationsAdvice(enums, changes) {\n\tif (isBooleanEnum(enums)) return `${NO_THIRD_BOOLEAN} To keep that data, plan the change with migration plan, remove the removeStoredValue calls of this enum from the migration.ts it writes, and ${SWAP_IN_ONE_UPDATE}, before you apply it.`;\n\tconst names = changes.map(({ enumValue }) => `\"${enumValueStatementText(enums.fromContract, enumValue)}\"`);\n\treturn `To keep that data: ${inTwoSteps(`move the stored values of ${names.length === 1 ? `enum value ${names.join(\"\")}` : `enum values ${names.slice(0, -1).join(\", \")} and ${names.at(-1)}`} to values the enum does not use`, \"move them to their final values\")} MongoDB applies the operations one at a time, so replacements whose old values other replacements write cannot safely run again after a later operation stops.`;\n}\n/** How to make a change of the enum's stored values that one migration cannot make safely. */\nfunction enumTwoMigrationsAdvice(enums) {\n\treturn isBooleanEnum(enums) ? `${NO_THIRD_BOOLEAN} Leave out these statements, plan the change with migration plan, remove the removeStoredValue calls of this enum from the migration.ts it writes, and ${SWAP_IN_ONE_UPDATE}, before you apply it.` : inTwoSteps(\"move every value they swap or chain to a stored value the enum does not use\", \"move them to their final values\");\n}\n/** The expression that writes a stored value with the BSON type the enum's codec stores. */\nfunction valueExpression(value, bsonTypes) {\n\tif (typeof value === \"string\") return { $literal: value };\n\tif (typeof value === \"boolean\") return value;\n\tif (bsonTypes.includes(\"double\")) return { $toDouble: value };\n\tif (bsonTypes.includes(\"long\")) return { $toLong: value };\n\tif (bsonTypes.includes(\"decimal\")) return { $toDecimal: String(value) };\n\treturn value;\n}\nfunction enumValueText(contract, value) {\n\treturn `enum value \"${enumValueStatementText(contract, value)}\"`;\n}\nfunction refused$1(enums, change, reason, why) {\n\tconst { statement } = change;\n\tif (statement === void 0) return {\n\t\tkind: \"fieldRemovalRefused\",\n\t\tsummary: `Cannot remove ${enumValueText(enums.fromContract, change.enumValue)}: ${reason}`,\n\t\twhy\n\t};\n\treturn {\n\t\tkind: \"statementRefused\",\n\t\tsummary: `Cannot rename ${enumValueText(enums.fromContract, statement.from)} to \"${enumValueStatementText(enums.contract, statement.to)}\": ${reason}`,\n\t\twhy,\n\t\trefusedStatement: statement\n\t};\n}\nfunction unsupportedValueRefusal(enums, change, stored) {\n\treturn refused$1(enums, change, `its stored value ${JSON.stringify(stored)} is not a string, a number or a boolean`, `The plan matches stored enum values by equality, and MongoDB's equality on an object depends on the order of its keys and on a list matches lists that contain it. Rewrite the documents that hold ${enumValueText(enums.fromContract, change.enumValue)} yourself, in a dataTransform operation of the migration.ts that migration plan writes or in mongosh, then run the command again.`);\n}\nfunction stillStoredRefusal(enums, statement, stored, holder) {\n\tconst holderText = enumValueStatementText(enums.contract, {\n\t\t...statement.to,\n\t\tmember: holder\n\t});\n\treturn refused$1(enums, {\n\t\tenumValue: statement.from,\n\t\tstatement\n\t}, `the destination enum still stores ${JSON.stringify(stored)}, as enum value \"${holderText}\"`, `A rename changes the stored value in every document that holds it, so the documents that hold ${JSON.stringify(stored)} for \"${holderText}\" would change too. Leave out this statement.`);\n}\n/**\n* For a member that keeps its name and takes the stored value of an origin member the destination no longer has: the plan cannot tell whether that member is gone, so it says how to name the member it became. The member it suggests is the destination's only new member that no rename names, as the question picks it.\n*/\nfunction takenValueAdvice(enums, enumValue, to, holder, renamedTo) {\n\tconst { originEnum, destinationEnum } = enums;\n\tif (holder === void 0 || destinationEnum.members.some(({ name }) => name === holder)) return;\n\tconst added = destinationEnum.members.filter(({ name }) => !renamedTo.includes(name) && !originEnum.members.some((member) => member.name === name));\n\tconst [only] = added;\n\tif (only === void 0) return void 0;\n\tconst holderText = enumValueStatementText(enums.fromContract, {\n\t\t...enumValue,\n\t\tmember: holder\n\t});\n\tconst lead = `Its new stored value ${JSON.stringify(to)} was the stored value of enum value \"${holderText}\", which the enum no longer has.`;\n\tconst ask = \"and the next question says how to keep the data of both.\";\n\tconst memberText = (member) => enumValueStatementText(enums.contract, {\n\t\t...enumValue,\n\t\tmember\n\t});\n\tconst rename = (member) => statementFlag(\"rename\", `${holderText}:${memberText(member)}`);\n\tif (added.length > 1) return `${lead} If \"${holderText}\" is now another member, add ${rename(\"<new member>\")}, ${ask}`;\n\treturn `${lead} If \"${holderText}\" is now \"${memberText(only.name)}\", add ${rename(only.name)}, ${ask}`;\n}\nfunction mergingRefusal(enums, statement, from, to, holder) {\n\tconst holderText = enumValueStatementText(enums.fromContract, {\n\t\t...statement.from,\n\t\tmember: holder\n\t});\n\treturn refused$1(enums, {\n\t\tenumValue: statement.from,\n\t\tstatement\n\t}, `the origin enum already stores ${JSON.stringify(to)}, as enum value \"${holderText}\"`, `A rename changes ${JSON.stringify(from)} to ${JSON.stringify(to)} in every document that holds it, which merges its data with the data of \"${holderText}\". Leave out this statement. To merge them on purpose, plan the change with migration plan and write replaceStoredValue(...) in the migration.ts it writes.`);\n}\nfunction unlistedRefusal$1(enums, change, unlisted) {\n\tconst where = `field \"${unlisted.field}\" of collection \"${unlisted.collection}\"`;\n\treturn unlisted.reach.kind === \"containsItself\" ? refused$1(enums, change, `${where} holds it inside \"${unlisted.reach.type}\", which contains itself, so the documents can hold it at any depth`, `The plan rewrites a stored value at every path from a field to it, and a type that contains itself has no last path. Rewrite ${where} yourself, in a dataTransform operation of the migration.ts that migration plan writes or in mongosh.`) : refused$1(enums, change, `${where} holds a ${unlisted.reach.kind} of value objects`, `The plan rewrites a stored value only in a field that holds it, a value object, a list of them, or an embedded model. Rewrite ${where} yourself, in a dataTransform operation of the migration.ts that migration plan writes or in mongosh.`);\n}\n/**\n* The rewrites of stored enum values a plan makes, as SQL plans them. Enums are compared by the\n* stored value of each member (see `valueChanges`). A changed value is rewritten at every place the\n* destination's documents hold the enum: a rename statement replaces it, and any other change\n* removes it, which the plan asks about, with the replacements that would keep its data. Rename\n* statements that merge two values, or leave a value another member stores, are refused; the\n* planner refuses swaps and chains for the whole plan (see `overlapRefusal`). A rename in a\n* collection whose control policy is not `managed` is refused, and a removal there is left out. With\n* no origin contract, nothing is known to have changed.\n*/\nfunction planEnumValueRewrites(input) {\n\tconst { fromContract, contract } = input;\n\tif (fromContract === null) return ok({\n\t\treplacements: [],\n\t\tremovals: []\n\t});\n\tconst valueRenames = input.statements.filter((statement) => statement.entity === \"enumValue\");\n\tconst replacements = [];\n\tconst removals = [];\n\tconst conflicts = [];\n\tfor (const [namespaceId, namespace] of Object.entries(fromContract.domain?.namespaces ?? {})) for (const [enumName, originEnum] of Object.entries(namespace.enum ?? {})) {\n\t\tconst destinationEnum = contract.domain?.namespaces[namespaceId]?.enum?.[enumName];\n\t\tif (destinationEnum === void 0) continue;\n\t\tconst found = planEnum({\n\t\t\tfromContract,\n\t\t\tcontract,\n\t\t\toriginEnum,\n\t\t\tdestinationEnum\n\t\t}, namespaceId, enumName, valueRenames, input);\n\t\tif (!found.ok) {\n\t\t\tconflicts.push(...found.failure);\n\t\t\tcontinue;\n\t\t}\n\t\treplacements.push(...found.value.replacements);\n\t\tremovals.push(...found.value.removals);\n\t}\n\treturn conflicts.length > 0 ? notOk(conflicts) : ok({\n\t\treplacements,\n\t\tremovals\n\t});\n}\nfunction planEnum(enums, namespaceId, enumName, valueRenames, input) {\n\tconst { originEnum, destinationEnum, contract } = enums;\n\tconst raw = valueChanges(enums, (member) => ({\n\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\tenum: enumName,\n\t\tmember\n\t}), (member) => valueRenames.find((rename) => rename.from.namespaceId === namespaceId && rename.from.enum === enumName && rename.from.member === member));\n\tconst checked = [];\n\tfor (const change of raw) {\n\t\tif (!isStoredValue(change.from)) return notOk([unsupportedValueRefusal(enums, change, change.from)]);\n\t\tif (change.to !== void 0 && !isStoredValue(change.to)) return notOk([unsupportedValueRefusal(enums, change, change.to)]);\n\t\tchecked.push({\n\t\t\t...change,\n\t\t\tfrom: change.from,\n\t\t\tto: change.to\n\t\t});\n\t}\n\tconst changedFrom = (value) => checked.some(({ from }) => sameValue(from, value));\n\tconst changedTo = (value) => checked.some(({ to }) => to !== void 0 && sameValue(to, value));\n\tconst merging = (to) => originEnum.members.find(({ value }) => sameValue(value, to) && !changedFrom(value));\n\tfor (const { statement, from, to } of checked) {\n\t\tif (statement === void 0 || to === void 0) continue;\n\t\tconst holder = destinationEnum.members.find(({ value }) => sameValue(value, from));\n\t\tif (holder !== void 0 && !changedTo(from)) return notOk([stillStoredRefusal(enums, statement, from, holder.name)]);\n\t\tconst merged = merging(to);\n\t\tif (merged !== void 0) return notOk([mergingRefusal(enums, statement, from, to, merged.name)]);\n\t}\n\tif (checked.length === 0) return ok({\n\t\treplacements: [],\n\t\tremovals: []\n\t});\n\tconst overlapping = overlappingChanges(checked);\n\tconst advice = enumTwoMigrationsAdvice(enums);\n\tconst places = placesOfEnum(contract, namespaceId, enumName);\n\tif (!places.ok) {\n\t\tconst [first] = checked;\n\t\treturn first === void 0 ? ok({\n\t\t\treplacements: [],\n\t\t\tremovals: []\n\t\t}) : notOk([unlistedRefusal$1(enums, checked.find((change) => change.statement !== void 0) ?? first, places.failure)]);\n\t}\n\tconst live = places.value.filter(({ place }) => input.schema.collection(place.collection) !== void 0);\n\tconst conflicts = placeRefusals(enums, checked, live, input);\n\tif (conflicts.length > 0) return notOk(conflicts);\n\tconst bsonTypes = bsonTypesOfCodec(destinationEnum.codecId, input.lookups) ?? [];\n\tconst replacements = [];\n\tconst removals = [];\n\tfor (const change of checked) {\n\t\tconst keepsDataBy = change.statement !== void 0 || change.to === void 0 || merging(change.to) !== void 0 ? void 0 : overlapping.includes(change) ? \"advice\" : \"edit\";\n\t\tconst removalAdvice = keepsDataBy === \"advice\" ? twoMigrationsAdvice(enums, overlapping) : change.statement === void 0 && change.to !== void 0 ? takenValueAdvice(enums, change.enumValue, change.to, merging(change.to)?.name, valueRenames.flatMap((statement) => statement.to.enum === enumName && statement.to.namespaceId === namespaceId ? [statement.to.member] : [])) : void 0;\n\t\tfor (const enumPlace of live) {\n\t\t\tif (collectionControlPolicy(contract, enumPlace.place.collection) !== \"managed\") continue;\n\t\t\tconst at = {\n\t\t\t\tcollection: enumPlace.place.collection,\n\t\t\t\tfield: enumPlace.place.field,\n\t\t\t\t...enumPlace.path === void 0 ? {} : { path: enumPlace.path },\n\t\t\t\t...enumPlace.place.variant === void 0 ? {} : { filter: variantFilter(enumPlace.place.variant) }\n\t\t\t};\n\t\t\tconst replacementCall = (to) => new ReplaceStoredValueCall({\n\t\t\t\t...at,\n\t\t\t\tfrom: change.from,\n\t\t\t\tto: valueExpression(to, bsonTypes)\n\t\t\t});\n\t\t\tif (change.statement !== void 0 && change.to !== void 0) {\n\t\t\t\treplacements.push({\n\t\t\t\t\tcall: replacementCall(change.to),\n\t\t\t\t\tenumValue: change.enumValue,\n\t\t\t\t\tstatement: change.statement,\n\t\t\t\t\tkeepDataEdit: void 0,\n\t\t\t\t\tkeepDataAdvice: void 0,\n\t\t\t\t\ttwoMigrationsAdvice: advice,\n\t\t\t\t\twrittenValue: change.to,\n\t\t\t\t\tvariant: enumPlace.place.variant\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst call = new RemoveStoredValueCall({\n\t\t\t\t...at,\n\t\t\t\tvalue: change.from,\n\t\t\t\t...enumPlace.required ? { required: true } : {},\n\t\t\t\tenumValue: enumValueCoordinateJson(change.enumValue)\n\t\t\t}, { importsReplacement: keepsDataBy === \"edit\" || enumPlace.required });\n\t\t\tremovals.push({\n\t\t\t\tcall,\n\t\t\t\tenumValue: change.enumValue,\n\t\t\t\tstatement: void 0,\n\t\t\t\tkeepDataEdit: keepsDataBy === \"edit\" && change.to !== void 0 ? {\n\t\t\t\t\tremove: callInSentence(call),\n\t\t\t\t\treplaceWith: callInSentence(replacementCall(change.to))\n\t\t\t\t} : void 0,\n\t\t\t\tkeepDataAdvice: removalAdvice,\n\t\t\t\ttwoMigrationsAdvice: advice,\n\t\t\t\tvariant: enumPlace.place.variant\n\t\t\t});\n\t\t}\n\t}\n\treturn ok({\n\t\treplacements,\n\t\tremovals\n\t});\n}\n/** The refusals of the places a change rewrites: keys MongoDB cannot rewrite, unmanaged collections for a rename, time-series and shared collections. */\nfunction placeRefusals(enums, changes, places, input) {\n\tconst conflicts = [];\n\tconst seen = /* @__PURE__ */ new Set();\n\tconst push = (conflict) => {\n\t\tconst key = JSON.stringify([conflict.kind, conflict.summary]);\n\t\tif (seen.has(key)) return;\n\t\tseen.add(key);\n\t\tconflicts.push(conflict);\n\t};\n\tfor (const change of changes) {\n\t\tconst kind = change.statement === void 0 ? \"removeStoredValue\" : \"replaceStoredValue\";\n\t\tfor (const { place, keys } of places) {\n\t\t\tconst policy = collectionControlPolicy(input.contract, place.collection);\n\t\t\tif (policy !== \"managed\") {\n\t\t\t\tif (change.statement !== void 0) push(refused$1(enums, change, `collection \"${place.collection}\" has control policy \"${policy}\"`, \"Statements rename only collections, and fields of collections, whose control policy is \\\"managed\\\". Make the change in the database yourself and leave out this statement.\"));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst unrewritable = keys.find((key) => unrewritableKeyReason(key) !== void 0);\n\t\t\tif (unrewritable !== void 0) {\n\t\t\t\tpush(refused$1(enums, change, `the stored name \"${unrewritable}\" cannot be rewritten`, `${unrewritableKeyReason(unrewritable)}, so the plan cannot rewrite the value there. Rewrite it in the database yourself, or ${change.statement === void 0 ? \"keep the enum value in the contract\" : \"leave out this statement\"}.`));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfor (const conflict of rewriteRefusals({\n\t\t\t\tkind,\n\t\t\t\tcollection: place.collection,\n\t\t\t\tfield: place.field,\n\t\t\t\tvariant: place.variant,\n\t\t\t\tmodel: place.model,\n\t\t\t\tstoredKey: {\n\t\t\t\t\tkey: enumValueText(enums.fromContract, change.enumValue),\n\t\t\t\t\ttogether: []\n\t\t\t\t}\n\t\t\t}, input.contract, rewriteCollectionOf(input.schema, place.collection))) push(change.statement === void 0 ? conflict : {\n\t\t\t\t...conflict,\n\t\t\t\trefusedStatement: change.statement\n\t\t\t});\n\t\t}\n\t}\n\treturn conflicts;\n}\n//#endregion\n//#region src/core/migrations/mongo-discriminator-renames.ts\n/**\n* The rename that gives a destination base's discriminator the values of its origin's, when the\n* origin's discriminator field is gone from the destination and no rename moves it elsewhere.\n*/\nfunction discriminatorRenameOf(origin, destination, contracts) {\n\tconst from = origin === void 0 ? void 0 : modelAt(contracts.fromContract, origin);\n\tconst to = modelAt(contracts.contract, destination);\n\tconst oldField = from?.discriminator?.field;\n\tconst newField = to?.discriminator?.field;\n\tif (origin === void 0 || to === void 0 || oldField === void 0 || newField === void 0) return void 0;\n\tconst movedElsewhere = contracts.statements.some((statement) => statement.kind === \"rename\" && statement.entity === \"field\" && statement.from.namespaceId === origin.namespaceId && statement.from.model === origin.model && statement.from.field === oldField);\n\tif (oldField === newField || Object.hasOwn(to.fields, oldField) || movedElsewhere) return void 0;\n\tconst text = fieldStatementText(contracts.contract, {\n\t\t...destination,\n\t\tfield: oldField\n\t});\n\tconst baseRenamed = origin.namespaceId !== destination.namespaceId || origin.model !== destination.model;\n\tconst baseRenameStated = contracts.statements.some((statement) => statement.kind === \"rename\" && statement.entity === \"model\" && statement.from.namespaceId === origin.namespaceId && statement.from.model === origin.model);\n\tconst fieldRename = statementFlag(\"rename\", `${text}:${fieldStatementText(contracts.contract, {\n\t\t...destination,\n\t\tfield: newField\n\t})}`);\n\treturn {\n\t\tfrom: fieldStatementText(contracts.fromContract, {\n\t\t\t...origin,\n\t\t\tfield: oldField\n\t\t}),\n\t\tflags: baseRenamed && !baseRenameStated ? `${statementFlag(\"rename\", `${modelStatementText(contracts.fromContract, origin)}:${modelStatementText(contracts.contract, destination)}`)} ${fieldRename}` : fieldRename\n\t};\n}\n//#endregion\n//#region src/core/migrations/mongo-field-fills.ts\nconst EMPTY_LIST = {\n\texpression: [],\n\ttext: \"[]\"\n};\n/** The temporary value of a field's type: an empty list for any list, and for a scalar the one its codec declares. A value object, an enum or a dictionary has none. */\nfunction temporaryValueOf(field, lookups) {\n\tif (field.many !== void 0 && field.many !== false) return EMPTY_LIST;\n\tif (field.type.kind !== \"scalar\" || field.valueSet !== void 0 || field.dict === true) return;\n\treturn temporaryValueOfCodec(field.type.codecId, lookups);\n}\nfunction backfilled(statements, field) {\n\treturn statements.some((statement) => statement.kind === \"backfill\" && statement.entity === \"field\" && statement.field.namespaceId === field.namespaceId && statement.field.model === field.model && statement.field.field === field.field);\n}\n/** Whether the origin stored the field: in the origin model, unless a rename moves the origin's field of that name away, or, without an origin contract, in the origin validator. */\nfunction inOrigin(input, field, collection, storedName) {\n\tif (input.match === void 0) {\n\t\tconst validator = input.schema.collection(collection)?.validator;\n\t\treturn validator === void 0 || validatorFieldNamesOf(validator.jsonSchema).has(storedName);\n\t}\n\tconst origin = originModelOf(field, input.match);\n\tconst model = origin === void 0 ? void 0 : modelAt(input.match.fromContract, origin);\n\tif (origin === void 0 || model === void 0) return true;\n\tconst originField = originFieldOf(field, input.match.statements);\n\treturn !(destinationFieldOf({\n\t\t...origin,\n\t\tfield: originField\n\t}, input.match.statements) !== field.field) && (Object.hasOwn(model.fields, originField) || storedFieldsKeptOf(input.match, origin).has(storedName));\n}\n/** Whether a unique index covers the field, so that one value in every document would break it. */\nfunction underUniqueIndex$1(destination, collection, storedName) {\n\treturn (destination.collection(collection)?.indexes ?? []).some((index) => index.unique && index.keys.some((key) => key.field === storedName));\n}\n/**\n* The refusal of a new required discriminator whose values the documents hold in the origin's\n* discriminator, which the plan removes: a temporary value names no variant, and only a rename of\n* the old discriminator keeps each document's variant. `undefined` when the destination has no such\n* rename to offer, such as for a base's first discriminator; the validator change then checks the\n* documents.\n*/\nfunction newDiscriminatorRefusal(input, model, field, collection) {\n\tconst rename = input.match === void 0 ? void 0 : discriminatorRenameOf(originModelOf(model, input.match), model, {\n\t\tfromContract: input.match.fromContract,\n\t\tcontract: input.contract,\n\t\tstatements: input.statements\n\t});\n\tif (rename === void 0) return void 0;\n\treturn {\n\t\tkind: \"unsupportedOperation\",\n\t\tsummary: `Cannot plan the migration: new discriminator field \"${fieldStatementText(input.contract, {\n\t\t\t...model,\n\t\t\tfield\n\t\t})}\" has no value in the documents of collection ${collection}`,\n\t\twhy: `A document's discriminator value says which variant it is, and no temporary value names a variant, so the plan does not fill the field. The documents hold their variant in \"${rename.from}\", which the plan removes: add ${rename.flags} to keep it, and run the command again.`\n\t};\n}\n/**\n* Each required field of the destination that is new on a collection the plan keeps, with the\n* temporary value its type declares, unless a `--backfill` statement names it. A field whose type\n* declares none, or that a unique index covers, is left to the validator change's document check,\n* and so is a new discriminator, since a temporary value would leave every document matched by no\n* variant; when the documents hold their variants in an old discriminator the plan removes, the\n* plan is refused instead, offering its rename.\n*/\nfunction planFieldFills(input) {\n\tconst refusals = [];\n\tconst fills = modelCoordinates(input.contract).flatMap((model) => {\n\t\tconst definition = modelAt(input.contract, model);\n\t\tconst collection = collectionOfModel(input.contract.domain, model);\n\t\tif (definition === void 0 || collection === void 0 || embeddingModelOf(input.contract.domain, model) !== void 0) return [];\n\t\tif (input.schema.collection(collection) === void 0) return [];\n\t\tif (collectionControlPolicy(input.contract, collection) !== \"managed\") return [];\n\t\treturn Object.entries(definition.fields).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).flatMap(([field, contractField]) => {\n\t\t\tconst coordinate = {\n\t\t\t\t...model,\n\t\t\t\tfield\n\t\t\t};\n\t\t\tconst storedName = ownStoredNameOf(definition, field);\n\t\t\tif (contractField.nullable || unrewritableFieldNameReason(storedName) !== void 0) return [];\n\t\t\tif (backfilled(input.statements, coordinate)) return [];\n\t\t\tif (inOrigin(input, coordinate, collection, storedName)) return [];\n\t\t\tif (definition.discriminator?.field === field) {\n\t\t\t\tconst refusal = newDiscriminatorRefusal(input, model, field, collection);\n\t\t\t\tif (refusal !== void 0) refusals.push(refusal);\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tif (underUniqueIndex$1(input.destination, collection, storedName)) return [];\n\t\t\tconst value = temporaryValueOf(contractField, input.lookups);\n\t\t\tif (value === void 0) return [];\n\t\t\tconst variant = selectedVariantOf(input.contract.domain, model);\n\t\t\treturn [{\n\t\t\t\tcall: new FillFieldCall({\n\t\t\t\t\tcollection,\n\t\t\t\t\tfield: storedName,\n\t\t\t\t\tvalue: value.expression,\n\t\t\t\t\t...variant === void 0 ? {} : { filter: variantFilter(variant) }\n\t\t\t\t}),\n\t\t\t\tsubject: {\n\t\t\t\t\tkind: \"field\",\n\t\t\t\t\t...coordinate\n\t\t\t\t},\n\t\t\t\ttext: value.text,\n\t\t\t\tvariant\n\t\t\t}];\n\t\t});\n\t});\n\treturn refusals.length > 0 ? notOk(refusals) : ok(fills);\n}\n//#endregion\n//#region src/core/migrations/mongo-stored-key-fills.ts\nfunction byName([a], [b]) {\n\treturn a < b ? -1 : a > b ? 1 : 0;\n}\nfunction sameValueObjectField(a, b) {\n\treturn a.namespaceId === b.namespaceId && a.valueObject === b.valueObject && a.field === b.field;\n}\nfunction sameField$1(a, b) {\n\treturn a.namespaceId === b.namespaceId && a.model === b.model && a.field === b.field;\n}\n/**\n* The name the origin gives a destination field: the field a rename statement renames to it, else\n* the field of the same name, unless a rename statement moves that field away, which makes the\n* destination's field a new one.\n*/\nfunction originNameOf(name, renamedTo, movedAway) {\n\tif (renamedTo !== void 0) return renamedTo.from.field;\n\treturn movedAway ? void 0 : name;\n}\n/** Whether a field is new to the destination, or was optional in the origin. */\nfunction newlyRequired(field, origin) {\n\treturn !field.nullable && (origin === void 0 || origin.nullable);\n}\nfunction valueObjectFields(fromContract, contract, statements) {\n\treturn valueObjectsWithCoordinates(contract.storage).flatMap(({ coordinate, valueObject }) => {\n\t\tconst origin = valueObjectAt(fromContract.storage, coordinate);\n\t\tif (origin === void 0) return [];\n\t\treturn Object.entries(valueObject.fields).sort(byName).flatMap(([name, field]) => {\n\t\t\tconst subject = {\n\t\t\t\tkind: \"valueObjectField\",\n\t\t\t\tnamespaceId: asNamespaceId(coordinate.namespaceId),\n\t\t\t\tvalueObject: coordinate.entityName,\n\t\t\t\tfield: name\n\t\t\t};\n\t\t\tconst renames = statements.filter((statement) => statement.kind === \"rename\" && statement.entity === \"valueObjectField\");\n\t\t\tconst originName = originNameOf(name, renames.find((rename) => sameValueObjectField(rename.to, subject)), renames.some((rename) => sameValueObjectField(rename.from, subject)));\n\t\t\tconst originField = originName !== void 0 && Object.hasOwn(origin.fields, originName) ? origin.fields[originName] : void 0;\n\t\t\tif (!newlyRequired(field, originField)) return [];\n\t\t\treturn [{\n\t\t\t\ttype: {\n\t\t\t\t\tkind: \"valueObject\",\n\t\t\t\t\tvalueObject: coordinate\n\t\t\t\t},\n\t\t\t\tsubject,\n\t\t\t\tkey: name,\n\t\t\t\tfield,\n\t\t\t\tisNew: originField === void 0,\n\t\t\t\tstatement: statements.find((statement) => statement.kind === \"backfill\" && statement.entity === \"valueObjectField\" && sameValueObjectField(statement.field, subject))\n\t\t\t}];\n\t\t});\n\t});\n}\nfunction embeddedModelFields(fromContract, contract, statements) {\n\treturn modelCoordinates(contract).flatMap((coordinate) => {\n\t\tif (embeddingModelOf(contract.domain, coordinate) === void 0) return [];\n\t\tif (embeddingModelOf(fromContract.domain, coordinate) === void 0) return [];\n\t\tconst origin = modelAt(fromContract, coordinate);\n\t\tconst destination = modelAt(contract, coordinate);\n\t\tif (origin === void 0 || destination === void 0) return [];\n\t\treturn Object.entries(destination.fields).sort(byName).flatMap(([name, field]) => {\n\t\t\tconst subject = {\n\t\t\t\tkind: \"field\",\n\t\t\t\t...coordinate,\n\t\t\t\tfield: name\n\t\t\t};\n\t\t\tconst renames = statements.filter((statement) => statement.kind === \"rename\" && statement.entity === \"field\");\n\t\t\tconst originName = originNameOf(name, renames.find((rename) => sameField$1(rename.to, subject)), renames.some((rename) => sameField$1(rename.from, subject)));\n\t\t\tconst originField = originName !== void 0 && Object.hasOwn(origin.fields, originName) ? origin.fields[originName] : void 0;\n\t\t\tif (!newlyRequired(field, originField)) return [];\n\t\t\treturn [{\n\t\t\t\ttype: {\n\t\t\t\t\tkind: \"embeddedModel\",\n\t\t\t\t\tmodel: coordinate\n\t\t\t\t},\n\t\t\t\tsubject,\n\t\t\t\tkey: ownStoredNameOf(destination, name),\n\t\t\t\tfield,\n\t\t\t\tisNew: originField === void 0,\n\t\t\t\tstatement: statements.find((statement) => statement.kind === \"backfill\" && statement.entity === \"field\" && sameField$1(statement.field, subject))\n\t\t\t}];\n\t\t});\n\t});\n}\n/** The backfill statements of fields inside a field's value: of a value object field, or of a field of an embedded model. */\nfunction nestedBackfills(statements, contract) {\n\treturn statements.filter((statement) => statement.kind === \"backfill\" && (statement.entity === \"valueObjectField\" || embeddingModelOf(contract.domain, statement.field) !== void 0));\n}\n/** The field a fill is about, as a refusal names it. */\nfunction fieldText$1(required, contract) {\n\treturn required.subject.kind === \"valueObjectField\" ? `value object field \"${valueObjectFieldStatementText(contract, required.subject)}\"` : `field \"${fieldStatementText(contract, required.subject)}\"`;\n}\n/** The field as a statement names it, such as `Address.zip`. */\nfunction statementText(required, contract) {\n\treturn required.subject.kind === \"valueObjectField\" ? valueObjectFieldStatementText(contract, required.subject) : fieldStatementText(contract, required.subject);\n}\nfunction refused(required, contracts, reason, why) {\n\tif (required.statement === void 0) return {\n\t\tkind: \"fieldFillRefused\",\n\t\tsummary: `Cannot fill ${fieldText$1(required, contracts.contract)}: ${reason}`,\n\t\twhy: why(\"make the field optional in the contract\")\n\t};\n\treturn {\n\t\tkind: \"statementRefused\",\n\t\tsummary: `Cannot ${describeMigrationStatement(required.statement, contracts.fromContract, contracts.contract)}: ${reason}`,\n\t\twhy: why(\"leave out this statement\"),\n\t\trefusedStatement: required.statement\n\t};\n}\nfunction placeText(place) {\n\treturn `field \"${place.field}\" of collection \"${place.collection}\"`;\n}\nfunction unlistedRefusal(required, place, contracts) {\n\tconst byHand = (advice) => `Fill the key in ${placeText(place)} yourself, in a dataTransform operation of the migration.ts that migration plan writes or in mongosh, or ${advice}.`;\n\tif (place.reach.kind === \"containsItself\") return refused(required, contracts, `${placeText(place)} holds it inside \"${place.reach.type}\", which contains itself, so the documents can hold it at any depth`, (advice) => `The plan fills a key at every path from a field to its objects, and a type that contains itself has no last path. ${byHand(advice)}`);\n\treturn refused(required, contracts, `${placeText(place)} holds a ${place.reach.kind} of value objects`, (advice) => `The plan fills a key only in a field that holds a value object, a list of them, or an embedded model. ${byHand(advice)}`);\n}\n/** The names on the path from a document to the key: the root field, each member the path steps through, and the key. */\nfunction namesOnPath(place, key) {\n\treturn [\n\t\tplace.field,\n\t\t...place.steps.flatMap((step) => step.kind === \"member\" ? [step.name] : []),\n\t\tkey\n\t];\n}\n/** Whether a unique index covers the key at a place, so that one value in every object would break it. */\nfunction underUniqueIndex(destination, place, key) {\n\tconst dotted = namesOnPath(place, key).join(\".\");\n\treturn (destination.collection(place.collection)?.indexes ?? []).some((index) => index.unique && index.keys.some((indexKey) => indexKey.field === dotted));\n}\n/**\n* The places a required field is filled at: every place the destination's documents hold its value object or embedded model, in a collection the plan keeps, as the destination names them. A temporary value is not written in a collection whose control policy is not `managed`, nor where a stored name on the path cannot be rewritten; a backfill there is refused.\n*/\nfunction fillPlaces(required, places, input, contracts) {\n\tconst planned = /* @__PURE__ */ new Map();\n\tconst conflicts = [];\n\tfor (const place of places) {\n\t\tif (input.schema.collection(place.collection) === void 0) continue;\n\t\tconst policy = collectionControlPolicy(input.contract, place.collection);\n\t\tif (policy !== \"managed\") {\n\t\t\tif (required.statement !== void 0) conflicts.push(refused(required, contracts, `collection \"${place.collection}\" has control policy \"${policy}\"`, () => \"Statements fill only fields of collections whose control policy is \\\"managed\\\". Fill the field in the database yourself and leave out this statement.\"));\n\t\t\tcontinue;\n\t\t}\n\t\tconst unrewritable = namesOnPath(place, required.key).find((name) => unrewritableKeyReason(name) !== void 0);\n\t\tif (unrewritable !== void 0) {\n\t\t\tif (required.statement !== void 0) conflicts.push(refused(required, contracts, `the stored name \"${unrewritable}\" cannot be rewritten`, (advice) => `${unrewritableKeyReason(unrewritable)}, so the plan cannot fill the key. Fill it in the database yourself, or ${advice}.`));\n\t\t\tcontinue;\n\t\t}\n\t\tconst path = [...place.steps, {\n\t\t\tkind: \"member\",\n\t\t\tname: required.key\n\t\t}];\n\t\tconst key = JSON.stringify([\n\t\t\tplace.collection,\n\t\t\tplace.field,\n\t\t\tjsonPathText(path),\n\t\t\tplace.variant ?? null\n\t\t]);\n\t\tconst known = planned.get(key);\n\t\tif (known !== void 0) {\n\t\t\tknown.models.push(place.model.model);\n\t\t\tcontinue;\n\t\t}\n\t\tplanned.set(key, {\n\t\t\trequired,\n\t\t\tplace,\n\t\t\tpath,\n\t\t\tmodels: [place.model.model]\n\t\t});\n\t}\n\treturn conflicts.length > 0 ? notOk(conflicts) : ok([...planned.values()]);\n}\nfunction plannedRewriteOf(fill, contract) {\n\treturn {\n\t\tkind: \"fillStoredKey\",\n\t\tcollection: fill.place.collection,\n\t\tfield: fill.place.field,\n\t\tvariant: fill.place.variant,\n\t\tmodel: fill.place.model,\n\t\tstoredKey: {\n\t\t\tkey: fieldText$1(fill.required, contract),\n\t\t\ttogether: fill.models\n\t\t}\n\t};\n}\n/**\n* The fills of keys inside fields' values a plan makes. A field of a value object or an embedded model that both contracts have is filled when the destination makes it required and the origin lacks it or makes it optional. A backfill statement fills it with a value the user writes in `migration.ts`. Without one, a new field whose type has a temporary value gets it, unless a unique index covers it at one of its places; any other, and a field that was optional, is left to the validator change's document check, as at the top level. Each fill acts at every place the destination's documents hold the type, nested or in lists, as the destination names them, and has the refusals of every rewrite. With no origin contract, nothing is known to have changed.\n*/\nfunction planStoredKeyFills(input) {\n\tconst { fromContract, contract } = input;\n\tconst required = fromContract === null ? [] : [...valueObjectFields(fromContract, contract, input.statements), ...embeddedModelFields(fromContract, contract, input.statements)];\n\tconst conflicts = nestedBackfills(input.statements, contract).filter((statement) => !required.some((each) => each.statement === statement)).map((statement) => ({\n\t\tkind: \"statementRefused\",\n\t\tsummary: `Cannot ${describeMigrationStatement(statement, fromContract ?? contract, contract)}: no existing object is known to lack it, since the origin contract has no such field that is optional, nor this value object or embedded model without it`,\n\t\twhy: \"A --backfill statement fills a required field that a value object or an embedded model gains, or that was optional. Leave out this statement.\",\n\t\trefusedStatement: statement\n\t}));\n\tif (fromContract === null) return conflicts.length > 0 ? notOk(conflicts) : ok([]);\n\tconst contracts = {\n\t\tfromContract,\n\t\tcontract\n\t};\n\tconst placesOf = storedPlacesOf(contract);\n\tconst fills = [];\n\tfor (const each of required) {\n\t\tconst temporary = each.statement === void 0 && each.isNew ? temporaryValueOf(each.field, input.lookups) : void 0;\n\t\tif (each.statement === void 0 && temporary === void 0) continue;\n\t\tconst places = placesOf(each.type);\n\t\tif (!places.ok) {\n\t\t\tconflicts.push(unlistedRefusal(each, places.failure, contracts));\n\t\t\tcontinue;\n\t\t}\n\t\tif (temporary !== void 0 && places.value.some((place) => underUniqueIndex(input.destination, place, each.key))) continue;\n\t\tconst planned = fillPlaces(each, places.value, input, contracts);\n\t\tif (!planned.ok) {\n\t\t\tconflicts.push(...planned.failure);\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const fill of planned.value) {\n\t\t\tconflicts.push(...rewriteRefusals(plannedRewriteOf(fill, contract), contract, rewriteCollectionOf(input.schema, fill.place.collection)));\n\t\t\tfills.push({\n\t\t\t\tcall: new FillStoredKeyCall({\n\t\t\t\t\tcollection: fill.place.collection,\n\t\t\t\t\tfield: fill.place.field,\n\t\t\t\t\tpath: jsonPathText(fill.path),\n\t\t\t\t\tvalue: temporary?.expression ?? new UnfilledValue(`${statementText(each, contract)}:value`),\n\t\t\t\t\t...fill.place.variant === void 0 ? {} : { filter: variantFilter(fill.place.variant) }\n\t\t\t\t}),\n\t\t\t\tsubject: each.subject,\n\t\t\t\ttext: temporary?.text,\n\t\t\t\tstatement: each.statement,\n\t\t\t\tvariant: fill.place.variant\n\t\t\t});\n\t\t}\n\t}\n\treturn conflicts.length > 0 ? notOk(conflicts) : ok(fills);\n}\nfunction storedTypesOf(contract) {\n\tconst valueObjects = valueObjectsWithCoordinates(contract.storage).map(({ coordinate, valueObject }) => ({\n\t\ttype: {\n\t\t\tkind: \"valueObject\",\n\t\t\tvalueObject: coordinate\n\t\t},\n\t\tstoredNames: valueObjectStoredNamesOf(valueObject),\n\t\tsubjectOf: (field) => ({\n\t\t\tkind: \"valueObjectField\",\n\t\t\tnamespaceId: asNamespaceId(coordinate.namespaceId),\n\t\t\tvalueObject: coordinate.entityName,\n\t\t\tfield\n\t\t})\n\t}));\n\tconst embedded = modelCoordinates(contract).flatMap((coordinate) => {\n\t\tconst model = modelAt(contract, coordinate);\n\t\treturn model === void 0 || embeddingModelOf(contract.domain, coordinate) === void 0 ? [] : [{\n\t\t\ttype: {\n\t\t\t\tkind: \"embeddedModel\",\n\t\t\t\tmodel: coordinate\n\t\t\t},\n\t\t\tstoredNames: ownStoredNamesOf(model),\n\t\t\tsubjectOf: (field) => ({\n\t\t\t\tkind: \"field\",\n\t\t\t\t...coordinate,\n\t\t\t\tfield\n\t\t\t})\n\t\t}];\n\t});\n\treturn [...valueObjects, ...embedded];\n}\n/**\n* The field of a value object or an embedded model that the destination's documents store at `path` inside root field `field` of `collection`, where `path` is the JSONPath from the field's value to the key; `undefined` when no listed place holds one there.\n*/\nfunction storedKeyFieldAt(contract, at) {\n\tconst placesOf = storedPlacesOf(contract);\n\tfor (const { type, storedNames, subjectOf } of storedTypesOf(contract)) {\n\t\tconst places = placesOf(type);\n\t\tif (!places.ok) continue;\n\t\tfor (const [name, storedName] of Object.entries(storedNames)) {\n\t\t\tconst place = places.value.find((each) => each.collection === at.collection && each.field === at.field && jsonPathText([...each.steps, {\n\t\t\t\tkind: \"member\",\n\t\t\t\tname: storedName\n\t\t\t}]) === at.path);\n\t\t\tif (place === void 0) continue;\n\t\t\tconst subject = subjectOf(name);\n\t\t\treturn {\n\t\t\t\tsubject,\n\t\t\t\ttext: subject.kind === \"valueObjectField\" ? valueObjectFieldStatementText(contract, subject) : fieldStatementText(contract, subject),\n\t\t\t\tplace\n\t\t\t};\n\t\t}\n\t}\n}\n//#endregion\n//#region src/core/migrations/mongo-type-changes.ts\nfunction withoutNull(types) {\n\treturn types.filter((type) => type !== \"null\");\n}\nfunction fieldShapeOf(field, lookups) {\n\tif (field?.type.kind !== \"scalar\" || field.dict === true) return void 0;\n\tconst types = bsonTypesOfCodec(field.type.codecId, lookups);\n\treturn types === void 0 ? void 0 : {\n\t\ttypes: withoutNull(types),\n\t\tlist: field.many !== void 0 && field.many !== false\n\t};\n}\nfunction isRecord$2(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction bsonTypesOf(schema) {\n\treturn withoutNull(propertyBsonTypesOf(schema));\n}\nfunction isObjectSchema(schema) {\n\treturn [\n\t\t\"properties\",\n\t\t\"oneOf\",\n\t\t\"anyOf\"\n\t].some((keyword) => Object.hasOwn(schema, keyword));\n}\n/** The shape a validator's property schema gives a field; `undefined` for an object, whose fields are not compared here. */\nfunction propertyShapeOf(schema) {\n\tif (!isRecord$2(schema) || isObjectSchema(schema)) return void 0;\n\tconst types = bsonTypesOf(schema);\n\tconst items = schema[\"items\"];\n\tif (types.length === 1 && types[0] === \"array\" && isRecord$2(items)) return isObjectSchema(items) ? void 0 : {\n\t\ttypes: bsonTypesOf(items),\n\t\tlist: true\n\t};\n\treturn {\n\t\ttypes,\n\t\tlist: false\n\t};\n}\n/** Whether a field of shape `to` takes every value a field of shape `from` holds. */\nfunction takesEveryValue(from, to) {\n\tif (to.types.length === 0 && !to.list) return true;\n\tif (from.list !== to.list) return false;\n\tif (to.types.length === 0) return true;\n\treturn from.types.length > 0 && from.types.every((type) => to.types.includes(type));\n}\nfunction castOptions(from, to) {\n\tconst [target, ...others] = to.types;\n\tif (from.types.length === 0) return void 0;\n\tif (from.list !== to.list || target === void 0 || others.length > 0) return void 0;\n\tif (!isConvertTarget(target) || !from.types.every((type) => castsFrom(type, target))) return;\n\treturn {\n\t\tfrom: from.types,\n\t\tto: target,\n\t\t...to.list ? { list: true } : {}\n\t};\n}\nfunction typeChange(input) {\n\treturn {\n\t\t...input,\n\t\tcast: castOptions(input.from, input.to)\n\t};\n}\n/** The `castField` call that carries out a type change, when it has a cast. */\nfunction castFieldCallOf(change) {\n\treturn change.cast === void 0 ? void 0 : new CastFieldCall({\n\t\tcollection: change.collection,\n\t\tfield: change.field,\n\t\t...change.cast,\n\t\t...change.variant === void 0 ? {} : { filter: variantFilter(change.variant) }\n\t});\n}\n/**\n* Each top-level field of a model or variant, in a collection the plan keeps, whose destination\n* type does not take every value its origin type holds, read from the BSON types of the two codecs.\n*/\nfunction planFieldTypeChanges(input, lookups) {\n\treturn modelCoordinates(input.fromContract).flatMap((origin) => {\n\t\tconst model = modelAt(input.fromContract, origin);\n\t\tif (model === void 0 || embeddedModelReason(input.fromContract, origin) !== void 0) return [];\n\t\tconst destination = destinationModelOf(origin, input);\n\t\tconst destinationModel = destination === void 0 ? void 0 : modelAt(input.contract, destination);\n\t\tif (destination === void 0 || destinationModel === void 0) return [];\n\t\tconst collection = collectionOfModel(input.contract.domain, destination);\n\t\tif (collection === void 0 || !input.keptCollections.has(collection)) return [];\n\t\tif (collectionControlPolicy(input.contract, collection) !== \"managed\") return [];\n\t\treturn Object.keys(model.fields).sort().flatMap((field) => {\n\t\t\tconst destinationField = destinationFieldOf({\n\t\t\t\t...origin,\n\t\t\t\tfield\n\t\t\t}, input.statements);\n\t\t\tif (!Object.hasOwn(destinationModel.fields, destinationField)) return [];\n\t\t\tconst from = fieldShapeOf(model.fields[field], lookups);\n\t\t\tconst to = fieldShapeOf(destinationModel.fields[destinationField], lookups);\n\t\t\tconst storedName = ownStoredNameOf(destinationModel, destinationField);\n\t\t\tif (from === void 0 || to === void 0 || takesEveryValue(from, to)) return [];\n\t\t\tif (storedName === \"_id\") return [];\n\t\t\treturn [typeChange({\n\t\t\t\tsubject: {\n\t\t\t\t\tkind: \"field\",\n\t\t\t\t\t...origin,\n\t\t\t\t\tfield\n\t\t\t\t},\n\t\t\t\tdestination: {\n\t\t\t\t\t...destination,\n\t\t\t\t\tfield: destinationField\n\t\t\t\t},\n\t\t\t\tcollection,\n\t\t\t\tfield: storedName,\n\t\t\t\tfrom,\n\t\t\t\tto,\n\t\t\t\tvariant: selectedVariantOf(input.contract.domain, destination)\n\t\t\t})];\n\t\t});\n\t});\n}\n/**\n* Without an origin contract, each field a root model of both validators declares whose new\n* property schema does not take every value the old one does, named by its storage name.\n*/\nfunction planValidatorTypeChanges(input) {\n\treturn input.origin.collections.flatMap((originCollection) => {\n\t\tconst collection = originCollection.name;\n\t\tif (collectionControlPolicy(input.contract, collection) !== \"managed\") return [];\n\t\tconst destination = input.destination.collection(collection);\n\t\tif (destination?.validator === void 0 || originCollection.validator === void 0) return [];\n\t\tconst before = validatorDocumentShapesOf(originCollection.validator.jsonSchema);\n\t\tconst changes = validatorDocumentShapesOf(destination.validator.jsonSchema).flatMap((after) => {\n\t\t\tconst matched = before.find(({ key }) => key === after.key);\n\t\t\tif (matched === void 0) return [];\n\t\t\treturn Object.keys(after.properties).filter((field) => field !== \"_id\" && Object.hasOwn(matched.properties, field)).flatMap((field) => {\n\t\t\t\tconst from = propertyShapeOf(matched.properties[field]);\n\t\t\t\tconst to = propertyShapeOf(after.properties[field]);\n\t\t\t\tif (from === void 0 || to === void 0 || takesEveryValue(from, to)) return [];\n\t\t\t\treturn [{\n\t\t\t\t\tshape: after,\n\t\t\t\t\tfield,\n\t\t\t\t\tfrom,\n\t\t\t\t\tto\n\t\t\t\t}];\n\t\t\t});\n\t\t});\n\t\tconst sameEverywhere = (field, rootIndex) => {\n\t\t\tconst shapes = validatorDocumentShapesOf(destination.validator?.jsonSchema).filter((shape) => shape.rootIndex === rootIndex);\n\t\t\tconst found = changes.filter((change) => change.field === field && change.shape.rootIndex === rootIndex);\n\t\t\treturn found.length === shapes.length && found.every((change) => JSON.stringify([change.from, change.to]) === JSON.stringify([found[0]?.from, found[0]?.to]));\n\t\t};\n\t\tconst planned = /* @__PURE__ */ new Map();\n\t\tfor (const { shape, field, from, to } of changes) {\n\t\t\tconst variant = shape.discriminator === void 0 || sameEverywhere(field, shape.rootIndex) ? void 0 : shape.discriminator;\n\t\t\tconst key = JSON.stringify([\n\t\t\t\tshape.rootIndex,\n\t\t\t\tfield,\n\t\t\t\tvariant ?? null\n\t\t\t]);\n\t\t\tif (planned.has(key)) continue;\n\t\t\tplanned.set(key, typeChange({\n\t\t\t\tsubject: {\n\t\t\t\t\tkind: \"storage\",\n\t\t\t\t\tname: `${collection}.${field}`\n\t\t\t\t},\n\t\t\t\tdestination: void 0,\n\t\t\t\tcollection,\n\t\t\t\tfield,\n\t\t\t\tfrom,\n\t\t\t\tto,\n\t\t\t\tvariant\n\t\t\t}));\n\t\t}\n\t\treturn [...planned.values()].sort((a, b) => a.field < b.field ? -1 : a.field > b.field ? 1 : 0);\n\t});\n}\nfunction shapeText(shape) {\n\tconst types = shape.types.length === 0 ? \"any value\" : shape.types.join(\", \");\n\treturn shape.list ? `list of ${types}` : types;\n}\nfunction fieldText(change, contract) {\n\treturn change.destination === void 0 ? change.subject.kind === \"storage\" ? change.subject.name : change.field : fieldStatementText(contract, change.destination);\n}\n/** A type change of a field whose stored name MongoDB reads as a path or an operator: neither a cast nor a conversion can rewrite it. */\nfunction unrewritableTypeChangeRefusals(changes, contract) {\n\treturn changes.flatMap((change) => {\n\t\tconst reason = unrewritableFieldNameReason(change.field);\n\t\tif (reason === void 0) return [];\n\t\treturn [{\n\t\t\tkind: \"typeChangeRefused\",\n\t\t\tsummary: `Cannot change the type of field \"${fieldText(change, contract)}\" in collection \"${change.collection}\": its stored name ${JSON.stringify(change.field)} cannot be rewritten: ${reason}`,\n\t\t\twhy: \"A cast or a conversion would have to rewrite the field. Keep its type, or store it under a name without \\\".\\\" that does not start with \\\"$\\\", then run this command again.\"\n\t\t}];\n\t});\n}\n/** A type change with no cast that keeps what the values mean: only a conversion the user writes keeps the field. */\nfunction noCastRefusals(changes, contract) {\n\treturn changes.filter((change) => change.cast === void 0).map((change) => {\n\t\tconst field = fieldText(change, contract);\n\t\treturn {\n\t\t\tkind: \"typeChangeRefused\",\n\t\t\tsummary: `Cannot change the type of field \"${field}\" in collection \"${change.collection}\" from ${shapeText(change.from)} to ${shapeText(change.to)}: MongoDB has no cast from ${shapeText(change.from)} to ${shapeText(change.to)} that keeps what the values mean`,\n\t\t\twhy: change.destination === void 0 ? \"Its values cannot be cast, so --delete cannot keep the field. Plan the change with migration plan --from <hash of the migration the database is at> and --convert, and write the conversion in migration.ts.\" : `Its values cannot be cast, so --delete cannot keep the field. Plan the change with migration plan and --convert ${field}, and write the conversion in migration.ts.`\n\t\t};\n\t});\n}\nfunction sameField(a, b) {\n\treturn a.namespaceId === b.namespaceId && a.model === b.model && a.field === b.field;\n}\n/** The type change a convert statement names, if it names one. */\nfunction typeChangeConverted(statement, changes) {\n\treturn changes.find((change) => change.destination !== void 0 && sameField(change.destination, statement.field));\n}\n//#endregion\n//#region src/core/migrations/mongo-type-lookups.ts\n/** The codecs and data types the composed components register, an extension's among them. */\nfunction mongoTypeLookupsOf(frameworkComponents) {\n\treturn {\n\t\tcodecLookup: extractCodecLookup(frameworkComponents),\n\t\tdataTypeLookup: assembleDataTypes(frameworkComponents).lookup\n\t};\n}\n//#endregion\n//#region src/core/migrations/mongo-variant-planning.ts\nfunction sameModel(a, b) {\n\treturn a.namespaceId === b.namespaceId && a.model === b.model;\n}\nfunction statementOf(origin, destination, statements) {\n\treturn statements.find((statement) => statement.entity === \"model\" && (statement.kind === \"rename\" && sameModel(statement.from, origin) || statement.kind === \"convert\" && sameModel(statement.model, destination)));\n}\n/** The model of the destination a model of the origin is, as the statements and field changes find it: a variant renamed without a statement that keeps its collection and value is the same documents. */\nfunction destinationOf(origin, fromContract, input) {\n\treturn destinationModelOf(origin, {\n\t\tstatements: input.statements.filter((statement) => statement.kind === \"rename\"),\n\t\tfromContract,\n\t\tcontract: input.contract,\n\t\tcollectionAfterRenames: input.collectionAfterRenames\n\t});\n}\nfunction baseOf(contract, model) {\n\tconst base = modelAt(contract, model)?.base;\n\treturn base === void 0 ? void 0 : {\n\t\tnamespaceId: asNamespaceId(base.namespace),\n\t\tmodel: base.model\n\t};\n}\n/** The destination's base of a variant of the origin: the base of the model it is, else the model its origin base is. */\nfunction destinationBaseOf(origin, destination, fromContract, input) {\n\tconst originBase = baseOf(fromContract, origin);\n\treturn (destination === void 0 ? void 0 : baseOf(input.contract, destination)) ?? (originBase === void 0 ? void 0 : destinationOf(originBase, fromContract, input));\n}\n/** The stored name of the discriminator of the destination's base, when it still has one, as SQL finds the column. */\nfunction destinationDiscriminator(origin, destination, fromContract, input) {\n\tconst base = destinationBaseOf(origin, destination, fromContract, input);\n\tconst model = base === void 0 ? void 0 : modelAt(input.contract, base);\n\tconst field = model?.discriminator?.field;\n\treturn model === void 0 || field === void 0 ? void 0 : ownStoredNameOf(model, field);\n}\n/** The enum value replacement that rewrites `from` to `to` in the discriminator field itself. */\nfunction enumReplacementOf(input, at, from, to) {\n\treturn input.enumReplacements.find(({ options }) => options.collection === at.collection && options.field === at.field && options.path === void 0 && options.filter === void 0 && options.from === from && canonicalize(options.to) === canonicalize({ $literal: to }));\n}\n/** What changes for the documents of one variant of the origin, if anything does. */\nfunction changeOf(origin, fromContract, input) {\n\tif (embeddingModelOf(fromContract.domain, origin) !== void 0) return void 0;\n\tconst before = selectedVariantOf(fromContract.domain, origin);\n\tconst originCollection = collectionOfModel(fromContract.domain, origin);\n\tif (before === void 0 || originCollection === void 0) return void 0;\n\tconst collection = input.collectionAfterRenames(originCollection);\n\tif (!input.keptCollections.has(collection)) return void 0;\n\tconst destination = destinationOf(origin, fromContract, input);\n\tconst after = destination === void 0 ? void 0 : selectedVariantOf(input.contract.domain, destination);\n\tif (destination !== void 0 && after === void 0) return void 0;\n\tconst field = destinationDiscriminator(origin, destination, fromContract, input);\n\tif (field === void 0) return void 0;\n\tconst from = String(before.value);\n\tconst to = after === void 0 ? void 0 : String(after.value);\n\tif (to === from) return void 0;\n\tconst statement = destination === void 0 ? void 0 : statementOf(origin, destination, input.statements);\n\tconst byEnum = to === void 0 ? void 0 : enumReplacementOf(input, {\n\t\tcollection,\n\t\tfield\n\t}, from, to);\n\treturn {\n\t\tmodel: origin,\n\t\tdestination,\n\t\tcollection,\n\t\tfield,\n\t\toriginField: before.field,\n\t\tfrom,\n\t\tto: statement === void 0 && byEnum === void 0 ? void 0 : to,\n\t\tstatement,\n\t\tbyEnum\n\t};\n}\nfunction quoted(value) {\n\treturn JSON.stringify(value);\n}\nfunction variantText(model) {\n\treturn `variant ${quoted(modelDisplayName(model))}`;\n}\nfunction changeLabel(change, input, fromContract) {\n\treturn change.statement === void 0 ? `Cannot delete the documents of ${variantText(change.model)}` : `Cannot ${describeMigrationStatement(change.statement, fromContract, input.contract)}`;\n}\nfunction refusedChange(change, label, reason, why) {\n\treturn change.statement === void 0 ? {\n\t\tkind: \"unsupportedOperation\",\n\t\tsummary: `${label}: ${reason}`,\n\t\twhy\n\t} : {\n\t\tkind: \"statementRefused\",\n\t\tsummary: `${label}: ${reason}`,\n\t\twhy,\n\t\trefusedStatement: change.statement\n\t};\n}\n/** How to change discriminator values that one migration cannot change safely. */\nconst VARIANT_TWO_STEPS = inTwoSteps(\"delete the variants, or move their values to discriminator values no variant uses\", \"change the values to their final ones\");\n/** Why a change cannot be planned in its collection: a time-series collection, or, for a statement, one whose control policy is not `managed`. */\nfunction collectionRefusal(change, input, fromContract) {\n\tconst label = changeLabel(change, input, fromContract);\n\tconst policy = collectionControlPolicy(input.contract, change.collection);\n\tif (policy !== \"managed\") return refusedChange(change, label, `collection \"${change.collection}\" has control policy \"${policy}\"`, \"Statements rename only collections, and fields of collections, whose control policy is \\\"managed\\\". Make the change in the database yourself and leave out this statement.\");\n\tif (input.schema.collection(change.collection)?.options?.timeseries === void 0) return sharedCollectionRefusal(change, label, fromContract);\n\treturn refusedChange(change, label, `collection \"${change.collection}\" is a time-series collection`, `${TIME_SERIES_UPDATES}, so the plan does not rewrite or delete the documents of a variant there. Keep the variant and its discriminator value in the contract, then run this command again.`);\n}\n/**\n* The refusal of a change whose documents another root model stored in the same collection can\n* share: a model with the same discriminator field and value, whose documents the delete or\n* replacement would reach too.\n*/\nfunction sharedCollectionRefusal(change, label, fromContract) {\n\tconst originCollection = collectionOfModel(fromContract.domain, change.model);\n\tif (originCollection === void 0) return void 0;\n\tconst others = otherModelsReached(fromContract.domain, change.model, originCollection, {\n\t\tfield: change.originField,\n\t\tvalue: change.from\n\t}, void 0);\n\tif (others.length === 0) return void 0;\n\tconst named = others.map(quoted).join(\", \");\n\tconst effect = change.to === void 0 ? \"deleting the documents with that value would delete the documents\" : \"replacing the value would replace it in the documents\";\n\treturn refusedChange(change, label, `model ${named} ${others.length === 1 ? \"is\" : \"are\"} stored in collection ${quoted(change.collection)} and its documents can hold ${change.originField} ${quoted(change.from)}`, `${sharedCollectionWhy(change.collection, others, effect)} To change only the documents of ${variantText(change.model)}, ${SEPARATE_THE_MODELS}.`);\n}\n/**\n* The refusal of a change whose documents hold their discriminator value in a field the plan does\n* not rename to the destination's discriminator: the rewrite would select its documents by a field\n* that holds no variant's value.\n*/\nfunction unrenamedDiscriminatorRefusal(change, input, fromContract) {\n\tconst renamed = input.fieldRenames.some((rename) => rename.collection === change.collection && rename.from === change.originField && rename.to === change.field);\n\tif (change.field === change.originField || renamed) return void 0;\n\tconst destinationBase = destinationBaseOf(change.model, change.destination, fromContract, input);\n\tconst rename = destinationBase === void 0 ? void 0 : discriminatorRenameOf(baseOf(fromContract, change.model), destinationBase, {\n\t\tfromContract,\n\t\tcontract: input.contract,\n\t\tstatements: input.statements\n\t});\n\tconst field = quoted(change.field);\n\tconst discriminator = destinationBase === void 0 ? void 0 : modelAt(input.contract, destinationBase)?.discriminator?.field;\n\tconst backfill = destinationBase === void 0 || discriminator === void 0 ? \"--backfill\" : `--backfill ${fieldStatementText(input.contract, {\n\t\t...destinationBase,\n\t\tfield: discriminator\n\t})}`;\n\tconst advice = rename === void 0 ? inTwoSteps(`make ${field} the discriminator with the variants' current values, giving every document its value there (under migration plan, with ${backfill})`, \"change the variants\") : `Add ${rename.flags} and run the command again.`;\n\tconst unrenamed = `hold their discriminator value in field ${quoted(change.originField)}, which the plan does not rename to ${field}`;\n\treturn refusedChange(change, change.statement === void 0 ? \"Cannot plan the migration\" : changeLabel(change, input, fromContract), change.statement === void 0 ? `the documents of ${variantText(change.model)} ${unrenamed}` : `its documents ${unrenamed}`, `The plan rewrites the documents of a variant by their value in field ${field}, which only a rename of field ${quoted(change.originField)} gives them. ${advice}`);\n}\nfunction callOf(change) {\n\tif (change.byEnum !== void 0) return change.byEnum;\n\treturn change.to === void 0 ? new DeleteDocumentsCall({\n\t\tcollection: change.collection,\n\t\tfilter: variantFilter({\n\t\t\tfield: change.field,\n\t\t\tvalue: change.from\n\t\t})\n\t}) : new ReplaceStoredValueCall({\n\t\tcollection: change.collection,\n\t\tfield: change.field,\n\t\tfrom: change.from,\n\t\tto: { $literal: change.to }\n\t});\n}\n/**\n* The document rewrites a plan makes for the variants of the origin whose discriminator value the\n* destination changes or drops, as SQL plans their rows. A rename or convert statement replaces a\n* changed value in the base's collection; a changed value with no statement, and a variant the\n* destination no longer has, delete the documents that hold the old value, which the plan asks about.\n* Deletes run first, so later rewrites read fewer documents; a delete and a replacement of the same\n* value are refused for the whole plan (see `overlapRefusal`), so the order does not decide what the\n* documents end as. A rewrite that would reach the documents of another root model in the same\n* collection is refused. In a collection whose control policy is not `managed`, a statement is refused and a\n* delete left out. The discriminator is read from the destination's base, so a base that renames it\n* is followed, and a base that no longer has one keeps every document. A replacement of an enum value\n* that already moves a variant's value is that variant's replacement. With no origin contract,\n* nothing is known to have changed.\n*/\nfunction planVariantDocumentRewrites(input) {\n\tconst { fromContract } = input;\n\tif (fromContract === null) return ok({\n\t\tdeletes: [],\n\t\treplacements: []\n\t});\n\tconst changes = modelCoordinates(fromContract).flatMap((origin) => {\n\t\tconst change = changeOf(origin, fromContract, input);\n\t\tif (change === void 0) return [];\n\t\treturn change.to === void 0 && collectionControlPolicy(input.contract, change.collection) !== \"managed\" ? [] : [change];\n\t});\n\tconst refusals = changes.flatMap((change) => {\n\t\tconst refusal = collectionRefusal(change, input, fromContract) ?? unrenamedDiscriminatorRefusal(change, input, fromContract);\n\t\treturn refusal === void 0 ? [] : [refusal];\n\t});\n\tif (refusals.length > 0) return notOk(refusals);\n\tconst rewrites = changes.map((change) => ({\n\t\t...change,\n\t\tcall: callOf(change)\n\t}));\n\treturn ok({\n\t\tdeletes: rewrites.flatMap(({ call, ...rewrite }) => call instanceof DeleteDocumentsCall ? [{\n\t\t\t...rewrite,\n\t\t\tcall\n\t\t}] : []),\n\t\treplacements: rewrites.flatMap(({ call, ...rewrite }) => call instanceof ReplaceStoredValueCall ? [{\n\t\t\t...rewrite,\n\t\t\tcall\n\t\t}] : [])\n\t});\n}\n//#endregion\n//#region src/core/migrations/render-ops.ts\nfunction renderOps(calls) {\n\treturn calls.map((call) => call.toOp());\n}\n//#endregion\n//#region src/core/migrations/render-typescript.ts\n/**\n* Always-present base imports for the rendered scaffold, both from the\n* target's own `migration` entry:\n*\n* - `Migration` — the user-facing Mongo `Migration` base, forwarded from\n* `@internal/family-mongo`; subclasses don't need to redeclare\n* `targetId` or thread family/target generics.\n* - `MigrationCLI` — the migration-file CLI entrypoint that loads\n* `prisma.config.ts`, assembles a `ControlStack`, and instantiates\n* the migration class. The migration file owns this dependency directly:\n* pulling CLI machinery in at script run time is acceptable because the\n* script's whole purpose is to be invoked from the project that owns the\n* config.\n*\n* Naming one package rather than three is what lets an application that\n* installed only `@prisma/orm-mongo` run a scaffolded migration: emitted\n* code may name only a direct dependency (ADR 242), and the facade carries\n* the target's `migration` entry but neither the family base nor the CLI.\n*/\nconst BASE_IMPORTS = [{\n\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\tsymbol: \"Migration\"\n}, {\n\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\tsymbol: \"MigrationCLI\"\n}];\n/**\n* Render a list of Mongo `OpFactoryCall`s as a `migration.ts` source string.\n* The result is shebanged, imports the contract JSON from the shared\n* snapshot store (the destination contract, plus the source contract for a\n* non-baseline migration), extends `Migration<Start, End>` (or\n* `Migration<never, End>` for a baseline) from\n* `@internal/target-mongo/migration`,\n* assigns the JSON to `endContractJson` / `startContractJson`, and implements\n* `operations`. The `Migration` base derives `describe()` from those fields.\n*\n* The walk is polymorphic: each call node contributes its own\n* `renderTypeScript()` expression and declares its own `importRequirements()`.\n* The top-level renderer aggregates imports across all nodes and emits one\n* `import { … } from \"…\"` line per module. The `Migration` / `MigrationCLI`\n* base imports and the contract-JSON imports are always emitted, independent\n* of the call nodes.\n*/\nfunction renderCallsToTypeScript(calls, meta) {\n\tconst imports = buildImports(calls, meta);\n\tconst operationsBody = calls.map((c) => c.renderTypeScript()).join(\",\\n\");\n\tconst hasStart = meta.from !== null;\n\tconst startField = hasStart ? [\" override readonly startContractJson = startContract;\"] : [];\n\treturn [\n\t\tshebangLineFor(detectScaffoldRuntime()),\n\t\timports,\n\t\t\"\",\n\t\t`class M extends Migration<${hasStart ? \"Start\" : \"never\"}, End> {`,\n\t\t...startField,\n\t\t\" override readonly endContractJson = endContract;\",\n\t\t\"\",\n\t\t\" override get operations() {\",\n\t\t\" return [\",\n\t\tindent(operationsBody, 6),\n\t\t\" ];\",\n\t\t\" }\",\n\t\t\"}\",\n\t\t\"\",\n\t\t\"export default M;\",\n\t\t\"MigrationCLI.run(import.meta.url, M);\",\n\t\t\"\"\n\t].join(\"\\n\");\n}\nfunction buildImports(calls, meta) {\n\tconst requirements = [...BASE_IMPORTS, ...contractImports(meta)];\n\tfor (const call of calls) for (const req of call.importRequirements()) requirements.push(req);\n\treturn renderImports(resolveRequirementSpecifiers(requirements, meta.resolveImportSpecifier));\n}\n/**\n* The committed contract-JSON imports the scaffold reads its from/to identity\n* from, resolved to the deduplicated snapshot store under\n* `meta.snapshotsImportPath`. The end snapshot is always present; the start\n* snapshot is added only for a non-baseline migration (`meta.from !== null`).\n* The matching `Contract` type imports (aliased `Start`/`End`) feed the\n* `Migration<Start, End>` generics. Baseline emits `Migration<never, End>` with\n* no start imports — `never` is the honest \"no prior contract\" Start.\n*/\nfunction contractImports(meta) {\n\tconst reqs = [{\n\t\tmoduleSpecifier: contractSnapshotJsonSpecifier(meta.snapshotsImportPath, meta.to),\n\t\tsymbol: \"endContract\",\n\t\tkind: \"default\",\n\t\tattributes: { type: \"json\" }\n\t}, {\n\t\tmoduleSpecifier: contractSnapshotTypesSpecifier(meta.snapshotsImportPath, meta.to),\n\t\tsymbol: \"Contract\",\n\t\talias: \"End\",\n\t\ttypeOnly: true\n\t}];\n\tif (meta.from !== null) {\n\t\treqs.push({\n\t\t\tmoduleSpecifier: contractSnapshotJsonSpecifier(meta.snapshotsImportPath, meta.from),\n\t\t\tsymbol: \"startContract\",\n\t\t\tkind: \"default\",\n\t\t\tattributes: { type: \"json\" }\n\t\t});\n\t\treqs.push({\n\t\t\tmoduleSpecifier: contractSnapshotTypesSpecifier(meta.snapshotsImportPath, meta.from),\n\t\t\tsymbol: \"Contract\",\n\t\t\talias: \"Start\",\n\t\t\ttypeOnly: true\n\t\t});\n\t}\n\treturn reqs;\n}\nfunction indent(text, spaces) {\n\tconst pad = \" \".repeat(spaces);\n\treturn text.split(\"\\n\").map((line) => line.trim() ? `${pad}${line}` : line).join(\"\\n\");\n}\n//#endregion\n//#region src/core/migrations/planner-produced-migration.ts\n/**\n* Planner-produced Mongo migration, returned by `MongoMigrationPlanner.plan(...)`\n* and `MongoMigrationPlanner.emptyMigration(...)`.\n*\n* Unlike user-authored migrations (which extend `MongoMigration` from\n* `@internal/family-mongo`), this class lives inside the target and holds\n* the richer authoring IR (`OpFactoryCall[]`) needed to render itself back to\n* TypeScript source. It implements `MigrationPlanWithAuthoringSurface` so\n* that the CLI can uniformly ask any planner result to serialize itself to a\n* `migration.ts`.\n*\n* It extends the framework `Migration` base directly and declares its own\n* `targetId` rather than inheriting `MongoMigration`, whose added value is\n* the lazily-built contract views a planner result never reads.\n*/\nvar PlannerProducedMongoMigration = class extends Migration {\n\tcalls;\n\tmeta;\n\tsnapshotsImportPath;\n\ttargetId = \"mongo\";\n\tconstructor(calls, meta, snapshotsImportPath) {\n\t\tsuper();\n\t\tthis.calls = calls;\n\t\tthis.meta = meta;\n\t\tthis.snapshotsImportPath = snapshotsImportPath;\n\t}\n\tget operations() {\n\t\treturn renderOps(this.calls);\n\t}\n\tdescribe() {\n\t\treturn this.meta;\n\t}\n\trenderTypeScript(resolveImportSpecifier) {\n\t\treturn renderCallsToTypeScript(this.calls, {\n\t\t\tfrom: this.meta.from,\n\t\t\tto: this.meta.to,\n\t\t\tsnapshotsImportPath: this.snapshotsImportPath,\n\t\t\tresolveImportSpecifier\n\t\t});\n\t}\n};\n//#endregion\n//#region src/core/migrations/mongo-planner.ts\nfunction validatorsEqual(a, b) {\n\tif (!a && !b) return true;\n\tif (!a || !b) return false;\n\treturn a.validationLevel === b.validationLevel && a.validationAction === b.validationAction && canonicalize(a.jsonSchema) === canonicalize(b.jsonSchema);\n}\nfunction isPlainObject(v) {\n\treturn typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\n/** Each field a root model or variant of the validator declares, with the distinct schemas they give it, in canonical form. */\nfunction propertiesOf(schema) {\n\tconst schemas = /* @__PURE__ */ new Map();\n\tfor (const shape of validatorDocumentShapesOf(schema)) for (const [field, fieldSchema] of Object.entries(shape.properties)) schemas.set(field, (schemas.get(field) ?? /* @__PURE__ */ new Set()).add(canonicalize(fieldSchema)));\n\treturn Object.fromEntries([...schemas].map(([field, distinct]) => [field, [...distinct].sort().join(\"|\")]));\n}\nfunction propertyChanges(origin, dest) {\n\treturn {\n\t\tchanged: Object.keys(dest).filter((field) => Object.hasOwn(origin, field) && origin[field] !== dest[field]),\n\t\tadded: Object.keys(dest).filter((field) => !Object.hasOwn(origin, field)),\n\t\tremoved: Object.keys(origin).filter((field) => !Object.hasOwn(dest, field))\n\t};\n}\n/** The property changes of each kind of document both validators describe that the collection-wide changes do not name, each in the words of the documents it applies to. */\nfunction shapeChanges(origin, dest, named) {\n\tconst canonical = (properties) => Object.fromEntries(Object.entries(properties).map(([field, schema]) => [field, canonicalize(schema)]));\n\tconst shapesBefore = validatorDocumentShapesOf(origin.jsonSchema);\n\tconst changes = validatorDocumentShapesOf(dest.jsonSchema).flatMap((shape) => {\n\t\tconst before = shapesBefore.find(({ key }) => key === shape.key);\n\t\tif (before === void 0 || shape.discriminator === void 0) return [];\n\t\tconst { field, value } = shape.discriminator;\n\t\tconst where = ` in documents whose ${field} is ${JSON.stringify(value)}`;\n\t\tconst found = propertyChanges(canonical(before.properties), canonical(shape.properties));\n\t\tconst unnamed = (kind) => found[kind].filter((each) => !named[kind].includes(each)).map((each) => `${each}${where}`);\n\t\treturn [{\n\t\t\tchanged: unnamed(\"changed\"),\n\t\t\tadded: unnamed(\"added\"),\n\t\t\tremoved: unnamed(\"removed\")\n\t\t}];\n\t});\n\treturn {\n\t\tchanged: changes.flatMap(({ changed }) => changed),\n\t\tadded: changes.flatMap(({ added }) => added),\n\t\tremoved: changes.flatMap(({ removed }) => removed)\n\t};\n}\n/**\n* A label naming the properties whose schema changed, so a dry run shows what a validator update does: `Update validator on items (changed: meta; added: note)`. A change of a variant's properties that the collection's properties as a whole do not show names the variant's documents.\n*/\nfunction validatorUpdateLabel(collName, origin, dest) {\n\tconst whole = propertyChanges(propertiesOf(origin.jsonSchema), propertiesOf(dest.jsonSchema));\n\tconst ofVariants = shapeChanges(origin, dest, whole);\n\tconst changed = [...whole.changed, ...ofVariants.changed];\n\tconst added = [...whole.added, ...ofVariants.added];\n\tconst removed = [...whole.removed, ...ofVariants.removed];\n\tconst parts = [\n\t\t...changed.length > 0 ? [`changed: ${changed.join(\", \")}`] : [],\n\t\t...added.length > 0 ? [`added: ${added.join(\", \")}`] : [],\n\t\t...removed.length > 0 ? [`removed: ${removed.join(\", \")}`] : []\n\t];\n\treturn parts.length === 0 ? `Update validator on ${collName}` : `Update validator on ${collName} (${parts.join(\"; \")})`;\n}\n/**\n* The keys of an option MongoDB fills in when a collection is created without them, each with a\n* test for the value it fills in. `listCollections` reports a time-series collection's granularity\n* as \"seconds\" and its bucketMaxSpanSeconds when they were not given, and bucketRoundingSeconds only\n* for custom bucketing, which a contract cannot state; and a clustered index's v, key and unique, and\n* its name as \"_id_\".\n*/\nconst SERVER_FILLED = {\n\ttimeseries: {\n\t\tgranularity: (value) => value === \"seconds\",\n\t\tbucketMaxSpanSeconds: () => true,\n\t\tbucketRoundingSeconds: () => true\n\t},\n\tclusteredIndex: {\n\t\tv: () => true,\n\t\tkey: () => true,\n\t\tunique: () => true,\n\t\tname: (value) => value === \"_id_\"\n\t}\n};\n/** The origin's value of an option without the keys the server filled in and the destination leaves out. */\nfunction withoutServerFilled(option, origin, dest) {\n\tif (!isPlainObject(origin)) return origin;\n\tconst filled = SERVER_FILLED[option];\n\treturn Object.fromEntries(Object.entries(origin).filter(([key, value]) => isPlainObject(dest) && Object.hasOwn(dest, key) || !filled[key]?.(value)));\n}\nfunction hasImmutableOptionChange(origin, dest) {\n\tif (canonicalize(origin?.capped) !== canonicalize(dest?.capped)) return \"capped\";\n\tif (canonicalize(withoutServerFilled(\"timeseries\", origin?.timeseries, dest?.timeseries)) !== canonicalize(dest?.timeseries)) return \"timeseries\";\n\tif (canonicalize(origin?.collation) !== canonicalize(dest?.collation)) return \"collation\";\n\tif (canonicalize(withoutServerFilled(\"clusteredIndex\", origin?.clusteredIndex, dest?.clusteredIndex)) !== canonicalize(dest?.clusteredIndex)) return \"clusteredIndex\";\n}\nfunction collectionHasOptions(coll) {\n\treturn !!(coll.options || coll.validator);\n}\n/**\n* The model of `fromContract` that stores its documents in `collection`, if any: the root model\n* when variants share the collection with it.\n*/\nfunction modelStoredIn(fromContract, collection) {\n\tconst storing = Object.entries(fromContract.domain.namespaces).flatMap(([namespaceId, namespace]) => Object.entries(namespace.models).flatMap(([model, definition]) => {\n\t\tconst coordinate = {\n\t\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\t\tmodel\n\t\t};\n\t\treturn collectionOfModel(fromContract.domain, coordinate) === collection ? [{\n\t\t\tcoordinate,\n\t\t\tisRoot: definition.base === void 0\n\t\t}] : [];\n\t}));\n\treturn (storing.find(({ isRoot }) => isRoot) ?? storing[0])?.coordinate;\n}\n/**\n* Each collection drop of the plan, with the model whose documents it loses. When that model keeps\n* its name and the plan brings its new collection into existence, the drop says how to rename the\n* collection by hand instead.\n*/\nfunction collectionDrops(calls, fromContract, contract, collections) {\n\tconst created = (collection) => collections.origin.collection(collection) === void 0 && collections.destination.collection(collection) !== void 0;\n\treturn calls.flatMap((call, operationIndex) => {\n\t\tif (!(call instanceof DropCollectionCall)) return [];\n\t\tconst model = fromContract === null ? void 0 : modelStoredIn(fromContract, call.collection);\n\t\tconst lost = {\n\t\t\toperationIndex,\n\t\t\tloss: \"drop\",\n\t\t\tlabel: call.label\n\t\t};\n\t\tif (model === void 0) return [{\n\t\t\t...lost,\n\t\t\tsubject: {\n\t\t\t\tkind: \"storage\",\n\t\t\t\tname: call.collection\n\t\t\t}\n\t\t}];\n\t\tconst subject = {\n\t\t\tkind: \"model\",\n\t\t\t...model\n\t\t};\n\t\tconst destinationCollection = modelStoredInDestination(contract, model);\n\t\treturn [destinationCollection !== void 0 && created(destinationCollection) ? {\n\t\t\t...lost,\n\t\t\tsubject,\n\t\t\tkeepDataAdvice: keepCollectionByHandAdvice(model, call.collection, destinationCollection)\n\t\t} : {\n\t\t\t...lost,\n\t\t\tsubject\n\t\t}];\n\t});\n}\n/** The collection the destination stores `model` in, when the destination still has that model. */\nfunction modelStoredInDestination(contract, model) {\n\tconst namespace = contract.domain.namespaces[model.namespaceId];\n\treturn namespace !== void 0 && Object.hasOwn(namespace.models, model.model) ? collectionOfModel(contract.domain, model) : void 0;\n}\nfunction callsOf(diff) {\n\treturn [\n\t\t...diff.collCreates,\n\t\t...diff.drops,\n\t\t...diff.creates,\n\t\t...diff.validatorOps,\n\t\t...diff.mutableOptionOps,\n\t\t...diff.collDrops\n\t];\n}\n/**\n* The calls for one collection. Indexes are paired in `originColl` and `destColl`, which may hold indexes in the form the verifier compares; each create is built from the contract's index as written, in `writtenDestColl`.\n*/\nfunction planCollectionDiff(collName, originColl, destColl, writtenDestColl) {\n\tconst collCreates = [];\n\tconst drops = [];\n\tconst creates = [];\n\tconst validatorOps = [];\n\tconst mutableOptionOps = [];\n\tconst collDrops = [];\n\tconst conflicts = [];\n\tif (!originColl) {\n\t\tif (destColl && (collectionHasOptions(destColl) || destColl.indexes.length === 0)) {\n\t\t\tconst opts = collectionHasOptions(destColl) ? schemaCollectionToCreateCollectionOptions(destColl) : void 0;\n\t\t\tcollCreates.push(new CreateCollectionCall(collName, opts));\n\t\t}\n\t} else if (!destColl) collDrops.push(new DropCollectionCall(collName));\n\telse {\n\t\tconst immutableChange = hasImmutableOptionChange(originColl.options, destColl.options);\n\t\tif (immutableChange) conflicts.push({\n\t\t\tkind: \"policy-violation\",\n\t\t\tsummary: `Cannot change immutable collection option '${immutableChange}' on ${collName}`,\n\t\t\twhy: `MongoDB does not support modifying the '${immutableChange}' option after collection creation`\n\t\t});\n\t\tconst mutableCall = planMutableOptionsDiffCall(collName, originColl.options, destColl.options);\n\t\tif (mutableCall) mutableOptionOps.push(mutableCall);\n\t\tconst validatorCall = planValidatorDiffCall(collName, originColl.validator, destColl.validator);\n\t\tif (validatorCall) validatorOps.push(validatorCall);\n\t}\n\tconst originLookup = /* @__PURE__ */ new Map();\n\tif (originColl) for (const idx of originColl.indexes) originLookup.set(indexLookupKey(idx), idx);\n\tconst destLookup = /* @__PURE__ */ new Map();\n\tif (destColl) for (const idx of destColl.indexes) destLookup.set(indexLookupKey(idx), idx);\n\tfor (const [lookupKey, idx] of originLookup) if (destLookup.get(lookupKey)?.name !== idx.name) drops.push(new DropIndexCall(collName, idx.keys, schemaIndexToCreateIndexOptions(idx)));\n\tfor (const [lookupKey, idx] of destLookup) if (originLookup.get(lookupKey)?.name !== idx.name) {\n\t\tconst asWritten = writtenDestColl?.indexes.find((written) => written.name === idx.name) ?? idx;\n\t\tcreates.push(new CreateIndexCall(collName, asWritten.keys, schemaIndexToCreateIndexOptions(asWritten)));\n\t}\n\treturn {\n\t\tcollCreates,\n\t\tdrops,\n\t\tcreates,\n\t\tvalidatorOps,\n\t\tmutableOptionOps,\n\t\tcollDrops,\n\t\tconflicts\n\t};\n}\n/**\n* The warning for a change a collection's control policy left out of the plan, worded as the Postgres planner words a suppressed call.\n*/\nfunction suppressedCallWarning(call, collection, control) {\n\tconst declared = control.declared !== void 0 && control.declared !== control.policy ? ` but declared '${control.declared}'` : \"\";\n\treturn {\n\t\tkind: \"controlPolicySuppressedCall\",\n\t\tsummary: `control policy suppressed: ${call.label} — collection \"${collection}\" has effective control '${control.policy}'${declared}`,\n\t\tmeta: {\n\t\t\tcontrolPolicy: control.policy,\n\t\t\t...ifDefined(\"declaredControlPolicy\", control.declared)\n\t\t}\n\t};\n}\nfunction withIndexesOf(schema, indexesFrom) {\n\treturn new MongoSchemaIR(schema.collections.map((collection) => new MongoSchemaCollection({\n\t\tname: collection.name,\n\t\tindexes: indexesFrom.collection(collection.name)?.indexes ?? collection.indexes,\n\t\t...ifDefined(\"validator\", collection.validator),\n\t\t...ifDefined(\"options\", collection.options)\n\t})), { fromDatabase: schema.fromDatabase });\n}\n/**\n* The origin and destination with indexes the planner can pair by content. A database reports a text index's keys as `_fts` and `_ftsx` and fills in its weights and languages and a collation's unwritten fields, so the indexes of a database origin are compared as the verifier compares them. A contract origin is compared exactly.\n*/\nfunction comparableIndexes(origin, destination, fromDatabase) {\n\tif (!fromDatabase) return {\n\t\torigin,\n\t\tdestination\n\t};\n\tconst canonical = canonicalizeSchemasForVerification(origin, destination);\n\treturn {\n\t\torigin: withIndexesOf(origin, canonical.live),\n\t\tdestination: withIndexesOf(destination, canonical.expected)\n\t};\n}\nvar MongoMigrationPlanner = class {\n\tplanCalls(options) {\n\t\tconst contract = blindCast(options.contract);\n\t\tconst schema = blindCast(options.schema);\n\t\tconst writtenDestinationIR = contractToMongoSchemaIR(contract);\n\t\tconst { origin: originIR, destination: destinationIR } = comparableIndexes(options.statementCalls?.schema ?? schema, writtenDestinationIR, schema.fromDatabase);\n\t\tconst collCreates = [];\n\t\tconst drops = [];\n\t\tconst creates = [];\n\t\tconst validatorOps = [];\n\t\tconst mutableOptionOps = [];\n\t\tconst collDrops = [];\n\t\tconst conflicts = [];\n\t\tconst warnings = [];\n\t\tconst allCollectionNames = /* @__PURE__ */ new Set([...originIR.collectionNames, ...destinationIR.collectionNames]);\n\t\tfor (const collName of [...allCollectionNames].sort()) {\n\t\t\tconst originColl = originIR.collection(collName);\n\t\t\tconst planned = planCollectionDiff(collName, originColl, destinationIR.collection(collName), writtenDestinationIR.collection(collName));\n\t\t\tconst control = collectionControlOf(contract, options.fromContract, collName);\n\t\t\tif (!plansChangesTo(control.policy, originColl !== void 0)) {\n\t\t\t\twarnings.push(...callsOf(planned).map((call) => suppressedCallWarning(call, collName, control)));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tcollCreates.push(...planned.collCreates);\n\t\t\tdrops.push(...planned.drops);\n\t\t\tcreates.push(...planned.creates);\n\t\t\tvalidatorOps.push(...planned.validatorOps);\n\t\t\tmutableOptionOps.push(...planned.mutableOptionOps);\n\t\t\tcollDrops.push(...planned.collDrops);\n\t\t\tconflicts.push(...planned.conflicts);\n\t\t}\n\t\tif (conflicts.length > 0) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts\n\t\t};\n\t\tconst allCalls = [\n\t\t\t...options.statementCalls?.collectionRenames ?? [],\n\t\t\t...collCreates,\n\t\t\t...drops,\n\t\t\t...options.statementCalls?.rewrites ?? [],\n\t\t\t...creates,\n\t\t\t...validatorOps,\n\t\t\t...mutableOptionOps,\n\t\t\t...collDrops\n\t\t];\n\t\tfor (const call of allCalls) if (!options.policy.allowedOperationClasses.includes(call.operationClass)) conflicts.push({\n\t\t\tkind: \"policy-violation\",\n\t\t\tsummary: `${call.operationClass} operation disallowed: ${call.label}`,\n\t\t\twhy: `Policy does not allow '${call.operationClass}' operations`,\n\t\t\trefusedOperationClass: call.operationClass\n\t\t});\n\t\tif (conflicts.length > 0) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts\n\t\t};\n\t\treturn {\n\t\t\tkind: \"success\",\n\t\t\tcalls: allCalls,\n\t\t\twarnings\n\t\t};\n\t}\n\tplan(options) {\n\t\tconst contract = blindCast(options.contract);\n\t\tconst originIR = blindCast(options.schema);\n\t\tconst fromContract = options.fromContract;\n\t\tconst renames = options.statements.filter((statement) => statement.kind === \"rename\");\n\t\tconst statementPlan = planStatements({\n\t\t\tstatements: renames,\n\t\t\tfromContract: fromContract ?? contract,\n\t\t\tcontract,\n\t\t\tschema: originIR\n\t\t});\n\t\tif (!statementPlan.ok) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts: statementPlan.failure\n\t\t};\n\t\tconst { schema, collectionRenames, fieldRenames, callOfStatement } = statementPlan.value;\n\t\tconst destinationIR = contractToMongoSchemaIR(contract);\n\t\tconst storedKeys = planStoredKeyRewrites({\n\t\t\tstatements: renames,\n\t\t\tfromContract,\n\t\t\tcontract,\n\t\t\tschema,\n\t\t\tdestination: destinationIR\n\t\t});\n\t\tif (!storedKeys.ok) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts: [...storedKeys.failure]\n\t\t};\n\t\tconst storedKeyRewrites = [...storedKeys.value.renames, ...storedKeys.value.removals];\n\t\tconst enumValues = planEnumValueRewrites({\n\t\t\tstatements: renames,\n\t\t\tfromContract,\n\t\t\tcontract,\n\t\t\tschema,\n\t\t\tlookups: mongoTypeLookupsOf(options.frameworkComponents)\n\t\t});\n\t\tif (!enumValues.ok) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts: [...enumValues.failure]\n\t\t};\n\t\tconst { replacements: valueReplacements, removals: valueRemovals } = enumValues.value;\n\t\tconst renamedTo = new Map(collectionRenames.map((call) => [call.from, call.to]));\n\t\tconst match = fromContract === null ? void 0 : {\n\t\t\tstatements: renames,\n\t\t\tfromContract,\n\t\t\tcontract,\n\t\t\tcollectionAfterRenames: (collection) => renamedTo.get(collection) ?? collection\n\t\t};\n\t\tconst lookups = mongoTypeLookupsOf(options.frameworkComponents);\n\t\tconst plannedFills = planFieldFills({\n\t\t\tmatch,\n\t\t\tcontract,\n\t\t\tlookups,\n\t\t\tschema,\n\t\t\tdestination: destinationIR,\n\t\t\tstatements: options.statements\n\t\t});\n\t\tif (!plannedFills.ok) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts: [...plannedFills.failure]\n\t\t};\n\t\tconst fills = plannedFills.value;\n\t\tconst variants = planVariantDocumentRewrites({\n\t\t\tstatements: options.statements,\n\t\t\tfromContract,\n\t\t\tcontract,\n\t\t\tschema,\n\t\t\tkeptCollections: new Set(schema.collectionNames.filter((name) => destinationIR.collection(name) !== void 0)),\n\t\t\tcollectionAfterRenames: (collection) => renamedTo.get(collection) ?? collection,\n\t\t\tenumReplacements: valueReplacements.flatMap(({ call }) => call instanceof ReplaceStoredValueCall ? [call] : []),\n\t\t\tfieldRenames: fieldRenames.map(({ call }) => call)\n\t\t});\n\t\tif (!variants.ok) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts: [...variants.failure]\n\t\t};\n\t\tconst { deletes: variantDeletes, replacements: variantReplacements } = variants.value;\n\t\tconst variantCalls = new Set(variantReplacements.map(({ call }) => call));\n\t\tconst removals = fromContract === null ? planValidatorFieldRemovals({\n\t\t\torigin: schema,\n\t\t\tdestination: destinationIR,\n\t\t\tcontract\n\t\t}) : planFieldRemovals({\n\t\t\tstatements: renames,\n\t\t\tfromContract,\n\t\t\tcontract,\n\t\t\tcollectionAfterRenames: (collection) => renamedTo.get(collection) ?? collection,\n\t\t\tkeptCollections: new Set(schema.collectionNames.filter((name) => destinationIR.collection(name) !== void 0))\n\t\t});\n\t\tconst typeChanges = fromContract === null ? planValidatorTypeChanges({\n\t\t\torigin: schema,\n\t\t\tdestination: destinationIR,\n\t\t\tcontract\n\t\t}) : planFieldTypeChanges({\n\t\t\tstatements: renames,\n\t\t\tfromContract,\n\t\t\tcontract,\n\t\t\tcollectionAfterRenames: (collection) => renamedTo.get(collection) ?? collection,\n\t\t\tkeptCollections: new Set(schema.collectionNames.filter((name) => destinationIR.collection(name) !== void 0))\n\t\t}, lookups);\n\t\tconst contracts = {\n\t\t\tfromContract: fromContract ?? contract,\n\t\t\tcontract\n\t\t};\n\t\tconst converted = [];\n\t\tconst transforms = options.statements.flatMap((statement) => {\n\t\t\tif (statement.kind === \"convert\" && statement.entity === \"field\") {\n\t\t\t\tconst change = typeChangeConverted(statement, typeChanges);\n\t\t\t\tif (change !== void 0) converted.push(change);\n\t\t\t\treturn [{\n\t\t\t\t\tstatement,\n\t\t\t\t\toutcome: convertTransform(statement, change, contracts)\n\t\t\t\t}];\n\t\t\t}\n\t\t\tif (statement.kind === \"backfill\" && statement.entity === \"field\" && embeddingModelOf(contract.domain, statement.field) === void 0) return [{\n\t\t\t\tstatement,\n\t\t\t\toutcome: backfillTransform(statement, {\n\t\t\t\t\tcontract,\n\t\t\t\t\tschema,\n\t\t\t\t\tmatch\n\t\t\t\t})\n\t\t\t}];\n\t\t\treturn [];\n\t\t});\n\t\tconst unconverted = typeChanges.filter((change) => !converted.includes(change));\n\t\tconst rewritable = unconverted.filter((change) => unrewritableFieldNameReason(change.field) === void 0);\n\t\tconst casts = rewritable.flatMap((change) => {\n\t\t\tconst call = castFieldCallOf(change);\n\t\t\treturn call === void 0 ? [] : [{\n\t\t\t\t...change,\n\t\t\t\tcall\n\t\t\t}];\n\t\t});\n\t\tconst storedKeyFills = planStoredKeyFills({\n\t\t\tstatements: options.statements,\n\t\t\tfromContract,\n\t\t\tcontract,\n\t\t\tlookups,\n\t\t\tschema,\n\t\t\tdestination: destinationIR\n\t\t});\n\t\tif (!storedKeyFills.ok) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts: [...storedKeyFills.failure]\n\t\t};\n\t\tconst rewrites = [\n\t\t\t...removals.map(({ call, destination, variant }) => ({\n\t\t\t\tkind: \"removal\",\n\t\t\t\tcollection: call.collection,\n\t\t\t\tfield: call.field,\n\t\t\t\tvariant,\n\t\t\t\tmodel: destination,\n\t\t\t\tstoredKey: void 0\n\t\t\t})),\n\t\t\t...casts.map((change) => ({\n\t\t\t\tkind: \"cast\",\n\t\t\t\tcollection: change.collection,\n\t\t\t\tfield: change.field,\n\t\t\t\tvariant: change.variant,\n\t\t\t\tmodel: change.destination,\n\t\t\t\tstoredKey: void 0\n\t\t\t})),\n\t\t\t...transforms.flatMap(({ outcome }) => outcome.kind === \"transform\" ? [outcome.rewrite] : []),\n\t\t\t...fills.map(({ call, subject, variant }) => ({\n\t\t\t\tkind: \"fill\",\n\t\t\t\tcollection: call.options.collection,\n\t\t\t\tfield: call.options.field,\n\t\t\t\tvariant,\n\t\t\t\tmodel: subject.kind === \"field\" ? subject : void 0,\n\t\t\t\tstoredKey: void 0\n\t\t\t}))\n\t\t];\n\t\tconst refusals = [\n\t\t\t...transforms.flatMap(({ outcome }) => outcome.kind === \"refused\" ? [outcome.conflict] : []),\n\t\t\t...unrewritableTypeChangeRefusals(unconverted, contract),\n\t\t\t...noCastRefusals(rewritable, contract),\n\t\t\t...rewrites.flatMap((rewrite) => rewriteRefusals(rewrite, contract, {\n\t\t\t\ttimeSeries: schema.collection(rewrite.collection)?.options?.timeseries !== void 0,\n\t\t\t\tvalidator: schema.collection(rewrite.collection)?.validator?.jsonSchema\n\t\t\t}))\n\t\t];\n\t\tif (refusals.length > 0) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts: refusals\n\t\t};\n\t\tconst callsOf = new Map([\n\t\t\t...renames.map((statement, index) => {\n\t\t\t\tconst call = callOfStatement[index];\n\t\t\t\tconst keyCalls = [\n\t\t\t\t\t...storedKeyRewrites,\n\t\t\t\t\t...variantReplacements,\n\t\t\t\t\t...valueReplacements\n\t\t\t\t].flatMap((rewrite) => rewrite.statement === statement ? [rewrite.call] : []);\n\t\t\t\treturn [statement, call === void 0 ? keyCalls : [call, ...keyCalls]];\n\t\t\t}),\n\t\t\t...transforms.map(({ statement, outcome }) => outcome.kind === \"transform\" ? [statement, [outcome.call]] : [statement, []]),\n\t\t\t...variantReplacements.flatMap((rewrite) => rewrite.statement?.kind === \"convert\" ? [[rewrite.statement, [rewrite.call]]] : []),\n\t\t\t...options.statements.flatMap((statement) => {\n\t\t\t\tconst calls = storedKeyFills.value.flatMap((fill) => fill.statement === statement ? [fill.call] : []);\n\t\t\t\treturn calls.length === 0 ? [] : [[statement, calls]];\n\t\t\t})\n\t\t]);\n\t\tconst twoMigrationsAdvice = new Map([...[...valueReplacements, ...valueRemovals].map((rewrite) => [rewrite.call, rewrite.twoMigrationsAdvice]), ...[...variantDeletes, ...variantReplacements].map((rewrite) => [rewrite.call, VARIANT_TWO_STEPS])]);\n\t\tconst changeOfCall = new Map([\n\t\t\t...removals.map(({ call, subject }) => [call, {\n\t\t\t\tkind: \"removed\",\n\t\t\t\tsubject\n\t\t\t}]),\n\t\t\t...variantDeletes.map(({ call, model }) => [call, {\n\t\t\t\tkind: \"removed\",\n\t\t\t\tsubject: {\n\t\t\t\t\tkind: \"model\",\n\t\t\t\t\t...model\n\t\t\t\t}\n\t\t\t}]),\n\t\t\t...storedKeys.value.removals.map(({ call, subject }) => [call, {\n\t\t\t\tkind: \"removed\",\n\t\t\t\tsubject\n\t\t\t}]),\n\t\t\t...valueRemovals.map(({ call, enumValue }) => [call, {\n\t\t\t\tkind: \"removed\",\n\t\t\t\tsubject: {\n\t\t\t\t\tkind: \"enumValue\",\n\t\t\t\t\t...enumValue\n\t\t\t\t}\n\t\t\t}]),\n\t\t\t...fills.map(({ call, subject }) => [call, {\n\t\t\t\tkind: \"newRequired\",\n\t\t\t\tsubject\n\t\t\t}]),\n\t\t\t...storedKeyFills.value.flatMap(({ call, subject, text }) => text === void 0 ? [] : [[call, {\n\t\t\t\tkind: \"newRequired\",\n\t\t\t\tsubject\n\t\t\t}]])\n\t\t]);\n\t\tconst rewriteOf = (facts) => {\n\t\t\tconst statements = options.statements.filter((statement) => (callsOf.get(statement) ?? []).includes(facts.call));\n\t\t\treturn {\n\t\t\t\t...facts,\n\t\t\t\tstatements,\n\t\t\t\ttwoMigrationsAdvice: twoMigrationsAdvice.get(facts.call),\n\t\t\t\tunanswered: statements.length === 0 ? changeOfCall.get(facts.call) : void 0\n\t\t\t};\n\t\t};\n\t\tconst writesDiscriminator = ({ statement }) => {\n\t\t\tconst { namespaceId, model, field } = statement.field;\n\t\t\treturn mongoModelsOf(contract.domain, namespaceId)[model]?.discriminator?.field === field;\n\t\t};\n\t\tconst transformRewrites = (kind, selected = () => true) => transforms.filter(selected).flatMap(({ statement, outcome }) => statement.kind === kind && outcome.kind === \"transform\" ? [rewriteOf({\n\t\t\tkind: \"dataTransform\",\n\t\t\tcall: outcome.call,\n\t\t\ttransformedField: outcome.rewrite.field,\n\t\t\tdiscriminatorFilter: variantDiscriminatorFilter(outcome.rewrite.variant)\n\t\t})] : []);\n\t\tconst fieldRenamesSelecting = (kind) => fieldRenames.flatMap(({ call, discriminatorFilter }) => discriminatorFilter?.kind === kind ? [rewriteOf({\n\t\t\tkind: \"renameField\",\n\t\t\tcall,\n\t\t\tdiscriminatorFilter\n\t\t})] : []);\n\t\tconst orderedRewrites = [\n\t\t\t...fieldRenamesSelecting(\"variant\"),\n\t\t\t...fieldRenamesSelecting(void 0),\n\t\t\t...variantDeletes.map(({ call, field, from }) => rewriteOf({\n\t\t\t\tkind: \"deleteDocuments\",\n\t\t\t\tcall,\n\t\t\t\tdeletedVariant: {\n\t\t\t\t\tfield,\n\t\t\t\t\tvalue: from\n\t\t\t\t}\n\t\t\t})),\n\t\t\t...variantReplacements.map(({ call, to }) => rewriteOf({\n\t\t\t\tkind: \"replaceStoredValue\",\n\t\t\t\tcall,\n\t\t\t\twrittenValue: valueReplacements.find((replacement) => replacement.call === call)?.writtenValue ?? to,\n\t\t\t\tdiscriminatorFilter: void 0\n\t\t\t})),\n\t\t\t...fieldRenamesSelecting(\"noneOf\"),\n\t\t\t...storedKeys.value.renames.map(({ call, variant }) => rewriteOf({\n\t\t\t\tkind: \"renameStoredKey\",\n\t\t\t\tcall,\n\t\t\t\tdiscriminatorFilter: variantDiscriminatorFilter(variant)\n\t\t\t})),\n\t\t\t...valueReplacements.flatMap(({ call, writtenValue, variant }) => variantCalls.has(call) ? [] : [rewriteOf({\n\t\t\t\tkind: \"replaceStoredValue\",\n\t\t\t\tcall,\n\t\t\t\twrittenValue,\n\t\t\t\tdiscriminatorFilter: variantDiscriminatorFilter(variant)\n\t\t\t})]),\n\t\t\t...transformRewrites(\"backfill\", writesDiscriminator),\n\t\t\t...casts.map(({ call, variant }) => rewriteOf({\n\t\t\t\tkind: \"castField\",\n\t\t\t\tcall,\n\t\t\t\tdiscriminatorFilter: variantDiscriminatorFilter(variant)\n\t\t\t})),\n\t\t\t...transformRewrites(\"convert\"),\n\t\t\t...fills.map(({ call, variant }) => rewriteOf({\n\t\t\t\tkind: \"fillField\",\n\t\t\t\tcall,\n\t\t\t\tdiscriminatorFilter: variantDiscriminatorFilter(variant)\n\t\t\t})),\n\t\t\t...storedKeyFills.value.map(({ call, variant }) => rewriteOf({\n\t\t\t\tkind: \"fillStoredKey\",\n\t\t\t\tcall,\n\t\t\t\tdiscriminatorFilter: variantDiscriminatorFilter(variant)\n\t\t\t})),\n\t\t\t...transformRewrites(\"backfill\", (transform) => !writesDiscriminator(transform)),\n\t\t\t...removals.map(({ call, discriminatorFilter }) => rewriteOf({\n\t\t\t\tkind: \"unsetField\",\n\t\t\t\tcall,\n\t\t\t\tdiscriminatorFilter\n\t\t\t})),\n\t\t\t...storedKeys.value.removals.map(({ call, variant }) => rewriteOf({\n\t\t\t\tkind: \"removeStoredKey\",\n\t\t\t\tcall,\n\t\t\t\tdiscriminatorFilter: variantDiscriminatorFilter(variant)\n\t\t\t})),\n\t\t\t...valueRemovals.map(({ call, variant }) => rewriteOf({\n\t\t\t\tkind: \"removeStoredValue\",\n\t\t\t\tcall,\n\t\t\t\tdiscriminatorFilter: variantDiscriminatorFilter(variant)\n\t\t\t}))\n\t\t];\n\t\tconst overlap = overlapRefusal(orderedRewrites, {\n\t\t\t...contracts,\n\t\t\tstatements: options.statements\n\t\t});\n\t\tif (overlap !== void 0) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts: [overlap]\n\t\t};\n\t\tconst result = this.planCalls({\n\t\t\t...options,\n\t\t\tstatementCalls: {\n\t\t\t\tschema,\n\t\t\t\tcollectionRenames,\n\t\t\t\trewrites: orderedRewrites.map(({ call }) => call)\n\t\t\t}\n\t\t});\n\t\tif (result.kind === \"failure\") return result;\n\t\tconst { calls, warnings } = result;\n\t\tconst allWarnings = [...warnings, ...match === void 0 ? [] : documentsNotRewrittenWarnings(match)];\n\t\tconst fieldLoss = [\n\t\t\t...variantDeletes.map((rewrite) => ({\n\t\t\t\toperationIndex: calls.indexOf(rewrite.call),\n\t\t\t\tsubject: {\n\t\t\t\t\tkind: \"model\",\n\t\t\t\t\t...rewrite.model\n\t\t\t\t},\n\t\t\t\tloss: \"drop\",\n\t\t\t\tlabel: rewrite.call.label\n\t\t\t})),\n\t\t\t...removals.map((removal) => ({\n\t\t\t\toperationIndex: calls.indexOf(removal.call),\n\t\t\t\tsubject: removal.subject,\n\t\t\t\tloss: \"drop\",\n\t\t\t\tlabel: removal.call.label\n\t\t\t})),\n\t\t\t...storedKeys.value.removals.map((removal) => ({\n\t\t\t\toperationIndex: calls.indexOf(removal.call),\n\t\t\t\tsubject: removal.subject,\n\t\t\t\tloss: \"drop\",\n\t\t\t\tlabel: removal.call.label\n\t\t\t})),\n\t\t\t...valueRemovals.map((removal) => ({\n\t\t\t\toperationIndex: calls.indexOf(removal.call),\n\t\t\t\tsubject: {\n\t\t\t\t\tkind: \"enumValue\",\n\t\t\t\t\t...removal.enumValue\n\t\t\t\t},\n\t\t\t\tloss: \"drop\",\n\t\t\t\tlabel: removal.call.label,\n\t\t\t\t...ifDefined(\"keepDataEdit\", removal.keepDataEdit),\n\t\t\t\t...ifDefined(\"keepDataAdvice\", removal.keepDataAdvice)\n\t\t\t})),\n\t\t\t...casts.flatMap(({ call, subject }) => call.operationClass !== \"destructive\" ? [] : [{\n\t\t\t\toperationIndex: calls.indexOf(call),\n\t\t\t\tsubject,\n\t\t\t\tloss: \"typeChange\",\n\t\t\t\tlabel: call.label\n\t\t\t}])\n\t\t];\n\t\treturn {\n\t\t\tkind: \"success\",\n\t\t\tplan: new PlannerProducedMongoMigration(calls, {\n\t\t\t\tfrom: options.origin?.storageHash ?? null,\n\t\t\t\tto: contract.storage.storageHash\n\t\t\t}, options.snapshotsImportPath),\n\t\t\tappliedStatements: options.statements.map((statement) => ({\n\t\t\t\tstatement,\n\t\t\t\toperationIndexes: (callsOf.get(statement) ?? []).map((call) => calls.indexOf(call))\n\t\t\t})),\n\t\t\tdataLoss: [...collectionDrops(calls, fromContract, contract, {\n\t\t\t\torigin: schema,\n\t\t\t\tdestination: destinationIR\n\t\t\t}), ...fieldLoss].sort((a, b) => a.operationIndex - b.operationIndex),\n\t\t\taccessChanges: [],\n\t\t\ttemporaryValues: [...fills.map((fill) => ({\n\t\t\t\toperationIndex: calls.indexOf(fill.call),\n\t\t\t\tsubject: fill.subject,\n\t\t\t\tvalue: fill.text\n\t\t\t})), ...storedKeyFills.value.flatMap(({ call, subject, text }) => text === void 0 ? [] : [{\n\t\t\t\toperationIndex: calls.indexOf(call),\n\t\t\t\tsubject,\n\t\t\t\tvalue: text\n\t\t\t}])],\n\t\t\t...allWarnings.length > 0 ? { warnings: allWarnings } : {}\n\t\t};\n\t}\n\t/**\n\t* Produce an empty `migration.ts` authoring surface for `migration new`.\n\t*\n\t* The \"empty migration\" is a `PlannerProducedMongoMigration` with no\n\t* operations; `renderTypeScript()` emits a stub class with the correct\n\t* `from`/`to` metadata that the user then fills in with operations. The\n\t* contract path on the context is unused — Mongo's emitted source does\n\t* not import from the generated contract `.d.ts`.\n\t*/\n\temptyMigration(context) {\n\t\treturn new PlannerProducedMongoMigration([], {\n\t\t\tfrom: context.fromHash,\n\t\t\tto: context.toHash\n\t\t}, context.snapshotsImportPath);\n\t}\n};\nfunction plansChangesTo(policy, collectionExists) {\n\tswitch (policy) {\n\t\tcase \"managed\": return true;\n\t\tcase \"tolerated\": return !collectionExists;\n\t\tcase \"external\":\n\t\tcase \"observed\": return false;\n\t}\n}\nfunction planValidatorDiffCall(collName, originValidator, destValidator) {\n\tif (validatorsEqual(originValidator, destValidator)) return void 0;\n\tif (destValidator) return new CollModCall(collName, {\n\t\tvalidator: { $jsonSchema: destValidator.jsonSchema },\n\t\tvalidationLevel: destValidator.validationLevel,\n\t\tvalidationAction: destValidator.validationAction\n\t}, {\n\t\tid: `validator.${collName}.${originValidator ? \"update\" : \"add\"}`,\n\t\tlabel: originValidator ? validatorUpdateLabel(collName, originValidator, destValidator) : `Add validator on ${collName}`,\n\t\toperationClass: \"widening\",\n\t\tcheckDocuments: true\n\t});\n\treturn new CollModCall(collName, {\n\t\tvalidator: {},\n\t\tvalidationLevel: \"strict\",\n\t\tvalidationAction: \"error\"\n\t}, {\n\t\tid: `validator.${collName}.remove`,\n\t\tlabel: `Remove validator on ${collName}`,\n\t\toperationClass: \"widening\"\n\t});\n}\nfunction planMutableOptionsDiffCall(collName, origin, dest) {\n\tconst originCSPPI = origin?.changeStreamPreAndPostImages;\n\tconst destCSPPI = dest?.changeStreamPreAndPostImages;\n\tif (deepEqual(originCSPPI, destCSPPI)) return void 0;\n\treturn new CollModCall(collName, { changeStreamPreAndPostImages: destCSPPI ?? { enabled: false } }, {\n\t\tid: `options.${collName}.update`,\n\t\tlabel: `Update mutable options on ${collName}`,\n\t\toperationClass: \"widening\"\n\t});\n}\n//#endregion\n//#region src/core/migrations/filter-evaluator.ts\nfunction isRecord$1(value) {\n\treturn value !== null && typeof value === \"object\";\n}\nfunction getNestedField(doc, path) {\n\tconst parts = path.split(\".\");\n\tlet current = doc;\n\tfor (const part of parts) {\n\t\tif (!isRecord$1(current)) return;\n\t\tconst record = current;\n\t\tif (!Object.hasOwn(record, part)) return;\n\t\tcurrent = record[part];\n\t}\n\treturn blindCast(current);\n}\nfunction evaluateFieldOp(op, actual, expected) {\n\tswitch (op) {\n\t\tcase \"$eq\": return deepEqual(actual, expected);\n\t\tcase \"$ne\": return !deepEqual(actual, expected);\n\t\tcase \"$gt\": return typeof actual === typeof expected && blindCast(actual) > blindCast(expected);\n\t\tcase \"$gte\": return typeof actual === typeof expected && blindCast(actual) >= blindCast(expected);\n\t\tcase \"$lt\": return typeof actual === typeof expected && blindCast(actual) < blindCast(expected);\n\t\tcase \"$lte\": return typeof actual === typeof expected && blindCast(actual) <= blindCast(expected);\n\t\tcase \"$in\": return Array.isArray(expected) && expected.some((v) => deepEqual(actual, v));\n\t\tdefault: throw mongoTargetError(\"MIGRATION.OPERATION_UNSUPPORTED\", `Unsupported filter operator in migration check: ${op}`, { meta: { operator: op } });\n\t}\n}\nvar FilterEvaluator = class {\n\tdoc = {};\n\tevaluate(filter, doc) {\n\t\tthis.doc = doc;\n\t\treturn filter.accept(this);\n\t}\n\tfield(expr) {\n\t\tconst value = getNestedField(this.doc, expr.field);\n\t\treturn evaluateFieldOp(expr.op, value, expr.value);\n\t}\n\tand(expr) {\n\t\treturn expr.exprs.every((child) => child.accept(this));\n\t}\n\tor(expr) {\n\t\treturn expr.exprs.some((child) => child.accept(this));\n\t}\n\tnot(expr) {\n\t\treturn !expr.expr.accept(this);\n\t}\n\texists(expr) {\n\t\tconst has = getNestedField(this.doc, expr.field) !== void 0;\n\t\treturn expr.exists ? has : !has;\n\t}\n\texpr(_expr) {\n\t\tthrow mongoTargetError(\"MIGRATION.OPERATION_UNSUPPORTED\", \"Aggregation expression filters are not supported in migration checks\", { meta: { operator: \"$expr\" } });\n\t}\n};\n//#endregion\n//#region src/core/migrations/mongo-ops-serializer.ts\nconst IndexKeyJson = type({\n\tfield: \"string\",\n\tdirection: type(\"1 | -1 | \\\"text\\\" | \\\"2dsphere\\\" | \\\"2d\\\" | \\\"hashed\\\"\")\n});\nconst CollationJson = type({\n\tlocale: \"string\",\n\t\"caseLevel?\": \"boolean\",\n\t\"caseFirst?\": \"string\",\n\t\"strength?\": \"number\",\n\t\"numericOrdering?\": \"boolean\",\n\t\"alternate?\": \"string\",\n\t\"maxVariable?\": \"string\",\n\t\"backwards?\": \"boolean\",\n\t\"normalization?\": \"boolean\"\n});\nconst CreateIndexJson = type({\n\tkind: \"\\\"createIndex\\\"\",\n\tcollection: \"string\",\n\tkeys: IndexKeyJson.array().atLeastLength(1),\n\t\"unique?\": \"boolean\",\n\t\"sparse?\": \"boolean\",\n\t\"expireAfterSeconds?\": \"number\",\n\t\"partialFilterExpression?\": \"Record<string, unknown>\",\n\t\"name?\": \"string\",\n\t\"wildcardProjection?\": \"Record<string, 0 | 1>\",\n\t\"collation?\": CollationJson,\n\t\"weights?\": \"Record<string, number>\",\n\t\"default_language?\": \"string\",\n\t\"language_override?\": \"string\"\n});\nconst DropIndexJson = type({\n\tkind: \"\\\"dropIndex\\\"\",\n\tcollection: \"string\",\n\tname: \"string\"\n});\nconst CreateCollectionJson = type({\n\tkind: \"\\\"createCollection\\\"\",\n\tcollection: \"string\",\n\t\"validator?\": \"Record<string, unknown>\",\n\t\"validationLevel?\": \"\\\"strict\\\" | \\\"moderate\\\"\",\n\t\"validationAction?\": \"\\\"error\\\" | \\\"warn\\\"\",\n\t\"capped?\": \"boolean\",\n\t\"size?\": \"number\",\n\t\"max?\": \"number\",\n\t\"timeseries?\": {\n\t\ttimeField: \"string\",\n\t\t\"metaField?\": \"string\",\n\t\t\"granularity?\": \"\\\"seconds\\\" | \\\"minutes\\\" | \\\"hours\\\"\"\n\t},\n\t\"collation?\": CollationJson,\n\t\"changeStreamPreAndPostImages?\": { enabled: \"boolean\" },\n\t\"clusteredIndex?\": {\n\t\tkey: \"Record<string, number>\",\n\t\tunique: \"boolean\",\n\t\t\"name?\": \"string\"\n\t}\n});\nconst DropCollectionJson = type({\n\tkind: \"\\\"dropCollection\\\"\",\n\tcollection: \"string\"\n});\nconst RenameCollectionJson = type({\n\tkind: \"\\\"renameCollection\\\"\",\n\tcollection: \"string\",\n\tto: \"string\"\n});\nconst CollModJson = type({\n\tkind: \"\\\"collMod\\\"\",\n\tcollection: \"string\",\n\t\"validator?\": \"Record<string, unknown>\",\n\t\"validationLevel?\": \"\\\"strict\\\" | \\\"moderate\\\"\",\n\t\"validationAction?\": \"\\\"error\\\" | \\\"warn\\\"\",\n\t\"changeStreamPreAndPostImages?\": { enabled: \"boolean\" }\n});\nconst ListIndexesJson = type({\n\tkind: \"\\\"listIndexes\\\"\",\n\tcollection: \"string\"\n});\nconst ListCollectionsJson = type({ kind: \"\\\"listCollections\\\"\" });\nconst FieldFilterJson = type({\n\tkind: \"\\\"field\\\"\",\n\tfield: \"string\",\n\top: \"string\",\n\tvalue: \"unknown\"\n});\nconst AndFilterJson = type({\n\tkind: \"\\\"and\\\"\",\n\texprs: \"Record<string, unknown>[]\"\n});\nconst OrFilterJson = type({\n\tkind: \"\\\"or\\\"\",\n\texprs: \"Record<string, unknown>[]\"\n});\nconst NotFilterJson = type({\n\tkind: \"\\\"not\\\"\",\n\texpr: \"Record<string, unknown>\"\n});\nconst ExistsFilterJson = type({\n\tkind: \"\\\"exists\\\"\",\n\tfield: \"string\",\n\texists: \"boolean\"\n});\nconst RawInsertOneJson = type({\n\tkind: \"\\\"rawInsertOne\\\"\",\n\tcollection: \"string\",\n\tdocument: \"Record<string, unknown>\"\n});\nconst RawInsertManyJson = type({\n\tkind: \"\\\"rawInsertMany\\\"\",\n\tcollection: \"string\",\n\tdocuments: \"Record<string, unknown>[]\"\n});\nconst RawUpdateOneJson = type({\n\tkind: \"\\\"rawUpdateOne\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\",\n\tupdate: \"Record<string, unknown> | Record<string, unknown>[]\"\n});\nconst RawUpdateManyJson = type({\n\tkind: \"\\\"rawUpdateMany\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\",\n\tupdate: \"Record<string, unknown> | Record<string, unknown>[]\",\n\t\"bypassDocumentValidation?\": \"boolean\"\n});\nconst RawDeleteOneJson = type({\n\tkind: \"\\\"rawDeleteOne\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\"\n});\nconst RawDeleteManyJson = type({\n\tkind: \"\\\"rawDeleteMany\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\"\n});\nconst RawAggregateJson = type({\n\tkind: \"\\\"rawAggregate\\\"\",\n\tcollection: \"string\",\n\tpipeline: \"Record<string, unknown>[]\"\n});\nconst RawFindOneAndUpdateJson = type({\n\tkind: \"\\\"rawFindOneAndUpdate\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\",\n\tupdate: \"Record<string, unknown> | Record<string, unknown>[]\",\n\tupsert: \"boolean\"\n});\nconst RawFindOneAndDeleteJson = type({\n\tkind: \"\\\"rawFindOneAndDelete\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\"\n});\nconst TypedAggregateJson = type({\n\tkind: \"\\\"aggregate\\\"\",\n\tcollection: \"string\",\n\tpipeline: \"Record<string, unknown>[]\"\n});\nconst QueryPlanJson = type({\n\tcollection: \"string\",\n\tcommand: \"Record<string, unknown>\",\n\tmeta: type({\n\t\ttarget: \"string\",\n\t\tstorageHash: \"string\",\n\t\tlane: \"string\",\n\t\t\"targetFamily?\": \"string\",\n\t\t\"profileHash?\": \"string\",\n\t\t\"annotations?\": \"Record<string, unknown>\"\n\t})\n});\nconst MatchStageJson = type({\n\tkind: \"\\\"match\\\"\",\n\tfilter: \"Record<string, unknown>\"\n});\nconst LimitStageJson = type({\n\tkind: \"\\\"limit\\\"\",\n\tlimit: \"number\"\n});\nconst SortStageJson = type({\n\tkind: \"\\\"sort\\\"\",\n\tsort: \"Record<string, 1 | -1>\"\n});\nconst ProjectStageJson = type({\n\tkind: \"\\\"project\\\"\",\n\tprojection: \"Record<string, 0 | 1>\"\n});\nconst AddFieldsStageJson = type({\n\tkind: \"\\\"addFields\\\"\",\n\tfields: \"Record<string, unknown>\"\n});\nconst LookupStageJson = type({\n\tkind: \"\\\"lookup\\\"\",\n\tfrom: \"string\",\n\tas: \"string\",\n\t\"localField?\": \"string\",\n\t\"foreignField?\": \"string\",\n\t\"pipeline?\": \"Record<string, unknown>[]\",\n\t\"let_?\": \"Record<string, unknown>\"\n});\nconst CheckJson = type({\n\tdescription: \"string\",\n\tsource: \"Record<string, unknown>\",\n\tfilter: \"Record<string, unknown>\",\n\texpect: \"\\\"exists\\\" | \\\"notExists\\\"\",\n\t\"object?\": \"string > 0\"\n});\nconst StepJson = type({\n\tdescription: \"string\",\n\tcommand: \"Record<string, unknown>\"\n});\nconst OperationMetaJson = type({ \"rewrite?\": type({\n\tkind: \"\\\"cast\\\"\",\n\tcollection: \"string\",\n\tfield: \"string\",\n\tto: \"string\"\n}).or({\n\tkind: \"\\\"fill\\\"\",\n\tcollection: \"string\",\n\tfield: \"string\"\n}).or({\n\tkind: \"\\\"renameStoredKey\\\"\",\n\tcollection: \"string\",\n\tfield: \"string\",\n\tpath: \"string\",\n\tto: \"string\"\n}).or({\n\tkind: \"\\\"removeStoredKey\\\" | \\\"fillStoredKey\\\"\",\n\tcollection: \"string\",\n\tfield: \"string\",\n\tpath: \"string\"\n}).or({\n\tkind: \"\\\"replaceStoredValue\\\"\",\n\tcollection: \"string\",\n\tfield: \"string\",\n\t\"path?\": \"string\"\n}).or({\n\tkind: \"\\\"removeStoredValue\\\"\",\n\tcollection: \"string\",\n\tfield: \"string\",\n\t\"path?\": \"string\",\n\tvalue: \"string | number | boolean\",\n\t\"required?\": \"boolean\",\n\t\"filter?\": \"Record<string, unknown>\",\n\t\"enumValue?\": {\n\t\t\"namespaceId?\": \"string\",\n\t\tenum: \"string\",\n\t\tmember: \"string\"\n\t}\n}) });\nconst DdlOperationJson = type({\n\tid: \"string\",\n\tlabel: \"string\",\n\toperationClass: \"\\\"additive\\\" | \\\"widening\\\" | \\\"destructive\\\"\",\n\t\"meta?\": OperationMetaJson,\n\tprecheck: \"Record<string, unknown>[]\",\n\texecute: \"Record<string, unknown>[]\",\n\tpostcheck: \"Record<string, unknown>[]\"\n});\nconst DmlCheckJson = type({\n\tdescription: \"string\",\n\tsource: \"Record<string, unknown>\",\n\tfilter: \"Record<string, unknown>\",\n\texpect: \"\\\"exists\\\" | \\\"notExists\\\"\"\n});\nconst DmlOperationJson = type({\n\tid: \"string\",\n\tlabel: \"string\",\n\toperationClass: \"\\\"additive\\\" | \\\"widening\\\" | \\\"destructive\\\" | \\\"data\\\"\",\n\tname: \"string\",\n\t\"meta?\": OperationMetaJson,\n\tprecheck: \"Record<string, unknown>[]\",\n\trun: \"Record<string, unknown>[]\",\n\tpostcheck: \"Record<string, unknown>[]\"\n});\nfunction recordValue(json, key, context) {\n\tif (json === null || typeof json !== \"object\") throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Invalid ${context}: expected object`, { meta: { context } });\n\treturn blindCast(Reflect.get(json, key));\n}\nfunction recordKind(json, context) {\n\tconst kind = recordValue(json, \"kind\", context);\n\treturn typeof kind === \"string\" ? kind : \"\";\n}\nfunction validate(schema, data, context) {\n\ttry {\n\t\treturn schema.assert(stripUndefinedDeep(data));\n\t} catch (error) {\n\t\t/* v8 ignore stop */\n\t\tthrow mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Invalid ${context}: ${error instanceof Error ? error.message : String(error)}`, {\n\t\t\tmeta: { context },\n\t\t\tcause: error\n\t\t});\n\t}\n}\n/**\n* Strip `undefined`-valued properties before they reach arktype's optional-key\n* assertions.\n*\n* Op IRs (e.g. `CreateCollectionCommand`) assign every optional field on\n* every instance — fields the caller did not provide land as\n* `undefined`-valued properties. arktype treats `{ foo?: 'boolean' }` as\n* \"key may be absent, but if present must be boolean\", so the bare instance\n* fails validation when it crosses the deserialize boundary in-process\n* (no JSON round-trip happens between planner → runner). This helper\n* recovers the JSON-round-tripped shape (undefined keys absent) without\n* forcing every caller to round-trip.\n*\n* Returns the original value reference whenever no change is needed.\n* That preserves prototype-bound payload values such as BSON wrappers\n* (`ObjectId`, `Decimal128`, `Binary`, …) which embed no `undefined`\n* own-enumerable properties and therefore never trigger a rebuild.\n* Top-level op IRs (class instances with `undefined` optional fields)\n* still get flattened to plain records as required by arktype.\n*/\nfunction stripUndefinedDeep(value) {\n\tif (Array.isArray(value)) {\n\t\tlet changed = false;\n\t\tconst next = value.map((item) => {\n\t\t\tconst stripped = stripUndefinedDeep(item);\n\t\t\tif (stripped !== item) changed = true;\n\t\t\treturn stripped;\n\t\t});\n\t\treturn changed ? next : value;\n\t}\n\tif (value === null || typeof value !== \"object\") return blindCast(value);\n\tconst entries = Object.entries(value);\n\tconst out = {};\n\tlet changed = false;\n\tfor (const [key, val] of entries) {\n\t\tif (val === void 0) {\n\t\t\tchanged = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconst stripped = stripUndefinedDeep(val);\n\t\tif (stripped !== val) changed = true;\n\t\tout[key] = stripped;\n\t}\n\treturn changed ? out : blindCast(value);\n}\nfunction deserializeFilterExpr(json) {\n\tconst kind = recordKind(json, \"filter expression\");\n\tswitch (kind) {\n\t\tcase \"field\": {\n\t\t\tconst data = validate(FieldFilterJson, json, \"field filter\");\n\t\t\treturn MongoFieldFilter.of(data.field, data.op, blindCast(data.value));\n\t\t}\n\t\tcase \"and\": {\n\t\t\tconst data = validate(AndFilterJson, json, \"and filter\");\n\t\t\treturn MongoAndExpr.of(data.exprs.map(deserializeFilterExpr));\n\t\t}\n\t\tcase \"or\": {\n\t\t\tconst data = validate(OrFilterJson, json, \"or filter\");\n\t\t\treturn MongoOrExpr.of(data.exprs.map(deserializeFilterExpr));\n\t\t}\n\t\tcase \"not\": return new MongoNotExpr(deserializeFilterExpr(validate(NotFilterJson, json, \"not filter\").expr));\n\t\tcase \"exists\": {\n\t\t\tconst data = validate(ExistsFilterJson, json, \"exists filter\");\n\t\t\treturn new MongoExistsExpr(data.field, data.exists);\n\t\t}\n\t\tdefault: throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Unknown filter expression kind: ${kind}`, { meta: {\n\t\t\tcontext: \"filter expression\",\n\t\t\tkind\n\t\t} });\n\t}\n}\nfunction deserializePipelineStage(json) {\n\tconst kind = recordKind(json, \"pipeline stage\");\n\tswitch (kind) {\n\t\tcase \"match\": return new MongoMatchStage(deserializeFilterExpr(validate(MatchStageJson, json, \"match stage\").filter));\n\t\tcase \"limit\": return new MongoLimitStage(validate(LimitStageJson, json, \"limit stage\").limit);\n\t\tcase \"sort\": return new MongoSortStage(validate(SortStageJson, json, \"sort stage\").sort);\n\t\tcase \"project\": return new MongoProjectStage(validate(ProjectStageJson, json, \"project stage\").projection);\n\t\tcase \"addFields\": return new MongoAddFieldsStage(blindCast(validate(AddFieldsStageJson, json, \"addFields stage\").fields));\n\t\tcase \"lookup\": {\n\t\t\tconst data = validate(LookupStageJson, json, \"lookup stage\");\n\t\t\tconst opts = {\n\t\t\t\tfrom: data.from,\n\t\t\t\tas: data.as\n\t\t\t};\n\t\t\tif (data.localField !== void 0) opts.localField = data.localField;\n\t\t\tif (data.foreignField !== void 0) opts.foreignField = data.foreignField;\n\t\t\tif (data.pipeline !== void 0) opts.pipeline = data.pipeline.map(deserializePipelineStage);\n\t\t\tif (data.let_ !== void 0) opts.let_ = blindCast(data.let_);\n\t\t\treturn new MongoLookupStage(opts);\n\t\t}\n\t\tcase \"merge\": {\n\t\t\tconst whenMatched = recordValue(json, \"whenMatched\", \"merge stage\");\n\t\t\tconst opts = { into: blindCast(recordValue(json, \"into\", \"merge stage\")) };\n\t\t\tconst on = recordValue(json, \"on\", \"merge stage\");\n\t\t\tif (on !== void 0) opts.on = blindCast(on);\n\t\t\tif (whenMatched !== void 0) opts.whenMatched = typeof whenMatched === \"string\" ? whenMatched : blindCast(blindCast(whenMatched).map(deserializePipelineStage));\n\t\t\tconst whenNotMatched = recordValue(json, \"whenNotMatched\", \"merge stage\");\n\t\t\tif (whenNotMatched !== void 0) opts.whenNotMatched = blindCast(whenNotMatched);\n\t\t\treturn new MongoMergeStage(opts);\n\t\t}\n\t\tdefault: throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Unknown pipeline stage kind: ${kind}`, { meta: {\n\t\t\tcontext: \"pipeline stage\",\n\t\t\tkind\n\t\t} });\n\t}\n}\nfunction deserializeDmlCommand(json) {\n\tconst kind = recordKind(json, \"DML command\");\n\tswitch (kind) {\n\t\tcase \"rawInsertOne\": {\n\t\t\tconst data = validate(RawInsertOneJson, json, \"rawInsertOne command\");\n\t\t\treturn new RawInsertOneCommand(data.collection, data.document);\n\t\t}\n\t\tcase \"rawInsertMany\": {\n\t\t\tconst data = validate(RawInsertManyJson, json, \"rawInsertMany command\");\n\t\t\treturn new RawInsertManyCommand(data.collection, data.documents);\n\t\t}\n\t\tcase \"rawUpdateOne\": {\n\t\t\tconst data = validate(RawUpdateOneJson, json, \"rawUpdateOne command\");\n\t\t\treturn new RawUpdateOneCommand(data.collection, data.filter, data.update);\n\t\t}\n\t\tcase \"rawUpdateMany\": {\n\t\t\tconst data = validate(RawUpdateManyJson, json, \"rawUpdateMany command\");\n\t\t\treturn new RawUpdateManyCommand(data.collection, data.filter, data.update, ifDefined(\"bypassDocumentValidation\", data.bypassDocumentValidation));\n\t\t}\n\t\tcase \"rawDeleteOne\": {\n\t\t\tconst data = validate(RawDeleteOneJson, json, \"rawDeleteOne command\");\n\t\t\treturn new RawDeleteOneCommand(data.collection, data.filter);\n\t\t}\n\t\tcase \"rawDeleteMany\": {\n\t\t\tconst data = validate(RawDeleteManyJson, json, \"rawDeleteMany command\");\n\t\t\treturn new RawDeleteManyCommand(data.collection, data.filter);\n\t\t}\n\t\tcase \"rawAggregate\": {\n\t\t\tconst data = validate(RawAggregateJson, json, \"rawAggregate command\");\n\t\t\treturn new RawAggregateCommand(data.collection, data.pipeline);\n\t\t}\n\t\tcase \"rawFindOneAndUpdate\": {\n\t\t\tconst data = validate(RawFindOneAndUpdateJson, json, \"rawFindOneAndUpdate command\");\n\t\t\treturn new RawFindOneAndUpdateCommand(data.collection, data.filter, data.update, data.upsert);\n\t\t}\n\t\tcase \"rawFindOneAndDelete\": {\n\t\t\tconst data = validate(RawFindOneAndDeleteJson, json, \"rawFindOneAndDelete command\");\n\t\t\treturn new RawFindOneAndDeleteCommand(data.collection, data.filter);\n\t\t}\n\t\tcase \"aggregate\": {\n\t\t\tconst data = validate(TypedAggregateJson, json, \"aggregate command\");\n\t\t\tconst pipeline = data.pipeline.map(deserializePipelineStage);\n\t\t\treturn new AggregateCommand(data.collection, pipeline);\n\t\t}\n\t\tdefault: throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Unknown DML command kind: ${kind}`, { meta: {\n\t\t\tcontext: \"DML command\",\n\t\t\tkind\n\t\t} });\n\t}\n}\nfunction deserializeMongoQueryPlan(json) {\n\tconst data = validate(QueryPlanJson, json, \"Mongo query plan\");\n\tconst command = deserializeDmlCommand(data.command);\n\tconst m = data.meta;\n\tconst meta = {\n\t\ttarget: m.target,\n\t\tstorageHash: m.storageHash,\n\t\tlane: m.lane,\n\t\t...ifDefined(\"targetFamily\", m.targetFamily),\n\t\t...ifDefined(\"profileHash\", m.profileHash),\n\t\t...ifDefined(\"annotations\", m.annotations)\n\t};\n\treturn {\n\t\tcollection: data.collection,\n\t\tcommand,\n\t\tmeta\n\t};\n}\nfunction deserializeDdlCommand(json) {\n\tconst kind = recordKind(json, \"DDL command\");\n\tswitch (kind) {\n\t\tcase \"createIndex\": {\n\t\t\tconst data = validate(CreateIndexJson, json, \"createIndex command\");\n\t\t\treturn new CreateIndexCommand(data.collection, data.keys, {\n\t\t\t\t...ifDefined(\"unique\", data.unique),\n\t\t\t\t...ifDefined(\"sparse\", data.sparse),\n\t\t\t\t...ifDefined(\"expireAfterSeconds\", data.expireAfterSeconds),\n\t\t\t\t...ifDefined(\"partialFilterExpression\", data.partialFilterExpression),\n\t\t\t\t...ifDefined(\"name\", data.name),\n\t\t\t\t...ifDefined(\"wildcardProjection\", data.wildcardProjection),\n\t\t\t\t...ifDefined(\"collation\", data.collation),\n\t\t\t\t...ifDefined(\"weights\", data.weights),\n\t\t\t\t...ifDefined(\"default_language\", data.default_language),\n\t\t\t\t...ifDefined(\"language_override\", data.language_override)\n\t\t\t});\n\t\t}\n\t\tcase \"dropIndex\": {\n\t\t\tconst data = validate(DropIndexJson, json, \"dropIndex command\");\n\t\t\treturn new DropIndexCommand(data.collection, data.name);\n\t\t}\n\t\tcase \"createCollection\": {\n\t\t\tconst data = validate(CreateCollectionJson, json, \"createCollection command\");\n\t\t\treturn new CreateCollectionCommand(data.collection, {\n\t\t\t\t...ifDefined(\"validator\", data.validator),\n\t\t\t\t...ifDefined(\"validationLevel\", data.validationLevel),\n\t\t\t\t...ifDefined(\"validationAction\", data.validationAction),\n\t\t\t\t...ifDefined(\"capped\", data.capped),\n\t\t\t\t...ifDefined(\"size\", data.size),\n\t\t\t\t...ifDefined(\"max\", data.max),\n\t\t\t\t...ifDefined(\"timeseries\", data.timeseries),\n\t\t\t\t...ifDefined(\"collation\", data.collation),\n\t\t\t\t...ifDefined(\"changeStreamPreAndPostImages\", data.changeStreamPreAndPostImages),\n\t\t\t\t...ifDefined(\"clusteredIndex\", data.clusteredIndex)\n\t\t\t});\n\t\t}\n\t\tcase \"dropCollection\": return new DropCollectionCommand(validate(DropCollectionJson, json, \"dropCollection command\").collection);\n\t\tcase \"renameCollection\": {\n\t\t\tconst data = validate(RenameCollectionJson, json, \"renameCollection command\");\n\t\t\treturn new RenameCollectionCommand(data.collection, data.to);\n\t\t}\n\t\tcase \"collMod\": {\n\t\t\tconst data = validate(CollModJson, json, \"collMod command\");\n\t\t\treturn new CollModCommand(data.collection, {\n\t\t\t\t...ifDefined(\"validator\", data.validator),\n\t\t\t\t...ifDefined(\"validationLevel\", data.validationLevel),\n\t\t\t\t...ifDefined(\"validationAction\", data.validationAction),\n\t\t\t\t...ifDefined(\"changeStreamPreAndPostImages\", data.changeStreamPreAndPostImages)\n\t\t\t});\n\t\t}\n\t\tdefault: throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Unknown DDL command kind: ${kind}`, { meta: {\n\t\t\tcontext: \"DDL command\",\n\t\t\tkind\n\t\t} });\n\t}\n}\nfunction deserializeInspectionCommand(json) {\n\tconst kind = recordKind(json, \"inspection command\");\n\tswitch (kind) {\n\t\tcase \"listIndexes\": return new ListIndexesCommand(validate(ListIndexesJson, json, \"listIndexes command\").collection);\n\t\tcase \"listCollections\":\n\t\t\tvalidate(ListCollectionsJson, json, \"listCollections command\");\n\t\t\treturn new ListCollectionsCommand();\n\t\tdefault: throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Unknown inspection command kind: ${kind}`, { meta: {\n\t\t\tcontext: \"inspection command\",\n\t\t\tkind\n\t\t} });\n\t}\n}\n/** An inspection command has a `kind`, which its deserializer checks; a query plan has none. */\nfunction deserializeCheckSource(json) {\n\treturn \"kind\" in json ? deserializeInspectionCommand(json) : deserializeMongoQueryPlan(json);\n}\nfunction deserializeCheck(json) {\n\tconst data = validate(CheckJson, json, \"migration check\");\n\treturn {\n\t\tdescription: data.description,\n\t\tsource: deserializeCheckSource(data.source),\n\t\tfilter: deserializeFilterExpr(data.filter),\n\t\texpect: data.expect,\n\t\t...ifDefined(\"object\", data.object)\n\t};\n}\nfunction deserializeStep(json) {\n\tconst data = validate(StepJson, json, \"migration step\");\n\treturn {\n\t\tdescription: data.description,\n\t\tcommand: deserializeDdlCommand(data.command)\n\t};\n}\nfunction isDmlOperationJson(json) {\n\treturn Array.isArray(recordValue(json, \"run\", \"migration operation\"));\n}\nfunction deserializeDdlOp(json) {\n\tconst data = validate(DdlOperationJson, json, \"migration operation\");\n\treturn {\n\t\tid: data.id,\n\t\tlabel: data.label,\n\t\toperationClass: data.operationClass,\n\t\t...ifDefined(\"meta\", data.meta),\n\t\tprecheck: data.precheck.map(deserializeCheck),\n\t\texecute: data.execute.map(deserializeStep),\n\t\tpostcheck: data.postcheck.map(deserializeCheck)\n\t};\n}\nfunction deserializeDmlCheck(json) {\n\tconst data = validate(DmlCheckJson, json, \"DML operation check\");\n\treturn {\n\t\tdescription: data.description,\n\t\tsource: deserializeMongoQueryPlan(data.source),\n\t\tfilter: deserializeFilterExpr(data.filter),\n\t\texpect: data.expect\n\t};\n}\nfunction deserializeDmlOp(json) {\n\tconst data = validate(DmlOperationJson, json, \"DML operation\");\n\treturn {\n\t\tid: data.id,\n\t\tlabel: data.label,\n\t\toperationClass: data.operationClass,\n\t\tname: data.name,\n\t\t...ifDefined(\"meta\", data.meta),\n\t\tprecheck: data.precheck.map(deserializeDmlCheck),\n\t\trun: data.run.map(deserializeMongoQueryPlan),\n\t\tpostcheck: data.postcheck.map(deserializeDmlCheck)\n\t};\n}\nfunction deserializeMongoOp(json) {\n\tif (isDmlOperationJson(json)) return deserializeDmlOp(json);\n\treturn deserializeDdlOp(json);\n}\nfunction deserializeMongoOps(json) {\n\treturn json.map(deserializeMongoOp);\n}\nfunction serializeMongoOps(ops) {\n\treturn JSON.stringify(ops, null, 2);\n}\n//#endregion\n//#region src/core/migrations/mongo-runner.ts\nconst READ_ONLY_CHECK_COMMAND_KINDS = /* @__PURE__ */ new Set([\"aggregate\", \"rawAggregate\"]);\nconst WRITING_STAGES = [\"$out\", \"$merge\"];\n/** The stage of an aggregate's pipeline that writes, `$out` or `$merge`, if it has one. */\nfunction writingStageOf(command) {\n\tif (command instanceof RawAggregateCommand) return command.pipeline.flatMap((stage) => WRITING_STAGES.filter((name) => Object.hasOwn(stage, name))).at(0);\n\tif (command instanceof AggregateCommand) return command.pipeline.map((stage) => `$${stage.kind}`).find((name) => WRITING_STAGES.includes(name));\n}\nconst CHANGED_DOCUMENT_COUNTS = [\n\t\"insertedCount\",\n\t\"modifiedCount\",\n\t\"upsertedCount\",\n\t\"deletedCount\"\n];\n/** Whether a write command's result row says it changed no document: every count it carries is zero. */\nfunction reportsNoChangedDocuments(row) {\n\tif (typeof row !== \"object\" || row === null) return false;\n\tconst counts = CHANGED_DOCUMENT_COUNTS.map((field) => Reflect.get(row, field)).filter((count) => count !== void 0);\n\treturn counts.length > 0 && counts.every((count) => count === 0);\n}\nfunction failedCheckOf(operationId, phase, check) {\n\treturn {\n\t\toperationId,\n\t\tphase,\n\t\tdescription: check.description,\n\t\t...ifDefined(\"expectation\", check.object === void 0 ? void 0 : check.expect === \"exists\" ? expectPresent(check.object) : expectAbsent(check.object))\n\t};\n}\nfunction runnerFailure(code, summary, options) {\n\treturn notOk(migrationRunnerFailure(code, summary, options));\n}\nfunction storageHashMovedFailure(space, expectedFrom, found, destination) {\n\treturn migrationRunnerFailure(\"MIGRATION.MARKER_CAS_FAILURE\", \"Marker was modified by another process during migration execution.\", { meta: {\n\t\treason: \"storageHash\",\n\t\tspace,\n\t\texpectedStorageHash: expectedFrom,\n\t\tfoundStorageHash: found?.storageHash ?? null,\n\t\tdestinationStorageHash: destination.storageHash\n\t} });\n}\nfunction markerChangedFailure(space, expectedFrom, destination) {\n\treturn migrationRunnerFailure(\"MIGRATION.MARKER_CAS_FAILURE\", \"Marker was modified by another process during migration execution.\", {\n\t\twhy: \"Another process changed the marker and changed it back while this run was writing it. Run the command again.\",\n\t\tmeta: {\n\t\t\treason: \"markerChanged\",\n\t\t\tspace,\n\t\t\texpectedStorageHash: expectedFrom,\n\t\t\tdestinationStorageHash: destination.storageHash\n\t\t}\n\t});\n}\n/** The mongosh query that finds the documents a DML operation's first precheck matches. */\nfunction precheckFind(op, collection) {\n\tconst source = op.precheck[0]?.source.command;\n\tconst match = source instanceof RawAggregateCommand ? Reflect.get(source.pipeline[0] ?? {}, \"$match\") : void 0;\n\treturn `db.getCollection(${JSON.stringify(collection)}).find(${JSON.stringify(match ?? {})})`;\n}\n/**\n* The failure when a field rename's before-check finds documents that already hold the new name,\n* which `$rename` would overwrite: what to look for and fix, and that the plan resumes.\n*/\nfunction renameOverwriteRefusal(op) {\n\tconst rewrite = fieldRewriteOf(op);\n\tif (rewrite === void 0) return void 0;\n\tconst renames = Reflect.get(rewrite.command.update, \"$rename\");\n\tconst to = typeof renames === \"object\" && renames !== null ? Reflect.get(renames, rewrite.field) : void 0;\n\tif (typeof to !== \"string\") return void 0;\n\tconst find = precheckFind(op, rewrite.collection);\n\treturn runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${op.id} stopped: some documents in collection ${rewrite.collection} already hold ${to} as well as ${rewrite.field}`, {\n\t\twhy: `Renaming ${rewrite.field} to ${to} would overwrite their ${to}. Find them with ${find} in mongosh, and move or remove one of the two values in each. Once the documents are fixed, run the command again; operations that already ran are skipped.`,\n\t\tmeta: {\n\t\t\toperationId: op.id,\n\t\t\tname: op.name\n\t\t}\n\t});\n}\n/**\n* The failure when a key rename's before-check finds objects that already hold the new key, which\n* the rename would overwrite: how to find them, and that the plan resumes.\n*/\nfunction storedKeyRenameRefusal(op) {\n\tconst rewrite = op.meta?.rewrite;\n\tif (rewrite?.kind !== \"renameStoredKey\") return void 0;\n\tconst keyPath = storedKeyPath(rewrite.field, rewrite.path);\n\tif (!keyPath.ok) return void 0;\n\tconst from = JSON.stringify(keyPath.value.key);\n\tconst to = JSON.stringify(rewrite.to);\n\treturn runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${op.id} stopped: some objects at path ${JSON.stringify(keyPath.value.objectsText)} in field ${rewrite.field} of collection ${rewrite.collection} already hold key ${to} as well as key ${from}`, {\n\t\twhy: `Renaming key ${from} to ${to} would overwrite their ${to}. Find them with ${precheckFind(op, rewrite.collection)} in mongosh, and remove one of the two keys from each of those objects. Once the documents are fixed, run the command again; operations that already ran are skipped.`,\n\t\tmeta: {\n\t\t\toperationId: op.id,\n\t\t\tname: op.name\n\t\t}\n\t});\n}\n/**\n* The failure when a collection rename's before-check finds that the new collection already exists.\n*/\nfunction renameTargetExistsRefusal(op, failed) {\n\tconst rename = op.execute.find((step) => step.command instanceof RenameCollectionCommand)?.command;\n\tif (!(rename instanceof RenameCollectionCommand) || failed.expect !== \"notExists\") return;\n\tconst { collection: from, to } = rename;\n\treturn runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${op.id} stopped: collection ${to} already exists, so collection ${from} cannot be renamed to it`, {\n\t\twhy: `If ${to} holds nothing you need, drop it, then run the command again; operations that already ran are skipped. If an earlier operation of the same migration created ${to}, as a createIndex on ${to} does, make renameCollection(${JSON.stringify(from)}, ${JSON.stringify(to)}) the first operation of its migration.ts, run node on that migration.ts, and then drop ${to} and run the command again.`,\n\t\tmeta: { operationId: op.id }\n\t});\n}\nfunction validatorSetBy(op) {\n\tconst step = op.execute.find(({ command }) => command instanceof CollModCommand)?.command;\n\treturn step instanceof CollModCommand && step.validator !== void 0 ? step : void 0;\n}\n/** The BSON types a property schema's `bsonType` allows, or `undefined` when it names none. */\nfunction allowedBsonTypes(schema) {\n\tconst types = propertyBsonTypesOf(schema);\n\treturn types.length === 0 ? void 0 : new Set(types);\n}\n/** The shape of a property schema that describes an embedded document, such as a value object. */\nfunction nestedShapeOf(schema) {\n\tif (typeof schema !== \"object\" || schema === null) return void 0;\n\tconst properties = Reflect.get(schema, \"properties\");\n\tconst required = Reflect.get(schema, \"required\");\n\tif (typeof properties !== \"object\" || properties === null || Array.isArray(properties)) return;\n\treturn {\n\t\tproperties: { ...properties },\n\t\trequired: Array.isArray(required) ? required.filter((name) => typeof name === \"string\") : [],\n\t\tclosed: Reflect.get(schema, \"additionalProperties\") === false\n\t};\n}\nfunction problemsAgainst(fields, shape, path) {\n\tconst named = (field) => JSON.stringify(`${path}${field}`);\n\tconst unreadable = (field) => field === \"_id\" ? void 0 : unrewritableFieldNameReason(field);\n\tconst unchecked = [...fields.keys()].flatMap((field) => {\n\t\tconst reason = unreadable(field);\n\t\treturn reason === void 0 ? [] : [`has ${named(field)}, which the new validator cannot check: ${reason}`];\n\t});\n\tconst missing = shape.required.filter((field) => !fields.has(field)).map((field) => `has no ${named(field)}`);\n\tconst retyped = [...fields].flatMap(([field, { type }]) => {\n\t\tif (unreadable(field) !== void 0) return [];\n\t\tconst allowed = allowedBsonTypes(shape.properties[field]);\n\t\treturn allowed === void 0 || allowed.has(type) ? [] : [`holds a value of type ${type} in ${named(field)}, which the new validator does not allow there`];\n\t});\n\tconst outsideEnum = [...fields].flatMap(([field, { value }]) => {\n\t\tconst allowed = Reflect.get(Object(shape.properties[field]), \"enum\");\n\t\treturn !Array.isArray(allowed) || allowed.some((member) => canonicalize(member) === canonicalize(value)) ? [] : [`holds ${mongoshValue(value)} in ${named(field)}, a value the new validator does not allow there`];\n\t});\n\tconst undeclared = shape.closed ? [...fields.keys()].filter((field) => !Object.hasOwn(shape.properties, field) && unreadable(field) === void 0).map((field) => `has ${named(field)}, a field the new validator does not name`) : [];\n\treturn [...unchecked.map((text) => ({\n\t\ttext,\n\t\tuncheckable: true\n\t})), ...[\n\t\t...missing,\n\t\t...retyped,\n\t\t...outsideEnum,\n\t\t...undeclared\n\t].map((text) => ({\n\t\ttext,\n\t\tuncheckable: false\n\t}))];\n}\n/**\n* The root model or variant of a validator a document is read against: the variant whose\n* discriminator value the document holds, or else the one it fits best.\n*/\nfunction shapeOfDocument(fields, shapes) {\n\tconst selected = shapes.filter(({ discriminator }) => discriminator !== void 0 && canonicalize(fields.get(discriminator.field)?.value) === canonicalize(discriminator.value));\n\treturn (selected.length > 0 ? selected : shapes).reduce((best, shape) => best === void 0 || problemsAgainst(fields, shape, \"\").length < problemsAgainst(fields, best, \"\").length ? shape : best, void 0);\n}\nfunction joinedList(items) {\n\tif (items.length <= 2) return items.join(\" and \");\n\treturn `${items.slice(0, -1).join(\", \")}, and ${items.at(-1)}`;\n}\n/**\n* The `--backfill` statements that let the user choose values for the fields a change makes\n* required, one for each field the planner would accept the statement for, as its rewrite refusals\n* and stored name rules say; and each such field as `rowsWithoutValue`, from which the caller gives\n* the steps that plan the change with them. A field only new variants require gets its value in\n* the update of the discriminator's backfill, or later by its own.\n*/\nfunction backfillAdvice(contract, lacking, touched, rewriteCollection, position) {\n\tconst lackingFields = [...lacking.documents.keys()].filter((field) => !position.renamed.has(field));\n\tconst accepted = backfillStatements(contract, lacking.collection, lackingFields.filter((field) => !touched.ofNewVariants.has(field)), touched.keys, rewriteCollection);\n\tif (accepted.length === 0) return {\n\t\tsentences: [],\n\t\trowsWithoutValue: []\n\t};\n\tconst statements = [...new Set(accepted.map(({ statement }) => `--backfill ${statement}`))];\n\tconst subjects = new Map(accepted.map(({ stored, subject }) => [migrationSubjectKey(subject), {\n\t\tsubject,\n\t\tdocuments: lacking.documents.get(stored) ?? 0\n\t}]));\n\treturn {\n\t\tsentences: [`To give ${quotedList(accepted.map(({ stored }) => stored))} values you choose, plan the change with ${statements.join(\" \")}, as the steps to take describe.`, ...newVariantFieldsAdvice(contract, lacking.collection, lackingFields.flatMap((field) => {\n\t\t\tconst discriminator = touched.ofNewVariants.get(field);\n\t\t\treturn discriminator === void 0 ? [] : [{\n\t\t\t\tfield,\n\t\t\t\tdiscriminator\n\t\t\t}];\n\t\t}), accepted)],\n\t\trowsWithoutValue: [...subjects.values()].map(({ subject, documents }) => ({\n\t\t\tfield: subject,\n\t\t\treason: \"newField\",\n\t\t\trows: documents,\n\t\t\toperationIndex: position.operationIndex\n\t\t}))\n\t};\n}\n/**\n* How fields that only new variants require get values: the update of the discriminator's\n* `--backfill` sets them where it gives a variant's value, or they stay optional until a later\n* change, when their variant has documents, makes them required with their own `--backfill`.\n*/\nfunction newVariantFieldsAdvice(contract, collection, fields, accepted) {\n\tconst [first] = fields;\n\tconst discriminatorBackfill = first === void 0 ? void 0 : accepted.find(({ stored }) => stored === first.discriminator.field);\n\tif (first === void 0 || discriminatorBackfill === void 0) return [];\n\tconst where = [...new Set(fields.map(({ discriminator }) => discriminator.value))].map((value) => {\n\t\treturn `${quotedList(fields.filter(({ discriminator }) => discriminator.value === value).map(({ field }) => field))} in the documents it gives value ${JSON.stringify(value)}`;\n\t});\n\tconst example = fields.filter(({ discriminator }) => discriminator.value === first.discriminator.value).map(({ field }) => `${field}: <value>`);\n\tconst later = fields.flatMap(({ field }) => {\n\t\tconst subject = fieldStoredAt(contract, collection, field);\n\t\treturn subject.kind === \"field\" ? [`--backfill ${fieldStatementText(contract, subject)}`] : [];\n\t});\n\tconst them = fields.length === 1 ? \"it\" : \"them\";\n\treturn [`The update you write for --backfill ${discriminatorBackfill.statement} can also set ${joinedList(where)}, such as { $set: { ${first.discriminator.field}: ${JSON.stringify(first.discriminator.value)}, ${example.join(\", \")} } }.`, `Or keep ${quotedList(fields.map(({ field }) => field))} optional until a later change, which can make ${them} required${later.length === 0 ? \"\" : ` with ${later.join(\" \")}`}.`];\n}\n/**\n* The fields and nested keys, by their dotted stored paths such as `home.line1`, to which a rename\n* of the plan gives its new name in `collection`. Such a field was required under its old name, so\n* a document without it lacked the old one too: it needs fixing, not a `--backfill`.\n*/\nfunction renamedInto(operations, collection) {\n\treturn new Set(operations.flatMap((operation) => {\n\t\tif (!isMongoDmlOperation(operation)) return [];\n\t\tconst rewrite = operation.meta?.rewrite;\n\t\tif (rewrite?.kind === \"renameStoredKey\") {\n\t\t\tif (rewrite.collection !== collection) return [];\n\t\t\tconst parsed = storedKeyPath(rewrite.field, rewrite.path);\n\t\t\tif (!parsed.ok) return [];\n\t\t\treturn [[\n\t\t\t\trewrite.field,\n\t\t\t\t...keysOf(parsed.value).slice(0, -1),\n\t\t\t\trewrite.to\n\t\t\t].join(\".\")];\n\t\t}\n\t\tconst renamed = fieldRewriteOf(operation);\n\t\tif (renamed === void 0 || renamed.collection !== collection) return [];\n\t\tconst names = Reflect.get(renamed.command.update, \"$rename\");\n\t\treturn isRecord(names) ? Object.values(names).filter((name) => typeof name === \"string\") : [];\n\t}));\n}\n/** The `--backfill` statement of a nested key, by the field of a value object or an embedded model stored there, and that field, when the planner would accept it. */\nfunction nestedBackfillStatement(contract, collection, key, rewriteCollection) {\n\tconst parsed = storedKeyPath(key.field, key.path);\n\tif (!parsed.ok) return void 0;\n\tif ([key.field, ...parsed.value.path.steps.flatMap((step) => step.kind === \"member\" ? [step.name] : [])].some((name) => unrewritableKeyReason(name) !== void 0)) return void 0;\n\tconst found = storedKeyFieldAt(contract, {\n\t\tcollection,\n\t\t...key\n\t});\n\tif (found === void 0) return void 0;\n\treturn rewriteRefusals({\n\t\tkind: \"fillStoredKey\",\n\t\tcollection,\n\t\tfield: key.field,\n\t\tvariant: found.place.variant,\n\t\tmodel: found.place.model,\n\t\tstoredKey: {\n\t\t\tkey: found.text,\n\t\t\ttogether: []\n\t\t}\n\t}, contract, rewriteCollection).length === 0 ? {\n\t\tstatement: found.text,\n\t\tsubject: found.subject\n\t} : void 0;\n}\n/** The `--backfill` statement of each of `fields` the planner would accept it for, with the field's stored name. */\nfunction backfillStatements(contract, collection, fields, keys, rewriteCollection) {\n\treturn fields.flatMap((stored) => {\n\t\tconst key = keys.get(stored);\n\t\tif (key !== void 0) {\n\t\t\tconst found = nestedBackfillStatement(contract, collection, key, rewriteCollection);\n\t\t\treturn found === void 0 ? [] : [{\n\t\t\t\tstored,\n\t\t\t\t...found\n\t\t\t}];\n\t\t}\n\t\tif (unrewritableFieldNameReason(stored) !== void 0) return [];\n\t\tconst field = fieldStoredAt(contract, collection, stored);\n\t\tif (field.kind !== \"field\") return [];\n\t\tconst model = {\n\t\t\tnamespaceId: field.namespaceId,\n\t\t\tmodel: field.model\n\t\t};\n\t\treturn rewriteRefusals({\n\t\t\tkind: \"backfill\",\n\t\t\tcollection,\n\t\t\tfield: stored,\n\t\t\tvariant: selectedVariantOf(contract.domain, model),\n\t\t\tmodel,\n\t\t\tstoredKey: void 0\n\t\t}, contract, rewriteCollection).length === 0 ? [{\n\t\t\tstored,\n\t\t\tstatement: fieldStatementText(contract, field),\n\t\t\tsubject: field\n\t\t}] : [];\n\t});\n}\n/** How to change documents by hand while the old validator, which may reject their new shape, is in place. */\nfunction byHandAdvice(collection) {\n\treturn `The old validator may reject a document changed to the new shape, so the update that fixes one can skip document validation: change them with a dataTransform in migration.ts, or in mongosh with an update command that sets bypassDocumentValidation: true, such as db.runCommand({ update: ${JSON.stringify(collection)}, updates: [{ q: { _id: <id> }, u: { $set: { <field>: <value> } } }], bypassDocumentValidation: true }).`;\n}\nfunction bsonTypeOf(value) {\n\treturn Reflect.get(value, \"_bsontype\");\n}\nfunction uuidText(bytes) {\n\tconst hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n\treturn [\n\t\thex.slice(0, 8),\n\t\thex.slice(8, 12),\n\t\thex.slice(12, 16),\n\t\thex.slice(16, 20),\n\t\thex.slice(20)\n\t].join(\"-\");\n}\n/** A value as `mongosh` writes it: `ObjectId(\"…\")`, `ISODate(\"…\")`, `UUID(\"…\")`, anything else as JSON. */\nfunction mongoshValue(value) {\n\tif (value instanceof Date) return `ISODate(${JSON.stringify(value.toISOString())})`;\n\tif (typeof value === \"object\" && value !== null) {\n\t\tif (bsonTypeOf(value) === \"ObjectId\") return `ObjectId(${JSON.stringify(String(value))})`;\n\t\tconst bytes = Reflect.get(value, \"buffer\");\n\t\tif (bsonTypeOf(value) === \"Binary\" && Reflect.get(value, \"sub_type\") === 4 && bytes instanceof Uint8Array && bytes.length === 16) return `UUID(${JSON.stringify(uuidText(bytes))})`;\n\t}\n\treturn JSON.stringify(value) ?? String(value);\n}\nconst ANY_VALUE = canonicalize({});\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/** The object schemas a property schema accepts: itself, or the branches of its `oneOf` or `anyOf`. */\nfunction objectSchemasOf(schema) {\n\tif (!isRecord(schema)) return [];\n\tif (isRecord(schema[\"properties\"])) return [schema];\n\treturn [schema[\"oneOf\"], schema[\"anyOf\"]].flatMap((branches) => Array.isArray(branches) ? branches : []).flatMap(objectSchemasOf);\n}\n/** The element schema a property schema gives a list, itself or through its `oneOf` or `anyOf` branches. */\nfunction itemsOf(schema) {\n\tif (!isRecord(schema)) return void 0;\n\tif (schema[\"items\"] !== void 0) return schema[\"items\"];\n\treturn [schema[\"oneOf\"], schema[\"anyOf\"]].flatMap((branches) => Array.isArray(branches) ? branches : []).map(itemsOf).find((items) => items !== void 0);\n}\nfunction requiredOf(schema) {\n\tconst required = schema[\"required\"];\n\treturn new Set(Array.isArray(required) ? required.filter((key) => typeof key === \"string\") : []);\n}\n/** The keys below a property that the new schema requires and the old one, which also describes the objects there, did not. A union of object schemas is not compared. */\nfunction nestedRequiredKeys(before, after, steps) {\n\tconst [objectBefore, ...otherBefore] = objectSchemasOf(before);\n\tconst [objectAfter, ...otherAfter] = objectSchemasOf(after);\n\tconst inObjects = objectBefore === void 0 || objectAfter === void 0 || otherBefore.length > 0 || otherAfter.length > 0 ? [] : [...[...requiredOf(objectAfter)].filter((key) => !requiredOf(objectBefore).has(key)).map((key) => [...steps, {\n\t\tkind: \"member\",\n\t\tname: key\n\t}]), ...Object.entries(isRecord(objectAfter[\"properties\"]) ? objectAfter[\"properties\"] : {}).filter(([key]) => isRecord(objectBefore[\"properties\"]) && Object.hasOwn(objectBefore[\"properties\"], key)).flatMap(([key, schema]) => nestedRequiredKeys(Reflect.get(objectBefore[\"properties\"] ?? {}, key), schema, [...steps, {\n\t\tkind: \"member\",\n\t\tname: key\n\t}]))];\n\tconst itemsBefore = itemsOf(before);\n\tconst itemsAfter = itemsOf(after);\n\treturn [...inObjects, ...itemsBefore === void 0 || itemsAfter === void 0 ? [] : nestedRequiredKeys(itemsBefore, itemsAfter, [...steps, { kind: \"wildcard\" }])];\n}\n/**\n* The fields a validator change makes required, and those whose accepted values it changes, each\n* kind of document compared with the same kind under the validator the collection has. Inside a field both validators describe, a\n* key of its objects or list elements that the change makes required is named by its dotted path. A kind the collection's validator does not describe is not\n* compared; with no validator, every field it requires is new.\n*/\nfunction fieldsTouched(before, after) {\n\tconst shapesBefore = validatorDocumentShapesOf(before);\n\tconst requires = /* @__PURE__ */ new Set();\n\tconst retypes = /* @__PURE__ */ new Set();\n\tconst keys = /* @__PURE__ */ new Map();\n\tconst ofOldKinds = /* @__PURE__ */ new Set();\n\tconst ofNewVariants = /* @__PURE__ */ new Map();\n\tconst objectLists = /* @__PURE__ */ new Set();\n\tconst rootsAfter = validatorRootShapesOf(after);\n\tfor (const shape of validatorDocumentShapesOf(after)) {\n\t\tconst same = shapesBefore.length === 0 ? void 0 : sameKindOfDocumentIn(shapesBefore, shape);\n\t\tif (shapesBefore.length > 0 && same === void 0) continue;\n\t\tconst previous = same?.shape ?? {\n\t\t\trequired: [],\n\t\t\tproperties: {}\n\t\t};\n\t\tconst ownedByRoot = /* @__PURE__ */ new Set([...rootsAfter[shape.rootIndex]?.required ?? [], ...shape.discriminator === void 0 ? [] : [shape.discriminator.field]]);\n\t\tfor (const field of shape.required) {\n\t\t\tif (field === \"_id\" || previous.required.includes(field)) continue;\n\t\t\trequires.add(field);\n\t\t\tif (same?.matchedBy === \"root\" && shape.discriminator !== void 0 && !ownedByRoot.has(field)) {\n\t\t\t\tif (!ofNewVariants.has(field)) ofNewVariants.set(field, shape.discriminator);\n\t\t\t} else ofOldKinds.add(field);\n\t\t}\n\t\tfor (const [field, schema] of Object.entries(shape.properties)) {\n\t\t\tconst items = itemsOf(schema);\n\t\t\tif (isRecord(items) && isRecord(items[\"properties\"])) objectLists.add(field);\n\t\t\tif (!Object.hasOwn(previous.properties, field)) continue;\n\t\t\tconst schemaBefore = previous.properties[field];\n\t\t\tconst canonical = canonicalize(schema);\n\t\t\tif (canonicalize(schemaBefore) !== canonical && canonical !== ANY_VALUE) retypes.add(field);\n\t\t\tfor (const steps of nestedRequiredKeys(schemaBefore, schema, [])) {\n\t\t\t\tconst dotted = [field, ...steps.flatMap((step) => step.kind === \"member\" ? [step.name] : [])].join(\".\");\n\t\t\t\trequires.add(dotted);\n\t\t\t\tkeys.set(dotted, {\n\t\t\t\t\tfield,\n\t\t\t\t\tpath: jsonPathText(steps),\n\t\t\t\t\tsteps\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\trequires: [...requires].sort(),\n\t\tretypes: [...retypes].filter((field) => !requires.has(field)).sort(),\n\t\tkeys,\n\t\tofNewVariants: new Map([...ofNewVariants].filter(([field]) => !ofOldKinds.has(field))),\n\t\tobjectLists\n\t};\n}\nfunction quotedList(fields) {\n\tconst quoted = fields.map((field) => JSON.stringify(field));\n\treturn quoted.length <= 1 ? quoted.join(\"\") : `${quoted.slice(0, -1).join(\", \")} and ${quoted.at(-1)}`;\n}\n/** What a document holds at the objects a required key's steps lead to: an object without the key, or a list element that is not an object. */\nfunction keyFindingsOf(value, steps) {\n\tconst [step, ...rest] = steps;\n\tif (step === void 0) return /* @__PURE__ */ new Set();\n\tif (step.kind === \"wildcard\") {\n\t\tif (!Array.isArray(value)) return /* @__PURE__ */ new Set();\n\t\treturn new Set(value.flatMap((element) => rest[0]?.kind === \"member\" && !isRecord(element) ? [\"notObject\"] : [...keyFindingsOf(element, rest)]));\n\t}\n\tif (!isRecord(value)) return /* @__PURE__ */ new Set();\n\tif (!Object.hasOwn(value, step.name)) return new Set(rest.length === 0 ? [\"lacks\"] : []);\n\treturn keyFindingsOf(value[step.name], rest);\n}\n/**\n* Of the nested keys a validator change makes required, those the document shown lacks, and the\n* fields whose list elements must be objects, or hold keys the change requires, that hold an\n* element that is not an object.\n*/\nfunction nestedFindings(touched, shown) {\n\tconst lacking = [];\n\tconst notObjects = /* @__PURE__ */ new Set();\n\tfor (const [dotted, key] of touched.keys) {\n\t\tconst findings = keyFindingsOf(shown.get(key.field)?.value, key.steps);\n\t\tif (findings.has(\"lacks\")) lacking.push(dotted);\n\t\tif (findings.has(\"notObject\")) notObjects.add(key.field);\n\t}\n\tfor (const field of touched.objectLists) {\n\t\tconst value = shown.get(field)?.value;\n\t\tif (Array.isArray(value) && value.some((element) => !isRecord(element))) notObjects.add(field);\n\t}\n\treturn {\n\t\tlacking,\n\t\tnotObjects: [...notObjects].sort()\n\t};\n}\n/**\n* What a validator change touches, in words: `This validator change makes \"plan\" required.` Only\n* what the document shown breaks is named: the fields and nested keys it lacks, and the fields it\n* holds whose accepted values change.\n*/\nfunction touchedSentence(touched, shown) {\n\tconst lackingNested = new Set(nestedFindings(touched, shown).lacking);\n\tconst lacking = touched.requires.filter((field) => touched.keys.has(field) ? lackingNested.has(field) : !shown.has(field));\n\tconst retypes = touched.retypes.filter((field) => shown.has(field));\n\tconst parts = [...lacking.length === 0 ? [] : [`makes ${quotedList(lacking)} required`], ...retypes.length === 0 ? [] : [`changes what ${quotedList(retypes)} ${retypes.length === 1 ? \"accepts\" : \"accept\"}`]];\n\treturn parts.length === 0 ? \"\" : `This validator change ${parts.join(\" and \")}. `;\n}\nconst MONGO_UNAUTHORIZED = 13;\n/**\n* The failure for a rewrite that skips validation when the database user lacks the\n* `bypassDocumentValidation` action, as a `readWrite` user on a hosted cluster does.\n*/\nfunction bypassValidationRefusal(op, plan, error) {\n\tif (!(plan.command instanceof RawUpdateManyCommand) || !plan.command.bypassDocumentValidation) return;\n\tif (typeof error !== \"object\" || error === null) return void 0;\n\tif (Reflect.get(error, \"code\") !== MONGO_UNAUTHORIZED) return void 0;\n\tconst codeName = Reflect.get(error, \"codeName\");\n\treturn runnerFailure(\"MIGRATION.EXECUTION_FAILED\", `Operation ${op.id} failed: the database user may not skip document validation`, {\n\t\twhy: `Rewriting documents to fit the new schema skips document validation, because the old validator rejects the new shape. MongoDB refused it with error ${MONGO_UNAUTHORIZED} (${String(codeName)}). Grant the user the bypassDocumentValidation action on the database, for example with the dbAdmin or restore role, then run the command again; operations that already ran are skipped.`,\n\t\tmeta: {\n\t\t\toperationId: op.id,\n\t\t\tmongoCode: MONGO_UNAUTHORIZED,\n\t\t\tcodeName\n\t\t}\n\t});\n}\n/**\n* Compares the policies a caller checked with the application space's marker, before the run's\n* first operation. The application space's marker is later written only while they still hold.\n*/\nasync function checkDatabasePolicies(markerOps, checked) {\n\tconst comparison = compareMarkerDatabasePolicies(await markerOps.readMarker(APP_SPACE_ID), checked);\n\tswitch (comparison.kind) {\n\t\tcase \"held\": return okVoid();\n\t\tcase \"moved\": return notOk(withDatabaseUnchanged(databasePoliciesMovedFailure(checked, comparison.found), true));\n\t\tcase \"unreadable\": throw markerPoliciesCorrupt(markerOps, comparison.why);\n\t}\n}\nfunction markerPoliciesCorrupt(markerOps, why) {\n\treturn errorMarkerPoliciesCorrupt({\n\t\twhy,\n\t\tspace: APP_SPACE_ID,\n\t\tmarkerLocation: markerOps.markerLocation\n\t});\n}\nconst MONGO_CONVERSION_FAILURE = 241;\n/** The innermost cause MongoDB gives in an error's message, without its closing period. */\nfunction mongoErrorText(error) {\n\tconst message = String(Reflect.get(error, \"message\"));\n\treturn (message.split(\" :: caused by :: \").at(-1) ?? message).replace(/\\.+$/, \"\");\n}\n/** The field of the destination contract a collection stores under `storedName`, or the storage name when no model declares it. */\nfunction fieldStoredAt(contract, collection, storedName) {\n\tconst field = modelFieldStoredAs(contract.domain, collection, storedName);\n\treturn field === void 0 ? {\n\t\tkind: \"storage\",\n\t\tname: `${collection}.${storedName}`\n\t} : {\n\t\tkind: \"field\",\n\t\t...field,\n\t\tnamespaceId: asNamespaceId(field.namespaceId)\n\t};\n}\nconst MONGO_DUPLICATE_KEY = 11e3;\n/** What a user can do about a MongoDB error that stopped a rewrite, when the error says. */\nfunction rewriteErrorFix(mongoCode, reason) {\n\tif (mongoCode !== MONGO_DUPLICATE_KEY) return void 0;\n\tconst index = /index: (\\S+)/.exec(reason)?.[1];\n\treturn `The rewrite would give two documents the same value under ${index === void 0 ? \"a unique index\" : `unique index ${JSON.stringify(index)}`}. Change or remove the documents that would collide, then run the command again; operations that already ran are skipped.`;\n}\n/**\n* The failure when MongoDB cannot build a unique index because two documents hold the same value\n* of its keys, as documents without the field all hold `null`. The build changes nothing.\n*/\n/** The fields of a duplicate key MongoDB reports, when every one of them is `null` or missing. */\nfunction nullKeyFields(error) {\n\tconst keyValue = Reflect.get(error, \"keyValue\");\n\tif (typeof keyValue !== \"object\" || keyValue === null) return [];\n\tconst entries = Object.entries(keyValue);\n\treturn entries.length > 0 && entries.every(([, value]) => value === null) ? entries.map(([field]) => field) : [];\n}\nfunction isDuplicateKeyError(error) {\n\treturn typeof error === \"object\" && error !== null && Reflect.get(error, \"code\") === MONGO_DUPLICATE_KEY;\n}\nfunction indexBuildFailure(op, command, error, backfill) {\n\tconst reason = mongoErrorText(error);\n\tconst duplicate = /dup key: (\\{.*\\})/.exec(reason)?.[1];\n\tconst index = command.name ?? defaultMongoIndexName(command.keys);\n\tconst lacking = nullKeyFields(error);\n\tconst statements = backfill(lacking);\n\tconst why = [\n\t\tlacking.length === 0 ? \"A document without the field counts as holding null.\" : `The documents that collide lack ${quotedList(lacking)} or hold null in ${lacking.length === 1 ? \"it\" : \"them\"}, and a document without the field counts as holding null.`,\n\t\t\"Give each document its own value of the indexed fields, or remove the duplicates, then run the command again; operations that already ran are skipped.\",\n\t\t...statements.length === 0 ? [] : [`Under migration plan, ${statements.join(\" \")} writes a slot to give each document its own value.`]\n\t].join(\" \");\n\treturn runnerFailure(\"MIGRATION.EXECUTION_FAILED\", `Operation ${op.id} failed: the unique index ${index} cannot be built, because two documents in collection ${command.collection} hold the same value${duplicate === void 0 ? \"\" : ` ${duplicate}`}`, {\n\t\twhy,\n\t\tmeta: {\n\t\t\toperationId: op.id,\n\t\t\tmongoCode: MONGO_DUPLICATE_KEY,\n\t\t\tindex,\n\t\t\tcollection: command.collection,\n\t\t\t...duplicate === void 0 ? {} : { duplicateKey: duplicate }\n\t\t}\n\t});\n}\n/**\n* The failure when a rewrite fails after MongoDB began it: documents it reached may already be\n* rewritten. A planner cast that meets a value `$convert` cannot cast names the field, which the\n* advice reads to offer `--convert`. A data transform's update is the user's own, so its failure\n* never names a type change.\n*/\nfunction rewriteFailure(op, error, position) {\n\tif (typeof error !== \"object\" || error === null) return void 0;\n\tconst mongoCode = Reflect.get(error, \"code\");\n\tif (typeof mongoCode !== \"number\") return void 0;\n\tconst codeName = Reflect.get(error, \"codeName\");\n\tconst mongoError = typeof codeName === \"string\" ? `${mongoCode} (${codeName})` : `${mongoCode}`;\n\tconst reason = mongoErrorText(error);\n\tif (op.operationClass === \"data\") return mongoCode === MONGO_CONVERSION_FAILURE ? runnerFailure(\"MIGRATION.EXECUTION_FAILED\", `Operation ${op.id} failed: its update met a value MongoDB cannot convert`, {\n\t\twhy: `MongoDB stopped the data transform's update: ${reason}. Documents it updated before that value stay updated. Until a re-run finishes, a document the update already changed may no longer fit the collection's current validator, so updates to it fail. Fix the update in the migration's migration.ts, run the file with node, then run the command again.`,\n\t\tmeta: {\n\t\t\toperationId: op.id,\n\t\t\tmongoCode\n\t\t}\n\t}) : runnerFailure(\"MIGRATION.EXECUTION_FAILED\", `Operation ${op.id} failed: MongoDB error ${mongoError}: ${reason}`, {\n\t\twhy: \"Documents the update changed before the error stay changed. Until a re-run finishes, a document the update already changed may no longer fit the collection's current validator, so updates to it fail. Fix what MongoDB names; when it comes from the update, change the update in the migration's migration.ts so its filter and update work on a re-run, and run the file with node. Then run the command again.\",\n\t\tmeta: {\n\t\t\toperationId: op.id,\n\t\t\tmongoCode,\n\t\t\t...typeof codeName === \"string\" ? { codeName } : {}\n\t\t}\n\t});\n\tconst rewrite = fieldRewriteOf(op);\n\tif (rewrite === void 0) return void 0;\n\tconst cast = op.meta?.rewrite?.kind === \"cast\" ? op.meta.rewrite : void 0;\n\tif (mongoCode !== MONGO_CONVERSION_FAILURE || cast === void 0) {\n\t\tconst fix = rewriteErrorFix(mongoCode, reason);\n\t\treturn runnerFailure(\"MIGRATION.EXECUTION_FAILED\", `Operation ${op.id} failed: MongoDB error ${mongoError}: ${reason}`, {\n\t\t\twhy: [\"Documents the rewrite changed before the error stay changed.\", ...fix === void 0 ? [] : [fix]].join(\" \"),\n\t\t\tmeta: {\n\t\t\t\toperationId: op.id,\n\t\t\t\tmongoCode,\n\t\t\t\t...typeof codeName === \"string\" ? { codeName } : {}\n\t\t\t}\n\t\t});\n\t}\n\tconst field = fieldStoredAt(position.contract, rewrite.collection, rewrite.field);\n\tconst named = field.kind === \"field\" ? fieldStatementText(position.contract, field) : rewrite.field;\n\treturn runnerFailure(\"MIGRATION.EXECUTION_FAILED\", `Operation ${op.id} failed: a value of field \"${named}\" in collection ${cast.collection} cannot be cast to ${cast.to}`, {\n\t\twhy: `MongoDB's $convert met a value of field \"${named}\" it cannot cast to ${cast.to}: ${reason}. Documents cast before that value stay cast, and a re-run casts the rest. Until it does, a document already cast holds a type the collection's current validator does not allow, so updates to it fail.`,\n\t\tmeta: {\n\t\t\toperationId: op.id,\n\t\t\tmongoCode,\n\t\t\tfailedTypeChange: {\n\t\t\t\tfield,\n\t\t\t\tby: \"cast\",\n\t\t\t\treason: \"value\",\n\t\t\t\toperationIndex: position.operationIndex\n\t\t\t}\n\t\t}\n\t});\n}\n/** The edit that keeps the documents a failed removal found: the removal, replaced by a replacement whose new value is the placeholder `\"<stored value>\"`. */\nfunction keepRemovedValueEdit(options) {\n\tconst { value, required: _required, enumValue: _enumValue, ...at } = options;\n\treturn {\n\t\tremove: callInSentence(new RemoveStoredValueCall(options)),\n\t\treplaceWith: callInSentence(new ReplaceStoredValueCall({\n\t\t\t...at,\n\t\t\tfrom: value,\n\t\t\tto: \"<stored value>\"\n\t\t}))\n\t};\n}\nvar MongoMigrationRunner = class {\n\tdeps;\n\tconstructor(deps) {\n\t\tthis.deps = deps;\n\t}\n\tasync execute(options) {\n\t\tlet changedDatabase = false;\n\t\tconst result = await this.apply(options, () => {\n\t\t\tchangedDatabase = true;\n\t\t});\n\t\treturn result.ok ? ok({\n\t\t\t...result.value,\n\t\t\tchangedDatabase\n\t\t}) : notOk(withDatabaseUnchanged(result.failure, options.databaseChangedBefore !== true && !changedDatabase));\n\t}\n\t/** Applies the plan, calling `wrote` after each command that changes the database. */\n\tasync apply(options, wrote) {\n\t\tconst { inspectionExecutor, adapter, driver, executeDdl, markerOps } = this.deps;\n\t\tconst operations = deserializeMongoOps(blindCast(options.plan.operations));\n\t\tconst space = options.plan.spaceId ?? APP_SPACE_ID;\n\t\tconst policyCheck = this.enforcePolicyCompatibility(options.policy, operations);\n\t\tif (policyCheck) return policyCheck;\n\t\tconst existingMarker = await markerOps.readMarker(space);\n\t\tconst markerCheck = this.ensureMarkerCompatibility(existingMarker, options.plan);\n\t\tif (markerCheck) return markerCheck;\n\t\tconst checks = options.executionChecks;\n\t\tconst runPrechecks = checks?.prechecks !== false;\n\t\tconst runPostchecks = checks?.postchecks !== false;\n\t\tconst runIdempotency = checks?.idempotencyChecks !== false;\n\t\tconst filterEvaluator = new FilterEvaluator();\n\t\tlet operationsExecuted = 0;\n\t\tfor (const [operationIndex, operation] of operations.entries()) {\n\t\t\toptions.callbacks?.onOperationStart?.(operation);\n\t\t\ttry {\n\t\t\t\tif (isMongoDmlOperation(operation)) {\n\t\t\t\t\tconst result = await this.executeDmlOperation(operation, adapter, driver, filterEvaluator, runIdempotency, runPrechecks, runPostchecks, wrote, {\n\t\t\t\t\t\toperationIndex,\n\t\t\t\t\t\tcontract: options.destinationContract\n\t\t\t\t\t});\n\t\t\t\t\tif (result.failure) return result.failure;\n\t\t\t\t\tif (result.executed) operationsExecuted += 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (runPostchecks && runIdempotency) {\n\t\t\t\t\tif (await this.allChecksSatisfied(operation.postcheck, inspectionExecutor, filterEvaluator)) continue;\n\t\t\t\t}\n\t\t\t\tif (runPrechecks) {\n\t\t\t\t\tconst failing = await this.firstFailingCheck(operation.precheck, inspectionExecutor, filterEvaluator);\n\t\t\t\t\tif (failing !== void 0) {\n\t\t\t\t\t\tconst failedCheck = failedCheckOf(operation.id, \"precheck\", failing);\n\t\t\t\t\t\treturn renameTargetExistsRefusal(operation, failing) ?? await this.documentsFailingValidatorRefusal(operation, failing, options.destinationContract, {\n\t\t\t\t\t\t\toperationIndex,\n\t\t\t\t\t\t\tplan: operations\n\t\t\t\t\t\t}) ?? runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${operation.id} failed during precheck: ${failing.description}`, {\n\t\t\t\t\t\t\twhy: failedPrecheckWhy(failedCheck),\n\t\t\t\t\t\t\tmeta: { failedCheck }\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const step of operation.execute) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait executeDdl(step.command);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconst { command } = step;\n\t\t\t\t\t\tif (!(command instanceof CreateIndexCommand) || !isDuplicateKeyError(error)) throw error;\n\t\t\t\t\t\tconst inPlace = await this.collectionInPlace(command.collection);\n\t\t\t\t\t\treturn indexBuildFailure(operation, command, error, (fields) => backfillStatements(options.destinationContract, command.collection, fields, /* @__PURE__ */ new Map(), inPlace.rewrite).map(({ statement }) => `--backfill ${statement}`));\n\t\t\t\t\t}\n\t\t\t\t\twrote();\n\t\t\t\t}\n\t\t\t\tif (runPostchecks) {\n\t\t\t\t\tconst failing = await this.firstFailingCheck(operation.postcheck, inspectionExecutor, filterEvaluator);\n\t\t\t\t\tif (failing !== void 0) {\n\t\t\t\t\t\tconst failedCheck = failedCheckOf(operation.id, \"postcheck\", failing);\n\t\t\t\t\t\treturn runnerFailure(\"MIGRATION.POSTCHECK_FAILED\", `Operation ${operation.id} failed during postcheck: ${failing.description}`, {\n\t\t\t\t\t\t\twhy: failedPostcheckWhy(failedCheck),\n\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\toperationId: operation.id,\n\t\t\t\t\t\t\t\tfailedCheck\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toperationsExecuted += 1;\n\t\t\t} finally {\n\t\t\t\toptions.callbacks?.onOperationComplete?.(operation);\n\t\t\t}\n\t\t}\n\t\tconst destination = options.plan.destination;\n\t\tconst profileHash = options.destinationContract.profileHash ?? destination.storageHash;\n\t\tconst incomingInvariants = options.plan.providedInvariants ?? [];\n\t\tconst existingInvariantSet = new Set(existingMarker?.invariants ?? []);\n\t\tconst incomingIsSubsetOfExisting = incomingInvariants.every((id) => existingInvariantSet.has(id));\n\t\tconst markerAlreadyAtDestination = existingMarker !== null && existingMarker.storageHash === destination.storageHash && existingMarker.profileHash === profileHash;\n\t\tconst isNoOp = operationsExecuted === 0 && markerAlreadyAtDestination && incomingIsSubsetOfExisting;\n\t\tif (!isNoOp || options.databasePolicies !== void 0) {\n\t\t\tconst liveSchema = await this.deps.introspectSchema();\n\t\t\tconst rawVerifyResult = verifyMongoSchema({\n\t\t\t\tcontract: options.destinationContract,\n\t\t\t\tschema: liveSchema,\n\t\t\t\tstrict: options.strictVerification ?? true,\n\t\t\t\tframeworkComponents: options.frameworkComponents,\n\t\t\t\t...options.context ? { context: options.context } : {}\n\t\t\t});\n\t\t\tconst verifyResult = options.scopeVerifyResult ? options.scopeVerifyResult(rawVerifyResult) : rawVerifyResult;\n\t\t\tif (!verifyResult.ok) return runnerFailure(\"MIGRATION.SCHEMA_VERIFY_FAILED\", verifyResult.summary, {\n\t\t\t\twhy: schemaCheckWhy(verifyResult.schema.issues),\n\t\t\t\tmeta: { schemaIssues: verifyResult.schema.issues }\n\t\t\t});\n\t\t\tif (existingMarker) {\n\t\t\t\tconst swapFailure = await this.updateMarker(markerOps, space, existingMarker.storageHash, {\n\t\t\t\t\tstorageHash: destination.storageHash,\n\t\t\t\t\tprofileHash,\n\t\t\t\t\tinvariants: incomingInvariants,\n\t\t\t\t\t...ifDefined(\"databasePolicies\", options.databasePolicies)\n\t\t\t\t}, options.checkedPolicies);\n\t\t\t\tif (swapFailure !== void 0) return notOk(swapFailure);\n\t\t\t} else await markerOps.initMarker(space, {\n\t\t\t\tstorageHash: destination.storageHash,\n\t\t\t\tprofileHash,\n\t\t\t\tinvariants: incomingInvariants,\n\t\t\t\t...ifDefined(\"databasePolicies\", options.databasePolicies)\n\t\t\t});\n\t\t\twrote();\n\t\t\tif (!isNoOp) await this.recordLedgerEntries(markerOps, space, options);\n\t\t}\n\t\treturn ok({\n\t\t\toperationsPlanned: operations.length,\n\t\t\toperationsExecuted\n\t\t});\n\t}\n\t/**\n\t* Writes the marker while it still holds `expectedFrom` and, for the application space, while its\n\t* policies read as those the run checked.\n\t*/\n\tasync updateMarker(markerOps, space, expectedFrom, destination, checkedPolicies) {\n\t\tif (await markerOps.updateMarker(space, expectedFrom, destination, checkedPolicies)) return;\n\t\tconst found = await markerOps.readMarker(space);\n\t\tconst failure = markerSwapFailure(found, expectedFrom, checkedPolicies);\n\t\tif (failure.kind === \"policiesUnreadable\") throw markerPoliciesCorrupt(markerOps, failure.why);\n\t\tif (failure.kind === \"policiesMoved\" && checkedPolicies !== void 0) return databasePoliciesMovedFailure(checkedPolicies, failure.found);\n\t\tif (failure.kind === \"markerChanged\") return markerChangedFailure(space, expectedFrom, destination);\n\t\treturn storageHashMovedFailure(space, expectedFrom, found, destination);\n\t}\n\tasync recordLedgerEntries(markerOps, space, options) {\n\t\tconst plan = options.plan;\n\t\tconst edges = options.migrationEdges;\n\t\tconst totalEdgeOps = edges.reduce((sum, edge) => sum + edge.operationCount, 0);\n\t\tif (totalEdgeOps !== plan.operations.length) throw new InternalError(`Ledger write: plan.operations length (${plan.operations.length}) does not match sum of migrationEdges operationCount (${totalEdgeOps})`);\n\t\tlet offset = 0;\n\t\tfor (const edge of edges) {\n\t\t\tconst edgeOps = plan.operations.slice(offset, offset + edge.operationCount);\n\t\t\toffset += edge.operationCount;\n\t\t\tawait markerOps.writeLedgerEntry(space, {\n\t\t\t\tedgeId: `${edge.from}->${edge.to}`,\n\t\t\t\tfrom: edge.from,\n\t\t\t\tto: edge.to,\n\t\t\t\tmigrationName: edge.dirName,\n\t\t\t\tmigrationHash: edge.migrationHash,\n\t\t\t\toperations: edgeOps\n\t\t\t});\n\t\t}\n\t}\n\tasync executeDmlOperation(op, adapter, driver, filterEvaluator, runIdempotency, runPrechecks, runPostchecks, wrote, position) {\n\t\tif (runPostchecks && runIdempotency && op.postcheck.length > 0) {\n\t\t\tif (await this.evaluateDmlChecks(op.postcheck, filterEvaluator)) return { executed: false };\n\t\t}\n\t\tif (runPrechecks && op.precheck.length > 0) {\n\t\t\tif (!await this.evaluateDmlChecks(op.precheck, filterEvaluator)) return {\n\t\t\t\texecuted: false,\n\t\t\t\tfailure: renameOverwriteRefusal(op) ?? storedKeyRenameRefusal(op) ?? await this.documentsHoldingRemovedValueRefusal(op, position) ?? runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${op.id} failed during precheck`, { meta: {\n\t\t\t\t\toperationId: op.id,\n\t\t\t\t\tname: op.name\n\t\t\t\t} })\n\t\t\t};\n\t\t}\n\t\tfor (const plan of op.run) {\n\t\t\tconst wireCommand = await adapter.lower(plan, {});\n\t\t\ttry {\n\t\t\t\tlet reportedNoChange = false;\n\t\t\t\tlet reportedChange = false;\n\t\t\t\tfor await (const row of driver.execute(wireCommand)) if (reportsNoChangedDocuments(row)) reportedNoChange = true;\n\t\t\t\telse reportedChange = true;\n\t\t\t\tif (reportedChange || !reportedNoChange) wrote();\n\t\t\t} catch (error) {\n\t\t\t\tconst refusal = bypassValidationRefusal(op, plan, error);\n\t\t\t\tif (refusal !== void 0) return {\n\t\t\t\t\texecuted: false,\n\t\t\t\t\tfailure: refusal\n\t\t\t\t};\n\t\t\t\tconst failure = rewriteFailure(op, error, position);\n\t\t\t\tif (failure === void 0) throw error;\n\t\t\t\twrote();\n\t\t\t\treturn {\n\t\t\t\t\texecuted: false,\n\t\t\t\t\tfailure\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tif (runPostchecks && op.postcheck.length > 0) {\n\t\t\tif (!await this.evaluateDmlChecks(op.postcheck, filterEvaluator)) return {\n\t\t\t\texecuted: false,\n\t\t\t\tfailure: await this.documentsStillMatchingFailure(op) ?? runnerFailure(\"MIGRATION.POSTCHECK_FAILED\", `Operation ${op.id} failed during postcheck`, { meta: {\n\t\t\t\t\toperationId: op.id,\n\t\t\t\t\tname: op.name\n\t\t\t\t} })\n\t\t\t};\n\t\t}\n\t\treturn { executed: true };\n\t}\n\t/**\n\t* The failure when a stored value removal's precheck finds documents whose required field or key\n\t* holds the value: how many, one `_id`, the query that finds them all, and how to keep them.\n\t*/\n\tasync documentsHoldingRemovedValueRefusal(op, position) {\n\t\tconst rewrite = op.meta?.rewrite;\n\t\tconst [check] = op.precheck;\n\t\tif (rewrite?.kind !== \"removeStoredValue\" || check === void 0) return void 0;\n\t\tconst { command } = check.source;\n\t\tif (!(command instanceof RawAggregateCommand)) return void 0;\n\t\tconst match = Reflect.get(command.pipeline[0] ?? {}, \"$match\");\n\t\tif (typeof match !== \"object\" || match === null) return void 0;\n\t\tconst counted = await this.firstRow({\n\t\t\t...check.source,\n\t\t\tcommand: new RawAggregateCommand(command.collection, [{ $match: match }, { $group: {\n\t\t\t\t_id: null,\n\t\t\t\tdocuments: { $sum: 1 },\n\t\t\t\tdocumentId: { $first: \"$_id\" }\n\t\t\t} }])\n\t\t});\n\t\tconst documents = Number(counted?.[\"documents\"] ?? 0);\n\t\tif (documents === 0) return void 0;\n\t\tconst one = documents === 1;\n\t\tconst { collection, field, path, value, enumValue, required, filter } = rewrite;\n\t\tconst place = path === void 0 ? `in field ${field}` : `at path ${JSON.stringify(path)} in field ${field}`;\n\t\tconst query = `db.getCollection(${JSON.stringify(collection)}).find(${JSON.stringify(match)})`;\n\t\tconst coordinate = enumValue === void 0 ? void 0 : {\n\t\t\t...ifDefined(\"namespaceId\", enumValue.namespaceId === void 0 ? void 0 : asNamespaceId(enumValue.namespaceId)),\n\t\t\tenum: enumValue.enum,\n\t\t\tmember: enumValue.member\n\t\t};\n\t\tconst named = coordinate === void 0 ? \"the enum value\" : `enum value \"${enumValueStatementText(position.contract, enumValueCoordinateFromJson(coordinate))}\"`;\n\t\treturn runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${op.id} stopped: ${documents} ${one ? \"document\" : \"documents\"} in collection ${collection} ${one ? \"holds\" : \"hold\"} value ${JSON.stringify(value)} ${place}, which is required`, {\n\t\t\twhy: [\n\t\t\t\t`${one ? \"It has\" : \"One of them has\"} _id ${mongoshValue(counted?.[\"documentId\"])}. Find them all with ${query} in mongosh.`,\n\t\t\t\t`To keep them, add a new member to the enum and rename ${named} to it instead of removing it, or change those documents to another value first.`,\n\t\t\t\t\"Once the documents are fixed, run the command again; operations that already ran are skipped.\"\n\t\t\t].join(\" \"),\n\t\t\tmeta: {\n\t\t\t\toperationId: op.id,\n\t\t\t\tname: op.name,\n\t\t\t\t...coordinate === void 0 || typeof value === \"boolean\" ? {} : { rowsHoldingValue: [{\n\t\t\t\t\tenumValue: coordinate,\n\t\t\t\t\tvalue,\n\t\t\t\t\trows: documents,\n\t\t\t\t\toperationIndex: position.operationIndex,\n\t\t\t\t\tkeepDataEdit: keepRemovedValueEdit({\n\t\t\t\t\t\tcollection,\n\t\t\t\t\t\tfield,\n\t\t\t\t\t\t...ifDefined(\"path\", path),\n\t\t\t\t\t\t...ifDefined(\"filter\", filter),\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t...ifDefined(\"required\", required),\n\t\t\t\t\t\t...ifDefined(\"enumValue\", enumValue)\n\t\t\t\t\t})\n\t\t\t\t}] }\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* The failure when a validator change's precheck finds documents the new validator rejects: how\n\t* many, one `_id`, and the query that finds them all.\n\t*/\n\tasync documentsFailingValidatorRefusal(op, failed, contract, position) {\n\t\tconst { operationIndex, plan } = position;\n\t\tif (isInspectionCheckSource(failed.source)) return void 0;\n\t\tconst collMod = validatorSetBy(op);\n\t\tif (collMod?.validator === void 0) return void 0;\n\t\tconst { collection, validator } = collMod;\n\t\tconst failing = { $nor: [validator] };\n\t\tconst counted = await this.firstRow({\n\t\t\t...failed.source,\n\t\t\tcommand: new RawAggregateCommand(collection, [{ $match: failing }, { $group: {\n\t\t\t\t_id: null,\n\t\t\t\tdocuments: { $sum: 1 },\n\t\t\t\tdocumentId: { $first: \"$_id\" }\n\t\t\t} }])\n\t\t});\n\t\tconst documents = Number(counted?.[\"documents\"] ?? 0);\n\t\tif (documents === 0) return void 0;\n\t\tconst documentId = mongoshValue(counted?.[\"documentId\"]);\n\t\tconst query = `db.getCollection(${JSON.stringify(collection)}).find(${JSON.stringify(failing)})`;\n\t\tconst inPlace = await this.collectionInPlace(collection);\n\t\tconst validatorBefore = inPlace.validator;\n\t\tconst touched = fieldsTouched(Reflect.get(validatorBefore ?? {}, \"$jsonSchema\"), Reflect.get(validator, \"$jsonSchema\"));\n\t\tconst one = documents === 1;\n\t\tconst documentObjectId = counted?.[\"documentId\"];\n\t\tconst fields = await this.fieldsOfDocument(failed.source, collection, documentObjectId, \"$$ROOT\");\n\t\tconst shape = fields.size === 0 ? void 0 : shapeOfDocument(fields, validatorDocumentShapesOf(Reflect.get(validator, \"$jsonSchema\")));\n\t\tconst problems = shape === void 0 ? [] : await this.documentProblems({\n\t\t\tsource: failed.source,\n\t\t\tcollection,\n\t\t\tid: documentObjectId\n\t\t}, fields, shape, \"\");\n\t\tconst nested = nestedFindings(touched, fields);\n\t\tconst shownProblems = [...problems, ...[...nested.lacking.map((key) => `has no ${JSON.stringify(key)}`), ...nested.notObjects.map((field) => `holds an element in ${JSON.stringify(field)} that is not an object`)].filter((text) => !problems.some((problem) => problem.text === text)).map((text) => ({\n\t\t\ttext,\n\t\t\tuncheckable: false\n\t\t}))];\n\t\tconst hadValidator = typeof validatorBefore === \"object\" && validatorBefore !== null;\n\t\tconst found = [\n\t\t\t`${touchedSentence(touched, fields)}${one ? \"It has\" : \"One of them has\"} _id ${documentId}.`,\n\t\t\t...shownProblems.length === 0 ? [] : [`That document ${joinedList(shownProblems.map(({ text }) => text))}.`],\n\t\t\t`Find them all with ${query} in mongosh.`\n\t\t];\n\t\tconst uncheckable = problems.length > 0 && problems.every((problem) => problem.uncheckable);\n\t\tconst backfills = uncheckable || !hadValidator ? {\n\t\t\tsentences: [],\n\t\t\trowsWithoutValue: []\n\t\t} : backfillAdvice(contract, {\n\t\t\tcollection,\n\t\t\tdocuments: await this.documentsLacking(failed.source, collection, failing, touched)\n\t\t}, touched, inPlace.rewrite, {\n\t\t\toperationIndex,\n\t\t\trenamed: renamedInto(plan, collection)\n\t\t});\n\t\tconst advice = uncheckable ? [\"A document that holds such a field can never fit the validator, so changing the documents does not help: store the field under a name without \\\".\\\" that does not start with \\\"$\\\".\"] : hadValidator ? [...backfills.sentences, byHandAdvice(collection)] : [\"Change them with a dataTransform in migration.ts, or with an update in mongosh.\"];\n\t\tconst why = [\n\t\t\t...found,\n\t\t\t...advice,\n\t\t\t`Under db migrate you can instead apply the validator over them: set checkDocuments to false on this operation in that migration.ts, run the file with node, and run db migrate again. db update writes no migration.ts, so there ${uncheckable ? \"store the field under another name\" : \"fix the documents\"} first.`,\n\t\t\t\"This operation did not change the validator.\",\n\t\t\t`${uncheckable ? \"Then run the command again\" : \"Once the documents are fixed, run the command again\"}; operations that already ran are skipped.`\n\t\t].join(\" \");\n\t\treturn runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${op.id} stopped: ${documents} ${one ? \"document\" : \"documents\"} in collection ${collection} ${one ? \"does\" : \"do\"} not fit the new validator`, {\n\t\t\twhy,\n\t\t\tmeta: {\n\t\t\t\toperationId: op.id,\n\t\t\t\tdocumentsFailingValidator: {\n\t\t\t\t\tcollection,\n\t\t\t\t\tdocuments,\n\t\t\t\t\tdocumentId,\n\t\t\t\t\tquery,\n\t\t\t\t\trequires: touched.requires,\n\t\t\t\t\tretypes: touched.retypes\n\t\t\t\t},\n\t\t\t\t...backfills.rowsWithoutValue.length === 0 ? {} : { rowsWithoutValue: backfills.rowsWithoutValue }\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* The failure when a rewrite's check still finds documents after its update: how many, one `_id`,\n\t* and the query that finds them all. Only a data transform's update is the user's to change.\n\t*/\n\tasync documentsStillMatchingFailure(op) {\n\t\tconst [check] = op.postcheck;\n\t\tconst command = check?.source.command;\n\t\tif (check?.expect !== \"notExists\" || !(command instanceof RawAggregateCommand)) return void 0;\n\t\tconst match = Reflect.get(command.pipeline[0] ?? {}, \"$match\");\n\t\tif (typeof match !== \"object\" || match === null) return void 0;\n\t\tconst counted = await this.firstRow({\n\t\t\t...check.source,\n\t\t\tcommand: new RawAggregateCommand(command.collection, [{ $match: match }, { $group: {\n\t\t\t\t_id: null,\n\t\t\t\tdocuments: { $sum: 1 },\n\t\t\t\tdocumentId: { $first: \"$_id\" }\n\t\t\t} }])\n\t\t});\n\t\tconst documents = Number(counted?.[\"documents\"] ?? 0);\n\t\tif (documents === 0) return void 0;\n\t\tconst one = documents === 1;\n\t\tconst documentId = mongoshValue(counted?.[\"documentId\"]);\n\t\tconst query = `db.getCollection(${JSON.stringify(command.collection)}).find(${JSON.stringify(match)})`;\n\t\treturn runnerFailure(\"MIGRATION.POSTCHECK_FAILED\", `Operation ${op.id} failed: after its update, ${documents} ${one ? \"document\" : \"documents\"} in collection ${command.collection} still ${one ? \"matches\" : \"match\"} its check`, {\n\t\t\twhy: [`${one ? \"It has\" : \"One of them has\"} _id ${documentId}. Find them all with ${query} in mongosh.`, op.operationClass === \"data\" ? \"Change the update in the migration's migration.ts so it changes them too, run the file with node, then run the command again; operations that already ran are skipped.\" : \"The update this operation runs did not change them: another client may have written them during the apply, or the value it writes does not pass its own check. Run the command again; operations that already ran are skipped. If they are still found, change them by hand.\"].join(\" \"),\n\t\t\tmeta: {\n\t\t\t\toperationId: op.id,\n\t\t\t\tname: op.name,\n\t\t\t\tdocumentsStillMatching: {\n\t\t\t\t\tcollection: command.collection,\n\t\t\t\t\tdocuments,\n\t\t\t\t\tdocumentId,\n\t\t\t\t\tquery\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* Why a document does not fit a validator, against `shape`: the required fields it lacks, the\n\t* fields whose type the validator does not allow, the fields a closed validator does not name, and\n\t* the same inside each embedded document the validator describes, such as a value object.\n\t*/\n\tasync documentProblems(document, fields, shape, path) {\n\t\tconst nested = await Promise.all([...fields].map(async ([field, { type }]) => {\n\t\t\tconst nestedShape = type === \"object\" ? nestedShapeOf(shape.properties[field]) : void 0;\n\t\t\tif (nestedShape === void 0) return [];\n\t\t\tconst nestedPath = `${path}${field}`;\n\t\t\tconst nestedFields = await this.fieldsOfDocument(document.source, document.collection, document.id, `$${nestedPath}`);\n\t\t\treturn this.documentProblems(document, nestedFields, nestedShape, `${nestedPath}.`);\n\t\t}));\n\t\treturn [...problemsAgainst(fields, shape, path), ...nested.flat()];\n\t}\n\t/**\n\t* The collection as the database has it now: its validator, and what a rewrite's refusals read of\n\t* it, whether it is a time-series collection and its validator's `$jsonSchema`.\n\t*/\n\tasync collectionInPlace(collection) {\n\t\tconst [current] = (await this.deps.inspectionExecutor.listCollections(new ListCollectionsCommand())).filter((info) => info[\"name\"] === collection);\n\t\tconst options = current?.[\"options\"];\n\t\tconst readable = typeof options === \"object\" && options !== null;\n\t\tconst validator = readable ? Reflect.get(options, \"validator\") : void 0;\n\t\treturn {\n\t\t\tvalidator,\n\t\t\trewrite: {\n\t\t\t\ttimeSeries: readable && Reflect.get(options, \"timeseries\") !== void 0,\n\t\t\t\tvalidator: Reflect.get(validator ?? {}, \"$jsonSchema\")\n\t\t\t}\n\t\t};\n\t}\n\t/** Each field or nested key the change makes required that documents matching `failing` lack or hold as `null`, with how many do; a nested key counts only in an object that the document holds. */\n\tasync documentsLacking(source, collection, failing, touched) {\n\t\tconst lackingFilter = (field) => {\n\t\t\tconst key = touched.keys.get(field);\n\t\t\tif (key === void 0) return unrewritableFieldNameReason(field) === void 0 ? { [field]: null } : void 0;\n\t\t\tconst parsed = storedKeyPath(key.field, key.path);\n\t\t\treturn parsed.ok ? documentsWithObject(parsed.value, (object) => lacksKey(object, parsed.value.key)) : void 0;\n\t\t};\n\t\tconst lacking = await Promise.all(touched.requires.map(async (field) => {\n\t\t\tconst filter = lackingFilter(field);\n\t\t\tif (filter === void 0) return [];\n\t\t\tconst counted = await this.firstRow({\n\t\t\t\t...source,\n\t\t\t\tcommand: new RawAggregateCommand(collection, [{ $match: { $and: [failing, filter] } }, { $count: \"documents\" }])\n\t\t\t});\n\t\t\tconst documents = Number(counted?.[\"documents\"] ?? 0);\n\t\t\treturn documents === 0 ? [] : [[field, documents]];\n\t\t}));\n\t\treturn new Map(lacking.flat());\n\t}\n\t/**\n\t* Each field of the document with `_id`, at `input`, `$$ROOT` or the path of an embedded document:\n\t* its BSON type, read with `$type`, and its value.\n\t*/\n\tasync fieldsOfDocument(source, collection, id, input) {\n\t\tconst fields = (await this.firstRow({\n\t\t\t...source,\n\t\t\tcommand: new RawAggregateCommand(collection, [\n\t\t\t\t{ $match: { _id: id } },\n\t\t\t\t{ $limit: 1 },\n\t\t\t\t{ $project: {\n\t\t\t\t\t_id: 0,\n\t\t\t\t\tfields: { $map: {\n\t\t\t\t\t\tinput: { $objectToArray: input },\n\t\t\t\t\t\tin: [\n\t\t\t\t\t\t\t\"$$this.k\",\n\t\t\t\t\t\t\t{ $type: \"$$this.v\" },\n\t\t\t\t\t\t\t\"$$this.v\"\n\t\t\t\t\t\t]\n\t\t\t\t\t} }\n\t\t\t\t} }\n\t\t\t])\n\t\t}))?.[\"fields\"];\n\t\treturn new Map((Array.isArray(fields) ? fields : []).flatMap((entry) => Array.isArray(entry) && typeof entry[0] === \"string\" && typeof entry[1] === \"string\" ? [[entry[0], {\n\t\t\ttype: entry[1],\n\t\t\tvalue: entry[2]\n\t\t}]] : []));\n\t}\n\tasync firstRow(plan) {\n\t\tconst wireCommand = await this.deps.adapter.lower(plan, {});\n\t\tfor await (const row of this.deps.driver.execute(wireCommand)) return row;\n\t}\n\tasync evaluateDmlChecks(checks, filterEvaluator) {\n\t\tfor (const check of checks) {\n\t\t\tconst matchFound = await this.documentsMatch(check, check.source, filterEvaluator);\n\t\t\tif (!(check.expect === \"exists\" ? matchFound : !matchFound)) return false;\n\t\t}\n\t\treturn true;\n\t}\n\tasync documentsMatch(check, source, filterEvaluator) {\n\t\tconst commandKind = source.command.kind;\n\t\tif (!READ_ONLY_CHECK_COMMAND_KINDS.has(commandKind)) throw mongoTargetError(\"MIGRATION.DATA_TRANSFORM_CHECK_NOT_READ_ONLY\", `Migration check rejected: command kind \"${commandKind}\" is not read-only`, {\n\t\t\twhy: \"A migration check must read with an aggregate or rawAggregate command, so that running it cannot change the database.\",\n\t\t\tfix: \"Write the check's source as an aggregate or rawAggregate pipeline, not a command that writes.\",\n\t\t\tmeta: {\n\t\t\t\tcheckDescription: check.description,\n\t\t\t\tcommandKind,\n\t\t\t\tcollection: source.collection\n\t\t\t}\n\t\t});\n\t\tconst stage = writingStageOf(source.command);\n\t\tif (stage !== void 0) throw mongoTargetError(\"MIGRATION.DATA_TRANSFORM_CHECK_NOT_READ_ONLY\", `Migration check rejected: stage \"${stage}\" is not read-only`, {\n\t\t\twhy: `A migration check must only read, so that running it cannot change the database; the ${stage} stage of its pipeline writes its results to a collection.`,\n\t\t\tfix: `Remove the ${stage} stage from the check's pipeline.`,\n\t\t\tmeta: {\n\t\t\t\tcheckDescription: check.description,\n\t\t\t\tstage,\n\t\t\t\tcollection: source.collection\n\t\t\t}\n\t\t});\n\t\tconst wireCommand = await this.deps.adapter.lower(source, {});\n\t\tfor await (const row of this.deps.driver.execute(wireCommand)) if (filterEvaluator.evaluate(check.filter, row)) return true;\n\t\treturn false;\n\t}\n\tasync evaluateChecks(checks, inspectionExecutor, filterEvaluator) {\n\t\treturn await this.firstFailingCheck(checks, inspectionExecutor, filterEvaluator) === void 0;\n\t}\n\tasync firstFailingCheck(checks, inspectionExecutor, filterEvaluator) {\n\t\tfor (const check of checks) {\n\t\t\tconst matchFound = isInspectionCheckSource(check.source) ? (await check.source.accept(inspectionExecutor)).some((doc) => filterEvaluator.evaluate(check.filter, doc)) : await this.documentsMatch(check, check.source, filterEvaluator);\n\t\t\tif (!(check.expect === \"exists\" ? matchFound : !matchFound)) return check;\n\t\t}\n\t}\n\tasync allChecksSatisfied(checks, inspectionExecutor, filterEvaluator) {\n\t\tif (checks.length === 0) return false;\n\t\treturn this.evaluateChecks(checks, inspectionExecutor, filterEvaluator);\n\t}\n\tenforcePolicyCompatibility(policy, operations) {\n\t\tconst allowedClasses = new Set(policy.allowedOperationClasses);\n\t\tfor (const operation of operations) if (!allowedClasses.has(operation.operationClass)) return runnerFailure(\"MIGRATION.POLICY_VIOLATION\", `Operation ${operation.id} has class \"${operation.operationClass}\" which is not allowed by policy.`, {\n\t\t\twhy: `Policy only allows: ${[...allowedClasses].join(\", \")}.`,\n\t\t\tmeta: {\n\t\t\t\toperationId: operation.id,\n\t\t\t\toperationClass: operation.operationClass\n\t\t\t}\n\t\t});\n\t}\n\tensureMarkerCompatibility(marker, plan) {\n\t\tconst origin = plan.origin ?? null;\n\t\tif (!origin) return;\n\t\tif (!marker) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Missing contract marker: expected origin storage hash ${origin.storageHash}.`, { meta: { expectedOriginStorageHash: origin.storageHash } });\n\t\tif (marker.storageHash !== origin.storageHash) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing contract marker (${marker.storageHash}) does not match plan origin (${origin.storageHash}).`, { meta: {\n\t\t\tmarkerStorageHash: marker.storageHash,\n\t\t\texpectedOriginStorageHash: origin.storageHash\n\t\t} });\n\t}\n};\n//#endregion\n//#region src/core/migrations/mongo-target-schema-verifier.ts\n/**\n* Mongo target `SchemaVerifier` concretion. Extends the family base's\n* namespace-walk scaffolding and contributes the per-namespace diff via\n* `verifyNamespace`; the diff body reuses the existing target-side\n* helpers (`contractToMongoSchemaIR`, `canonicalizeSchemasForVerification`,\n* `diffMongoSchemas`) so production verification behaviour is unchanged.\n*\n* Today's invariant: every Mongo contract carries exactly one\n* namespace (the unbound singleton, materialised as\n* `MongoTargetUnboundDatabase`), so the family-base namespace walk\n* dispatches exactly once and the per-namespace body runs the existing\n* whole-schema diff. Future per-collection namespace assignment will\n* have this hook project the diff to the namespace's owned collections.\n*\n* `verifyTargetExtensions` returns the empty list — Mongo has no\n* target-only kinds today.\n*\n* Strict diff mode is `false` for SPI-routed calls; production\n* verification today still goes through `verifyMongoSchema` which\n* receives strict from the CLI.\n*/\nvar MongoTargetSchemaVerifier = class extends MongoSchemaVerifierBase {\n\tverifyNamespace(options) {\n\t\tconst expectedIR = contractToMongoSchemaIR(options.contract);\n\t\tconst { live, expected } = canonicalizeSchemasForVerification(options.schema, expectedIR);\n\t\tconst collectionControlPolicy = (name) => this.collectionControlPolicyForName(options.contract, name);\n\t\tconst { failures, warnings } = diffMongoSchemas(live, expected, false, collectionControlPolicy);\n\t\treturn [...failures, ...warnings];\n\t}\n\tverifyTargetExtensions(_options) {\n\t\treturn [];\n\t}\n};\n//#endregion\n//#region src/core/migrations/scope-verify-result.ts\n/**\n* The bare entity names the given contracts declare, unioned. The Mongo runner\n* asks this of every OTHER contract space in a multi-space apply, so each\n* space's post-apply verify can drop the extras those siblings claim.\n*/\nfunction entityNamesDeclaredBy(contracts) {\n\tconst owned = /* @__PURE__ */ new Set();\n\tfor (const contract of contracts) for (const { entityName } of elementCoordinates(contract.storage)) owned.add(entityName);\n\treturn owned;\n}\n/**\n* True when an issue reports a whole collection present in the database but\n* declared by no contract (an extra) — its path is exactly the collection\n* name, never a deeper index/validator/options auxiliary.\n*/\nfunction extraCollectionName(issue) {\n\tif (issueOutcome(issue) !== \"not-expected\" || issue.path.length !== 1) return void 0;\n\treturn issue.path[0];\n}\n/**\n* Scope a per-space post-apply verify result to the contract space's own\n* elements: drop the `extra` findings for collections another contract space\n* claims. The runner verifies the destination contract against the full live\n* database, which holds sibling spaces' collections — without the scoping a\n* multi-space apply could never pass strict verify. Extras claimed by NO space\n* survive, so genuine drift still fails the runner's verdict.\n*\n* The result is issue-based, so the verdict recomputes directly from the\n* surviving list: `ok` holds exactly when it is empty.\n*/\nfunction scopeVerifyResultToSpace(result, ownedByOtherSpaces) {\n\tif (ownedByOtherSpaces.size === 0) return result;\n\tconst issues = result.schema.issues.filter((issue) => {\n\t\tconst name = extraCollectionName(issue);\n\t\treturn name === void 0 || !ownedByOtherSpaces.has(name);\n\t});\n\tif (issues.length === result.schema.issues.length) return result;\n\tconst ok = issues.length === 0;\n\tconst { code: staleCode, ...envelope } = result;\n\treturn {\n\t\t...envelope,\n\t\tok,\n\t\t...ok ? {} : { code: result.code ?? VERIFY_CODE_SCHEMA_FAILURE },\n\t\tsummary: ok ? \"Database schema satisfies contract\" : result.summary,\n\t\tschema: {\n\t\t\t...result.schema,\n\t\t\tissues\n\t\t}\n\t};\n}\n//#endregion\n//#region src/core/migrations/control-target.ts\nsetFallbackTemporal(Temporal);\n/**\n* `migration.ts` default-exports a `Migration` subclass whose `operations`\n* getter returns the ordered list of operations and whose `describe()`\n* returns the manifest identity metadata. `MongoMigrationPlanner.plan()`\n* returns a `MigrationPlanWithAuthoringSurface` that knows how to render\n* itself back to such a file; `MongoMigrationPlanner.emptyMigration()`\n* returns the same shape for `migration new`. Users run the scaffolded\n* `migration.ts` directly (via `node migration.ts`) to self-emit\n* `ops.json` and attest the `migrationHash`.\n*/\nconst mongoTargetDescriptor = {\n\t...mongoTargetDescriptorMeta,\n\tcontractSerializer: new MongoTargetContractSerializer(),\n\tschemaVerifier: new MongoTargetSchemaVerifier(),\n\tmigrations: {\n\t\tcreatePlanner(_adapter) {\n\t\t\treturn new MongoMigrationPlanner();\n\t\t},\n\t\tcreateRunner(family) {\n\t\t\tlet cachedDeps;\n\t\t\tconst runMongo = async (driver, runnerOptions) => {\n\t\t\t\tcachedDeps ??= family.createRunnerDependencies({ driver });\n\t\t\t\treturn new MongoMigrationRunner(cachedDeps).execute({\n\t\t\t\t\t...runnerOptions,\n\t\t\t\t\tdestinationContract: blindCast(runnerOptions.destinationContract)\n\t\t\t\t});\n\t\t\t};\n\t\t\treturn { async execute({ driver, perSpaceOptions, expectedDatabasePolicies }) {\n\t\t\t\tif (expectedDatabasePolicies !== void 0) {\n\t\t\t\t\tcachedDeps ??= family.createRunnerDependencies({ driver });\n\t\t\t\t\tconst checked = await checkDatabasePolicies(cachedDeps.markerOps, expectedDatabasePolicies);\n\t\t\t\t\tif (!checked.ok) return notOk(checked.failure);\n\t\t\t\t}\n\t\t\t\tconst contracts = perSpaceOptions.map((opts) => blindCast(opts.destinationContract));\n\t\t\t\tconst perSpaceResults = [];\n\t\t\t\tlet changedDatabase = false;\n\t\t\t\tfor (let i = 0; i < perSpaceOptions.length; i++) {\n\t\t\t\t\tconst spaceOptions = perSpaceOptions[i];\n\t\t\t\t\tif (!spaceOptions) continue;\n\t\t\t\t\tconst ownedByOtherSpaces = entityNamesDeclaredBy(contracts.filter((_, j) => j !== i));\n\t\t\t\t\tconst scopeVerifyResult = (result) => scopeVerifyResultToSpace(result, ownedByOtherSpaces);\n\t\t\t\t\tconst { space, ...runnerOptions } = spaceOptions;\n\t\t\t\t\tconst result = await runMongo(driver, {\n\t\t\t\t\t\t...runnerOptions,\n\t\t\t\t\t\tscopeVerifyResult,\n\t\t\t\t\t\tdatabaseChangedBefore: changedDatabase,\n\t\t\t\t\t\t...space === APP_SPACE_ID ? ifDefined(\"checkedPolicies\", expectedDatabasePolicies) : {}\n\t\t\t\t\t});\n\t\t\t\t\tif (!result.ok) return notOk(withFailingSpace(result.failure, space));\n\t\t\t\t\tconst { changedDatabase: spaceChanged, ...value } = result.value;\n\t\t\t\t\tchangedDatabase ||= spaceChanged;\n\t\t\t\t\tperSpaceResults.push({\n\t\t\t\t\t\tspace,\n\t\t\t\t\t\tvalue\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn ok({ perSpaceResults });\n\t\t\t} };\n\t\t},\n\t\tcontractToSchema(contract) {\n\t\t\treturn contractToMongoSchemaIR(blindCast(contract));\n\t\t}\n\t},\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"mongo\",\n\t\t\ttargetId: \"mongo\"\n\t\t};\n\t}\n};\n//#endregion\nexport { CollModCall, CreateCollectionCall, CreateIndexCall, DropCollectionCall, DropIndexCall, FilterEvaluator, MongoMigrationPlanner, MongoMigrationRunner, MongoTargetContractSerializer, MongoTargetDatabase, MongoTargetSchemaVerifier, MongoTargetUnboundDatabase, PlannerProducedMongoMigration, RenameCollectionCall, RenameFieldCall, UnsetFieldCall, deserializeMongoOp, deserializeMongoOps, mongoTargetDescriptor, renderCallsToTypeScript, renderOps, schemaCollectionToCreateCollectionOptions, schemaIndexToCreateIndexOptions, serializeMongoOps };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,IAAI,sBAAsB,cAAc,cAAc;CACrD;CACA;CACA,YAAY,OAAO;EAClB,MAAM;EACN,KAAK,KAAK,MAAM;EAChB,MAAM,aAAa;GAClB,YAAY,CAAC;GACb,GAAG,MAAM;EACV;EACA,KAAK,UAAU,OAAO,OAAO,UAAU,yBAAyB,YAAY,wBAAwB,GAAG,OAAO,CAAC,CAAC;EAChH,OAAO,eAAe,MAAM,QAAQ;GACnC,OAAO;GACP,UAAU;GACV,YAAY;GACZ,cAAc;EACf,CAAC;EACD,WAAW,IAAI;CAChB;CACA,IAAI,aAAa;EAChB,OAAO,KAAK,QAAQ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