@prisma/orm-family-mongo 8.0.0-rc.23-dev.13 → 8.0.0-rc.23-dev.14
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.
- package/dist/{contract-builder-BsGubaBl.d.mts → contract-builder-CnON_Yzr.d.mts} +2 -2
- package/dist/{contract-builder-BsGubaBl.d.mts.map → contract-builder-CnON_Yzr.d.mts.map} +1 -1
- package/dist/{contract-builder-ClNv0uzB.mjs → contract-builder-DMWgsRpK.mjs} +3 -3
- package/dist/{contract-builder-ClNv0uzB.mjs.map → contract-builder-DMWgsRpK.mjs.map} +1 -1
- package/dist/contract-prisma6__provider.mjs +3 -3
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__provider.mjs +1 -1
- package/dist/contract-ts.d.mts +1 -1
- package/dist/contract-ts.mjs +1 -1
- package/dist/contract-ts__contract-builder.d.mts +1 -1
- package/dist/contract-ts__contract-builder.mjs +1 -1
- package/dist/contract.d.mts +2 -2
- package/dist/contract.mjs +2 -2
- package/dist/contract__data-type.d.mts +14 -1
- package/dist/contract__data-type.d.mts.map +1 -1
- package/dist/contract__data-type.mjs +2 -2
- package/dist/{control-BsOZ6I-N.d.mts → control-BNH5e5av.d.mts} +31 -4
- package/dist/{control-BsOZ6I-N.d.mts.map → control-BNH5e5av.d.mts.map} +1 -1
- package/dist/{control-c3gViWlG.mjs → control-C4YSpUJX.mjs} +19 -10
- package/dist/control-C4YSpUJX.mjs.map +1 -0
- package/dist/{control-CKsiMx4D.d.mts → control-Cxe4huYd.d.mts} +10 -9
- package/dist/{control-CKsiMx4D.d.mts.map → control-Cxe4huYd.d.mts.map} +1 -1
- package/dist/{control-ywVRqK1i.mjs → control-DJf8Ct2M.mjs} +6 -2
- package/dist/{control-ywVRqK1i.mjs.map → control-DJf8Ct2M.mjs.map} +1 -1
- package/dist/{control-adapter-BheElqfe-38zaUL-r.d.mts → control-adapter-BheElqfe-Z1rEl51r.d.mts} +4 -4
- package/dist/{control-adapter-BheElqfe-38zaUL-r.d.mts.map → control-adapter-BheElqfe-Z1rEl51r.d.mts.map} +1 -1
- package/dist/control-adapter-Cj8JmiQV.d.mts +1 -0
- package/dist/{dist-By5gbTEW.mjs → dist-DTFnQk-s.mjs} +171 -4
- package/dist/dist-DTFnQk-s.mjs.map +1 -0
- package/dist/{dist-DJzrbVGM.mjs → dist-Dyj5B2n7.mjs} +2 -2
- package/dist/{dist-DJzrbVGM.mjs.map → dist-Dyj5B2n7.mjs.map} +1 -1
- package/dist/{execution-CuluvtwX.d.mts → execution-CD6EeX3b.d.mts} +2 -2
- package/dist/{execution-CuluvtwX.d.mts.map → execution-CD6EeX3b.d.mts.map} +1 -1
- package/dist/family.d.mts +9 -9
- package/dist/family.mjs +7 -7
- package/dist/family__control-adapter.d.mts +2 -2
- package/dist/family__control.d.mts +1 -1
- package/dist/family__control.mjs +2 -2
- package/dist/family__ir.d.mts +2 -2
- package/dist/family__ir.mjs +3 -3
- package/dist/family__migration.d.mts +1 -1
- package/dist/family__migration.mjs +1 -1
- package/dist/family__pack.mjs +1 -1
- package/dist/family__runtime.d.mts +2 -2
- package/dist/family__runtime.mjs +1 -1
- package/dist/family__schema-verify.d.mts +1 -1
- package/dist/family__schema-verify.mjs +1 -1
- package/dist/{field-accessor-DJzCZm0f-zDz2llV-.d.mts → field-accessor-DJzCZm0f-ZGjGQy0_.d.mts} +3 -3
- package/dist/{field-accessor-DJzCZm0f-zDz2llV-.d.mts.map → field-accessor-DJzCZm0f-ZGjGQy0_.d.mts.map} +1 -1
- package/dist/{index-fnk4bdbx.d.mts → index-B2yjvk4C.d.mts} +3 -3
- package/dist/{index-fnk4bdbx.d.mts.map → index-B2yjvk4C.d.mts.map} +1 -1
- package/dist/{index-hugPlQ5w.d.mts → index-BHEoA-q8.d.mts} +77 -2
- package/dist/{index-hugPlQ5w.d.mts.map → index-BHEoA-q8.d.mts.map} +1 -1
- package/dist/{index-CZ-tX2cL.d.mts → index-Bw1gxp0Q.d.mts} +2 -2
- package/dist/{index-CZ-tX2cL.d.mts.map → index-Bw1gxp0Q.d.mts.map} +1 -1
- package/dist/{index-CgKJfbIP.d.mts → index-By9G6gWh.d.mts} +4 -4
- package/dist/{index-CgKJfbIP.d.mts.map → index-By9G6gWh.d.mts.map} +1 -1
- package/dist/{interpreter-v8GWMscU-DmijqboH.mjs → interpreter-v8GWMscU-BFP58so-.mjs} +3 -3
- package/dist/{interpreter-v8GWMscU-DmijqboH.mjs.map → interpreter-v8GWMscU-BFP58so-.mjs.map} +1 -1
- package/dist/{ir-B_tAgqIO.d.mts → ir-CeQg097e.d.mts} +3 -3
- package/dist/{ir-B_tAgqIO.d.mts.map → ir-CeQg097e.d.mts.map} +1 -1
- package/dist/{ir-Bm8xm1eu.mjs → ir-DvWO1xE7.mjs} +2 -2
- package/dist/{ir-Bm8xm1eu.mjs.map → ir-DvWO1xE7.mjs.map} +1 -1
- package/dist/lowering.d.mts +1 -1
- package/dist/{migration-LHRzvIrb.mjs → migration-8enuY81P.mjs} +2 -2
- package/dist/{migration-LHRzvIrb.mjs.map → migration-8enuY81P.mjs.map} +1 -1
- package/dist/{migration-C8VlQx5N.d.mts → migration-B7PcbeNg.d.mts} +4 -4
- package/dist/{migration-C8VlQx5N.d.mts.map → migration-B7PcbeNg.d.mts.map} +1 -1
- package/dist/{mongo-contract-serializer-BBknnHWy-DAzm09wB.mjs → mongo-contract-serializer-BBknnHWy-UNgq5T2h.mjs} +2 -2
- package/dist/{mongo-contract-serializer-BBknnHWy-DAzm09wB.mjs.map → mongo-contract-serializer-BBknnHWy-UNgq5T2h.mjs.map} +1 -1
- package/dist/{mongo-contract-view-AnejqfrQ-DmXEDnxi.d.mts → mongo-contract-view-AnejqfrQ-DLviCLRM.d.mts} +2 -2
- package/dist/{mongo-contract-view-AnejqfrQ-DmXEDnxi.d.mts.map → mongo-contract-view-AnejqfrQ-DLviCLRM.d.mts.map} +1 -1
- package/dist/{mongo-contract-view-CF5trX6R-BIF8ciuY.mjs → mongo-contract-view-CF5trX6R-_k8QTG5C.mjs} +3 -3
- package/dist/{mongo-contract-view-CF5trX6R-BIF8ciuY.mjs.map → mongo-contract-view-CF5trX6R-_k8QTG5C.mjs.map} +1 -1
- package/dist/{mongo-data-type-Bv8Bd0zu-cnTiyyP0.mjs → mongo-data-type-DPJy_m2a-CROT8T5j.mjs} +14 -5
- package/dist/mongo-data-type-DPJy_m2a-CROT8T5j.mjs.map +1 -0
- package/dist/orm.d.mts +2 -2
- package/dist/orm.mjs +2 -2
- package/dist/query-ast.d.mts +3 -3
- package/dist/query-ast.mjs +2 -2
- package/dist/query-ast__control.d.mts +2 -2
- package/dist/query-ast__control.mjs +2 -2
- package/dist/query-ast__execution.d.mts +1 -1
- package/dist/query-builder.d.mts +3 -3
- package/dist/query-builder.mjs +1 -1
- package/dist/query-builder__contract-free.d.mts +3 -3
- package/dist/query-builder__contract-free.mjs +1 -1
- package/dist/{runtime-Cx_Sw9eY.d.mts → runtime-C2G5v1Bk.d.mts} +2 -2
- package/dist/runtime-C2G5v1Bk.d.mts.map +1 -0
- package/dist/runtime.d.mts +4 -4
- package/dist/schema-ir.d.mts +1 -1
- package/dist/{schema-verify-BMTEmTLS.d.mts → schema-verify-DJyHpYGy.d.mts} +3 -3
- package/dist/{schema-verify-BMTEmTLS.d.mts.map → schema-verify-DJyHpYGy.d.mts.map} +1 -1
- package/dist/{verify-mongo-schema-D8rznxzZ-CjYf39zu.mjs → verify-mongo-schema-D8rznxzZ-Dg51Lhnp.mjs} +2 -2
- package/dist/{verify-mongo-schema-D8rznxzZ-CjYf39zu.mjs.map → verify-mongo-schema-D8rznxzZ-Dg51Lhnp.mjs.map} +1 -1
- package/dist/wire.d.mts +2 -2
- package/package.json +20 -20
- package/dist/control-adapter-CPwhJ0SM.d.mts +0 -1
- package/dist/control-c3gViWlG.mjs.map +0 -1
- package/dist/dist-By5gbTEW.mjs.map +0 -1
- package/dist/mongo-data-type-Bv8Bd0zu-cnTiyyP0.mjs.map +0 -1
- package/dist/runtime-Cx_Sw9eY.d.mts.map +0 -1
package/dist/{interpreter-v8GWMscU-DmijqboH.mjs.map → interpreter-v8GWMscU-BFP58so-.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interpreter-v8GWMscU-DmijqboH.mjs","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-psl/dist/interpreter-v8GWMscU.mjs"],"sourcesContent":["import { describeDiscriminatorRefusal, enumMemberProblemDiagnostic, instantiateAuthoringEntityType, instantiateAuthoringTypeAlias, instantiateAuthoringTypeConstructor, instantiateAuthoringTypeConstructorFromValues, isAuthoringEntityTypeDescriptor, resolveTypeAliasGenerators, validateAuthoringHelperArguments } from \"@internal/framework-components/authoring\";\nimport { argumentIndexOf, argumentSpan, claimedBlockKeywords, consumeInvalidFkPairing, enumMemberAttributeDiagnostics, fkRelationPairKey, instantiatePslTypeChoice, isBareTypeConstructor, mapPslHelperArgs, reportTypeConstructorNotCalled, requiredOneToOneBackrelationDiagnostic, unsupportedBlockDiagnostic } from \"@internal/psl-parser/interpret\";\nimport { resolveToOneRelationNullable } from \"@internal/contract-authoring\";\nimport { DOCUMENT_ID } from \"@internal/mongo-contract\";\nimport { buildMongoContractFromDefinition, mergeRedundantIndexes, nameIndexes } from \"@internal/mongo-contract-ts/contract-builder\";\nimport { bool, contributedTypeAliasOf, contributedTypeOf, createPslDiagnosticCollector, diagnosticSource, entityRef, fieldAttribute, fieldRef, funcCall, generatorAttributeSpec, identifier, int, interpretAttribute, interpretExtensionBlocks, isContributedTypeChoice, json, list, mapPslDiagnostics, modelAttribute, nodePslSpan, num, oneOf, optional, record, referencedFieldRef, refuseRepeatedTypeAliasAttributes, resolveTypeAliases, str, typeAliasSpecContext, typeAttributeSpecContextOfField, typeAttributeSubjectLabel, typeGeneratorAttributeSpec, typeReferenceNode, writtenScalar } from \"@internal/psl-parser\";\nimport { ArrayLiteralAst, FunctionCallAst, PathExprAst } from \"@internal/psl-parser/syntax\";\nimport { assertDefined, invariant } from \"@internal/utils/assertions\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { crossRef } from \"@internal/contract/types\";\n//#region src/mongo-attribute-specs.ts\nfunction buildModelAttributeCtx(input) {\n\treturn {\n\t\tsources: input.sources,\n\t\tselfModel: input.selfModel,\n\t\tbinder: input.binder,\n\t\tsymbols: input.symbols\n\t};\n}\nfunction buildFieldAttributeCtx(input) {\n\treturn {\n\t\tsources: input.sources,\n\t\tselfModel: input.selfModel,\n\t\tfield: input.field,\n\t\tbinder: input.binder,\n\t\tsymbols: input.symbols\n\t};\n}\nconst UNLOWERED_FIELD_ATTRIBUTE_HINTS = /* @__PURE__ */ new Map([[\"updatedAt\", \"Use @onCreate(now()) @onUpdate(now()), or type the field temporal.UpdatedAt.\"]]);\nconst DEFAULT_NOW_HINT = \"Use @onCreate(now()) instead; MongoDB has no database defaults.\";\n/** The hint for an attribute MongoDB PSL does not lower, naming what to write instead. */\nfunction unloweredAttributeHint(attribute) {\n\tif (attribute.name === \"default\" && attribute.args[0]?.value.replace(/\\s/g, \"\") === \"now()\") return DEFAULT_NOW_HINT;\n\treturn UNLOWERED_FIELD_ATTRIBUTE_HINTS.get(attribute.name);\n}\nfunction describeUnsupportedMongoAttribute(sources) {\n\treturn ({ attribute, level, owner, field }) => {\n\t\tif (level === \"model\") return {\n\t\t\tcode: \"PSL_UNSUPPORTED_MODEL_ATTRIBUTE\",\n\t\t\tmessage: `${owner.kind === \"mixin\" ? \"Mixin\" : \"Model\"} \"${owner.name}\" uses unsupported attribute \"@@${attribute.name}\"`,\n\t\t\t...diagnosticSource(sources, owner.node.syntax).at(attribute.span)\n\t\t};\n\t\tif (field === void 0) return void 0;\n\t\tconst base = `Field \"${owner.name}.${field.name}\" uses unsupported attribute \"@${attribute.name}\"`;\n\t\tconst hint = unloweredAttributeHint(attribute);\n\t\treturn {\n\t\t\tcode: \"PSL_UNSUPPORTED_FIELD_ATTRIBUTE\",\n\t\t\tmessage: hint === void 0 ? base : `${base}. ${hint}`,\n\t\t\t...diagnosticSource(sources, field.node.syntax).at(attribute.span)\n\t\t};\n\t};\n}\nfunction interpretModelAttribute(input) {\n\tconst result = interpretAttribute(input.node, input.spec, buildModelAttributeCtx({\n\t\tsymbols: input.symbols,\n\t\tselfModel: input.model,\n\t\tsources: input.sources,\n\t\tbinder: input.binder\n\t}));\n\tif (!result.ok) {\n\t\tinput.diagnostics.push(...result.failure);\n\t\treturn;\n\t}\n\treturn result.value;\n}\nfunction interpretFieldAttribute(input) {\n\tconst result = interpretAttribute(input.node, input.spec, buildFieldAttributeCtx({\n\t\tsymbols: input.symbols,\n\t\tselfModel: input.model,\n\t\tfield: input.field,\n\t\tsources: input.sources,\n\t\tbinder: input.binder\n\t}));\n\tif (!result.ok) {\n\t\tinput.diagnostics.push(...result.failure);\n\t\treturn;\n\t}\n\treturn result.value;\n}\nconst mapModelSpec = modelAttribute(\"map\", {\n\tdocumentation: \"Maps this model to a MongoDB collection name.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str(),\n\t\tdocumentation: \"The collection name stored in MongoDB.\"\n\t}]\n});\nconst mapFieldSpec = fieldAttribute(\"map\", {\n\tdocumentation: \"Maps this field to a stored document key.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str(),\n\t\tdocumentation: \"The key stored in MongoDB documents.\"\n\t}]\n});\nconst idFieldSpec = fieldAttribute(\"id\", { documentation: \"Marks the field stored as `_id`, the document’s id. The field must be stored as `_id`: name it `_id` or add `@map(\\\"_id\\\")`. A model may leave `@id` out; its documents still get an ObjectId `_id`.\" });\nconst indexMapArg = {\n\ttype: optional(str()),\n\tdocumentation: \"The name MongoDB stores the index under. Without it, the index is named after its keys and directions, such as `email_1`.\"\n};\nconst uniqueFieldSpec = fieldAttribute(\"unique\", {\n\tdocumentation: \"Requires values in this field to be unique across the collection.\",\n\tnamed: { map: indexMapArg }\n});\nconst relationFieldSpec = fieldAttribute(\"relation\", {\n\tdocumentation: \"Names a relation and associates local fields with fields on the referenced model.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: optional(str()),\n\t\tdocumentation: \"The relation name used to pair both sides. May also be supplied by name.\"\n\t}],\n\tnamed: {\n\t\tname: {\n\t\t\ttype: optional(str()),\n\t\t\tdocumentation: \"The relation name used to pair both sides. Cannot also be supplied positionally.\"\n\t\t},\n\t\tfields: {\n\t\t\ttype: optional(list(fieldRef(), {\n\t\t\t\tallowEmpty: false,\n\t\t\t\tunique: true\n\t\t\t})),\n\t\t\tdocumentation: \"The ordered local fields holding references to related documents.\"\n\t\t},\n\t\treferences: {\n\t\t\ttype: optional(list(referencedFieldRef(), {\n\t\t\t\tallowEmpty: false,\n\t\t\t\tunique: true\n\t\t\t})),\n\t\t\tdocumentation: \"The corresponding fields on the referenced model.\"\n\t\t}\n\t}\n});\nconst discriminatorModelSpec = modelAttribute(\"discriminator\", {\n\tdocumentation: \"Selects the field that distinguishes inheritance variants in this collection.\",\n\tpositional: [{\n\t\tkey: \"field\",\n\t\ttype: fieldRef(),\n\t\tdocumentation: \"The discriminator field on this model.\"\n\t}]\n});\nfunction baseModelSpec() {\n\treturn modelAttribute(\"base\", {\n\t\tdocumentation: \"Declares this model as a variant of a base model.\",\n\t\tpositional: [{\n\t\t\tkey: \"base\",\n\t\t\ttype: entityRef({ kind: \"model\" }),\n\t\t\tdocumentation: \"The base model to inherit from.\"\n\t\t}, {\n\t\t\tkey: \"value\",\n\t\t\ttype: writtenScalar(str()),\n\t\t\tdocumentation: \"The discriminator value identifying this variant, a value of the discriminator field's type.\"\n\t\t}]\n\t});\n}\nconst indexFieldElement = oneOf(fieldRef(), funcCall(\"wildcard\", {\n\tdocumentation: \"Indexes document fields using a MongoDB wildcard index.\",\n\tpositional: [{\n\t\tkey: \"scope\",\n\t\ttype: optional(identifier()),\n\t\tdocumentation: \"The field path to index recursively. Omit to index all document fields.\"\n\t}]\n}), funcCall(\"sort\", {\n\tdocumentation: \"Selects an index field with an explicit sort direction.\",\n\tpositional: [{\n\t\tkey: \"field\",\n\t\ttype: fieldRef(),\n\t\tdocumentation: \"The model field to index.\"\n\t}, {\n\t\tkey: \"direction\",\n\t\ttype: oneOf(identifier(\"Asc\", { documentation: \"Sort ascending.\" }), identifier(\"Desc\", { documentation: \"Sort descending.\" })),\n\t\tdocumentation: \"The index order for this field: `Asc` or `Desc`.\"\n\t}]\n}));\nconst collationNamedArgs = {\n\tcollationLocale: {\n\t\ttype: optional(str()),\n\t\tdocumentation: \"The ICU locale used for string comparison, or `simple` for binary comparison.\"\n\t},\n\tcollationStrength: {\n\t\ttype: optional(oneOf(num(1), num(2), num(3), num(4), num(5))),\n\t\tdocumentation: \"The collation comparison level, from `1` (primary differences) through `5` (identical).\"\n\t},\n\tcollationCaseLevel: {\n\t\ttype: optional(bool()),\n\t\tdocumentation: \"Whether case differences are compared at strength `1` or `2`.\"\n\t},\n\tcollationCaseFirst: {\n\t\ttype: optional(oneOf(str(\"upper\"), str(\"lower\"), str(\"off\"))),\n\t\tdocumentation: \"Whether uppercase or lowercase sorts first, or `off` for the locale default.\"\n\t},\n\tcollationNumericOrdering: {\n\t\ttype: optional(bool()),\n\t\tdocumentation: \"Whether numeric strings are compared as numbers rather than lexicographically.\"\n\t},\n\tcollationAlternate: {\n\t\ttype: optional(oneOf(str(\"non-ignorable\"), str(\"shifted\"))),\n\t\tdocumentation: \"Whether punctuation and whitespace are significant or shifted to a later comparison level.\"\n\t},\n\tcollationMaxVariable: {\n\t\ttype: optional(oneOf(str(\"punct\"), str(\"space\"))),\n\t\tdocumentation: \"Which characters are ignored when alternate handling is `shifted`: punctuation or spaces.\"\n\t},\n\tcollationBackwards: {\n\t\ttype: optional(bool()),\n\t\tdocumentation: \"Whether secondary differences, such as accents, are compared in reverse order.\"\n\t},\n\tcollationNormalization: {\n\t\ttype: optional(bool()),\n\t\tdocumentation: \"Whether strings are checked and normalized before comparison.\"\n\t}\n};\nfunction buildIndexModelSpec(name) {\n\treturn modelAttribute(name, {\n\t\tdocumentation: name === \"unique\" ? \"Declares a unique MongoDB index over the selected fields.\" : \"Declares a MongoDB index over the selected fields.\",\n\t\tpositional: [{\n\t\t\tkey: \"fields\",\n\t\t\ttype: list(indexFieldElement, { allowEmpty: false }),\n\t\t\tdocumentation: name === \"unique\" ? \"The nonempty list of indexed fields, optionally with sort directions. Wildcard scopes are not supported.\" : \"The nonempty list of indexed fields, optionally with sort directions or a wildcard scope.\"\n\t\t}],\n\t\tnamed: {\n\t\t\tmap: indexMapArg,\n\t\t\ttype: {\n\t\t\t\ttype: optional(oneOf(num(1), num(-1), str(\"text\"), str(\"2dsphere\"), str(\"2d\"), str(\"hashed\"))),\n\t\t\t\tdocumentation: \"The MongoDB index key type: ascending `1`, descending `-1`, text, geospatial, or hashed.\"\n\t\t\t},\n\t\t\tsparse: {\n\t\t\t\ttype: optional(bool()),\n\t\t\t\tdocumentation: \"Whether documents missing indexed fields are omitted from the index.\"\n\t\t\t},\n\t\t\texpireAfterSeconds: {\n\t\t\t\ttype: optional(int()),\n\t\t\t\tdocumentation: \"The expiration interval in seconds for a TTL index.\"\n\t\t\t},\n\t\t\tfilter: {\n\t\t\t\ttype: optional(json()),\n\t\t\t\tdocumentation: \"A JSON partial-filter expression limiting which documents are indexed.\"\n\t\t\t},\n\t\t\tinclude: {\n\t\t\t\ttype: optional(list(str())),\n\t\t\t\tdocumentation: \"Document paths included in the wildcard index projection.\"\n\t\t\t},\n\t\t\texclude: {\n\t\t\t\ttype: optional(list(str())),\n\t\t\t\tdocumentation: \"Document paths excluded from the wildcard index projection.\"\n\t\t\t},\n\t\t\tdefault_language: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The default language for text-index tokenization and stemming.\"\n\t\t\t},\n\t\t\tlanguageOverride: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The document field that overrides the text-index language.\"\n\t\t\t},\n\t\t\t...collationNamedArgs\n\t\t}\n\t});\n}\nfunction buildTextIndexModelSpec() {\n\treturn modelAttribute(\"textIndex\", {\n\t\tdocumentation: \"Declares a MongoDB text index with optional field weights and language settings.\",\n\t\tpositional: [{\n\t\t\tkey: \"fields\",\n\t\t\ttype: list(indexFieldElement, { allowEmpty: false }),\n\t\t\tdocumentation: \"The nonempty list of fields whose text is indexed.\"\n\t\t}],\n\t\tnamed: {\n\t\t\tmap: indexMapArg,\n\t\t\tfilter: {\n\t\t\t\ttype: optional(json()),\n\t\t\t\tdocumentation: \"A JSON partial-filter expression limiting which documents are indexed.\"\n\t\t\t},\n\t\t\tweights: {\n\t\t\t\ttype: optional(record(int({\n\t\t\t\t\tmin: 1,\n\t\t\t\t\tmax: 99999\n\t\t\t\t}))),\n\t\t\t\tdocumentation: \"Relative text-search weights by field, each from `1` through `99999`.\"\n\t\t\t},\n\t\t\tlanguage: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The default language for tokenization and stemming.\"\n\t\t\t},\n\t\t\tlanguageOverride: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The document field that overrides the text-index language.\"\n\t\t\t},\n\t\t\t...collationNamedArgs\n\t\t}\n\t});\n}\nfunction staticModelSpec(spec) {\n\treturn () => spec;\n}\nfunction staticFieldSpec(spec) {\n\treturn () => spec;\n}\nconst mongoAttributeSpecs = {\n\tmodel: {\n\t\tmap: staticModelSpec(mapModelSpec),\n\t\tdiscriminator: staticModelSpec(discriminatorModelSpec),\n\t\tbase: baseModelSpec,\n\t\tindex: staticModelSpec(buildIndexModelSpec(\"index\")),\n\t\tunique: staticModelSpec(buildIndexModelSpec(\"unique\")),\n\t\ttextIndex: staticModelSpec(buildTextIndexModelSpec())\n\t},\n\tfield: {\n\t\tid: staticFieldSpec(idFieldSpec),\n\t\tunique: staticFieldSpec(uniqueFieldSpec),\n\t\tmap: staticFieldSpec(mapFieldSpec),\n\t\trelation: staticFieldSpec(relationFieldSpec),\n\t\tonCreate: generatorAttributeSpec(\"onCreate\"),\n\t\tonUpdate: generatorAttributeSpec(\"onUpdate\")\n\t}\n};\n//#endregion\n//#region src/pair-back-relations.ts\n/**\n* Matches each back-relation with the foreign key on the other model: same model pair, and the same relation name when the back-relation has one. A back-relation with no match is orphaned unless its foreign key was already reported (`invalidFkPairings`); one with several matches is ambiguous.\n*/\nfunction pairMongoBackRelations(input) {\n\tconst foreignKeysByPair = /* @__PURE__ */ new Map();\n\tfor (const fk of input.foreignKeys) {\n\t\tconst key = fkRelationPairKey(fk.declaringModel, fk.targetModel);\n\t\tconst existing = foreignKeysByPair.get(key);\n\t\tif (existing) existing.push(fk);\n\t\telse foreignKeysByPair.set(key, [fk]);\n\t}\n\tconst relations = [];\n\tconst diagnostics = [];\n\tfor (const candidate of input.candidates) {\n\t\tconst { field, modelName, targetModelName } = candidate;\n\t\tconst source = diagnosticSource(candidate.sources, field.node.syntax);\n\t\tconst pairKey = fkRelationPairKey(targetModelName, modelName);\n\t\tconst pairMatches = foreignKeysByPair.get(pairKey) ?? [];\n\t\tconst matches = candidate.relationName ? pairMatches.filter((fk) => fk.relationName === candidate.relationName) : pairMatches;\n\t\tif (matches.length === 0) {\n\t\t\tif (consumeInvalidFkPairing(candidate, pairKey, input.invalidFkPairings)) continue;\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_ORPHANED_BACKRELATION\",\n\t\t\t\tmessage: `Backrelation list field \"${modelName}.${field.name}\" has no matching FK-side relation on model \"${targetModelName}\". Add @relation(fields: [...], references: [...]) on the FK-side relation or use an explicit join model for many-to-many.`,\n\t\t\t\t...source.at(field.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst [fk] = matches;\n\t\tif (fk === void 0 || matches.length > 1) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_AMBIGUOUS_BACKRELATION\",\n\t\t\t\tmessage: `Backrelation list field \"${modelName}.${field.name}\" matches multiple FK-side relations on model \"${targetModelName}\". Add @relation(\"...\") to both sides to disambiguate.`,\n\t\t\t\t...source.at(field.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (candidate.cardinality === \"1:1\" && !field.optional) diagnostics.push(requiredOneToOneBackrelationDiagnostic({\n\t\t\tmodelName,\n\t\t\tfield,\n\t\t\ttargetModelName,\n\t\t\tsources: candidate.sources,\n\t\t\trecordNoun: \"document\"\n\t\t}));\n\t\trelations.push({\n\t\t\tmodelName,\n\t\t\tfieldName: field.name,\n\t\t\trelation: {\n\t\t\t\tto: crossRef(targetModelName, input.namespaceId),\n\t\t\t\t...candidate.cardinality === \"1:N\" ? { cardinality: \"1:N\" } : {\n\t\t\t\t\tcardinality: \"1:1\",\n\t\t\t\t\tnullable: true\n\t\t\t\t},\n\t\t\t\ton: {\n\t\t\t\t\tlocalFields: fk.targetFields,\n\t\t\t\t\ttargetFields: fk.localFields\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\treturn {\n\t\trelations,\n\t\tdiagnostics\n\t};\n}\n//#endregion\n//#region src/psl-helpers.ts\n/** Storage collection name of a model that declares no `@@map`: the model name, verbatim. */\nfunction defaultCollectionName(modelName) {\n\treturn modelName;\n}\nfunction getAttribute(attributes, name) {\n\treturn attributes.find((attr) => attr.name === name);\n}\n//#endregion\n//#region src/refusal-diagnostics.ts\nfunction fieldSiteKey(owner, fieldName) {\n\treturn JSON.stringify([owner, fieldName]);\n}\nfunction fieldSiteOf(sites, key) {\n\tconst site = sites.fields.get(fieldSiteKey(key.owner.name, key.field));\n\tif (site === void 0) throw new InternalError(`A refused field \"${key.owner.name}.${key.field}\" has a site.`);\n\treturn site;\n}\nfunction modelSitesOf(sites, model) {\n\tconst modelSites = sites.models.get(model);\n\tif (modelSites === void 0) throw new InternalError(`A refused model \"${model}\" has sites.`);\n\treturn modelSites;\n}\nfunction indexSiteOf(sites, model, position) {\n\tconst site = modelSitesOf(sites, model).indexes[position];\n\tif (site === void 0) throw new InternalError(`Index ${position} of \"${model}\" has a site.`);\n\treturn site;\n}\nfunction at(site, code, message) {\n\treturn {\n\t\tcode,\n\t\tmessage,\n\t\t...site.source.at(site.span)\n\t};\n}\nfunction atField(field, code, message) {\n\treturn {\n\t\tcode,\n\t\tmessage,\n\t\t...field.source.at(field.symbol.span)\n\t};\n}\nfunction atFieldCall(field, code, message) {\n\treturn {\n\t\tcode,\n\t\tmessage,\n\t\t...field.source.at(field.symbol.typeConstructor?.span ?? field.symbol.span)\n\t};\n}\nfunction generatedListDiagnostic(field, label) {\n\tconst perElement = \"Lists have no per-element generated values;\";\n\tconst phase = field.generatorAttributes.onCreate !== void 0 ? \"onCreate\" : \"onUpdate\";\n\tconst attribute = field.generatorAttributes[phase];\n\tif (attribute !== void 0) return {\n\t\tcode: \"PSL_LIST_EXECUTION_DEFAULT_UNSUPPORTED\",\n\t\tmessage: `${label} is a list and cannot use @${phase}(${attribute.argument}). ${perElement} remove @${phase}(...).`,\n\t\t...field.source.at(attribute.span)\n\t};\n\treturn atField(field, \"PSL_LIST_EXECUTION_DEFAULT_UNSUPPORTED\", `${label} is a list, and its type alias \"${field.typeAlias?.name}\" generates a value. ${perElement} remove \"[]\" or type the field without the alias.`);\n}\nfunction generatedOnValueObjectDiagnostic(field, owner) {\n\tconst fieldName = field.symbol.name;\n\treturn atField(field, \"PSL_UNSUPPORTED_FIELD_TYPE\", `Member \"${fieldName}\" of composite type \"${owner}\" is typed by the type alias \"${field.typeAlias?.name}\", which generates a value; a composite type member has no generated values.`);\n}\nfunction relationNullabilityDiagnostic(field, model, ownsForeignKey) {\n\tconst fieldLabel = `Relation field \"${model}.${field.symbol.name}\"`;\n\tif (!ownsForeignKey) return atField(field, \"PSL_REQUIRED_ONE_TO_ONE_BACKRELATION\", `${fieldLabel} is required, but the other model holds the relation fields, so nothing in storage guarantees the related document exists. Make it optional with \"?\".`);\n\treturn atField(field, \"PSL_RELATION_NULLABILITY_MISMATCH\", field.symbol.optional ? `${fieldLabel} is optional but every field in @relation(fields: [...]) is required. Make one of those fields optional with \"?\" or remove \"?\" from \"${field.symbol.name}\".` : `${fieldLabel} is required but a field in @relation(fields: [...]) is optional. Add \"?\" to \"${field.symbol.name}\" or make those fields required.`);\n}\nconst INDEX_SHAPE_MESSAGES = {\n\t\"unique-wildcard\": () => \"Unique indexes cannot use wildcard() fields\",\n\t\"hashed-several-fields\": () => \"Hashed indexes must have exactly one field\",\n\t\"ttl-with-wildcard\": () => \"expireAfterSeconds cannot be combined with wildcard() fields\",\n\t\"projection-without-wildcard\": () => \"include/exclude options are only valid when the index contains a wildcard() field\",\n\t\"collation-without-locale\": () => \"collationLocale is required when using collation options\",\n\t\"second-text-index\": (model) => `Only one @@textIndex is allowed per collection (model \"${model}\")`\n};\nfunction validatorDiagnostic(refusal, sites) {\n\tswitch (refusal.kind) {\n\t\tcase \"enumBsonType\":\n\t\tcase \"enumNotListable\":\n\t\tcase \"enumMemberNotListable\": {\n\t\t\tconst site = sites.enums.get(refusal.enumName);\n\t\t\tif (site === void 0) throw new InternalError(`Enum \"${refusal.enumName}\" has a site.`);\n\t\t\tconst subject = `enum \"${refusal.enumName}\"`;\n\t\t\tconst base = {\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tsourceId: site.block.sourceId\n\t\t\t};\n\t\t\tif (refusal.kind === \"enumBsonType\") return {\n\t\t\t\t...base,\n\t\t\t\tmessage: `${subject} ${refusal.refusal.reason}`,\n\t\t\t\tspan: site.codecSpan\n\t\t\t};\n\t\t\tif (refusal.kind === \"enumNotListable\") return {\n\t\t\t\t...base,\n\t\t\t\tmessage: `${subject} @@type codec \"${refusal.codecId}\" ${refusal.reason}`,\n\t\t\t\tspan: site.codecSpan\n\t\t\t};\n\t\t\treturn {\n\t\t\t\t...base,\n\t\t\t\tmessage: `${subject} member \"${refusal.member}\" ${refusal.reason}`,\n\t\t\t\tspan: site.block.memberSpans[refusal.member] ?? site.codecSpan\n\t\t\t};\n\t\t}\n\t\tcase \"fieldBsonType\":\n\t\tcase \"documentId\": {\n\t\t\tconst owner = refusal.kind === \"fieldBsonType\" ? refusal.owner.name : refusal.modelName;\n\t\t\tconst field = fieldSiteOf(sites, {\n\t\t\t\tkind: \"field\",\n\t\t\t\towner: {\n\t\t\t\t\tkind: \"model\",\n\t\t\t\t\tname: owner\n\t\t\t\t},\n\t\t\t\tfield: refusal.fieldName\n\t\t\t});\n\t\t\treturn atField(field, refusal.kind === \"fieldBsonType\" ? \"PSL_UNSUPPORTED_FIELD_TYPE\" : \"PSL_MONGO_ID_INVALID\", `Field \"${owner}.${field.symbol.name}\" ${refusal.kind === \"fieldBsonType\" ? refusal.refusal.reason : refusal.reason}`);\n\t\t}\n\t\tcase \"embeddedModelHasVariants\": throw new InternalError(\"A PSL schema writes no embed relations.\");\n\t}\n}\n/**\n* The diagnostic for one refusal of the builder, at the place in the schema it is about, worded as PSL words it. A source position comes from the refusal's key.\n*/\nfunction refusalDiagnostic(refusal, sites) {\n\tswitch (refusal.kind) {\n\t\tcase \"storedNameUnsupported\": return atField(fieldSiteOf(sites, refusal.key), \"PSL_STORED_NAME_UNSUPPORTED\", `Field \"${refusal.key.owner.name}.${refusal.key.field}\" ${refusal.reason}. Give the field another stored name with @map.`);\n\t\tcase \"storedNameDuplicate\": {\n\t\t\tconst model = refusal.key.owner.name;\n\t\t\treturn atField(fieldSiteOf(sites, refusal.key), \"PSL_DUPLICATE_STORED_NAME\", `Fields \"${model}.${refusal.firstField}\" and \"${model}.${refusal.key.field}\" are both stored as \"${refusal.storedName}\". Give each field its own stored name with @map.`);\n\t\t}\n\t\tcase \"restatedBaseFieldDiffers\": return atField(fieldSiteOf(sites, refusal.key), \"PSL_VARIANT_FIELD_DIFFERS_FROM_BASE\", `Field \"${refusal.key.owner.name}.${refusal.key.field}\" restates field \"${refusal.key.field}\" of base model \"${refusal.baseModel}\" with a different ${refusal.differences.map(differenceWording).join(\" and \")}. A variant's documents are checked against the base's field, so declare it exactly as the base does, or remove it from the variant.`);\n\t\tcase \"storedNameSharedWithBase\": return atField(fieldSiteOf(sites, refusal.key), \"PSL_DUPLICATE_STORED_NAME\", `Fields \"${refusal.baseModel}.${refusal.baseField}\" and \"${refusal.key.owner.name}.${refusal.key.field}\" are both stored as \"${refusal.storedName}\", and a variant's documents hold its base's fields too. Give each field its own stored name with @map.`);\n\t\tcase \"valueObjectFieldStoredName\": {\n\t\t\tconst field = fieldSiteOf(sites, refusal.key);\n\t\t\treturn at(field.map ?? {\n\t\t\t\tsource: field.source,\n\t\t\t\tspan: field.symbol.span\n\t\t\t}, \"PSL_MONGO_TYPE_FIELD_MAP_UNSUPPORTED\", `Field \"${refusal.key.owner.name}.${refusal.key.field}\" has @map, but a field of a composite type is stored under its own name. Remove @map, or rename the field to the name it is stored under.`);\n\t\t}\n\t\tcase \"relationLocalFieldUnknown\": {\n\t\t\tconst { model, relation } = refusal.key;\n\t\t\treturn atField(fieldSiteOf(sites, {\n\t\t\t\tkind: \"field\",\n\t\t\t\towner: {\n\t\t\t\t\tkind: \"model\",\n\t\t\t\t\tname: model\n\t\t\t\t},\n\t\t\t\tfield: relation\n\t\t\t}), \"PSL_INVALID_ATTRIBUTE_ARGUMENT\", `Relation field \"${model}.${relation}\" joins on field \"${refusal.fieldName}\", which model \"${model}\" does not declare`);\n\t\t}\n\t\tcase \"relationNullability\": {\n\t\t\tconst { model, relation } = refusal.key;\n\t\t\treturn relationNullabilityDiagnostic(fieldSiteOf(sites, {\n\t\t\t\tkind: \"field\",\n\t\t\t\towner: {\n\t\t\t\t\tkind: \"model\",\n\t\t\t\t\tname: model\n\t\t\t\t},\n\t\t\t\tfield: relation\n\t\t\t}), model, refusal.ownsForeignKey);\n\t\t}\n\t\tcase \"variantCollectionDiffers\": {\n\t\t\tconst base = modelSitesOf(sites, refusal.key.model).base;\n\t\t\tif (base === void 0) throw new InternalError(\"A variant has a @@base site.\");\n\t\t\treturn at(base, \"PSL_MONGO_VARIANT_SEPARATE_COLLECTION\", `Mongo variant \"${refusal.key.model}\" cannot use a different collection than its base \"${refusal.baseModel}\". Mongo only supports single-collection polymorphism.`);\n\t\t}\n\t\tcase \"indexFieldUnknown\":\n\t\tcase \"indexShape\":\n\t\tcase \"indexScopeConflict\":\n\t\tcase \"indexDuplicate\": {\n\t\t\tconst { model, position } = refusal.key;\n\t\t\tconst site = modelSitesOf(sites, model).indexes[position];\n\t\t\tif (site === void 0) throw new InternalError(`Index ${position} of \"${model}\" has a site.`);\n\t\t\tswitch (refusal.kind) {\n\t\t\t\tcase \"indexFieldUnknown\": return at(site, \"PSL_INDEX_FIELD_NOT_FOUND\", `Index on model \"${model}\" references unknown field \"${refusal.fieldName}\"`);\n\t\t\t\tcase \"indexShape\": return at(site, \"PSL_INVALID_INDEX\", refusal.rule === \"wildcard-with-type\" ? `wildcard() fields cannot be combined with type: ${wildcardTypeOf(site.index)}` : INDEX_SHAPE_MESSAGES[refusal.rule](model));\n\t\t\t\tcase \"indexScopeConflict\": return at(site, \"PSL_INVALID_INDEX\", `Variant \"${model}\" index conflicts with discriminator scope: ${refusal.reason}`);\n\t\t\t\tcase \"indexDuplicate\": return at(site, \"PSL_INVALID_INDEX\", `${site.label} has the same keys and options as ${indexSiteOf(sites, refusal.firstModel, refusal.firstPosition).label}, in collection \"${refusal.collection}\", but another name. MongoDB cannot hold both. Remove one of them, or give them the same \\`map\\`.`);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"indexNameDuplicate\": {\n\t\t\tconst { model, position } = refusal.key;\n\t\t\tconst site = modelSitesOf(sites, model).indexes[position];\n\t\t\tif (site === void 0) throw new InternalError(`Index ${position} of \"${model}\" has a site.`);\n\t\t\treturn at(site, \"PSL_INVALID_INDEX\", `${site.label} is named \"${refusal.name}\", as is ${indexSiteOf(sites, refusal.firstModel, refusal.firstPosition).label}, in collection \"${refusal.collection}\". An index without \\`map\\` is named after its keys and directions. Give one of them another name with \\`map\\`.`);\n\t\t}\n\t\tcase \"generatedOnValueObject\": return generatedOnValueObjectDiagnostic(fieldSiteOf(sites, refusal.key), refusal.key.owner.name);\n\t\tcase \"generatorPhaseSetTwice\": throw new InternalError(`Field \"${refusal.key.owner.name}.${refusal.key.field}\" sets a phase twice, which PSL refuses as a repeated type alias attribute before building.`);\n\t\tcase \"generatedList\": return generatedListDiagnostic(fieldSiteOf(sites, refusal.key), `Field \"${refusal.key.owner.name}.${refusal.key.field}\"`);\n\t\tcase \"generatedOnVariant\": return atField(fieldSiteOf(sites, refusal.key), \"PSL_GENERATOR_ON_VARIANT_FIELD\", `Generated value on variant \"${refusal.key.owner.name}\" field \"${refusal.key.field}\": execution defaults apply to every document in collection \"${refusal.collection}\", so declare them on the base model.`);\n\t\tcase \"generatedConflict\": {\n\t\t\tconst field = fieldSiteOf(sites, refusal.key);\n\t\t\treturn atField(field, \"PSL_GENERATOR_CONFLICT\", `Generated value on \"${refusal.key.owner.name}.${refusal.key.field}\" sets different execution defaults than \"${refusal.otherModel}.${refusal.otherField}\" for field \"${field.storedName}\" of collection \"${refusal.collection}\". Generate the same values on both models.`);\n\t\t}\n\t\tcase \"typeParamsInvalid\": return atFieldCall(fieldSiteOf(sites, refusal.key), \"PSL_INVALID_ATTRIBUTE_ARGUMENT\", `${`Field \"${refusal.key.owner.name}.${refusal.key.field}\"`} has type parameters its type refuses: ${refusal.problem.message}`);\n\t\tcase \"enumMemberProblem\": {\n\t\t\tconst site = sites.enums.get(refusal.enumName);\n\t\t\tif (site === void 0) throw new InternalError(`Enum \"${refusal.enumName}\" has a site.`);\n\t\t\treturn enumMemberProblemDiagnostic(refusal.problem, site.block);\n\t\t}\n\t\tcase \"enumUnknown\": return atField(fieldSiteOf(sites, refusal.key), \"PSL_UNRESOLVED_REFERENCE\", `Field \"${refusal.key.owner.name}.${refusal.key.field}\" is typed by enum \"${refusal.enumName}\", which the schema does not declare`);\n\t\tcase \"discriminatorValueDuplicate\": {\n\t\t\tconst base = modelSitesOf(sites, refusal.key.variant).base;\n\t\t\tif (base === void 0) throw new InternalError(\"A variant has a @@base site.\");\n\t\t\treturn at(base, \"PSL_DUPLICATE_DISCRIMINATOR_VALUE\", `Discriminator value \"${refusal.value}\" is used by both \"${refusal.firstVariant}\" and \"${refusal.key.variant}\" on base model \"${refusal.baseModel}\"`);\n\t\t}\n\t\tcase \"discriminatorFieldUnknown\":\n\t\tcase \"discriminatorField\":\n\t\tcase \"discriminatorAndBase\":\n\t\tcase \"discriminatorWithoutVariants\": {\n\t\t\tconst model = refusal.key.model;\n\t\t\tconst site = modelSitesOf(sites, model).discriminator;\n\t\t\tif (site === void 0) throw new InternalError(\"A base has a @@discriminator site.\");\n\t\t\tswitch (refusal.kind) {\n\t\t\t\tcase \"discriminatorFieldUnknown\": return at(site, \"PSL_DISCRIMINATOR_FIELD_NOT_FOUND\", `Discriminator field \"${refusal.fieldName}\" is not a field on model \"${model}\"`);\n\t\t\t\tcase \"discriminatorField\": return at(site, \"PSL_INVALID_ATTRIBUTE_ARGUMENT\", describeDiscriminatorRefusal(refusal.refusal, {\n\t\t\t\t\tmodelName: model,\n\t\t\t\t\tfieldName: refusal.fieldName,\n\t\t\t\t\ttypeName: discriminatorTypeName(sites, model, refusal.fieldName),\n\t\t\t\t\tenumName: void 0,\n\t\t\t\t\tvariantName: () => model\n\t\t\t\t}));\n\t\t\t\tcase \"discriminatorAndBase\": return at(site, \"PSL_DISCRIMINATOR_AND_BASE\", `Model \"${model}\" cannot have both @@discriminator and @@base`);\n\t\t\t\tcase \"discriminatorWithoutVariants\": return at(site, \"PSL_ORPHANED_DISCRIMINATOR\", `Model \"${model}\" has @@discriminator but no variant models declare @@base(${model}, ...)`);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"discriminatorValue\": {\n\t\t\tconst base = modelSitesOf(sites, refusal.key.variant).base;\n\t\t\tif (base === void 0) throw new InternalError(\"A variant has a @@base site.\");\n\t\t\tconst valueSite = {\n\t\t\t\tsource: base.source,\n\t\t\t\tspan: base.valueSpan\n\t\t\t};\n\t\t\tif (refusal.refusal.kind === \"unreadable\") return {\n\t\t\t\t...refusal.refusal.refusal,\n\t\t\t\t...valueSite.source.at(valueSite.span)\n\t\t\t};\n\t\t\treturn at(valueSite, \"PSL_INVALID_ATTRIBUTE_ARGUMENT\", describeDiscriminatorRefusal(refusal.refusal, {\n\t\t\t\tmodelName: refusal.baseModel,\n\t\t\t\tfieldName: refusal.fieldName,\n\t\t\t\ttypeName: discriminatorTypeName(sites, refusal.baseModel, refusal.fieldName),\n\t\t\t\tenumName: refusal.enumName,\n\t\t\t\tvariantName: (variant) => variant\n\t\t\t}));\n\t\t}\n\t\tcase \"baseWithoutDiscriminator\": {\n\t\t\tconst base = modelSitesOf(sites, refusal.key.variant).base;\n\t\t\tif (base === void 0) throw new InternalError(\"A variant has a @@base site.\");\n\t\t\treturn at(base, \"PSL_ORPHANED_BASE\", `Model \"${refusal.key.variant}\" declares @@base(${refusal.baseModel}, ...) but \"${refusal.baseModel}\" has no @@discriminator`);\n\t\t}\n\t\tcase \"validator\": return validatorDiagnostic(refusal.refusal, sites);\n\t\tcase \"duplicateModel\":\n\t\tcase \"duplicateValueObject\":\n\t\tcase \"collectionSettingWithoutCollection\":\n\t\tcase \"collectionSettingTwice\":\n\t\tcase \"generatorUnknown\":\n\t\tcase \"generatorNotApplicable\":\n\t\tcase \"generatedWithoutCollection\":\n\t\tcase \"enumKeyMismatch\":\n\t\tcase \"listedVariantMissing\":\n\t\tcase \"baseUnknown\":\n\t\tcase \"variantWithoutValue\": throw new InternalError(`A PSL definition cannot be refused with \"${refusal.kind}\".`);\n\t}\n}\n/** The key type a wildcard index combines with. */\nfunction wildcardTypeOf(index) {\n\treturn (Object.values(index.fields).find((direction) => direction === \"hashed\" || direction === \"2d\" || direction === \"2dsphere\") ?? \"hashed\").toString();\n}\nfunction discriminatorTypeName(sites, model, fieldName) {\n\treturn sites.fields.get(fieldSiteKey(model, fieldName))?.symbol.typeName ?? fieldName;\n}\nfunction differenceWording(difference) {\n\tswitch (difference) {\n\t\tcase \"storedName\": return \"@map\";\n\t\tcase \"type\": return \"type\";\n\t\tcase \"nullable\": return \"optionality\";\n\t\tcase \"many\": return \"list shape\";\n\t}\n}\n//#endregion\n//#region src/type-aliases.ts\n/** The field type a use of a type choice gives: the column of the constructor its call chooses, read and refused as a SQL column's is. `undefined`, with a diagnostic pushed, when the call is refused. */\nfunction scalarTypeOfChoice(input) {\n\tconst output = instantiatePslTypeChoice(input);\n\treturn output === void 0 ? void 0 : {\n\t\tkind: \"scalar\",\n\t\tcodecId: output.codecId,\n\t\t...ifDefined(\"typeParams\", output.typeParams)\n\t};\n}\n/** The field type a use of a type constructor gives: a bare use keeps the constructor's fixed type params, and a call's arguments are read as the constructor declares them and checked by its codec. `undefined`, with a diagnostic pushed, when the call is refused. */\nfunction scalarTypeOfConstructor(input) {\n\tconst { descriptor, call } = input;\n\tif (call === void 0) {\n\t\tconst { codecId, typeParams } = instantiateAuthoringTypeConstructor(descriptor, []);\n\t\treturn {\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId,\n\t\t\t...ifDefined(\"typeParams\", typeParams)\n\t\t};\n\t}\n\tconst helperPath = call.path.join(\".\");\n\tconst subject = `${input.entityLabel} type \"${helperPath}\"`;\n\tconst refuse = (message, argumentIndex) => {\n\t\tinput.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\tmessage: `${subject}: ${message}`,\n\t\t\t...input.source.at(argumentSpan(call, descriptor.args, argumentIndex))\n\t\t});\n\t};\n\tconst args = mapPslHelperArgs({\n\t\targs: call.args,\n\t\tdescriptors: descriptor.args ?? [],\n\t\thelperLabel: `type \"${helperPath}\"`,\n\t\tspan: call.span,\n\t\tdiagnostics: input.diagnostics,\n\t\tsource: input.source,\n\t\tentityLabel: input.entityLabel,\n\t\tdataTypes: input.dataTypes\n\t});\n\tif (!args) return void 0;\n\ttry {\n\t\tvalidateAuthoringHelperArguments(helperPath, descriptor.args, args);\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn refuse(error instanceof Error ? error.message : String(error), argumentIndexOf(error));\n\t}\n\tconst output = instantiateAuthoringTypeConstructorFromValues(descriptor, args, input.codecLookup.descriptorFor(descriptor.output.codecId)?.paramsSchema);\n\tif (!output.ok) return refuse(output.failure.message, output.failure.argumentIndex);\n\tconst { codecId, typeParams } = output.value;\n\treturn {\n\t\tkind: \"scalar\",\n\t\tcodecId,\n\t\t...ifDefined(\"typeParams\", typeParams)\n\t};\n}\nconst GENERATOR_PHASES$1 = [\"onCreate\", \"onUpdate\"];\nconst MONGO_TYPE_ALIAS_ATTRIBUTE_NAMES = new Set(GENERATOR_PHASES$1);\nfunction describeUnsupportedMongoAliasAttribute(attribute, declaration) {\n\tif (attribute.name !== \"default\") return void 0;\n\tconst base = `Type alias \"${declaration.name}\" uses unsupported attribute \"@default\"`;\n\tconst hint = unloweredAttributeHint(attribute);\n\treturn hint === void 0 ? base : `${base}. ${hint}`;\n}\n/**\n* The generator a field's or type alias's `@onCreate(fn())` or `@onUpdate(fn())` resolves to for its type, or `undefined` once the attribute is diagnosed.\n*/\nfunction lowerGeneratorAttribute(input) {\n\tconst interpreted = interpretAttribute(input.attribute.node, typeGeneratorAttributeSpec(input.phase, input.specContext), {\n\t\tsources: input.sources,\n\t\tsymbols: input.symbols,\n\t\tbinder: input.binder\n\t});\n\tif (!interpreted.ok) {\n\t\tinput.diagnostics.push(...interpreted.failure);\n\t\treturn;\n\t}\n\tconst call = interpreted.value.value;\n\tconst { type } = input;\n\tconst resolution = type.kind === \"scalar\" ? input.generatorFunctions.resolve({\n\t\tname: call.fn,\n\t\targs: call.args\n\t}, {\n\t\tcodecId: type.codecId,\n\t\ttypeParams: type.typeParams,\n\t\tlength: void 0\n\t}) : void 0;\n\tif (resolution?.ok === true) return resolution.generator;\n\tconst label = typeAttributeSubjectLabel(input.specContext.subject);\n\tinput.diagnostics.push({\n\t\tcode: \"PSL_GENERATOR_NOT_APPLICABLE\",\n\t\tmessage: resolution?.reason === \"refused\" ? `${label}: ${resolution.message}` : `${label}: ${call.fn}() does not apply to this field's type.`,\n\t\t...diagnosticSource(input.sources, input.attribute.node.syntax).at(call.span)\n\t});\n}\nfunction aliasType(alias, input) {\n\tconst { base, symbol } = alias;\n\tif (base.kind === \"typeConstructor\") {\n\t\tconst type = scalarTypeOfConstructor({\n\t\t\tdescriptor: base.descriptor,\n\t\t\tcall: base.call,\n\t\t\tcodecLookup: input.codecLookup,\n\t\t\tdiagnostics: input.diagnostics,\n\t\t\tsource: diagnosticSource(input.sources, symbol.node.syntax),\n\t\t\tentityLabel: `Type alias \"${symbol.name}\"`,\n\t\t\tdataTypes: input.dataTypes\n\t\t});\n\t\treturn type === void 0 ? void 0 : {\n\t\t\ttype,\n\t\t\tvalueSet: void 0\n\t\t};\n\t}\n\tif (base.kind === \"typeChoice\") {\n\t\tconst type = scalarTypeOfChoice({\n\t\t\tsymbol: base.symbol,\n\t\t\tcall: base.call,\n\t\t\tspan: symbol.span,\n\t\t\tcodecLookup: input.codecLookup,\n\t\t\tdiagnostics: input.diagnostics,\n\t\t\tsource: diagnosticSource(input.sources, symbol.node.syntax),\n\t\t\tentityLabel: `Type alias \"${symbol.name}\"`,\n\t\t\tdataTypes: input.dataTypes\n\t\t});\n\t\treturn type === void 0 ? void 0 : {\n\t\t\ttype,\n\t\t\tvalueSet: void 0\n\t\t};\n\t}\n\tif (base.symbol.keyword !== \"enum\") {\n\t\tinput.diagnostics.push({\n\t\t\tcode: \"PSL_UNSUPPORTED_NAMED_TYPE_BASE\",\n\t\t\tmessage: `Type alias \"${symbol.name}\" references unsupported base type \"${alias.baseName}\"`,\n\t\t\t...diagnosticSource(input.sources, symbol.node.syntax).at(symbol.span)\n\t\t});\n\t\treturn;\n\t}\n\tconst codecId = input.codecIdByEnumName.get(base.symbol.name);\n\tif (codecId === void 0 || alias.baseResolution.kind !== \"block\") return void 0;\n\treturn {\n\t\ttype: {\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId\n\t\t},\n\t\tvalueSet: {\n\t\t\tplane: \"domain\",\n\t\t\tentityKind: \"enum\",\n\t\t\tnamespaceId: alias.baseResolution.namespace.id,\n\t\t\tentityName: base.symbol.name\n\t\t}\n\t};\n}\nfunction lowerAliasGenerators(alias, type, input) {\n\tconst specContext = typeAliasSpecContext(alias, input);\n\tconst phases = {};\n\tfor (const phase of GENERATOR_PHASES$1) {\n\t\tconst [attribute, duplicate] = alias.attributes.filter(({ name }) => name === phase);\n\t\tif (attribute === void 0) continue;\n\t\tif (duplicate !== void 0) {\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: \"PSL_DUPLICATE_ATTRIBUTE\",\n\t\t\t\tmessage: `\\`@${phase}\\` declared more than once on type alias \"${alias.symbol.name}\".`,\n\t\t\t\t...diagnosticSource(input.sources, duplicate.node.syntax).at(duplicate.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst generator = lowerGeneratorAttribute({\n\t\t\t...input,\n\t\t\tphase,\n\t\t\tattribute,\n\t\t\tspecContext,\n\t\t\ttype\n\t\t});\n\t\tif (generator !== void 0) phases[phase] = generator;\n\t}\n\treturn phases.onCreate === void 0 && phases.onUpdate === void 0 ? void 0 : phases;\n}\nfunction resolveContributedTypeAlias(alias, generatorFunctions) {\n\tconst { type } = instantiateAuthoringTypeAlias(alias.descriptor);\n\treturn {\n\t\talias,\n\t\tname: alias.name,\n\t\ttype: {\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId: type.codecId,\n\t\t\t...ifDefined(\"typeParams\", type.typeParams)\n\t\t},\n\t\tvalueSet: void 0,\n\t\texecutionDefaults: resolveTypeAliasGenerators({\n\t\t\tpath: alias.name,\n\t\t\tdescriptor: alias.descriptor,\n\t\t\tgeneratorFunctions,\n\t\t\tlength: void 0\n\t\t})\n\t};\n}\n/**\n* Resolves each `types {}` alias once: its field type and the values its `@onCreate` and `@onUpdate` generate. MongoDB has no database defaults, so an alias's `@default` is refused here, once, not at each field typed by it.\n*/\nfunction resolveMongoTypeAliases(input) {\n\tconst declared = /* @__PURE__ */ new Map();\n\tconst aliases = resolveTypeAliases({\n\t\tdeclarations: input.declarations,\n\t\tbinder: input.binder,\n\t\tsources: input.sources,\n\t\tdiagnostics: input.diagnostics,\n\t\tauthoringTypes: input.authoringTypes,\n\t\tacceptedAttributes: MONGO_TYPE_ALIAS_ATTRIBUTE_NAMES,\n\t\tdescribeUnsupportedAttribute: describeUnsupportedMongoAliasAttribute\n\t});\n\tfor (const alias of aliases.values()) {\n\t\tconst resolved = aliasType(alias, input);\n\t\tif (resolved === void 0) continue;\n\t\tdeclared.set(alias.symbol, {\n\t\t\talias,\n\t\t\tname: alias.symbol.name,\n\t\t\t...resolved,\n\t\t\texecutionDefaults: lowerAliasGenerators(alias, resolved.type, input)\n\t\t});\n\t}\n\tconst contributed = /* @__PURE__ */ new Map();\n\treturn { ofResolution(resolution) {\n\t\tif (resolution?.kind === \"namedType\") return declared.get(resolution.symbol);\n\t\tconst alias = contributedTypeAliasOf(resolution);\n\t\tif (alias === void 0) return void 0;\n\t\tconst existing = contributed.get(alias.descriptor);\n\t\tif (existing !== void 0) return existing;\n\t\tconst resolved = resolveContributedTypeAlias(alias, input.generatorFunctions);\n\t\tcontributed.set(alias.descriptor, resolved);\n\t\treturn resolved;\n\t} };\n}\n//#endregion\n//#region src/interpreter.ts\n/**\n* Reports `PSL_DEPRECATED_SCALAR_NAME` at the type of a field whose scalar name is a deprecated alias, naming the replacement. The alias resolves to the same codec, so the contract does not change.\n*/\nfunction deprecatedScalarWarner(input) {\n\tconst { reportWarning } = input;\n\tif (reportWarning === void 0) return () => {};\n\treturn (field, descriptor) => {\n\t\tif (descriptor.deprecated === void 0) return;\n\t\tconst typeNode = field.node.typeAnnotation()?.name()?.syntax ?? field.node.syntax;\n\t\tconst [warning] = mapPslDiagnostics([{\n\t\t\tcode: \"PSL_DEPRECATED_SCALAR_NAME\",\n\t\t\tmessage: `Scalar type \"${field.typeName}\" is deprecated and will be removed; use \"${descriptor.deprecated.replacement}\".`,\n\t\t\t...diagnosticSource(input.sources, typeNode).at()\n\t\t}], input.sources);\n\t\tif (warning !== void 0) reportWarning({\n\t\t\t...warning,\n\t\t\tseverity: \"warning\"\n\t\t});\n\t};\n}\n/**\n* Mongo's PSL surface binds the database from the connection string, so every\n* explicit namespace block is invalid, including `namespace unbound { … }`.\n*/\nfunction validateNamespaceBlocksForMongoTarget(input) {\n\tfor (const namespace of input.namespaces) for (const { node, span } of namespace.declarations) input.diagnostics.push({\n\t\tcode: \"PSL_UNSUPPORTED_NAMESPACE_BLOCK\",\n\t\tmessage: `Mongo does not support \\`namespace ${node.name()?.name() ?? namespace.name} { … }\\` blocks (the database is bound by the connection string; declare models at the document top level instead).`,\n\t\t...diagnosticSource(input.sources, node.syntax).at(span)\n\t});\n}\nfunction resolvePhysicalNames(input) {\n\tconst { model, physicalNames, specContext, sources, binder, diagnostics } = input;\n\tconst modelMap = model.attributes.find((attr) => attr.name === \"map\");\n\tconst collectionName = modelMap ? interpretModelAttribute({\n\t\tsymbols: specContext.symbols,\n\t\tnode: modelMap.node,\n\t\tspec: mongoAttributeSpecs.model.map(specContext),\n\t\tmodel,\n\t\tsources,\n\t\tbinder,\n\t\tdiagnostics\n\t})?.name : void 0;\n\tphysicalNames.set(model, collectionName ?? defaultCollectionName(model.name));\n\tfor (const field of Object.values(model.fields)) {\n\t\tconst fieldMap = field.attributes.find((attr) => attr.name === \"map\");\n\t\tconst mapped = fieldMap ? interpretFieldAttribute({\n\t\t\tsymbols: specContext.symbols,\n\t\t\tnode: fieldMap.node,\n\t\t\tspec: mongoAttributeSpecs.field.map({\n\t\t\t\t...specContext,\n\t\t\t\tfield,\n\t\t\t\ttypeResolution: fieldTypeResolution(field, binder),\n\t\t\t\tcontributedType: contributedTypeOf(fieldTypeResolution(field, binder), binder, field.typeConstructor)\n\t\t\t}),\n\t\t\tmodel,\n\t\t\tfield,\n\t\t\tsources,\n\t\t\tbinder,\n\t\t\tdiagnostics\n\t\t})?.name : void 0;\n\t\tphysicalNames.set(field, mapped ?? field.name);\n\t}\n}\nfunction physicalName(physicalNames, symbol) {\n\tassertDefined(symbol, \"Physical names require a bound declaration\");\n\tconst name = physicalNames.get(symbol);\n\tassertDefined(name, \"Physical names must be populated before lowering\");\n\treturn name;\n}\n/** A `@@base` value as it is written; the grammar reads only a quoted string there. */\nfunction writtenBaseValue(written) {\n\tif (written.written === void 0) throw new InternalError(\"A @@base value is a quoted string, never a tagged literal.\");\n\treturn written.written;\n}\nfunction collectPolymorphismDeclarations(input) {\n\tconst { sources, binder, diagnostics } = input;\n\tconst discriminators = /* @__PURE__ */ new Map();\n\tconst bases = /* @__PURE__ */ new Map();\n\tconst reported = {\n\t\tdiscriminators: /* @__PURE__ */ new Set(),\n\t\tbaseTargets: /* @__PURE__ */ new Set()\n\t};\n\tfor (const model of input.models) {\n\t\tconst specContext = input.specContextFor(model);\n\t\tconst discNode = model.attributes.find((attr) => attr.name === \"discriminator\")?.node;\n\t\tif (discNode) {\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\tnode: discNode,\n\t\t\t\tspec: mongoAttributeSpecs.model.discriminator(specContext),\n\t\t\t\tmodel,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed) discriminators.set(model, {\n\t\t\t\tfieldName: parsed.field,\n\t\t\t\tsource: diagnosticSource(sources, discNode.syntax),\n\t\t\t\tspan: nodePslSpan(discNode.syntax, sources)\n\t\t\t});\n\t\t\telse reported.discriminators.add(model.name);\n\t\t}\n\t\tconst baseAttribute = model.attributes.find((attr) => attr.name === \"base\");\n\t\tconst baseNode = baseAttribute?.node;\n\t\tif (baseNode) {\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\tnode: baseNode,\n\t\t\t\tspec: mongoAttributeSpecs.model.base(),\n\t\t\t\tmodel,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed) bases.set(model, {\n\t\t\t\tbase: parsed.base.declaration,\n\t\t\t\twritten: writtenBaseValue(parsed.value),\n\t\t\t\tvalueSpan: parsed.value.span,\n\t\t\t\tsource: diagnosticSource(sources, baseNode.syntax),\n\t\t\t\tspan: nodePslSpan(baseNode.syntax, sources)\n\t\t\t});\n\t\t\telse {\n\t\t\t\tconst target = baseAttribute?.args[0]?.value;\n\t\t\t\tif (target !== void 0) reported.baseTargets.add(target);\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tdiscriminators,\n\t\tbases,\n\t\treported\n\t};\n}\nfunction normalizeIndexField(element) {\n\tif (typeof element === \"string\") return {\n\t\tkind: \"field\",\n\t\tname: element\n\t};\n\tif (element.fn === \"wildcard\") {\n\t\tconst scope = element.args[\"scope\"];\n\t\treturn typeof scope === \"string\" ? {\n\t\t\tkind: \"wildcard\",\n\t\t\tscope\n\t\t} : { kind: \"wildcard\" };\n\t}\n\tconst field = element.args[\"field\"];\n\tinvariant(typeof field === \"string\", \"The sort function spec requires a field reference\");\n\treturn {\n\t\tkind: \"field\",\n\t\tname: field,\n\t\tdirection: element.args[\"direction\"] === \"Desc\" ? -1 : 1\n\t};\n}\n/** The collation the index arguments name, or undefined when they name none. A collation without `collationLocale` is passed on for the builder to refuse. */\nfunction buildCollationFromSpec(args) {\n\tconst collation = {\n\t\t...ifDefined(\"locale\", args.collationLocale),\n\t\t...ifDefined(\"strength\", args.collationStrength),\n\t\t...ifDefined(\"caseLevel\", args.collationCaseLevel),\n\t\t...ifDefined(\"caseFirst\", args.collationCaseFirst),\n\t\t...ifDefined(\"numericOrdering\", args.collationNumericOrdering),\n\t\t...ifDefined(\"alternate\", args.collationAlternate),\n\t\t...ifDefined(\"maxVariable\", args.collationMaxVariable),\n\t\t...ifDefined(\"backwards\", args.collationBackwards),\n\t\t...ifDefined(\"normalization\", args.collationNormalization)\n\t};\n\treturn Object.keys(collation).length === 0 ? void 0 : collation;\n}\n/** The index keys by field name, as the builder takes them: a wildcard is `$**` or `<field>.$**`. */\nfunction resolveIndexKeys(parsedFields, defaultDirection, ctx) {\n\tconst wildcardCount = parsedFields.filter((field) => field.kind === \"wildcard\").length;\n\tif (wildcardCount > 1) {\n\t\tctx.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\tmessage: \"An index can contain at most one wildcard() field\",\n\t\t\t...ctx.source.at(ctx.span)\n\t\t});\n\t\treturn;\n\t}\n\tconst fields = {};\n\tfor (const field of parsedFields) if (field.kind === \"wildcard\") fields[field.scope === void 0 ? \"$**\" : `${field.scope}.$**`] = defaultDirection;\n\telse fields[field.name] = field.direction ?? defaultDirection;\n\treturn {\n\t\tfields,\n\t\thasWildcard: wildcardCount === 1\n\t};\n}\nfunction buildProjection(include, exclude, hasWildcard, ctx) {\n\tif (include !== void 0 && exclude !== void 0) {\n\t\tctx.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\tmessage: \"Cannot specify both include and exclude on the same index\",\n\t\t\t...ctx.source.at(ctx.span)\n\t\t});\n\t\treturn null;\n\t}\n\tconst fields = include ?? exclude;\n\tif (fields === void 0 || fields.length === 0 && hasWildcard) return void 0;\n\tconst value = include === void 0 ? 0 : 1;\n\tconst projection = {};\n\tfor (const field of fields) projection[field] = value;\n\treturn projection;\n}\n/** Index options as the attribute specs read them, which are the values MongoDB takes. */\nfunction indexOptions(options) {\n\treturn blindCast(options);\n}\nfunction buildNormalIndex(parsed, unique, ctx) {\n\tconst parsedFields = parsed.fields.map(normalizeIndexField);\n\tif (parsedFields.length === 0) return void 0;\n\tconst resolved = resolveIndexKeys(parsedFields, parsed.type ?? 1, ctx);\n\tif (!resolved) return void 0;\n\tconst wildcardProjection = buildProjection(parsed.include, parsed.exclude, resolved.hasWildcard, ctx);\n\tif (wildcardProjection === null) return void 0;\n\tconst collation = buildCollationFromSpec(parsed);\n\treturn {\n\t\tfields: resolved.fields,\n\t\toptions: indexOptions({\n\t\t\t...ifDefined(\"name\", parsed.map),\n\t\t\t...unique && { unique: true },\n\t\t\t...ifDefined(\"sparse\", parsed.sparse),\n\t\t\t...ifDefined(\"expireAfterSeconds\", parsed.expireAfterSeconds),\n\t\t\t...ifDefined(\"partialFilterExpression\", parsed.filter),\n\t\t\t...ifDefined(\"wildcardProjection\", wildcardProjection),\n\t\t\t...ifDefined(\"collation\", collation),\n\t\t\t...ifDefined(\"default_language\", parsed.default_language),\n\t\t\t...ifDefined(\"language_override\", parsed.languageOverride)\n\t\t})\n\t};\n}\nfunction buildTextIndex(parsed, ctx) {\n\tconst parsedFields = parsed.fields.map(normalizeIndexField);\n\tif (parsedFields.length === 0) return void 0;\n\tconst resolved = resolveIndexKeys(parsedFields, \"text\", ctx);\n\tif (!resolved) return void 0;\n\tif (resolved.hasWildcard) {\n\t\tctx.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\tmessage: \"wildcard() fields cannot be combined with type: hashed/2dsphere/2d or @@textIndex\",\n\t\t\t...ctx.source.at(ctx.span)\n\t\t});\n\t\treturn;\n\t}\n\tconst collation = buildCollationFromSpec(parsed);\n\treturn {\n\t\tfields: resolved.fields,\n\t\toptions: indexOptions({\n\t\t\t...ifDefined(\"name\", parsed.map),\n\t\t\t...ifDefined(\"partialFilterExpression\", parsed.filter),\n\t\t\t...ifDefined(\"collation\", collation),\n\t\t\t...ifDefined(\"weights\", parsed.weights),\n\t\t\t...ifDefined(\"default_language\", parsed.language),\n\t\t\t...ifDefined(\"language_override\", parsed.languageOverride)\n\t\t})\n\t};\n}\nfunction nestedIndexPath(node) {\n\tfor (const arg of node.argList()?.args() ?? []) {\n\t\tconst name = arg.name()?.name();\n\t\tconst list = arg.value();\n\t\tif (name !== void 0 && name !== \"fields\" || !(list instanceof ArrayLiteralAst)) continue;\n\t\tfor (const element of list.elements()) {\n\t\t\tconst field = element instanceof FunctionCallAst && element.name()?.identifier()?.token()?.text === \"sort\" ? [...element.args()][0]?.value() : element;\n\t\t\tconst path = field instanceof PathExprAst ? field.path() : [];\n\t\t\tif (field instanceof PathExprAst && path.length > 1) return {\n\t\t\t\tpath,\n\t\t\t\tsyntax: field.syntax\n\t\t\t};\n\t\t}\n\t}\n}\nfunction nestedIndexPathMessage(path, pslModel, binder) {\n\tconst [root = \"\"] = path;\n\tconst label = `Index field \"${path.join(\".\")}\" on model \"${pslModel.name}\"`;\n\tconst rootField = Object.hasOwn(pslModel.fields, root) ? pslModel.fields[root] : void 0;\n\treturn rootField !== void 0 && fieldTypeResolution(rootField, binder)?.kind === \"compositeType\" ? `${label} is a path into a composite type; indexes on fields of a composite type are not supported yet. Index a top-level field of \"${pslModel.name}\" or remove the index.` : `${label} is a dotted path, but \"${root}\" is not a field of \"${pslModel.name}\" whose type is a composite type, so the path names no field. List fields of \"${pslModel.name}\" by name.`;\n}\n/**\n* A model's indexes as the schema writes them, with where each is written: a field's `@unique` first, then `@@index`, `@@unique` and `@@textIndex` in the order the model lists them.\n*/\nfunction collectIndexes(pslModel, specContext, sources, binder, diagnostics) {\n\tconst indexes = [];\n\tfor (const field of Object.values(pslModel.fields)) {\n\t\tif (fieldTypeResolution(field, binder)?.kind === \"model\") continue;\n\t\tconst uniqueAttribute = field.attributes.find((attr) => attr.name === \"unique\");\n\t\tconst uniqueNode = uniqueAttribute?.node;\n\t\tif (!uniqueAttribute || !uniqueNode) continue;\n\t\tconst unique = interpretFieldAttribute({\n\t\t\tsymbols: specContext.symbols,\n\t\t\tnode: uniqueNode,\n\t\t\tspec: mongoAttributeSpecs.field.unique({\n\t\t\t\t...specContext,\n\t\t\t\tfield,\n\t\t\t\ttypeResolution: fieldTypeResolution(field, binder),\n\t\t\t\tcontributedType: contributedTypeOf(fieldTypeResolution(field, binder), binder, field.typeConstructor)\n\t\t\t}),\n\t\t\tmodel: pslModel,\n\t\t\tfield,\n\t\t\tsources,\n\t\t\tbinder,\n\t\t\tdiagnostics\n\t\t});\n\t\tif (unique === void 0) continue;\n\t\tconst source = diagnosticSource(sources, uniqueNode.syntax);\n\t\tconst span = nodePslSpan(uniqueNode.syntax, sources);\n\t\tif (unique.map === \"\") {\n\t\t\treportEmptyIndexMap(diagnostics, source, span);\n\t\t\tcontinue;\n\t\t}\n\t\tindexes.push({\n\t\t\tindex: {\n\t\t\t\tfields: { [field.name]: 1 },\n\t\t\t\toptions: {\n\t\t\t\t\tunique: true,\n\t\t\t\t\t...ifDefined(\"name\", unique.map)\n\t\t\t\t}\n\t\t\t},\n\t\t\tsource,\n\t\t\tspan,\n\t\t\tlabel: `${attributeText(\"@\", uniqueAttribute)} on field \"${pslModel.name}.${field.name}\"`\n\t\t});\n\t}\n\tfor (const attr of pslModel.attributes) {\n\t\tif (attr.name !== \"index\" && attr.name !== \"unique\" && attr.name !== \"textIndex\") continue;\n\t\tconst node = attr.node;\n\t\tconst source = diagnosticSource(sources, node.syntax);\n\t\tconst ctx = {\n\t\t\tsource,\n\t\t\tspan: attr.span,\n\t\t\tdiagnostics\n\t\t};\n\t\tconst nested = nestedIndexPath(node);\n\t\tif (nested !== void 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\t\tmessage: nestedIndexPathMessage(nested.path, pslModel, binder),\n\t\t\t\t...source.at(nodePslSpan(nested.syntax, sources))\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tlet index;\n\t\tif (attr.name === \"textIndex\") {\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\tnode,\n\t\t\t\tspec: mongoAttributeSpecs.model.textIndex(specContext),\n\t\t\t\tmodel: pslModel,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (!parsed || parsed.fields.length === 0) continue;\n\t\t\tindex = buildTextIndex(parsed, ctx);\n\t\t} else {\n\t\t\tconst unique = attr.name === \"unique\";\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\tnode,\n\t\t\t\tspec: unique ? mongoAttributeSpecs.model.unique(specContext) : mongoAttributeSpecs.model.index(specContext),\n\t\t\t\tmodel: pslModel,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (!parsed) continue;\n\t\t\tindex = buildNormalIndex(parsed, unique, ctx);\n\t\t}\n\t\tif (index === void 0) continue;\n\t\tif (index.options?.name === \"\") {\n\t\t\treportEmptyIndexMap(diagnostics, source, attr.span);\n\t\t\tcontinue;\n\t\t}\n\t\tindexes.push({\n\t\t\tindex,\n\t\t\tsource,\n\t\t\tspan: attr.span,\n\t\t\tlabel: `${attributeText(\"@@\", attr)} on model \"${pslModel.name}\"`\n\t\t});\n\t}\n\treturn indexes;\n}\n/** An attribute as the schema writes it, with its arguments as written. */\nfunction attributeText(prefix, attribute) {\n\tif (attribute.args.length === 0) return `${prefix}${attribute.name}`;\n\tconst args = attribute.args.map((arg) => arg.kind === \"named\" ? `${arg.name}: ${arg.value}` : arg.value);\n\treturn `${prefix}${attribute.name}(${args.join(\", \")})`;\n}\nfunction reportEmptyIndexMap(diagnostics, source, span) {\n\tdiagnostics.push({\n\t\tcode: \"PSL_INVALID_INDEX\",\n\t\tmessage: \"The `map` argument of an index cannot be an empty string.\",\n\t\t...source.at(span)\n\t});\n}\nfunction fieldTypeResolution(field, binder) {\n\tconst node = typeReferenceNode(field);\n\treturn node === void 0 ? void 0 : binder.symbolForNode(node);\n}\nconst GENERATOR_PHASES = [\"onCreate\", \"onUpdate\"];\n/**\n* The generators a field's `@onCreate(fn())` and `@onUpdate(fn())` resolve to, and where each attribute is written. An attribute written twice, or one whose call is refused, is reported here.\n*/\nfunction lowerGeneratorAttributes(input) {\n\tconst { field, modelName, diagnostics } = input;\n\tconst phases = {};\n\tconst sites = {};\n\tlet refused = false;\n\tfor (const phase of GENERATOR_PHASES) {\n\t\tconst [attribute, duplicate] = field.attributes.filter(({ name }) => name === phase);\n\t\tif (attribute === void 0) continue;\n\t\tsites[phase] = {\n\t\t\tspan: attribute.span,\n\t\t\targument: attribute.args.find((arg) => arg.kind === \"positional\")?.value.trim() ?? \"\"\n\t\t};\n\t\tif (duplicate !== void 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_DUPLICATE_ATTRIBUTE\",\n\t\t\t\tmessage: `\\`@${phase}\\` declared more than once on field \"${modelName}.${field.name}\".`,\n\t\t\t\t...diagnosticSource(input.sources, field.node.syntax).at(duplicate.span)\n\t\t\t});\n\t\t\trefused = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconst generator = lowerGeneratorAttribute({\n\t\t\tphase,\n\t\t\tattribute,\n\t\t\tspecContext: typeAttributeSpecContextOfField(input.specContext),\n\t\t\ttype: input.resolved.field.type,\n\t\t\tsymbols: input.specContext.symbols,\n\t\t\tbinder: input.binder,\n\t\t\tsources: input.sources,\n\t\t\tgeneratorFunctions: input.generatorFunctions,\n\t\t\tdiagnostics\n\t\t});\n\t\tif (generator === void 0) {\n\t\t\trefused = true;\n\t\t\tcontinue;\n\t\t}\n\t\tphases[phase] = generator;\n\t}\n\tconst none = phases.onCreate === void 0 && phases.onUpdate === void 0;\n\treturn {\n\t\tvalues: refused || none ? void 0 : phases,\n\t\tsites\n\t};\n}\nfunction fieldOfTypeAlias(field, typeAlias) {\n\treturn {\n\t\tfield: {\n\t\t\ttype: typeAlias.type,\n\t\t\tnullable: field.optional,\n\t\t\tmany: field.list ? { elementNullable: field.elementOptional } : false,\n\t\t\t...ifDefined(\"valueSet\", typeAlias.valueSet)\n\t\t},\n\t\ttypeAlias\n\t};\n}\n/**\n* Whether a field may take what its type alias carries: it repeats none of the alias's attributes. Reports each refusal at the field.\n*/\nfunction acceptsTypeAlias(input) {\n\treturn !refuseRepeatedTypeAliasAttributes({\n\t\tfield: input.field,\n\t\tfieldPath: `${input.modelName}.${input.field.name}`,\n\t\talias: input.typeAlias.alias,\n\t\tsources: input.sources,\n\t\tdiagnostics: input.diagnostics\n\t});\n}\nfunction resolveNonRelationField(field, owner, resolution, codecIdByEnumName, context, scalarNames, typeAliases, codecLookup) {\n\tconst ownerName = owner.name;\n\tif (resolution?.kind === \"compositeType\") return { field: {\n\t\ttype: {\n\t\t\tkind: \"valueObject\",\n\t\t\tplane: \"storage\",\n\t\t\tnamespaceId: resolution.namespace.id,\n\t\t\tentityKind: \"valueObject\",\n\t\t\tentityName: resolution.symbol.name\n\t\t},\n\t\tnullable: field.optional,\n\t\tmany: field.list ? { elementNullable: field.elementOptional } : false\n\t} };\n\tif (resolution?.kind === \"block\" && resolution.symbol.keyword === \"enum\") {\n\t\tconst enumCodecId = codecIdByEnumName.get(resolution.symbol.name);\n\t\tif (enumCodecId === void 0) return void 0;\n\t\tconst valueSet = {\n\t\t\tplane: \"domain\",\n\t\t\tentityKind: \"enum\",\n\t\t\tnamespaceId: resolution.namespace.id,\n\t\t\tentityName: resolution.symbol.name\n\t\t};\n\t\treturn { field: {\n\t\t\ttype: {\n\t\t\t\tkind: \"scalar\",\n\t\t\t\tcodecId: enumCodecId\n\t\t\t},\n\t\t\tnullable: field.optional,\n\t\t\tmany: field.list ? { elementNullable: field.elementOptional } : false,\n\t\t\tvalueSet\n\t\t} };\n\t}\n\tif (resolution?.kind === \"namedType\") {\n\t\tif (field.typeConstructor !== void 0) {\n\t\t\tcontext.diagnostics.push({\n\t\t\t\tcode: \"PSL_UNSUPPORTED_FIELD_TYPE\",\n\t\t\t\tmessage: `Field \"${ownerName}.${field.name}\" calls \"${field.typeConstructor.path.join(\".\")}\", which is a type alias, not a type constructor. Remove the arguments.`,\n\t\t\t\t...diagnosticSource(context.sources, field.node.syntax).at(field.span)\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst typeAlias = typeAliases.ofResolution(resolution);\n\t\treturn typeAlias === void 0 ? void 0 : fieldOfTypeAlias(field, typeAlias);\n\t}\n\tif (resolution?.kind === \"model\" || resolution?.kind === \"block\" || resolution?.kind === \"crossSpace\") {\n\t\tcontext.diagnostics.push({\n\t\t\tcode: \"PSL_UNSUPPORTED_FIELD_TYPE\",\n\t\t\tmessage: `Field \"${ownerName}.${field.name}\" type \"${field.typeName}\" is not supported in Mongo PSL interpreter`,\n\t\t\t...diagnosticSource(context.sources, field.node.syntax).at(field.span)\n\t\t});\n\t\treturn;\n\t}\n\tif (resolution?.kind !== \"contributedType\") return;\n\tconst call = field.typeConstructor;\n\tconst entityLabel = `Field \"${ownerName}.${field.name}\"`;\n\tconst source = diagnosticSource(context.sources, field.node.syntax);\n\tif (isContributedTypeChoice(resolution.symbol)) {\n\t\tconst type = scalarTypeOfChoice({\n\t\t\tsymbol: resolution.symbol,\n\t\t\tcall,\n\t\t\tspan: field.span,\n\t\t\tcodecLookup,\n\t\t\tdiagnostics: context.diagnostics,\n\t\t\tsource,\n\t\t\tentityLabel,\n\t\t\tdataTypes: context.dataTypes\n\t\t});\n\t\treturn type === void 0 ? void 0 : { field: {\n\t\t\ttype,\n\t\t\tnullable: field.optional,\n\t\t\tmany: field.list ? { elementNullable: field.elementOptional } : false\n\t\t} };\n\t}\n\tconst { descriptor, path } = resolution.symbol;\n\tif (descriptor.kind === \"typeAlias\") {\n\t\tif (call !== void 0) {\n\t\t\tcontext.diagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\tmessage: `${path.join(\".\")} is a type alias and takes no arguments.`,\n\t\t\t\t...source.at(call.span)\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst typeAlias = typeAliases.ofResolution(resolution);\n\t\tinvariant(typeAlias !== void 0, \"A contributed type alias always resolves\");\n\t\treturn fieldOfTypeAlias(field, typeAlias);\n\t}\n\tif (call === void 0 && !isBareTypeConstructor(descriptor)) {\n\t\treportTypeConstructorNotCalled({\n\t\t\tentityLabel,\n\t\t\tpath: path.join(\".\"),\n\t\t\tdescriptor,\n\t\t\tsource,\n\t\t\tspan: field.span,\n\t\t\tdiagnostics: context.diagnostics\n\t\t});\n\t\treturn;\n\t}\n\tif (call === void 0) scalarNames.warnDeprecated(field, descriptor);\n\tconst type = scalarTypeOfConstructor({\n\t\tdescriptor,\n\t\tcall,\n\t\tcodecLookup,\n\t\tdiagnostics: context.diagnostics,\n\t\tsource,\n\t\tentityLabel,\n\t\tdataTypes: context.dataTypes\n\t});\n\treturn type === void 0 ? void 0 : { field: {\n\t\ttype,\n\t\tnullable: field.optional,\n\t\tmany: field.list ? { elementNullable: field.elementOptional } : false\n\t} };\n}\nfunction processEnumDeclarations(input) {\n\tconst handles = {};\n\tif (input.enumSymbols.length === 0) return handles;\n\tconst enumDescriptor = input.authoringContributions?.entityTypes?.[\"enum\"] !== void 0 && isAuthoringEntityTypeDescriptor(input.authoringContributions.entityTypes[\"enum\"]) ? input.authoringContributions.entityTypes[\"enum\"] : void 0;\n\tif (!enumDescriptor) {\n\t\tfor (const enumSymbol of input.enumSymbols) {\n\t\t\tconst source = diagnosticSource(input.sources, enumSymbol.node.syntax);\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: \"PSL_ENUM_MISSING_FACTORY\",\n\t\t\t\tmessage: `enum \"${enumSymbol.name}\" requires an \"enum\" entityType factory in the active authoring contributions`,\n\t\t\t\t...source.at(enumSymbol.span)\n\t\t\t});\n\t\t}\n\t\treturn handles;\n\t}\n\tfor (const enumSymbol of input.enumSymbols) {\n\t\tconst sourceFile = input.sources.sourceFileFor(enumSymbol.node.syntax);\n\t\tconst envelope = input.parsedBlocks.get(enumSymbol);\n\t\tinput.diagnostics.push(...enumMemberAttributeDiagnostics(enumSymbol, input.sources));\n\t\tif (envelope === void 0) continue;\n\t\tconst handle = instantiateAuthoringEntityType(\"enum\", enumDescriptor, [envelope], {\n\t\t\t...input.entityContext,\n\t\t\tsourceId: sourceFile.filename\n\t\t});\n\t\tif (handle === void 0 || handle === null) continue;\n\t\thandles[envelope.name] = handle;\n\t\tconst typeAttribute = envelope.attributes[\"type\"];\n\t\tinput.sites.set(envelope.name, {\n\t\t\tblock: {\n\t\t\t\tenumName: envelope.name,\n\t\t\t\tcodecId: handle.codecId,\n\t\t\t\tsourceId: sourceFile.filename,\n\t\t\t\tspan: envelope.span,\n\t\t\t\tmemberSpans: envelope.parameterSpans\n\t\t\t},\n\t\t\tcodecSpan: typeAttribute?.argSpans?.[\"codecId\"] ?? typeAttribute?.span ?? envelope.span\n\t\t});\n\t}\n\treturn handles;\n}\nfunction withoutMergedIndexSites(modelSites, removedIndexes) {\n\treturn new Map([...modelSites].map(([modelName, sites]) => {\n\t\tconst removed = new Set(removedIndexes.filter(({ model }) => model === modelName).map(({ position }) => position));\n\t\treturn [modelName, {\n\t\t\t...sites,\n\t\t\tindexes: sites.indexes.filter((_, position) => !removed.has(position))\n\t\t}];\n\t}));\n}\n/** Whether PSL already reported the cause of a refusal, so the builder's refusal would repeat it. */\nfunction alreadyReported(refusal, dropped, reported) {\n\tswitch (refusal.kind) {\n\t\tcase \"indexFieldUnknown\": return dropped.has(fieldSiteKey(refusal.key.model, refusal.fieldName));\n\t\tcase \"relationLocalFieldUnknown\": return dropped.has(fieldSiteKey(refusal.key.model, refusal.fieldName));\n\t\tcase \"discriminatorFieldUnknown\": return dropped.has(fieldSiteKey(refusal.key.model, refusal.fieldName));\n\t\tcase \"discriminatorWithoutVariants\": return reported.baseTargets.has(refusal.key.model);\n\t\tcase \"baseWithoutDiscriminator\": return reported.discriminators.has(refusal.baseModel);\n\t\tdefault: return false;\n\t}\n}\nfunction enumNameOf(field) {\n\treturn field.valueSet?.entityKind === \"enum\" ? field.valueSet.entityName : void 0;\n}\nfunction fieldNodeOf(fieldName, storedName, resolved, generatedValues) {\n\tconst { field } = resolved;\n\tconst executionDefaults = resolved.typeAlias?.executionDefaults;\n\treturn {\n\t\tfieldName,\n\t\t...storedName === fieldName ? {} : { storedName },\n\t\ttype: field.type,\n\t\tnullable: field.nullable,\n\t\tmany: field.many ?? false,\n\t\t...ifDefined(\"enumName\", enumNameOf(field)),\n\t\t...ifDefined(\"executionDefaults\", executionDefaults),\n\t\t...ifDefined(\"generatedValues\", generatedValues)\n\t};\n}\nfunction relationNodeOf(fieldName, relation) {\n\tif (relation.cardinality === \"N:M\") throw new InternalError(\"A paired MongoDB back-relation is one-to-one or one-to-many.\");\n\treturn {\n\t\trelationName: fieldName,\n\t\ttoModel: relation.to.model,\n\t\tcardinality: relation.cardinality,\n\t\ton: relation.on,\n\t\tnullable: \"nullable\" in relation ? relation.nullable : void 0\n\t};\n}\nfunction interpretPslDocumentToMongoContract(input) {\n\tconst { symbolTable, sources, codecLookup } = input;\n\tconst diagnostics = createPslDiagnosticCollector(sources);\n\tconst fieldResolution = {\n\t\tsources,\n\t\tdiagnostics,\n\t\tdataTypes: input.dataTypes\n\t};\n\tconst scalarNames = { warnDeprecated: deprecatedScalarWarner({\n\t\tsources,\n\t\treportWarning: input.reportWarning\n\t}) };\n\tconst { binder } = input;\n\tconst { parsedBlocks, diagnostics: blockDiagnostics } = interpretExtensionBlocks({\n\t\tsymbolTable,\n\t\tsources,\n\t\tpslBlockDescriptors: input.authoringContributions?.pslBlockDescriptors ?? {},\n\t\tbinder,\n\t\tdataTypes: input.dataTypes\n\t});\n\tdiagnostics.push(...blockDiagnostics);\n\tconst { defaultNamespace } = symbolTable;\n\tvalidateNamespaceBlocksForMongoTarget({\n\t\tnamespaces: Object.values(symbolTable.namespaces),\n\t\tsources,\n\t\tbinder,\n\t\tdiagnostics\n\t});\n\tconst allModels = Object.values(defaultNamespace.models);\n\tconst allCompositeTypes = Object.values(defaultNamespace.compositeTypes);\n\tconst { generatorFunctions } = input;\n\tconst specContextFor = (model) => ({\n\t\tsymbols: symbolTable,\n\t\tmodel,\n\t\tdefaultFunctionRegistry: input.defaultFunctionRegistry,\n\t\tgeneratorFunctions,\n\t\tdataTypes: input.dataTypes\n\t});\n\tconst physicalNames = /* @__PURE__ */ new Map();\n\tfor (const model of allModels) resolvePhysicalNames({\n\t\tmodel,\n\t\tphysicalNames,\n\t\tspecContext: specContextFor(model),\n\t\tsources,\n\t\tbinder,\n\t\tdiagnostics\n\t});\n\tconst blockKeywords = /* @__PURE__ */ new Set([\"enum\", ...claimedBlockKeywords(input.authoringContributions?.pslBlockDescriptors)]);\n\tfor (const block of Object.values(defaultNamespace.blocks)) if (!blockKeywords.has(block.keyword)) diagnostics.push(unsupportedBlockDiagnostic(block, sources));\n\tconst topLevelEnumSymbols = Object.values(defaultNamespace.blocks).filter((b) => b.keyword === \"enum\");\n\tconst enumSites = /* @__PURE__ */ new Map();\n\tconst enumHandles = processEnumDeclarations({\n\t\tsites: enumSites,\n\t\tenumSymbols: topLevelEnumSymbols,\n\t\tparsedBlocks,\n\t\tsources,\n\t\tauthoringContributions: input.authoringContributions,\n\t\tentityContext: {\n\t\t\tfamily: \"mongo\",\n\t\t\ttarget: \"mongo\",\n\t\t\t...ifDefined(\"enumInferenceCodecs\", input.enumInferenceCodecs),\n\t\t\tcodecLookup,\n\t\t\tdataTypes: input.dataTypes,\n\t\t\tdiagnostics: { push: (d) => {\n\t\t\t\tdiagnostics.pushExternal(blindCast(d));\n\t\t\t} }\n\t\t},\n\t\tdiagnostics\n\t});\n\tconst codecIdByEnumName = new Map(Object.entries(enumHandles).map(([name, handle]) => [name, handle.codecId]));\n\tconst typeAliases = resolveMongoTypeAliases({\n\t\tdeclarations: Object.values(symbolTable.namedTypes),\n\t\tsymbols: symbolTable,\n\t\tbinder,\n\t\tsources,\n\t\tdiagnostics,\n\t\tcodecIdByEnumName,\n\t\tdefaultFunctionRegistry: input.defaultFunctionRegistry,\n\t\tgeneratorFunctions,\n\t\tdataTypes: input.dataTypes,\n\t\tcodecLookup: input.codecLookup,\n\t\tauthoringTypes: input.authoringContributions?.type\n\t});\n\tconst polymorphism = collectPolymorphismDeclarations({\n\t\tmodels: allModels,\n\t\tspecContextFor,\n\t\tsources,\n\t\tbinder,\n\t\tdiagnostics\n\t});\n\tconst allFkRelations = [];\n\tconst backrelationCandidates = [];\n\tconst invalidFkPairings = [];\n\tconst fieldSites = /* @__PURE__ */ new Map();\n\tconst modelSites = /* @__PURE__ */ new Map();\n\tconst droppedFields = /* @__PURE__ */ new Set();\n\tconst relationsByModel = /* @__PURE__ */ new Map();\n\tconst modelDrafts = [];\n\tfor (const pslModel of allModels) {\n\t\tconst specContext = specContextFor(pslModel);\n\t\tconst fields = [];\n\t\tconst relations = [];\n\t\trelationsByModel.set(pslModel.name, relations);\n\t\tfor (const field of Object.values(pslModel.fields)) {\n\t\t\tconst source = diagnosticSource(sources, field.node.syntax);\n\t\t\tconst siteKey = fieldSiteKey(pslModel.name, field.name);\n\t\t\tconst resolution = fieldTypeResolution(field, binder);\n\t\t\tif (resolution?.kind === \"model\") {\n\t\t\t\tfieldSites.set(siteKey, {\n\t\t\t\t\tsymbol: field,\n\t\t\t\t\tsource,\n\t\t\t\t\tgeneratorAttributes: {},\n\t\t\t\t\tstoredName: field.name\n\t\t\t\t});\n\t\t\t\tconst target = resolution.symbol;\n\t\t\t\tconst relationNode = field.attributes.find((attr) => attr.name === \"relation\")?.node;\n\t\t\t\tconst relation = relationNode ? interpretFieldAttribute({\n\t\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\t\tnode: relationNode,\n\t\t\t\t\tspec: mongoAttributeSpecs.field.relation({\n\t\t\t\t\t\t...specContext,\n\t\t\t\t\t\tfield,\n\t\t\t\t\t\ttypeResolution: fieldTypeResolution(field, binder),\n\t\t\t\t\t\tcontributedType: contributedTypeOf(fieldTypeResolution(field, binder), binder, field.typeConstructor)\n\t\t\t\t\t}),\n\t\t\t\t\tmodel: pslModel,\n\t\t\t\t\tfield,\n\t\t\t\t\tsources,\n\t\t\t\t\tbinder,\n\t\t\t\t\tdiagnostics\n\t\t\t\t}) : void 0;\n\t\t\t\tif (field.list || !(relation?.fields && relation?.references)) {\n\t\t\t\t\tbackrelationCandidates.push({\n\t\t\t\t\t\tmodelName: pslModel.name,\n\t\t\t\t\t\ttargetModelName: target.name,\n\t\t\t\t\t\t...ifDefined(\"relationName\", relation?.name),\n\t\t\t\t\t\tcardinality: field.list ? \"1:N\" : \"1:1\",\n\t\t\t\t\t\tfield,\n\t\t\t\t\t\tsources\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!physicalNames.has(target)) continue;\n\t\t\t\trelations.push({\n\t\t\t\t\trelationName: field.name,\n\t\t\t\t\ttoModel: target.name,\n\t\t\t\t\tcardinality: \"N:1\",\n\t\t\t\t\ton: {\n\t\t\t\t\t\tlocalFields: relation.fields,\n\t\t\t\t\t\ttargetFields: relation.references\n\t\t\t\t\t},\n\t\t\t\t\tnullable: field.optional\n\t\t\t\t});\n\t\t\t\tif (resolveToOneRelationNullable({\n\t\t\t\t\tdeclaredNullable: field.optional,\n\t\t\t\t\tlocalFieldNullability: relation.fields.map((localFieldName) => pslModel.fields[localFieldName]?.optional === true),\n\t\t\t\t\townsReference: true\n\t\t\t\t}).contradiction !== void 0) {\n\t\t\t\t\tinvalidFkPairings.push({\n\t\t\t\t\t\tpairKey: fkRelationPairKey(pslModel.name, target.name),\n\t\t\t\t\t\t...ifDefined(\"relationName\", relation.name)\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tallFkRelations.push({\n\t\t\t\t\tdeclaringModel: pslModel.name,\n\t\t\t\t\ttargetModel: target.name,\n\t\t\t\t\t...ifDefined(\"relationName\", relation.name),\n\t\t\t\t\tlocalFields: relation.fields,\n\t\t\t\t\ttargetFields: relation.references\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst resolved = resolveNonRelationField(field, {\n\t\t\t\tname: pslModel.name,\n\t\t\t\tkind: \"model\"\n\t\t\t}, resolution, codecIdByEnumName, fieldResolution, scalarNames, typeAliases, codecLookup);\n\t\t\tif (resolved === void 0 || resolved.typeAlias !== void 0 && !acceptsTypeAlias({\n\t\t\t\tfield,\n\t\t\t\tmodelName: pslModel.name,\n\t\t\t\ttypeAlias: resolved.typeAlias,\n\t\t\t\tsources,\n\t\t\t\tdiagnostics\n\t\t\t})) {\n\t\t\t\tdroppedFields.add(siteKey);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst storedName = physicalName(physicalNames, field);\n\t\t\tconst generated = lowerGeneratorAttributes({\n\t\t\t\tfield,\n\t\t\t\tmodelName: pslModel.name,\n\t\t\t\tresolved,\n\t\t\t\tspecContext: {\n\t\t\t\t\t...specContext,\n\t\t\t\t\tfield,\n\t\t\t\t\ttypeResolution: resolution,\n\t\t\t\t\tcontributedType: contributedTypeOf(resolution, binder, field.typeConstructor)\n\t\t\t\t},\n\t\t\t\tgeneratorFunctions,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tfields.push(fieldNodeOf(field.name, storedName, resolved, generated.values));\n\t\t\tfieldSites.set(siteKey, {\n\t\t\t\tsymbol: field,\n\t\t\t\tsource,\n\t\t\t\t...ifDefined(\"typeAlias\", resolved.typeAlias),\n\t\t\t\tgeneratorAttributes: generated.sites,\n\t\t\t\tstoredName\n\t\t\t});\n\t\t}\n\t\tconst idFields = [];\n\t\tfor (const field of Object.values(pslModel.fields)) {\n\t\t\tconst idNode = field.attributes.find((attr) => attr.name === \"id\")?.node;\n\t\t\tif (!idNode) continue;\n\t\t\tif (interpretFieldAttribute({\n\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\tnode: idNode,\n\t\t\t\tspec: mongoAttributeSpecs.field.id({\n\t\t\t\t\t...specContext,\n\t\t\t\t\tfield,\n\t\t\t\t\ttypeResolution: fieldTypeResolution(field, binder),\n\t\t\t\t\tcontributedType: contributedTypeOf(fieldTypeResolution(field, binder), binder, field.typeConstructor)\n\t\t\t\t}),\n\t\t\t\tmodel: pslModel,\n\t\t\t\tfield,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t}) === void 0) continue;\n\t\t\tidFields.push(field);\n\t\t\tconst storedName = physicalName(physicalNames, field);\n\t\t\tif (storedName !== DOCUMENT_ID) diagnostics.push({\n\t\t\t\tcode: \"PSL_MONGO_ID_ATTRIBUTE_INVALID\",\n\t\t\t\tmessage: `Field \"${pslModel.name}.${field.name}\" has @id but is stored as \"${storedName}\". In MongoDB, @id marks the field stored as _id, the document id: add @map(\"_id\") to it, or remove @id.`,\n\t\t\t\t...diagnosticSource(sources, field.node.syntax).at(field.span)\n\t\t\t});\n\t\t}\n\t\tconst [, secondIdField] = idFields;\n\t\tif (secondIdField !== void 0) diagnostics.push({\n\t\t\tcode: \"PSL_MONGO_ID_ATTRIBUTE_INVALID\",\n\t\t\tmessage: `Model \"${pslModel.name}\" has @id on ${idFields.length} fields, ${idFields.map((field) => `\"${field.name}\"`).join(\" and \")}. A document has one id: keep @id only on the field stored as _id.`,\n\t\t\t...diagnosticSource(sources, secondIdField.node.syntax).at(secondIdField.span)\n\t\t});\n\t\tconst indexes = collectIndexes(pslModel, specContext, sources, binder, diagnostics);\n\t\tconst discriminator = polymorphism.discriminators.get(pslModel);\n\t\tconst base = polymorphism.bases.get(pslModel);\n\t\tmodelSites.set(pslModel.name, {\n\t\t\tindexes,\n\t\t\t...ifDefined(\"discriminator\", discriminator),\n\t\t\t...ifDefined(\"base\", base)\n\t\t});\n\t\tconst inheritsCollection = base !== void 0 && getAttribute(pslModel.attributes, \"map\") === void 0;\n\t\tmodelDrafts.push({\n\t\t\tsymbol: pslModel,\n\t\t\tnode: {\n\t\t\t\tmodelName: pslModel.name,\n\t\t\t\t...inheritsCollection ? {} : { collection: physicalName(physicalNames, pslModel) },\n\t\t\t\tfields,\n\t\t\t\tindexes: indexes.map(({ index }) => index),\n\t\t\t\t...discriminator === void 0 ? {} : { discriminator: { field: discriminator.fieldName } },\n\t\t\t\t...base === void 0 ? {} : { base: {\n\t\t\t\t\tmodel: base.base.name,\n\t\t\t\t\tvalue: base.written\n\t\t\t\t} }\n\t\t\t}\n\t\t});\n\t}\n\tconst valueObjects = [];\n\tfor (const compositeType of allCompositeTypes) {\n\t\tconst fields = [];\n\t\tfor (const field of Object.values(compositeType.fields)) {\n\t\t\tconst siteKey = fieldSiteKey(compositeType.name, field.name);\n\t\t\tconst fieldMap = field.attributes.find((attr) => attr.name === \"map\");\n\t\t\tconst resolved = resolveNonRelationField(field, {\n\t\t\t\tname: compositeType.name,\n\t\t\t\tkind: \"compositeType\"\n\t\t\t}, fieldTypeResolution(field, binder), codecIdByEnumName, fieldResolution, scalarNames, typeAliases, codecLookup);\n\t\t\tif (resolved === void 0) {\n\t\t\t\tdroppedFields.add(siteKey);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst storedName = fieldMap?.args[0]?.value.replace(/^\"|\"$/g, \"\") ?? field.name;\n\t\t\tfields.push({\n\t\t\t\t...fieldNodeOf(field.name, field.name, resolved, void 0),\n\t\t\t\t...fieldMap === void 0 ? {} : { storedName }\n\t\t\t});\n\t\t\tfieldSites.set(siteKey, {\n\t\t\t\tsymbol: field,\n\t\t\t\tsource: diagnosticSource(sources, field.node.syntax),\n\t\t\t\t...ifDefined(\"typeAlias\", resolved.typeAlias),\n\t\t\t\tgeneratorAttributes: {},\n\t\t\t\t...fieldMap === void 0 ? {} : { map: {\n\t\t\t\t\tsource: diagnosticSource(sources, fieldMap.node.syntax),\n\t\t\t\t\tspan: nodePslSpan(fieldMap.node.syntax, sources)\n\t\t\t\t} },\n\t\t\t\tstoredName\n\t\t\t});\n\t\t}\n\t\tvalueObjects.push({\n\t\t\tname: compositeType.name,\n\t\t\tfields\n\t\t});\n\t}\n\tconst paired = pairMongoBackRelations({\n\t\tforeignKeys: allFkRelations,\n\t\tcandidates: backrelationCandidates,\n\t\tinvalidFkPairings,\n\t\tnamespaceId: defaultNamespace.id\n\t});\n\tdiagnostics.push(...paired.diagnostics);\n\tfor (const { modelName, fieldName, relation } of paired.relations) relationsByModel.get(modelName)?.push(relationNodeOf(fieldName, relation));\n\tconst modelNodes = modelDrafts.map(({ node }) => ({\n\t\t...node,\n\t\trelations: relationsByModel.get(node.modelName) ?? []\n\t}));\n\tconst { definition, removedIndexes } = mergeRedundantIndexes(nameIndexes({\n\t\ttarget: input.target,\n\t\t...ifDefined(\"extensions\", input.extensionPacks),\n\t\tmodels: [...modelNodes.filter((model) => model.base === void 0), ...modelNodes.filter((model) => model.base !== void 0)],\n\t\tvalueObjects,\n\t\tenums: enumHandles,\n\t\twritesCollectionValidators: true,\n\t\twarnings: void 0\n\t}), codecLookup, input.dataTypes);\n\tconst sites = {\n\t\tmodels: withoutMergedIndexSites(modelSites, removedIndexes),\n\t\tfields: fieldSites,\n\t\tenums: enumSites\n\t};\n\tconst built = buildMongoContractFromDefinition(definition, codecLookup, input.dataTypes);\n\tfor (const refusal of built.ok ? [] : built.failure.refusals) {\n\t\tif (alreadyReported(refusal, droppedFields, polymorphism.reported)) continue;\n\t\tconst diagnostic = refusalDiagnostic(refusal, sites);\n\t\tif (\"range\" in diagnostic) diagnostics.push(diagnostic);\n\t\telse diagnostics.pushExternal(diagnostic);\n\t}\n\tif (!built.ok || diagnostics.length > 0 || (input.seedDiagnostics?.length ?? 0) > 0) return notOk({\n\t\tsummary: \"PSL to Mongo contract interpretation failed\",\n\t\tdiagnostics: [...input.seedDiagnostics ?? [], ...diagnostics.toExternal()]\n\t});\n\treturn ok(built.value.contract);\n}\n//#endregion\nexport { mongoAttributeSpecs as i, pairMongoBackRelations as n, describeUnsupportedMongoAttribute as r, interpretPslDocumentToMongoContract as t };\n\n//# sourceMappingURL=interpreter-v8GWMscU.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,uBAAuB,OAAO;CACtC,OAAO;EACN,SAAS,MAAM;EACf,WAAW,MAAM;EACjB,QAAQ,MAAM;EACd,SAAS,MAAM;CAChB;AACD;AACA,SAAS,uBAAuB,OAAO;CACtC,OAAO;EACN,SAAS,MAAM;EACf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EACnD,IAAI,WAAW,YAAY,YAAY,KAAK,UAAU;OACjD,YAAY,aAAa,UAAU;CACzC;CACA,IAAI,CAAC,MAAM,MAAM,YAAY,SAAS,MAAM,MAAM,iBAAiB,UAAU,KAAK,GAAG,OAAO,MAAM;EACjG,SAAS;EACT,aAAa,CAAC,GAAG,MAAM,mBAAmB,CAAC,GAAG,GAAG,YAAY,WAAW,CAAC;CAC1E,CAAC;CACD,OAAO,GAAG,MAAM,MAAM,QAAQ;AAC/B"}
|
|
1
|
+
{"version":3,"file":"interpreter-v8GWMscU-BFP58so-.mjs","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-psl/dist/interpreter-v8GWMscU.mjs"],"sourcesContent":["import { describeDiscriminatorRefusal, enumMemberProblemDiagnostic, instantiateAuthoringEntityType, instantiateAuthoringTypeAlias, instantiateAuthoringTypeConstructor, instantiateAuthoringTypeConstructorFromValues, isAuthoringEntityTypeDescriptor, resolveTypeAliasGenerators, validateAuthoringHelperArguments } from \"@internal/framework-components/authoring\";\nimport { argumentIndexOf, argumentSpan, claimedBlockKeywords, consumeInvalidFkPairing, enumMemberAttributeDiagnostics, fkRelationPairKey, instantiatePslTypeChoice, isBareTypeConstructor, mapPslHelperArgs, reportTypeConstructorNotCalled, requiredOneToOneBackrelationDiagnostic, unsupportedBlockDiagnostic } from \"@internal/psl-parser/interpret\";\nimport { resolveToOneRelationNullable } from \"@internal/contract-authoring\";\nimport { DOCUMENT_ID } from \"@internal/mongo-contract\";\nimport { buildMongoContractFromDefinition, mergeRedundantIndexes, nameIndexes } from \"@internal/mongo-contract-ts/contract-builder\";\nimport { bool, contributedTypeAliasOf, contributedTypeOf, createPslDiagnosticCollector, diagnosticSource, entityRef, fieldAttribute, fieldRef, funcCall, generatorAttributeSpec, identifier, int, interpretAttribute, interpretExtensionBlocks, isContributedTypeChoice, json, list, mapPslDiagnostics, modelAttribute, nodePslSpan, num, oneOf, optional, record, referencedFieldRef, refuseRepeatedTypeAliasAttributes, resolveTypeAliases, str, typeAliasSpecContext, typeAttributeSpecContextOfField, typeAttributeSubjectLabel, typeGeneratorAttributeSpec, typeReferenceNode, writtenScalar } from \"@internal/psl-parser\";\nimport { ArrayLiteralAst, FunctionCallAst, PathExprAst } from \"@internal/psl-parser/syntax\";\nimport { assertDefined, invariant } from \"@internal/utils/assertions\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { crossRef } from \"@internal/contract/types\";\n//#region src/mongo-attribute-specs.ts\nfunction buildModelAttributeCtx(input) {\n\treturn {\n\t\tsources: input.sources,\n\t\tselfModel: input.selfModel,\n\t\tbinder: input.binder,\n\t\tsymbols: input.symbols\n\t};\n}\nfunction buildFieldAttributeCtx(input) {\n\treturn {\n\t\tsources: input.sources,\n\t\tselfModel: input.selfModel,\n\t\tfield: input.field,\n\t\tbinder: input.binder,\n\t\tsymbols: input.symbols\n\t};\n}\nconst UNLOWERED_FIELD_ATTRIBUTE_HINTS = /* @__PURE__ */ new Map([[\"updatedAt\", \"Use @onCreate(now()) @onUpdate(now()), or type the field temporal.UpdatedAt.\"]]);\nconst DEFAULT_NOW_HINT = \"Use @onCreate(now()) instead; MongoDB has no database defaults.\";\n/** The hint for an attribute MongoDB PSL does not lower, naming what to write instead. */\nfunction unloweredAttributeHint(attribute) {\n\tif (attribute.name === \"default\" && attribute.args[0]?.value.replace(/\\s/g, \"\") === \"now()\") return DEFAULT_NOW_HINT;\n\treturn UNLOWERED_FIELD_ATTRIBUTE_HINTS.get(attribute.name);\n}\nfunction describeUnsupportedMongoAttribute(sources) {\n\treturn ({ attribute, level, owner, field }) => {\n\t\tif (level === \"model\") return {\n\t\t\tcode: \"PSL_UNSUPPORTED_MODEL_ATTRIBUTE\",\n\t\t\tmessage: `${owner.kind === \"mixin\" ? \"Mixin\" : \"Model\"} \"${owner.name}\" uses unsupported attribute \"@@${attribute.name}\"`,\n\t\t\t...diagnosticSource(sources, owner.node.syntax).at(attribute.span)\n\t\t};\n\t\tif (field === void 0) return void 0;\n\t\tconst base = `Field \"${owner.name}.${field.name}\" uses unsupported attribute \"@${attribute.name}\"`;\n\t\tconst hint = unloweredAttributeHint(attribute);\n\t\treturn {\n\t\t\tcode: \"PSL_UNSUPPORTED_FIELD_ATTRIBUTE\",\n\t\t\tmessage: hint === void 0 ? base : `${base}. ${hint}`,\n\t\t\t...diagnosticSource(sources, field.node.syntax).at(attribute.span)\n\t\t};\n\t};\n}\nfunction interpretModelAttribute(input) {\n\tconst result = interpretAttribute(input.node, input.spec, buildModelAttributeCtx({\n\t\tsymbols: input.symbols,\n\t\tselfModel: input.model,\n\t\tsources: input.sources,\n\t\tbinder: input.binder\n\t}));\n\tif (!result.ok) {\n\t\tinput.diagnostics.push(...result.failure);\n\t\treturn;\n\t}\n\treturn result.value;\n}\nfunction interpretFieldAttribute(input) {\n\tconst result = interpretAttribute(input.node, input.spec, buildFieldAttributeCtx({\n\t\tsymbols: input.symbols,\n\t\tselfModel: input.model,\n\t\tfield: input.field,\n\t\tsources: input.sources,\n\t\tbinder: input.binder\n\t}));\n\tif (!result.ok) {\n\t\tinput.diagnostics.push(...result.failure);\n\t\treturn;\n\t}\n\treturn result.value;\n}\nconst mapModelSpec = modelAttribute(\"map\", {\n\tdocumentation: \"Maps this model to a MongoDB collection name.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str(),\n\t\tdocumentation: \"The collection name stored in MongoDB.\"\n\t}]\n});\nconst mapFieldSpec = fieldAttribute(\"map\", {\n\tdocumentation: \"Maps this field to a stored document key.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str(),\n\t\tdocumentation: \"The key stored in MongoDB documents.\"\n\t}]\n});\nconst idFieldSpec = fieldAttribute(\"id\", { documentation: \"Marks the field stored as `_id`, the document’s id. The field must be stored as `_id`: name it `_id` or add `@map(\\\"_id\\\")`. A model may leave `@id` out; its documents still get an ObjectId `_id`.\" });\nconst indexMapArg = {\n\ttype: optional(str()),\n\tdocumentation: \"The name MongoDB stores the index under. Without it, the index is named after its keys and directions, such as `email_1`.\"\n};\nconst uniqueFieldSpec = fieldAttribute(\"unique\", {\n\tdocumentation: \"Requires values in this field to be unique across the collection.\",\n\tnamed: { map: indexMapArg }\n});\nconst relationFieldSpec = fieldAttribute(\"relation\", {\n\tdocumentation: \"Names a relation and associates local fields with fields on the referenced model.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: optional(str()),\n\t\tdocumentation: \"The relation name used to pair both sides. May also be supplied by name.\"\n\t}],\n\tnamed: {\n\t\tname: {\n\t\t\ttype: optional(str()),\n\t\t\tdocumentation: \"The relation name used to pair both sides. Cannot also be supplied positionally.\"\n\t\t},\n\t\tfields: {\n\t\t\ttype: optional(list(fieldRef(), {\n\t\t\t\tallowEmpty: false,\n\t\t\t\tunique: true\n\t\t\t})),\n\t\t\tdocumentation: \"The ordered local fields holding references to related documents.\"\n\t\t},\n\t\treferences: {\n\t\t\ttype: optional(list(referencedFieldRef(), {\n\t\t\t\tallowEmpty: false,\n\t\t\t\tunique: true\n\t\t\t})),\n\t\t\tdocumentation: \"The corresponding fields on the referenced model.\"\n\t\t}\n\t}\n});\nconst discriminatorModelSpec = modelAttribute(\"discriminator\", {\n\tdocumentation: \"Selects the field that distinguishes inheritance variants in this collection.\",\n\tpositional: [{\n\t\tkey: \"field\",\n\t\ttype: fieldRef(),\n\t\tdocumentation: \"The discriminator field on this model.\"\n\t}]\n});\nfunction baseModelSpec() {\n\treturn modelAttribute(\"base\", {\n\t\tdocumentation: \"Declares this model as a variant of a base model.\",\n\t\tpositional: [{\n\t\t\tkey: \"base\",\n\t\t\ttype: entityRef({ kind: \"model\" }),\n\t\t\tdocumentation: \"The base model to inherit from.\"\n\t\t}, {\n\t\t\tkey: \"value\",\n\t\t\ttype: writtenScalar(str()),\n\t\t\tdocumentation: \"The discriminator value identifying this variant, a value of the discriminator field's type.\"\n\t\t}]\n\t});\n}\nconst indexFieldElement = oneOf(fieldRef(), funcCall(\"wildcard\", {\n\tdocumentation: \"Indexes document fields using a MongoDB wildcard index.\",\n\tpositional: [{\n\t\tkey: \"scope\",\n\t\ttype: optional(identifier()),\n\t\tdocumentation: \"The field path to index recursively. Omit to index all document fields.\"\n\t}]\n}), funcCall(\"sort\", {\n\tdocumentation: \"Selects an index field with an explicit sort direction.\",\n\tpositional: [{\n\t\tkey: \"field\",\n\t\ttype: fieldRef(),\n\t\tdocumentation: \"The model field to index.\"\n\t}, {\n\t\tkey: \"direction\",\n\t\ttype: oneOf(identifier(\"Asc\", { documentation: \"Sort ascending.\" }), identifier(\"Desc\", { documentation: \"Sort descending.\" })),\n\t\tdocumentation: \"The index order for this field: `Asc` or `Desc`.\"\n\t}]\n}));\nconst collationNamedArgs = {\n\tcollationLocale: {\n\t\ttype: optional(str()),\n\t\tdocumentation: \"The ICU locale used for string comparison, or `simple` for binary comparison.\"\n\t},\n\tcollationStrength: {\n\t\ttype: optional(oneOf(num(1), num(2), num(3), num(4), num(5))),\n\t\tdocumentation: \"The collation comparison level, from `1` (primary differences) through `5` (identical).\"\n\t},\n\tcollationCaseLevel: {\n\t\ttype: optional(bool()),\n\t\tdocumentation: \"Whether case differences are compared at strength `1` or `2`.\"\n\t},\n\tcollationCaseFirst: {\n\t\ttype: optional(oneOf(str(\"upper\"), str(\"lower\"), str(\"off\"))),\n\t\tdocumentation: \"Whether uppercase or lowercase sorts first, or `off` for the locale default.\"\n\t},\n\tcollationNumericOrdering: {\n\t\ttype: optional(bool()),\n\t\tdocumentation: \"Whether numeric strings are compared as numbers rather than lexicographically.\"\n\t},\n\tcollationAlternate: {\n\t\ttype: optional(oneOf(str(\"non-ignorable\"), str(\"shifted\"))),\n\t\tdocumentation: \"Whether punctuation and whitespace are significant or shifted to a later comparison level.\"\n\t},\n\tcollationMaxVariable: {\n\t\ttype: optional(oneOf(str(\"punct\"), str(\"space\"))),\n\t\tdocumentation: \"Which characters are ignored when alternate handling is `shifted`: punctuation or spaces.\"\n\t},\n\tcollationBackwards: {\n\t\ttype: optional(bool()),\n\t\tdocumentation: \"Whether secondary differences, such as accents, are compared in reverse order.\"\n\t},\n\tcollationNormalization: {\n\t\ttype: optional(bool()),\n\t\tdocumentation: \"Whether strings are checked and normalized before comparison.\"\n\t}\n};\nfunction buildIndexModelSpec(name) {\n\treturn modelAttribute(name, {\n\t\tdocumentation: name === \"unique\" ? \"Declares a unique MongoDB index over the selected fields.\" : \"Declares a MongoDB index over the selected fields.\",\n\t\tpositional: [{\n\t\t\tkey: \"fields\",\n\t\t\ttype: list(indexFieldElement, { allowEmpty: false }),\n\t\t\tdocumentation: name === \"unique\" ? \"The nonempty list of indexed fields, optionally with sort directions. Wildcard scopes are not supported.\" : \"The nonempty list of indexed fields, optionally with sort directions or a wildcard scope.\"\n\t\t}],\n\t\tnamed: {\n\t\t\tmap: indexMapArg,\n\t\t\ttype: {\n\t\t\t\ttype: optional(oneOf(num(1), num(-1), str(\"text\"), str(\"2dsphere\"), str(\"2d\"), str(\"hashed\"))),\n\t\t\t\tdocumentation: \"The MongoDB index key type: ascending `1`, descending `-1`, text, geospatial, or hashed.\"\n\t\t\t},\n\t\t\tsparse: {\n\t\t\t\ttype: optional(bool()),\n\t\t\t\tdocumentation: \"Whether documents missing indexed fields are omitted from the index.\"\n\t\t\t},\n\t\t\texpireAfterSeconds: {\n\t\t\t\ttype: optional(int()),\n\t\t\t\tdocumentation: \"The expiration interval in seconds for a TTL index.\"\n\t\t\t},\n\t\t\tfilter: {\n\t\t\t\ttype: optional(json()),\n\t\t\t\tdocumentation: \"A JSON partial-filter expression limiting which documents are indexed.\"\n\t\t\t},\n\t\t\tinclude: {\n\t\t\t\ttype: optional(list(str())),\n\t\t\t\tdocumentation: \"Document paths included in the wildcard index projection.\"\n\t\t\t},\n\t\t\texclude: {\n\t\t\t\ttype: optional(list(str())),\n\t\t\t\tdocumentation: \"Document paths excluded from the wildcard index projection.\"\n\t\t\t},\n\t\t\tdefault_language: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The default language for text-index tokenization and stemming.\"\n\t\t\t},\n\t\t\tlanguageOverride: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The document field that overrides the text-index language.\"\n\t\t\t},\n\t\t\t...collationNamedArgs\n\t\t}\n\t});\n}\nfunction buildTextIndexModelSpec() {\n\treturn modelAttribute(\"textIndex\", {\n\t\tdocumentation: \"Declares a MongoDB text index with optional field weights and language settings.\",\n\t\tpositional: [{\n\t\t\tkey: \"fields\",\n\t\t\ttype: list(indexFieldElement, { allowEmpty: false }),\n\t\t\tdocumentation: \"The nonempty list of fields whose text is indexed.\"\n\t\t}],\n\t\tnamed: {\n\t\t\tmap: indexMapArg,\n\t\t\tfilter: {\n\t\t\t\ttype: optional(json()),\n\t\t\t\tdocumentation: \"A JSON partial-filter expression limiting which documents are indexed.\"\n\t\t\t},\n\t\t\tweights: {\n\t\t\t\ttype: optional(record(int({\n\t\t\t\t\tmin: 1,\n\t\t\t\t\tmax: 99999\n\t\t\t\t}))),\n\t\t\t\tdocumentation: \"Relative text-search weights by field, each from `1` through `99999`.\"\n\t\t\t},\n\t\t\tlanguage: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The default language for tokenization and stemming.\"\n\t\t\t},\n\t\t\tlanguageOverride: {\n\t\t\t\ttype: optional(str()),\n\t\t\t\tdocumentation: \"The document field that overrides the text-index language.\"\n\t\t\t},\n\t\t\t...collationNamedArgs\n\t\t}\n\t});\n}\nfunction staticModelSpec(spec) {\n\treturn () => spec;\n}\nfunction staticFieldSpec(spec) {\n\treturn () => spec;\n}\nconst mongoAttributeSpecs = {\n\tmodel: {\n\t\tmap: staticModelSpec(mapModelSpec),\n\t\tdiscriminator: staticModelSpec(discriminatorModelSpec),\n\t\tbase: baseModelSpec,\n\t\tindex: staticModelSpec(buildIndexModelSpec(\"index\")),\n\t\tunique: staticModelSpec(buildIndexModelSpec(\"unique\")),\n\t\ttextIndex: staticModelSpec(buildTextIndexModelSpec())\n\t},\n\tfield: {\n\t\tid: staticFieldSpec(idFieldSpec),\n\t\tunique: staticFieldSpec(uniqueFieldSpec),\n\t\tmap: staticFieldSpec(mapFieldSpec),\n\t\trelation: staticFieldSpec(relationFieldSpec),\n\t\tonCreate: generatorAttributeSpec(\"onCreate\"),\n\t\tonUpdate: generatorAttributeSpec(\"onUpdate\")\n\t}\n};\n//#endregion\n//#region src/pair-back-relations.ts\n/**\n* Matches each back-relation with the foreign key on the other model: same model pair, and the same relation name when the back-relation has one. A back-relation with no match is orphaned unless its foreign key was already reported (`invalidFkPairings`); one with several matches is ambiguous.\n*/\nfunction pairMongoBackRelations(input) {\n\tconst foreignKeysByPair = /* @__PURE__ */ new Map();\n\tfor (const fk of input.foreignKeys) {\n\t\tconst key = fkRelationPairKey(fk.declaringModel, fk.targetModel);\n\t\tconst existing = foreignKeysByPair.get(key);\n\t\tif (existing) existing.push(fk);\n\t\telse foreignKeysByPair.set(key, [fk]);\n\t}\n\tconst relations = [];\n\tconst diagnostics = [];\n\tfor (const candidate of input.candidates) {\n\t\tconst { field, modelName, targetModelName } = candidate;\n\t\tconst source = diagnosticSource(candidate.sources, field.node.syntax);\n\t\tconst pairKey = fkRelationPairKey(targetModelName, modelName);\n\t\tconst pairMatches = foreignKeysByPair.get(pairKey) ?? [];\n\t\tconst matches = candidate.relationName ? pairMatches.filter((fk) => fk.relationName === candidate.relationName) : pairMatches;\n\t\tif (matches.length === 0) {\n\t\t\tif (consumeInvalidFkPairing(candidate, pairKey, input.invalidFkPairings)) continue;\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_ORPHANED_BACKRELATION\",\n\t\t\t\tmessage: `Backrelation list field \"${modelName}.${field.name}\" has no matching FK-side relation on model \"${targetModelName}\". Add @relation(fields: [...], references: [...]) on the FK-side relation or use an explicit join model for many-to-many.`,\n\t\t\t\t...source.at(field.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst [fk] = matches;\n\t\tif (fk === void 0 || matches.length > 1) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_AMBIGUOUS_BACKRELATION\",\n\t\t\t\tmessage: `Backrelation list field \"${modelName}.${field.name}\" matches multiple FK-side relations on model \"${targetModelName}\". Add @relation(\"...\") to both sides to disambiguate.`,\n\t\t\t\t...source.at(field.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (candidate.cardinality === \"1:1\" && !field.optional) diagnostics.push(requiredOneToOneBackrelationDiagnostic({\n\t\t\tmodelName,\n\t\t\tfield,\n\t\t\ttargetModelName,\n\t\t\tsources: candidate.sources,\n\t\t\trecordNoun: \"document\"\n\t\t}));\n\t\trelations.push({\n\t\t\tmodelName,\n\t\t\tfieldName: field.name,\n\t\t\trelation: {\n\t\t\t\tto: crossRef(targetModelName, input.namespaceId),\n\t\t\t\t...candidate.cardinality === \"1:N\" ? { cardinality: \"1:N\" } : {\n\t\t\t\t\tcardinality: \"1:1\",\n\t\t\t\t\tnullable: true\n\t\t\t\t},\n\t\t\t\ton: {\n\t\t\t\t\tlocalFields: fk.targetFields,\n\t\t\t\t\ttargetFields: fk.localFields\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\treturn {\n\t\trelations,\n\t\tdiagnostics\n\t};\n}\n//#endregion\n//#region src/psl-helpers.ts\n/** Storage collection name of a model that declares no `@@map`: the model name, verbatim. */\nfunction defaultCollectionName(modelName) {\n\treturn modelName;\n}\nfunction getAttribute(attributes, name) {\n\treturn attributes.find((attr) => attr.name === name);\n}\n//#endregion\n//#region src/refusal-diagnostics.ts\nfunction fieldSiteKey(owner, fieldName) {\n\treturn JSON.stringify([owner, fieldName]);\n}\nfunction fieldSiteOf(sites, key) {\n\tconst site = sites.fields.get(fieldSiteKey(key.owner.name, key.field));\n\tif (site === void 0) throw new InternalError(`A refused field \"${key.owner.name}.${key.field}\" has a site.`);\n\treturn site;\n}\nfunction modelSitesOf(sites, model) {\n\tconst modelSites = sites.models.get(model);\n\tif (modelSites === void 0) throw new InternalError(`A refused model \"${model}\" has sites.`);\n\treturn modelSites;\n}\nfunction indexSiteOf(sites, model, position) {\n\tconst site = modelSitesOf(sites, model).indexes[position];\n\tif (site === void 0) throw new InternalError(`Index ${position} of \"${model}\" has a site.`);\n\treturn site;\n}\nfunction at(site, code, message) {\n\treturn {\n\t\tcode,\n\t\tmessage,\n\t\t...site.source.at(site.span)\n\t};\n}\nfunction atField(field, code, message) {\n\treturn {\n\t\tcode,\n\t\tmessage,\n\t\t...field.source.at(field.symbol.span)\n\t};\n}\nfunction atFieldCall(field, code, message) {\n\treturn {\n\t\tcode,\n\t\tmessage,\n\t\t...field.source.at(field.symbol.typeConstructor?.span ?? field.symbol.span)\n\t};\n}\nfunction generatedListDiagnostic(field, label) {\n\tconst perElement = \"Lists have no per-element generated values;\";\n\tconst phase = field.generatorAttributes.onCreate !== void 0 ? \"onCreate\" : \"onUpdate\";\n\tconst attribute = field.generatorAttributes[phase];\n\tif (attribute !== void 0) return {\n\t\tcode: \"PSL_LIST_EXECUTION_DEFAULT_UNSUPPORTED\",\n\t\tmessage: `${label} is a list and cannot use @${phase}(${attribute.argument}). ${perElement} remove @${phase}(...).`,\n\t\t...field.source.at(attribute.span)\n\t};\n\treturn atField(field, \"PSL_LIST_EXECUTION_DEFAULT_UNSUPPORTED\", `${label} is a list, and its type alias \"${field.typeAlias?.name}\" generates a value. ${perElement} remove \"[]\" or type the field without the alias.`);\n}\nfunction generatedOnValueObjectDiagnostic(field, owner) {\n\tconst fieldName = field.symbol.name;\n\treturn atField(field, \"PSL_UNSUPPORTED_FIELD_TYPE\", `Member \"${fieldName}\" of composite type \"${owner}\" is typed by the type alias \"${field.typeAlias?.name}\", which generates a value; a composite type member has no generated values.`);\n}\nfunction relationNullabilityDiagnostic(field, model, ownsForeignKey) {\n\tconst fieldLabel = `Relation field \"${model}.${field.symbol.name}\"`;\n\tif (!ownsForeignKey) return atField(field, \"PSL_REQUIRED_ONE_TO_ONE_BACKRELATION\", `${fieldLabel} is required, but the other model holds the relation fields, so nothing in storage guarantees the related document exists. Make it optional with \"?\".`);\n\treturn atField(field, \"PSL_RELATION_NULLABILITY_MISMATCH\", field.symbol.optional ? `${fieldLabel} is optional but every field in @relation(fields: [...]) is required. Make one of those fields optional with \"?\" or remove \"?\" from \"${field.symbol.name}\".` : `${fieldLabel} is required but a field in @relation(fields: [...]) is optional. Add \"?\" to \"${field.symbol.name}\" or make those fields required.`);\n}\nconst INDEX_SHAPE_MESSAGES = {\n\t\"unique-wildcard\": () => \"Unique indexes cannot use wildcard() fields\",\n\t\"hashed-several-fields\": () => \"Hashed indexes must have exactly one field\",\n\t\"ttl-with-wildcard\": () => \"expireAfterSeconds cannot be combined with wildcard() fields\",\n\t\"projection-without-wildcard\": () => \"include/exclude options are only valid when the index contains a wildcard() field\",\n\t\"collation-without-locale\": () => \"collationLocale is required when using collation options\",\n\t\"second-text-index\": (model) => `Only one @@textIndex is allowed per collection (model \"${model}\")`\n};\nfunction validatorDiagnostic(refusal, sites) {\n\tswitch (refusal.kind) {\n\t\tcase \"enumBsonType\":\n\t\tcase \"enumNotListable\":\n\t\tcase \"enumMemberNotListable\": {\n\t\t\tconst site = sites.enums.get(refusal.enumName);\n\t\t\tif (site === void 0) throw new InternalError(`Enum \"${refusal.enumName}\" has a site.`);\n\t\t\tconst subject = `enum \"${refusal.enumName}\"`;\n\t\t\tconst base = {\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tsourceId: site.block.sourceId\n\t\t\t};\n\t\t\tif (refusal.kind === \"enumBsonType\") return {\n\t\t\t\t...base,\n\t\t\t\tmessage: `${subject} ${refusal.refusal.reason}`,\n\t\t\t\tspan: site.codecSpan\n\t\t\t};\n\t\t\tif (refusal.kind === \"enumNotListable\") return {\n\t\t\t\t...base,\n\t\t\t\tmessage: `${subject} @@type codec \"${refusal.codecId}\" ${refusal.reason}`,\n\t\t\t\tspan: site.codecSpan\n\t\t\t};\n\t\t\treturn {\n\t\t\t\t...base,\n\t\t\t\tmessage: `${subject} member \"${refusal.member}\" ${refusal.reason}`,\n\t\t\t\tspan: site.block.memberSpans[refusal.member] ?? site.codecSpan\n\t\t\t};\n\t\t}\n\t\tcase \"fieldBsonType\":\n\t\tcase \"documentId\": {\n\t\t\tconst owner = refusal.kind === \"fieldBsonType\" ? refusal.owner.name : refusal.modelName;\n\t\t\tconst field = fieldSiteOf(sites, {\n\t\t\t\tkind: \"field\",\n\t\t\t\towner: {\n\t\t\t\t\tkind: \"model\",\n\t\t\t\t\tname: owner\n\t\t\t\t},\n\t\t\t\tfield: refusal.fieldName\n\t\t\t});\n\t\t\treturn atField(field, refusal.kind === \"fieldBsonType\" ? \"PSL_UNSUPPORTED_FIELD_TYPE\" : \"PSL_MONGO_ID_INVALID\", `Field \"${owner}.${field.symbol.name}\" ${refusal.kind === \"fieldBsonType\" ? refusal.refusal.reason : refusal.reason}`);\n\t\t}\n\t\tcase \"embeddedModelHasVariants\": throw new InternalError(\"A PSL schema writes no embed relations.\");\n\t}\n}\n/**\n* The diagnostic for one refusal of the builder, at the place in the schema it is about, worded as PSL words it. A source position comes from the refusal's key.\n*/\nfunction refusalDiagnostic(refusal, sites) {\n\tswitch (refusal.kind) {\n\t\tcase \"storedNameUnsupported\": return atField(fieldSiteOf(sites, refusal.key), \"PSL_STORED_NAME_UNSUPPORTED\", `Field \"${refusal.key.owner.name}.${refusal.key.field}\" ${refusal.reason}. Give the field another stored name with @map.`);\n\t\tcase \"storedNameDuplicate\": {\n\t\t\tconst model = refusal.key.owner.name;\n\t\t\treturn atField(fieldSiteOf(sites, refusal.key), \"PSL_DUPLICATE_STORED_NAME\", `Fields \"${model}.${refusal.firstField}\" and \"${model}.${refusal.key.field}\" are both stored as \"${refusal.storedName}\". Give each field its own stored name with @map.`);\n\t\t}\n\t\tcase \"restatedBaseFieldDiffers\": return atField(fieldSiteOf(sites, refusal.key), \"PSL_VARIANT_FIELD_DIFFERS_FROM_BASE\", `Field \"${refusal.key.owner.name}.${refusal.key.field}\" restates field \"${refusal.key.field}\" of base model \"${refusal.baseModel}\" with a different ${refusal.differences.map(differenceWording).join(\" and \")}. A variant's documents are checked against the base's field, so declare it exactly as the base does, or remove it from the variant.`);\n\t\tcase \"storedNameSharedWithBase\": return atField(fieldSiteOf(sites, refusal.key), \"PSL_DUPLICATE_STORED_NAME\", `Fields \"${refusal.baseModel}.${refusal.baseField}\" and \"${refusal.key.owner.name}.${refusal.key.field}\" are both stored as \"${refusal.storedName}\", and a variant's documents hold its base's fields too. Give each field its own stored name with @map.`);\n\t\tcase \"valueObjectFieldStoredName\": {\n\t\t\tconst field = fieldSiteOf(sites, refusal.key);\n\t\t\treturn at(field.map ?? {\n\t\t\t\tsource: field.source,\n\t\t\t\tspan: field.symbol.span\n\t\t\t}, \"PSL_MONGO_TYPE_FIELD_MAP_UNSUPPORTED\", `Field \"${refusal.key.owner.name}.${refusal.key.field}\" has @map, but a field of a composite type is stored under its own name. Remove @map, or rename the field to the name it is stored under.`);\n\t\t}\n\t\tcase \"relationLocalFieldUnknown\": {\n\t\t\tconst { model, relation } = refusal.key;\n\t\t\treturn atField(fieldSiteOf(sites, {\n\t\t\t\tkind: \"field\",\n\t\t\t\towner: {\n\t\t\t\t\tkind: \"model\",\n\t\t\t\t\tname: model\n\t\t\t\t},\n\t\t\t\tfield: relation\n\t\t\t}), \"PSL_INVALID_ATTRIBUTE_ARGUMENT\", `Relation field \"${model}.${relation}\" joins on field \"${refusal.fieldName}\", which model \"${model}\" does not declare`);\n\t\t}\n\t\tcase \"relationNullability\": {\n\t\t\tconst { model, relation } = refusal.key;\n\t\t\treturn relationNullabilityDiagnostic(fieldSiteOf(sites, {\n\t\t\t\tkind: \"field\",\n\t\t\t\towner: {\n\t\t\t\t\tkind: \"model\",\n\t\t\t\t\tname: model\n\t\t\t\t},\n\t\t\t\tfield: relation\n\t\t\t}), model, refusal.ownsForeignKey);\n\t\t}\n\t\tcase \"variantCollectionDiffers\": {\n\t\t\tconst base = modelSitesOf(sites, refusal.key.model).base;\n\t\t\tif (base === void 0) throw new InternalError(\"A variant has a @@base site.\");\n\t\t\treturn at(base, \"PSL_MONGO_VARIANT_SEPARATE_COLLECTION\", `Mongo variant \"${refusal.key.model}\" cannot use a different collection than its base \"${refusal.baseModel}\". Mongo only supports single-collection polymorphism.`);\n\t\t}\n\t\tcase \"indexFieldUnknown\":\n\t\tcase \"indexShape\":\n\t\tcase \"indexScopeConflict\":\n\t\tcase \"indexDuplicate\": {\n\t\t\tconst { model, position } = refusal.key;\n\t\t\tconst site = modelSitesOf(sites, model).indexes[position];\n\t\t\tif (site === void 0) throw new InternalError(`Index ${position} of \"${model}\" has a site.`);\n\t\t\tswitch (refusal.kind) {\n\t\t\t\tcase \"indexFieldUnknown\": return at(site, \"PSL_INDEX_FIELD_NOT_FOUND\", `Index on model \"${model}\" references unknown field \"${refusal.fieldName}\"`);\n\t\t\t\tcase \"indexShape\": return at(site, \"PSL_INVALID_INDEX\", refusal.rule === \"wildcard-with-type\" ? `wildcard() fields cannot be combined with type: ${wildcardTypeOf(site.index)}` : INDEX_SHAPE_MESSAGES[refusal.rule](model));\n\t\t\t\tcase \"indexScopeConflict\": return at(site, \"PSL_INVALID_INDEX\", `Variant \"${model}\" index conflicts with discriminator scope: ${refusal.reason}`);\n\t\t\t\tcase \"indexDuplicate\": return at(site, \"PSL_INVALID_INDEX\", `${site.label} has the same keys and options as ${indexSiteOf(sites, refusal.firstModel, refusal.firstPosition).label}, in collection \"${refusal.collection}\", but another name. MongoDB cannot hold both. Remove one of them, or give them the same \\`map\\`.`);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"indexNameDuplicate\": {\n\t\t\tconst { model, position } = refusal.key;\n\t\t\tconst site = modelSitesOf(sites, model).indexes[position];\n\t\t\tif (site === void 0) throw new InternalError(`Index ${position} of \"${model}\" has a site.`);\n\t\t\treturn at(site, \"PSL_INVALID_INDEX\", `${site.label} is named \"${refusal.name}\", as is ${indexSiteOf(sites, refusal.firstModel, refusal.firstPosition).label}, in collection \"${refusal.collection}\". An index without \\`map\\` is named after its keys and directions. Give one of them another name with \\`map\\`.`);\n\t\t}\n\t\tcase \"generatedOnValueObject\": return generatedOnValueObjectDiagnostic(fieldSiteOf(sites, refusal.key), refusal.key.owner.name);\n\t\tcase \"generatorPhaseSetTwice\": throw new InternalError(`Field \"${refusal.key.owner.name}.${refusal.key.field}\" sets a phase twice, which PSL refuses as a repeated type alias attribute before building.`);\n\t\tcase \"generatedList\": return generatedListDiagnostic(fieldSiteOf(sites, refusal.key), `Field \"${refusal.key.owner.name}.${refusal.key.field}\"`);\n\t\tcase \"generatedOnVariant\": return atField(fieldSiteOf(sites, refusal.key), \"PSL_GENERATOR_ON_VARIANT_FIELD\", `Generated value on variant \"${refusal.key.owner.name}\" field \"${refusal.key.field}\": execution defaults apply to every document in collection \"${refusal.collection}\", so declare them on the base model.`);\n\t\tcase \"generatedConflict\": {\n\t\t\tconst field = fieldSiteOf(sites, refusal.key);\n\t\t\treturn atField(field, \"PSL_GENERATOR_CONFLICT\", `Generated value on \"${refusal.key.owner.name}.${refusal.key.field}\" sets different execution defaults than \"${refusal.otherModel}.${refusal.otherField}\" for field \"${field.storedName}\" of collection \"${refusal.collection}\". Generate the same values on both models.`);\n\t\t}\n\t\tcase \"typeParamsInvalid\": return atFieldCall(fieldSiteOf(sites, refusal.key), \"PSL_INVALID_ATTRIBUTE_ARGUMENT\", `${`Field \"${refusal.key.owner.name}.${refusal.key.field}\"`} has type parameters its type refuses: ${refusal.problem.message}`);\n\t\tcase \"enumMemberProblem\": {\n\t\t\tconst site = sites.enums.get(refusal.enumName);\n\t\t\tif (site === void 0) throw new InternalError(`Enum \"${refusal.enumName}\" has a site.`);\n\t\t\treturn enumMemberProblemDiagnostic(refusal.problem, site.block);\n\t\t}\n\t\tcase \"enumUnknown\": return atField(fieldSiteOf(sites, refusal.key), \"PSL_UNRESOLVED_REFERENCE\", `Field \"${refusal.key.owner.name}.${refusal.key.field}\" is typed by enum \"${refusal.enumName}\", which the schema does not declare`);\n\t\tcase \"discriminatorValueDuplicate\": {\n\t\t\tconst base = modelSitesOf(sites, refusal.key.variant).base;\n\t\t\tif (base === void 0) throw new InternalError(\"A variant has a @@base site.\");\n\t\t\treturn at(base, \"PSL_DUPLICATE_DISCRIMINATOR_VALUE\", `Discriminator value \"${refusal.value}\" is used by both \"${refusal.firstVariant}\" and \"${refusal.key.variant}\" on base model \"${refusal.baseModel}\"`);\n\t\t}\n\t\tcase \"discriminatorFieldUnknown\":\n\t\tcase \"discriminatorField\":\n\t\tcase \"discriminatorAndBase\":\n\t\tcase \"discriminatorWithoutVariants\": {\n\t\t\tconst model = refusal.key.model;\n\t\t\tconst site = modelSitesOf(sites, model).discriminator;\n\t\t\tif (site === void 0) throw new InternalError(\"A base has a @@discriminator site.\");\n\t\t\tswitch (refusal.kind) {\n\t\t\t\tcase \"discriminatorFieldUnknown\": return at(site, \"PSL_DISCRIMINATOR_FIELD_NOT_FOUND\", `Discriminator field \"${refusal.fieldName}\" is not a field on model \"${model}\"`);\n\t\t\t\tcase \"discriminatorField\": return at(site, \"PSL_INVALID_ATTRIBUTE_ARGUMENT\", describeDiscriminatorRefusal(refusal.refusal, {\n\t\t\t\t\tmodelName: model,\n\t\t\t\t\tfieldName: refusal.fieldName,\n\t\t\t\t\ttypeName: discriminatorTypeName(sites, model, refusal.fieldName),\n\t\t\t\t\tenumName: void 0,\n\t\t\t\t\tvariantName: () => model\n\t\t\t\t}));\n\t\t\t\tcase \"discriminatorAndBase\": return at(site, \"PSL_DISCRIMINATOR_AND_BASE\", `Model \"${model}\" cannot have both @@discriminator and @@base`);\n\t\t\t\tcase \"discriminatorWithoutVariants\": return at(site, \"PSL_ORPHANED_DISCRIMINATOR\", `Model \"${model}\" has @@discriminator but no variant models declare @@base(${model}, ...)`);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"discriminatorValue\": {\n\t\t\tconst base = modelSitesOf(sites, refusal.key.variant).base;\n\t\t\tif (base === void 0) throw new InternalError(\"A variant has a @@base site.\");\n\t\t\tconst valueSite = {\n\t\t\t\tsource: base.source,\n\t\t\t\tspan: base.valueSpan\n\t\t\t};\n\t\t\tif (refusal.refusal.kind === \"unreadable\") return {\n\t\t\t\t...refusal.refusal.refusal,\n\t\t\t\t...valueSite.source.at(valueSite.span)\n\t\t\t};\n\t\t\treturn at(valueSite, \"PSL_INVALID_ATTRIBUTE_ARGUMENT\", describeDiscriminatorRefusal(refusal.refusal, {\n\t\t\t\tmodelName: refusal.baseModel,\n\t\t\t\tfieldName: refusal.fieldName,\n\t\t\t\ttypeName: discriminatorTypeName(sites, refusal.baseModel, refusal.fieldName),\n\t\t\t\tenumName: refusal.enumName,\n\t\t\t\tvariantName: (variant) => variant\n\t\t\t}));\n\t\t}\n\t\tcase \"baseWithoutDiscriminator\": {\n\t\t\tconst base = modelSitesOf(sites, refusal.key.variant).base;\n\t\t\tif (base === void 0) throw new InternalError(\"A variant has a @@base site.\");\n\t\t\treturn at(base, \"PSL_ORPHANED_BASE\", `Model \"${refusal.key.variant}\" declares @@base(${refusal.baseModel}, ...) but \"${refusal.baseModel}\" has no @@discriminator`);\n\t\t}\n\t\tcase \"validator\": return validatorDiagnostic(refusal.refusal, sites);\n\t\tcase \"duplicateModel\":\n\t\tcase \"duplicateValueObject\":\n\t\tcase \"collectionSettingWithoutCollection\":\n\t\tcase \"collectionSettingTwice\":\n\t\tcase \"generatorUnknown\":\n\t\tcase \"generatorNotApplicable\":\n\t\tcase \"generatedWithoutCollection\":\n\t\tcase \"enumKeyMismatch\":\n\t\tcase \"listedVariantMissing\":\n\t\tcase \"baseUnknown\":\n\t\tcase \"variantWithoutValue\": throw new InternalError(`A PSL definition cannot be refused with \"${refusal.kind}\".`);\n\t}\n}\n/** The key type a wildcard index combines with. */\nfunction wildcardTypeOf(index) {\n\treturn (Object.values(index.fields).find((direction) => direction === \"hashed\" || direction === \"2d\" || direction === \"2dsphere\") ?? \"hashed\").toString();\n}\nfunction discriminatorTypeName(sites, model, fieldName) {\n\treturn sites.fields.get(fieldSiteKey(model, fieldName))?.symbol.typeName ?? fieldName;\n}\nfunction differenceWording(difference) {\n\tswitch (difference) {\n\t\tcase \"storedName\": return \"@map\";\n\t\tcase \"type\": return \"type\";\n\t\tcase \"nullable\": return \"optionality\";\n\t\tcase \"many\": return \"list shape\";\n\t}\n}\n//#endregion\n//#region src/type-aliases.ts\n/** The field type a use of a type choice gives: the column of the constructor its call chooses, read and refused as a SQL column's is. `undefined`, with a diagnostic pushed, when the call is refused. */\nfunction scalarTypeOfChoice(input) {\n\tconst output = instantiatePslTypeChoice(input);\n\treturn output === void 0 ? void 0 : {\n\t\tkind: \"scalar\",\n\t\tcodecId: output.codecId,\n\t\t...ifDefined(\"typeParams\", output.typeParams)\n\t};\n}\n/** The field type a use of a type constructor gives: a bare use keeps the constructor's fixed type params, and a call's arguments are read as the constructor declares them and checked by its codec. `undefined`, with a diagnostic pushed, when the call is refused. */\nfunction scalarTypeOfConstructor(input) {\n\tconst { descriptor, call } = input;\n\tif (call === void 0) {\n\t\tconst { codecId, typeParams } = instantiateAuthoringTypeConstructor(descriptor, []);\n\t\treturn {\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId,\n\t\t\t...ifDefined(\"typeParams\", typeParams)\n\t\t};\n\t}\n\tconst helperPath = call.path.join(\".\");\n\tconst subject = `${input.entityLabel} type \"${helperPath}\"`;\n\tconst refuse = (message, argumentIndex) => {\n\t\tinput.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\tmessage: `${subject}: ${message}`,\n\t\t\t...input.source.at(argumentSpan(call, descriptor.args, argumentIndex))\n\t\t});\n\t};\n\tconst args = mapPslHelperArgs({\n\t\targs: call.args,\n\t\tdescriptors: descriptor.args ?? [],\n\t\thelperLabel: `type \"${helperPath}\"`,\n\t\tspan: call.span,\n\t\tdiagnostics: input.diagnostics,\n\t\tsource: input.source,\n\t\tentityLabel: input.entityLabel,\n\t\tdataTypes: input.dataTypes\n\t});\n\tif (!args) return void 0;\n\ttry {\n\t\tvalidateAuthoringHelperArguments(helperPath, descriptor.args, args);\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn refuse(error instanceof Error ? error.message : String(error), argumentIndexOf(error));\n\t}\n\tconst output = instantiateAuthoringTypeConstructorFromValues(descriptor, args, input.codecLookup.descriptorFor(descriptor.output.codecId)?.paramsSchema);\n\tif (!output.ok) return refuse(output.failure.message, output.failure.argumentIndex);\n\tconst { codecId, typeParams } = output.value;\n\treturn {\n\t\tkind: \"scalar\",\n\t\tcodecId,\n\t\t...ifDefined(\"typeParams\", typeParams)\n\t};\n}\nconst GENERATOR_PHASES$1 = [\"onCreate\", \"onUpdate\"];\nconst MONGO_TYPE_ALIAS_ATTRIBUTE_NAMES = new Set(GENERATOR_PHASES$1);\nfunction describeUnsupportedMongoAliasAttribute(attribute, declaration) {\n\tif (attribute.name !== \"default\") return void 0;\n\tconst base = `Type alias \"${declaration.name}\" uses unsupported attribute \"@default\"`;\n\tconst hint = unloweredAttributeHint(attribute);\n\treturn hint === void 0 ? base : `${base}. ${hint}`;\n}\n/**\n* The generator a field's or type alias's `@onCreate(fn())` or `@onUpdate(fn())` resolves to for its type, or `undefined` once the attribute is diagnosed.\n*/\nfunction lowerGeneratorAttribute(input) {\n\tconst interpreted = interpretAttribute(input.attribute.node, typeGeneratorAttributeSpec(input.phase, input.specContext), {\n\t\tsources: input.sources,\n\t\tsymbols: input.symbols,\n\t\tbinder: input.binder\n\t});\n\tif (!interpreted.ok) {\n\t\tinput.diagnostics.push(...interpreted.failure);\n\t\treturn;\n\t}\n\tconst call = interpreted.value.value;\n\tconst { type } = input;\n\tconst resolution = type.kind === \"scalar\" ? input.generatorFunctions.resolve({\n\t\tname: call.fn,\n\t\targs: call.args\n\t}, {\n\t\tcodecId: type.codecId,\n\t\ttypeParams: type.typeParams,\n\t\tlength: void 0\n\t}) : void 0;\n\tif (resolution?.ok === true) return resolution.generator;\n\tconst label = typeAttributeSubjectLabel(input.specContext.subject);\n\tinput.diagnostics.push({\n\t\tcode: \"PSL_GENERATOR_NOT_APPLICABLE\",\n\t\tmessage: resolution?.reason === \"refused\" ? `${label}: ${resolution.message}` : `${label}: ${call.fn}() does not apply to this field's type.`,\n\t\t...diagnosticSource(input.sources, input.attribute.node.syntax).at(call.span)\n\t});\n}\nfunction aliasType(alias, input) {\n\tconst { base, symbol } = alias;\n\tif (base.kind === \"typeConstructor\") {\n\t\tconst type = scalarTypeOfConstructor({\n\t\t\tdescriptor: base.descriptor,\n\t\t\tcall: base.call,\n\t\t\tcodecLookup: input.codecLookup,\n\t\t\tdiagnostics: input.diagnostics,\n\t\t\tsource: diagnosticSource(input.sources, symbol.node.syntax),\n\t\t\tentityLabel: `Type alias \"${symbol.name}\"`,\n\t\t\tdataTypes: input.dataTypes\n\t\t});\n\t\treturn type === void 0 ? void 0 : {\n\t\t\ttype,\n\t\t\tvalueSet: void 0\n\t\t};\n\t}\n\tif (base.kind === \"typeChoice\") {\n\t\tconst type = scalarTypeOfChoice({\n\t\t\tsymbol: base.symbol,\n\t\t\tcall: base.call,\n\t\t\tspan: symbol.span,\n\t\t\tcodecLookup: input.codecLookup,\n\t\t\tdiagnostics: input.diagnostics,\n\t\t\tsource: diagnosticSource(input.sources, symbol.node.syntax),\n\t\t\tentityLabel: `Type alias \"${symbol.name}\"`,\n\t\t\tdataTypes: input.dataTypes\n\t\t});\n\t\treturn type === void 0 ? void 0 : {\n\t\t\ttype,\n\t\t\tvalueSet: void 0\n\t\t};\n\t}\n\tif (base.symbol.keyword !== \"enum\") {\n\t\tinput.diagnostics.push({\n\t\t\tcode: \"PSL_UNSUPPORTED_NAMED_TYPE_BASE\",\n\t\t\tmessage: `Type alias \"${symbol.name}\" references unsupported base type \"${alias.baseName}\"`,\n\t\t\t...diagnosticSource(input.sources, symbol.node.syntax).at(symbol.span)\n\t\t});\n\t\treturn;\n\t}\n\tconst codecId = input.codecIdByEnumName.get(base.symbol.name);\n\tif (codecId === void 0 || alias.baseResolution.kind !== \"block\") return void 0;\n\treturn {\n\t\ttype: {\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId\n\t\t},\n\t\tvalueSet: {\n\t\t\tplane: \"domain\",\n\t\t\tentityKind: \"enum\",\n\t\t\tnamespaceId: alias.baseResolution.namespace.id,\n\t\t\tentityName: base.symbol.name\n\t\t}\n\t};\n}\nfunction lowerAliasGenerators(alias, type, input) {\n\tconst specContext = typeAliasSpecContext(alias, input);\n\tconst phases = {};\n\tfor (const phase of GENERATOR_PHASES$1) {\n\t\tconst [attribute, duplicate] = alias.attributes.filter(({ name }) => name === phase);\n\t\tif (attribute === void 0) continue;\n\t\tif (duplicate !== void 0) {\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: \"PSL_DUPLICATE_ATTRIBUTE\",\n\t\t\t\tmessage: `\\`@${phase}\\` declared more than once on type alias \"${alias.symbol.name}\".`,\n\t\t\t\t...diagnosticSource(input.sources, duplicate.node.syntax).at(duplicate.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst generator = lowerGeneratorAttribute({\n\t\t\t...input,\n\t\t\tphase,\n\t\t\tattribute,\n\t\t\tspecContext,\n\t\t\ttype\n\t\t});\n\t\tif (generator !== void 0) phases[phase] = generator;\n\t}\n\treturn phases.onCreate === void 0 && phases.onUpdate === void 0 ? void 0 : phases;\n}\nfunction resolveContributedTypeAlias(alias, generatorFunctions) {\n\tconst { type } = instantiateAuthoringTypeAlias(alias.descriptor);\n\treturn {\n\t\talias,\n\t\tname: alias.name,\n\t\ttype: {\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId: type.codecId,\n\t\t\t...ifDefined(\"typeParams\", type.typeParams)\n\t\t},\n\t\tvalueSet: void 0,\n\t\texecutionDefaults: resolveTypeAliasGenerators({\n\t\t\tpath: alias.name,\n\t\t\tdescriptor: alias.descriptor,\n\t\t\tgeneratorFunctions,\n\t\t\tlength: void 0\n\t\t})\n\t};\n}\n/**\n* Resolves each `types {}` alias once: its field type and the values its `@onCreate` and `@onUpdate` generate. MongoDB has no database defaults, so an alias's `@default` is refused here, once, not at each field typed by it.\n*/\nfunction resolveMongoTypeAliases(input) {\n\tconst declared = /* @__PURE__ */ new Map();\n\tconst aliases = resolveTypeAliases({\n\t\tdeclarations: input.declarations,\n\t\tbinder: input.binder,\n\t\tsources: input.sources,\n\t\tdiagnostics: input.diagnostics,\n\t\tauthoringTypes: input.authoringTypes,\n\t\tacceptedAttributes: MONGO_TYPE_ALIAS_ATTRIBUTE_NAMES,\n\t\tdescribeUnsupportedAttribute: describeUnsupportedMongoAliasAttribute\n\t});\n\tfor (const alias of aliases.values()) {\n\t\tconst resolved = aliasType(alias, input);\n\t\tif (resolved === void 0) continue;\n\t\tdeclared.set(alias.symbol, {\n\t\t\talias,\n\t\t\tname: alias.symbol.name,\n\t\t\t...resolved,\n\t\t\texecutionDefaults: lowerAliasGenerators(alias, resolved.type, input)\n\t\t});\n\t}\n\tconst contributed = /* @__PURE__ */ new Map();\n\treturn { ofResolution(resolution) {\n\t\tif (resolution?.kind === \"namedType\") return declared.get(resolution.symbol);\n\t\tconst alias = contributedTypeAliasOf(resolution);\n\t\tif (alias === void 0) return void 0;\n\t\tconst existing = contributed.get(alias.descriptor);\n\t\tif (existing !== void 0) return existing;\n\t\tconst resolved = resolveContributedTypeAlias(alias, input.generatorFunctions);\n\t\tcontributed.set(alias.descriptor, resolved);\n\t\treturn resolved;\n\t} };\n}\n//#endregion\n//#region src/interpreter.ts\n/**\n* Reports `PSL_DEPRECATED_SCALAR_NAME` at the type of a field whose scalar name is a deprecated alias, naming the replacement. The alias resolves to the same codec, so the contract does not change.\n*/\nfunction deprecatedScalarWarner(input) {\n\tconst { reportWarning } = input;\n\tif (reportWarning === void 0) return () => {};\n\treturn (field, descriptor) => {\n\t\tif (descriptor.deprecated === void 0) return;\n\t\tconst typeNode = field.node.typeAnnotation()?.name()?.syntax ?? field.node.syntax;\n\t\tconst [warning] = mapPslDiagnostics([{\n\t\t\tcode: \"PSL_DEPRECATED_SCALAR_NAME\",\n\t\t\tmessage: `Scalar type \"${field.typeName}\" is deprecated and will be removed; use \"${descriptor.deprecated.replacement}\".`,\n\t\t\t...diagnosticSource(input.sources, typeNode).at()\n\t\t}], input.sources);\n\t\tif (warning !== void 0) reportWarning({\n\t\t\t...warning,\n\t\t\tseverity: \"warning\"\n\t\t});\n\t};\n}\n/**\n* Mongo's PSL surface binds the database from the connection string, so every\n* explicit namespace block is invalid, including `namespace unbound { … }`.\n*/\nfunction validateNamespaceBlocksForMongoTarget(input) {\n\tfor (const namespace of input.namespaces) for (const { node, span } of namespace.declarations) input.diagnostics.push({\n\t\tcode: \"PSL_UNSUPPORTED_NAMESPACE_BLOCK\",\n\t\tmessage: `Mongo does not support \\`namespace ${node.name()?.name() ?? namespace.name} { … }\\` blocks (the database is bound by the connection string; declare models at the document top level instead).`,\n\t\t...diagnosticSource(input.sources, node.syntax).at(span)\n\t});\n}\nfunction resolvePhysicalNames(input) {\n\tconst { model, physicalNames, specContext, sources, binder, diagnostics } = input;\n\tconst modelMap = model.attributes.find((attr) => attr.name === \"map\");\n\tconst collectionName = modelMap ? interpretModelAttribute({\n\t\tsymbols: specContext.symbols,\n\t\tnode: modelMap.node,\n\t\tspec: mongoAttributeSpecs.model.map(specContext),\n\t\tmodel,\n\t\tsources,\n\t\tbinder,\n\t\tdiagnostics\n\t})?.name : void 0;\n\tphysicalNames.set(model, collectionName ?? defaultCollectionName(model.name));\n\tfor (const field of Object.values(model.fields)) {\n\t\tconst fieldMap = field.attributes.find((attr) => attr.name === \"map\");\n\t\tconst mapped = fieldMap ? interpretFieldAttribute({\n\t\t\tsymbols: specContext.symbols,\n\t\t\tnode: fieldMap.node,\n\t\t\tspec: mongoAttributeSpecs.field.map({\n\t\t\t\t...specContext,\n\t\t\t\tfield,\n\t\t\t\ttypeResolution: fieldTypeResolution(field, binder),\n\t\t\t\tcontributedType: contributedTypeOf(fieldTypeResolution(field, binder), binder, field.typeConstructor)\n\t\t\t}),\n\t\t\tmodel,\n\t\t\tfield,\n\t\t\tsources,\n\t\t\tbinder,\n\t\t\tdiagnostics\n\t\t})?.name : void 0;\n\t\tphysicalNames.set(field, mapped ?? field.name);\n\t}\n}\nfunction physicalName(physicalNames, symbol) {\n\tassertDefined(symbol, \"Physical names require a bound declaration\");\n\tconst name = physicalNames.get(symbol);\n\tassertDefined(name, \"Physical names must be populated before lowering\");\n\treturn name;\n}\n/** A `@@base` value as it is written; the grammar reads only a quoted string there. */\nfunction writtenBaseValue(written) {\n\tif (written.written === void 0) throw new InternalError(\"A @@base value is a quoted string, never a tagged literal.\");\n\treturn written.written;\n}\nfunction collectPolymorphismDeclarations(input) {\n\tconst { sources, binder, diagnostics } = input;\n\tconst discriminators = /* @__PURE__ */ new Map();\n\tconst bases = /* @__PURE__ */ new Map();\n\tconst reported = {\n\t\tdiscriminators: /* @__PURE__ */ new Set(),\n\t\tbaseTargets: /* @__PURE__ */ new Set()\n\t};\n\tfor (const model of input.models) {\n\t\tconst specContext = input.specContextFor(model);\n\t\tconst discNode = model.attributes.find((attr) => attr.name === \"discriminator\")?.node;\n\t\tif (discNode) {\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\tnode: discNode,\n\t\t\t\tspec: mongoAttributeSpecs.model.discriminator(specContext),\n\t\t\t\tmodel,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed) discriminators.set(model, {\n\t\t\t\tfieldName: parsed.field,\n\t\t\t\tsource: diagnosticSource(sources, discNode.syntax),\n\t\t\t\tspan: nodePslSpan(discNode.syntax, sources)\n\t\t\t});\n\t\t\telse reported.discriminators.add(model.name);\n\t\t}\n\t\tconst baseAttribute = model.attributes.find((attr) => attr.name === \"base\");\n\t\tconst baseNode = baseAttribute?.node;\n\t\tif (baseNode) {\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\tnode: baseNode,\n\t\t\t\tspec: mongoAttributeSpecs.model.base(),\n\t\t\t\tmodel,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed) bases.set(model, {\n\t\t\t\tbase: parsed.base.declaration,\n\t\t\t\twritten: writtenBaseValue(parsed.value),\n\t\t\t\tvalueSpan: parsed.value.span,\n\t\t\t\tsource: diagnosticSource(sources, baseNode.syntax),\n\t\t\t\tspan: nodePslSpan(baseNode.syntax, sources)\n\t\t\t});\n\t\t\telse {\n\t\t\t\tconst target = baseAttribute?.args[0]?.value;\n\t\t\t\tif (target !== void 0) reported.baseTargets.add(target);\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tdiscriminators,\n\t\tbases,\n\t\treported\n\t};\n}\nfunction normalizeIndexField(element) {\n\tif (typeof element === \"string\") return {\n\t\tkind: \"field\",\n\t\tname: element\n\t};\n\tif (element.fn === \"wildcard\") {\n\t\tconst scope = element.args[\"scope\"];\n\t\treturn typeof scope === \"string\" ? {\n\t\t\tkind: \"wildcard\",\n\t\t\tscope\n\t\t} : { kind: \"wildcard\" };\n\t}\n\tconst field = element.args[\"field\"];\n\tinvariant(typeof field === \"string\", \"The sort function spec requires a field reference\");\n\treturn {\n\t\tkind: \"field\",\n\t\tname: field,\n\t\tdirection: element.args[\"direction\"] === \"Desc\" ? -1 : 1\n\t};\n}\n/** The collation the index arguments name, or undefined when they name none. A collation without `collationLocale` is passed on for the builder to refuse. */\nfunction buildCollationFromSpec(args) {\n\tconst collation = {\n\t\t...ifDefined(\"locale\", args.collationLocale),\n\t\t...ifDefined(\"strength\", args.collationStrength),\n\t\t...ifDefined(\"caseLevel\", args.collationCaseLevel),\n\t\t...ifDefined(\"caseFirst\", args.collationCaseFirst),\n\t\t...ifDefined(\"numericOrdering\", args.collationNumericOrdering),\n\t\t...ifDefined(\"alternate\", args.collationAlternate),\n\t\t...ifDefined(\"maxVariable\", args.collationMaxVariable),\n\t\t...ifDefined(\"backwards\", args.collationBackwards),\n\t\t...ifDefined(\"normalization\", args.collationNormalization)\n\t};\n\treturn Object.keys(collation).length === 0 ? void 0 : collation;\n}\n/** The index keys by field name, as the builder takes them: a wildcard is `$**` or `<field>.$**`. */\nfunction resolveIndexKeys(parsedFields, defaultDirection, ctx) {\n\tconst wildcardCount = parsedFields.filter((field) => field.kind === \"wildcard\").length;\n\tif (wildcardCount > 1) {\n\t\tctx.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\tmessage: \"An index can contain at most one wildcard() field\",\n\t\t\t...ctx.source.at(ctx.span)\n\t\t});\n\t\treturn;\n\t}\n\tconst fields = {};\n\tfor (const field of parsedFields) if (field.kind === \"wildcard\") fields[field.scope === void 0 ? \"$**\" : `${field.scope}.$**`] = defaultDirection;\n\telse fields[field.name] = field.direction ?? defaultDirection;\n\treturn {\n\t\tfields,\n\t\thasWildcard: wildcardCount === 1\n\t};\n}\nfunction buildProjection(include, exclude, hasWildcard, ctx) {\n\tif (include !== void 0 && exclude !== void 0) {\n\t\tctx.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\tmessage: \"Cannot specify both include and exclude on the same index\",\n\t\t\t...ctx.source.at(ctx.span)\n\t\t});\n\t\treturn null;\n\t}\n\tconst fields = include ?? exclude;\n\tif (fields === void 0 || fields.length === 0 && hasWildcard) return void 0;\n\tconst value = include === void 0 ? 0 : 1;\n\tconst projection = {};\n\tfor (const field of fields) projection[field] = value;\n\treturn projection;\n}\n/** Index options as the attribute specs read them, which are the values MongoDB takes. */\nfunction indexOptions(options) {\n\treturn blindCast(options);\n}\nfunction buildNormalIndex(parsed, unique, ctx) {\n\tconst parsedFields = parsed.fields.map(normalizeIndexField);\n\tif (parsedFields.length === 0) return void 0;\n\tconst resolved = resolveIndexKeys(parsedFields, parsed.type ?? 1, ctx);\n\tif (!resolved) return void 0;\n\tconst wildcardProjection = buildProjection(parsed.include, parsed.exclude, resolved.hasWildcard, ctx);\n\tif (wildcardProjection === null) return void 0;\n\tconst collation = buildCollationFromSpec(parsed);\n\treturn {\n\t\tfields: resolved.fields,\n\t\toptions: indexOptions({\n\t\t\t...ifDefined(\"name\", parsed.map),\n\t\t\t...unique && { unique: true },\n\t\t\t...ifDefined(\"sparse\", parsed.sparse),\n\t\t\t...ifDefined(\"expireAfterSeconds\", parsed.expireAfterSeconds),\n\t\t\t...ifDefined(\"partialFilterExpression\", parsed.filter),\n\t\t\t...ifDefined(\"wildcardProjection\", wildcardProjection),\n\t\t\t...ifDefined(\"collation\", collation),\n\t\t\t...ifDefined(\"default_language\", parsed.default_language),\n\t\t\t...ifDefined(\"language_override\", parsed.languageOverride)\n\t\t})\n\t};\n}\nfunction buildTextIndex(parsed, ctx) {\n\tconst parsedFields = parsed.fields.map(normalizeIndexField);\n\tif (parsedFields.length === 0) return void 0;\n\tconst resolved = resolveIndexKeys(parsedFields, \"text\", ctx);\n\tif (!resolved) return void 0;\n\tif (resolved.hasWildcard) {\n\t\tctx.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\tmessage: \"wildcard() fields cannot be combined with type: hashed/2dsphere/2d or @@textIndex\",\n\t\t\t...ctx.source.at(ctx.span)\n\t\t});\n\t\treturn;\n\t}\n\tconst collation = buildCollationFromSpec(parsed);\n\treturn {\n\t\tfields: resolved.fields,\n\t\toptions: indexOptions({\n\t\t\t...ifDefined(\"name\", parsed.map),\n\t\t\t...ifDefined(\"partialFilterExpression\", parsed.filter),\n\t\t\t...ifDefined(\"collation\", collation),\n\t\t\t...ifDefined(\"weights\", parsed.weights),\n\t\t\t...ifDefined(\"default_language\", parsed.language),\n\t\t\t...ifDefined(\"language_override\", parsed.languageOverride)\n\t\t})\n\t};\n}\nfunction nestedIndexPath(node) {\n\tfor (const arg of node.argList()?.args() ?? []) {\n\t\tconst name = arg.name()?.name();\n\t\tconst list = arg.value();\n\t\tif (name !== void 0 && name !== \"fields\" || !(list instanceof ArrayLiteralAst)) continue;\n\t\tfor (const element of list.elements()) {\n\t\t\tconst field = element instanceof FunctionCallAst && element.name()?.identifier()?.token()?.text === \"sort\" ? [...element.args()][0]?.value() : element;\n\t\t\tconst path = field instanceof PathExprAst ? field.path() : [];\n\t\t\tif (field instanceof PathExprAst && path.length > 1) return {\n\t\t\t\tpath,\n\t\t\t\tsyntax: field.syntax\n\t\t\t};\n\t\t}\n\t}\n}\nfunction nestedIndexPathMessage(path, pslModel, binder) {\n\tconst [root = \"\"] = path;\n\tconst label = `Index field \"${path.join(\".\")}\" on model \"${pslModel.name}\"`;\n\tconst rootField = Object.hasOwn(pslModel.fields, root) ? pslModel.fields[root] : void 0;\n\treturn rootField !== void 0 && fieldTypeResolution(rootField, binder)?.kind === \"compositeType\" ? `${label} is a path into a composite type; indexes on fields of a composite type are not supported yet. Index a top-level field of \"${pslModel.name}\" or remove the index.` : `${label} is a dotted path, but \"${root}\" is not a field of \"${pslModel.name}\" whose type is a composite type, so the path names no field. List fields of \"${pslModel.name}\" by name.`;\n}\n/**\n* A model's indexes as the schema writes them, with where each is written: a field's `@unique` first, then `@@index`, `@@unique` and `@@textIndex` in the order the model lists them.\n*/\nfunction collectIndexes(pslModel, specContext, sources, binder, diagnostics) {\n\tconst indexes = [];\n\tfor (const field of Object.values(pslModel.fields)) {\n\t\tif (fieldTypeResolution(field, binder)?.kind === \"model\") continue;\n\t\tconst uniqueAttribute = field.attributes.find((attr) => attr.name === \"unique\");\n\t\tconst uniqueNode = uniqueAttribute?.node;\n\t\tif (!uniqueAttribute || !uniqueNode) continue;\n\t\tconst unique = interpretFieldAttribute({\n\t\t\tsymbols: specContext.symbols,\n\t\t\tnode: uniqueNode,\n\t\t\tspec: mongoAttributeSpecs.field.unique({\n\t\t\t\t...specContext,\n\t\t\t\tfield,\n\t\t\t\ttypeResolution: fieldTypeResolution(field, binder),\n\t\t\t\tcontributedType: contributedTypeOf(fieldTypeResolution(field, binder), binder, field.typeConstructor)\n\t\t\t}),\n\t\t\tmodel: pslModel,\n\t\t\tfield,\n\t\t\tsources,\n\t\t\tbinder,\n\t\t\tdiagnostics\n\t\t});\n\t\tif (unique === void 0) continue;\n\t\tconst source = diagnosticSource(sources, uniqueNode.syntax);\n\t\tconst span = nodePslSpan(uniqueNode.syntax, sources);\n\t\tif (unique.map === \"\") {\n\t\t\treportEmptyIndexMap(diagnostics, source, span);\n\t\t\tcontinue;\n\t\t}\n\t\tindexes.push({\n\t\t\tindex: {\n\t\t\t\tfields: { [field.name]: 1 },\n\t\t\t\toptions: {\n\t\t\t\t\tunique: true,\n\t\t\t\t\t...ifDefined(\"name\", unique.map)\n\t\t\t\t}\n\t\t\t},\n\t\t\tsource,\n\t\t\tspan,\n\t\t\tlabel: `${attributeText(\"@\", uniqueAttribute)} on field \"${pslModel.name}.${field.name}\"`\n\t\t});\n\t}\n\tfor (const attr of pslModel.attributes) {\n\t\tif (attr.name !== \"index\" && attr.name !== \"unique\" && attr.name !== \"textIndex\") continue;\n\t\tconst node = attr.node;\n\t\tconst source = diagnosticSource(sources, node.syntax);\n\t\tconst ctx = {\n\t\t\tsource,\n\t\t\tspan: attr.span,\n\t\t\tdiagnostics\n\t\t};\n\t\tconst nested = nestedIndexPath(node);\n\t\tif (nested !== void 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_INDEX\",\n\t\t\t\tmessage: nestedIndexPathMessage(nested.path, pslModel, binder),\n\t\t\t\t...source.at(nodePslSpan(nested.syntax, sources))\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tlet index;\n\t\tif (attr.name === \"textIndex\") {\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\tnode,\n\t\t\t\tspec: mongoAttributeSpecs.model.textIndex(specContext),\n\t\t\t\tmodel: pslModel,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (!parsed || parsed.fields.length === 0) continue;\n\t\t\tindex = buildTextIndex(parsed, ctx);\n\t\t} else {\n\t\t\tconst unique = attr.name === \"unique\";\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\tnode,\n\t\t\t\tspec: unique ? mongoAttributeSpecs.model.unique(specContext) : mongoAttributeSpecs.model.index(specContext),\n\t\t\t\tmodel: pslModel,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (!parsed) continue;\n\t\t\tindex = buildNormalIndex(parsed, unique, ctx);\n\t\t}\n\t\tif (index === void 0) continue;\n\t\tif (index.options?.name === \"\") {\n\t\t\treportEmptyIndexMap(diagnostics, source, attr.span);\n\t\t\tcontinue;\n\t\t}\n\t\tindexes.push({\n\t\t\tindex,\n\t\t\tsource,\n\t\t\tspan: attr.span,\n\t\t\tlabel: `${attributeText(\"@@\", attr)} on model \"${pslModel.name}\"`\n\t\t});\n\t}\n\treturn indexes;\n}\n/** An attribute as the schema writes it, with its arguments as written. */\nfunction attributeText(prefix, attribute) {\n\tif (attribute.args.length === 0) return `${prefix}${attribute.name}`;\n\tconst args = attribute.args.map((arg) => arg.kind === \"named\" ? `${arg.name}: ${arg.value}` : arg.value);\n\treturn `${prefix}${attribute.name}(${args.join(\", \")})`;\n}\nfunction reportEmptyIndexMap(diagnostics, source, span) {\n\tdiagnostics.push({\n\t\tcode: \"PSL_INVALID_INDEX\",\n\t\tmessage: \"The `map` argument of an index cannot be an empty string.\",\n\t\t...source.at(span)\n\t});\n}\nfunction fieldTypeResolution(field, binder) {\n\tconst node = typeReferenceNode(field);\n\treturn node === void 0 ? void 0 : binder.symbolForNode(node);\n}\nconst GENERATOR_PHASES = [\"onCreate\", \"onUpdate\"];\n/**\n* The generators a field's `@onCreate(fn())` and `@onUpdate(fn())` resolve to, and where each attribute is written. An attribute written twice, or one whose call is refused, is reported here.\n*/\nfunction lowerGeneratorAttributes(input) {\n\tconst { field, modelName, diagnostics } = input;\n\tconst phases = {};\n\tconst sites = {};\n\tlet refused = false;\n\tfor (const phase of GENERATOR_PHASES) {\n\t\tconst [attribute, duplicate] = field.attributes.filter(({ name }) => name === phase);\n\t\tif (attribute === void 0) continue;\n\t\tsites[phase] = {\n\t\t\tspan: attribute.span,\n\t\t\targument: attribute.args.find((arg) => arg.kind === \"positional\")?.value.trim() ?? \"\"\n\t\t};\n\t\tif (duplicate !== void 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_DUPLICATE_ATTRIBUTE\",\n\t\t\t\tmessage: `\\`@${phase}\\` declared more than once on field \"${modelName}.${field.name}\".`,\n\t\t\t\t...diagnosticSource(input.sources, field.node.syntax).at(duplicate.span)\n\t\t\t});\n\t\t\trefused = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconst generator = lowerGeneratorAttribute({\n\t\t\tphase,\n\t\t\tattribute,\n\t\t\tspecContext: typeAttributeSpecContextOfField(input.specContext),\n\t\t\ttype: input.resolved.field.type,\n\t\t\tsymbols: input.specContext.symbols,\n\t\t\tbinder: input.binder,\n\t\t\tsources: input.sources,\n\t\t\tgeneratorFunctions: input.generatorFunctions,\n\t\t\tdiagnostics\n\t\t});\n\t\tif (generator === void 0) {\n\t\t\trefused = true;\n\t\t\tcontinue;\n\t\t}\n\t\tphases[phase] = generator;\n\t}\n\tconst none = phases.onCreate === void 0 && phases.onUpdate === void 0;\n\treturn {\n\t\tvalues: refused || none ? void 0 : phases,\n\t\tsites\n\t};\n}\nfunction fieldOfTypeAlias(field, typeAlias) {\n\treturn {\n\t\tfield: {\n\t\t\ttype: typeAlias.type,\n\t\t\tnullable: field.optional,\n\t\t\tmany: field.list ? { elementNullable: field.elementOptional } : false,\n\t\t\t...ifDefined(\"valueSet\", typeAlias.valueSet)\n\t\t},\n\t\ttypeAlias\n\t};\n}\n/**\n* Whether a field may take what its type alias carries: it repeats none of the alias's attributes. Reports each refusal at the field.\n*/\nfunction acceptsTypeAlias(input) {\n\treturn !refuseRepeatedTypeAliasAttributes({\n\t\tfield: input.field,\n\t\tfieldPath: `${input.modelName}.${input.field.name}`,\n\t\talias: input.typeAlias.alias,\n\t\tsources: input.sources,\n\t\tdiagnostics: input.diagnostics\n\t});\n}\nfunction resolveNonRelationField(field, owner, resolution, codecIdByEnumName, context, scalarNames, typeAliases, codecLookup) {\n\tconst ownerName = owner.name;\n\tif (resolution?.kind === \"compositeType\") return { field: {\n\t\ttype: {\n\t\t\tkind: \"valueObject\",\n\t\t\tplane: \"storage\",\n\t\t\tnamespaceId: resolution.namespace.id,\n\t\t\tentityKind: \"valueObject\",\n\t\t\tentityName: resolution.symbol.name\n\t\t},\n\t\tnullable: field.optional,\n\t\tmany: field.list ? { elementNullable: field.elementOptional } : false\n\t} };\n\tif (resolution?.kind === \"block\" && resolution.symbol.keyword === \"enum\") {\n\t\tconst enumCodecId = codecIdByEnumName.get(resolution.symbol.name);\n\t\tif (enumCodecId === void 0) return void 0;\n\t\tconst valueSet = {\n\t\t\tplane: \"domain\",\n\t\t\tentityKind: \"enum\",\n\t\t\tnamespaceId: resolution.namespace.id,\n\t\t\tentityName: resolution.symbol.name\n\t\t};\n\t\treturn { field: {\n\t\t\ttype: {\n\t\t\t\tkind: \"scalar\",\n\t\t\t\tcodecId: enumCodecId\n\t\t\t},\n\t\t\tnullable: field.optional,\n\t\t\tmany: field.list ? { elementNullable: field.elementOptional } : false,\n\t\t\tvalueSet\n\t\t} };\n\t}\n\tif (resolution?.kind === \"namedType\") {\n\t\tif (field.typeConstructor !== void 0) {\n\t\t\tcontext.diagnostics.push({\n\t\t\t\tcode: \"PSL_UNSUPPORTED_FIELD_TYPE\",\n\t\t\t\tmessage: `Field \"${ownerName}.${field.name}\" calls \"${field.typeConstructor.path.join(\".\")}\", which is a type alias, not a type constructor. Remove the arguments.`,\n\t\t\t\t...diagnosticSource(context.sources, field.node.syntax).at(field.span)\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst typeAlias = typeAliases.ofResolution(resolution);\n\t\treturn typeAlias === void 0 ? void 0 : fieldOfTypeAlias(field, typeAlias);\n\t}\n\tif (resolution?.kind === \"model\" || resolution?.kind === \"block\" || resolution?.kind === \"crossSpace\") {\n\t\tcontext.diagnostics.push({\n\t\t\tcode: \"PSL_UNSUPPORTED_FIELD_TYPE\",\n\t\t\tmessage: `Field \"${ownerName}.${field.name}\" type \"${field.typeName}\" is not supported in Mongo PSL interpreter`,\n\t\t\t...diagnosticSource(context.sources, field.node.syntax).at(field.span)\n\t\t});\n\t\treturn;\n\t}\n\tif (resolution?.kind !== \"contributedType\") return;\n\tconst call = field.typeConstructor;\n\tconst entityLabel = `Field \"${ownerName}.${field.name}\"`;\n\tconst source = diagnosticSource(context.sources, field.node.syntax);\n\tif (isContributedTypeChoice(resolution.symbol)) {\n\t\tconst type = scalarTypeOfChoice({\n\t\t\tsymbol: resolution.symbol,\n\t\t\tcall,\n\t\t\tspan: field.span,\n\t\t\tcodecLookup,\n\t\t\tdiagnostics: context.diagnostics,\n\t\t\tsource,\n\t\t\tentityLabel,\n\t\t\tdataTypes: context.dataTypes\n\t\t});\n\t\treturn type === void 0 ? void 0 : { field: {\n\t\t\ttype,\n\t\t\tnullable: field.optional,\n\t\t\tmany: field.list ? { elementNullable: field.elementOptional } : false\n\t\t} };\n\t}\n\tconst { descriptor, path } = resolution.symbol;\n\tif (descriptor.kind === \"typeAlias\") {\n\t\tif (call !== void 0) {\n\t\t\tcontext.diagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\tmessage: `${path.join(\".\")} is a type alias and takes no arguments.`,\n\t\t\t\t...source.at(call.span)\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst typeAlias = typeAliases.ofResolution(resolution);\n\t\tinvariant(typeAlias !== void 0, \"A contributed type alias always resolves\");\n\t\treturn fieldOfTypeAlias(field, typeAlias);\n\t}\n\tif (call === void 0 && !isBareTypeConstructor(descriptor)) {\n\t\treportTypeConstructorNotCalled({\n\t\t\tentityLabel,\n\t\t\tpath: path.join(\".\"),\n\t\t\tdescriptor,\n\t\t\tsource,\n\t\t\tspan: field.span,\n\t\t\tdiagnostics: context.diagnostics\n\t\t});\n\t\treturn;\n\t}\n\tif (call === void 0) scalarNames.warnDeprecated(field, descriptor);\n\tconst type = scalarTypeOfConstructor({\n\t\tdescriptor,\n\t\tcall,\n\t\tcodecLookup,\n\t\tdiagnostics: context.diagnostics,\n\t\tsource,\n\t\tentityLabel,\n\t\tdataTypes: context.dataTypes\n\t});\n\treturn type === void 0 ? void 0 : { field: {\n\t\ttype,\n\t\tnullable: field.optional,\n\t\tmany: field.list ? { elementNullable: field.elementOptional } : false\n\t} };\n}\nfunction processEnumDeclarations(input) {\n\tconst handles = {};\n\tif (input.enumSymbols.length === 0) return handles;\n\tconst enumDescriptor = input.authoringContributions?.entityTypes?.[\"enum\"] !== void 0 && isAuthoringEntityTypeDescriptor(input.authoringContributions.entityTypes[\"enum\"]) ? input.authoringContributions.entityTypes[\"enum\"] : void 0;\n\tif (!enumDescriptor) {\n\t\tfor (const enumSymbol of input.enumSymbols) {\n\t\t\tconst source = diagnosticSource(input.sources, enumSymbol.node.syntax);\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: \"PSL_ENUM_MISSING_FACTORY\",\n\t\t\t\tmessage: `enum \"${enumSymbol.name}\" requires an \"enum\" entityType factory in the active authoring contributions`,\n\t\t\t\t...source.at(enumSymbol.span)\n\t\t\t});\n\t\t}\n\t\treturn handles;\n\t}\n\tfor (const enumSymbol of input.enumSymbols) {\n\t\tconst sourceFile = input.sources.sourceFileFor(enumSymbol.node.syntax);\n\t\tconst envelope = input.parsedBlocks.get(enumSymbol);\n\t\tinput.diagnostics.push(...enumMemberAttributeDiagnostics(enumSymbol, input.sources));\n\t\tif (envelope === void 0) continue;\n\t\tconst handle = instantiateAuthoringEntityType(\"enum\", enumDescriptor, [envelope], {\n\t\t\t...input.entityContext,\n\t\t\tsourceId: sourceFile.filename\n\t\t});\n\t\tif (handle === void 0 || handle === null) continue;\n\t\thandles[envelope.name] = handle;\n\t\tconst typeAttribute = envelope.attributes[\"type\"];\n\t\tinput.sites.set(envelope.name, {\n\t\t\tblock: {\n\t\t\t\tenumName: envelope.name,\n\t\t\t\tcodecId: handle.codecId,\n\t\t\t\tsourceId: sourceFile.filename,\n\t\t\t\tspan: envelope.span,\n\t\t\t\tmemberSpans: envelope.parameterSpans\n\t\t\t},\n\t\t\tcodecSpan: typeAttribute?.argSpans?.[\"codecId\"] ?? typeAttribute?.span ?? envelope.span\n\t\t});\n\t}\n\treturn handles;\n}\nfunction withoutMergedIndexSites(modelSites, removedIndexes) {\n\treturn new Map([...modelSites].map(([modelName, sites]) => {\n\t\tconst removed = new Set(removedIndexes.filter(({ model }) => model === modelName).map(({ position }) => position));\n\t\treturn [modelName, {\n\t\t\t...sites,\n\t\t\tindexes: sites.indexes.filter((_, position) => !removed.has(position))\n\t\t}];\n\t}));\n}\n/** Whether PSL already reported the cause of a refusal, so the builder's refusal would repeat it. */\nfunction alreadyReported(refusal, dropped, reported) {\n\tswitch (refusal.kind) {\n\t\tcase \"indexFieldUnknown\": return dropped.has(fieldSiteKey(refusal.key.model, refusal.fieldName));\n\t\tcase \"relationLocalFieldUnknown\": return dropped.has(fieldSiteKey(refusal.key.model, refusal.fieldName));\n\t\tcase \"discriminatorFieldUnknown\": return dropped.has(fieldSiteKey(refusal.key.model, refusal.fieldName));\n\t\tcase \"discriminatorWithoutVariants\": return reported.baseTargets.has(refusal.key.model);\n\t\tcase \"baseWithoutDiscriminator\": return reported.discriminators.has(refusal.baseModel);\n\t\tdefault: return false;\n\t}\n}\nfunction enumNameOf(field) {\n\treturn field.valueSet?.entityKind === \"enum\" ? field.valueSet.entityName : void 0;\n}\nfunction fieldNodeOf(fieldName, storedName, resolved, generatedValues) {\n\tconst { field } = resolved;\n\tconst executionDefaults = resolved.typeAlias?.executionDefaults;\n\treturn {\n\t\tfieldName,\n\t\t...storedName === fieldName ? {} : { storedName },\n\t\ttype: field.type,\n\t\tnullable: field.nullable,\n\t\tmany: field.many ?? false,\n\t\t...ifDefined(\"enumName\", enumNameOf(field)),\n\t\t...ifDefined(\"executionDefaults\", executionDefaults),\n\t\t...ifDefined(\"generatedValues\", generatedValues)\n\t};\n}\nfunction relationNodeOf(fieldName, relation) {\n\tif (relation.cardinality === \"N:M\") throw new InternalError(\"A paired MongoDB back-relation is one-to-one or one-to-many.\");\n\treturn {\n\t\trelationName: fieldName,\n\t\ttoModel: relation.to.model,\n\t\tcardinality: relation.cardinality,\n\t\ton: relation.on,\n\t\tnullable: \"nullable\" in relation ? relation.nullable : void 0\n\t};\n}\nfunction interpretPslDocumentToMongoContract(input) {\n\tconst { symbolTable, sources, codecLookup } = input;\n\tconst diagnostics = createPslDiagnosticCollector(sources);\n\tconst fieldResolution = {\n\t\tsources,\n\t\tdiagnostics,\n\t\tdataTypes: input.dataTypes\n\t};\n\tconst scalarNames = { warnDeprecated: deprecatedScalarWarner({\n\t\tsources,\n\t\treportWarning: input.reportWarning\n\t}) };\n\tconst { binder } = input;\n\tconst { parsedBlocks, diagnostics: blockDiagnostics } = interpretExtensionBlocks({\n\t\tsymbolTable,\n\t\tsources,\n\t\tpslBlockDescriptors: input.authoringContributions?.pslBlockDescriptors ?? {},\n\t\tbinder,\n\t\tdataTypes: input.dataTypes\n\t});\n\tdiagnostics.push(...blockDiagnostics);\n\tconst { defaultNamespace } = symbolTable;\n\tvalidateNamespaceBlocksForMongoTarget({\n\t\tnamespaces: Object.values(symbolTable.namespaces),\n\t\tsources,\n\t\tbinder,\n\t\tdiagnostics\n\t});\n\tconst allModels = Object.values(defaultNamespace.models);\n\tconst allCompositeTypes = Object.values(defaultNamespace.compositeTypes);\n\tconst { generatorFunctions } = input;\n\tconst specContextFor = (model) => ({\n\t\tsymbols: symbolTable,\n\t\tmodel,\n\t\tdefaultFunctionRegistry: input.defaultFunctionRegistry,\n\t\tgeneratorFunctions,\n\t\tdataTypes: input.dataTypes\n\t});\n\tconst physicalNames = /* @__PURE__ */ new Map();\n\tfor (const model of allModels) resolvePhysicalNames({\n\t\tmodel,\n\t\tphysicalNames,\n\t\tspecContext: specContextFor(model),\n\t\tsources,\n\t\tbinder,\n\t\tdiagnostics\n\t});\n\tconst blockKeywords = /* @__PURE__ */ new Set([\"enum\", ...claimedBlockKeywords(input.authoringContributions?.pslBlockDescriptors)]);\n\tfor (const block of Object.values(defaultNamespace.blocks)) if (!blockKeywords.has(block.keyword)) diagnostics.push(unsupportedBlockDiagnostic(block, sources));\n\tconst topLevelEnumSymbols = Object.values(defaultNamespace.blocks).filter((b) => b.keyword === \"enum\");\n\tconst enumSites = /* @__PURE__ */ new Map();\n\tconst enumHandles = processEnumDeclarations({\n\t\tsites: enumSites,\n\t\tenumSymbols: topLevelEnumSymbols,\n\t\tparsedBlocks,\n\t\tsources,\n\t\tauthoringContributions: input.authoringContributions,\n\t\tentityContext: {\n\t\t\tfamily: \"mongo\",\n\t\t\ttarget: \"mongo\",\n\t\t\t...ifDefined(\"enumInferenceCodecs\", input.enumInferenceCodecs),\n\t\t\tcodecLookup,\n\t\t\tdataTypes: input.dataTypes,\n\t\t\tdiagnostics: { push: (d) => {\n\t\t\t\tdiagnostics.pushExternal(blindCast(d));\n\t\t\t} }\n\t\t},\n\t\tdiagnostics\n\t});\n\tconst codecIdByEnumName = new Map(Object.entries(enumHandles).map(([name, handle]) => [name, handle.codecId]));\n\tconst typeAliases = resolveMongoTypeAliases({\n\t\tdeclarations: Object.values(symbolTable.namedTypes),\n\t\tsymbols: symbolTable,\n\t\tbinder,\n\t\tsources,\n\t\tdiagnostics,\n\t\tcodecIdByEnumName,\n\t\tdefaultFunctionRegistry: input.defaultFunctionRegistry,\n\t\tgeneratorFunctions,\n\t\tdataTypes: input.dataTypes,\n\t\tcodecLookup: input.codecLookup,\n\t\tauthoringTypes: input.authoringContributions?.type\n\t});\n\tconst polymorphism = collectPolymorphismDeclarations({\n\t\tmodels: allModels,\n\t\tspecContextFor,\n\t\tsources,\n\t\tbinder,\n\t\tdiagnostics\n\t});\n\tconst allFkRelations = [];\n\tconst backrelationCandidates = [];\n\tconst invalidFkPairings = [];\n\tconst fieldSites = /* @__PURE__ */ new Map();\n\tconst modelSites = /* @__PURE__ */ new Map();\n\tconst droppedFields = /* @__PURE__ */ new Set();\n\tconst relationsByModel = /* @__PURE__ */ new Map();\n\tconst modelDrafts = [];\n\tfor (const pslModel of allModels) {\n\t\tconst specContext = specContextFor(pslModel);\n\t\tconst fields = [];\n\t\tconst relations = [];\n\t\trelationsByModel.set(pslModel.name, relations);\n\t\tfor (const field of Object.values(pslModel.fields)) {\n\t\t\tconst source = diagnosticSource(sources, field.node.syntax);\n\t\t\tconst siteKey = fieldSiteKey(pslModel.name, field.name);\n\t\t\tconst resolution = fieldTypeResolution(field, binder);\n\t\t\tif (resolution?.kind === \"model\") {\n\t\t\t\tfieldSites.set(siteKey, {\n\t\t\t\t\tsymbol: field,\n\t\t\t\t\tsource,\n\t\t\t\t\tgeneratorAttributes: {},\n\t\t\t\t\tstoredName: field.name\n\t\t\t\t});\n\t\t\t\tconst target = resolution.symbol;\n\t\t\t\tconst relationNode = field.attributes.find((attr) => attr.name === \"relation\")?.node;\n\t\t\t\tconst relation = relationNode ? interpretFieldAttribute({\n\t\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\t\tnode: relationNode,\n\t\t\t\t\tspec: mongoAttributeSpecs.field.relation({\n\t\t\t\t\t\t...specContext,\n\t\t\t\t\t\tfield,\n\t\t\t\t\t\ttypeResolution: fieldTypeResolution(field, binder),\n\t\t\t\t\t\tcontributedType: contributedTypeOf(fieldTypeResolution(field, binder), binder, field.typeConstructor)\n\t\t\t\t\t}),\n\t\t\t\t\tmodel: pslModel,\n\t\t\t\t\tfield,\n\t\t\t\t\tsources,\n\t\t\t\t\tbinder,\n\t\t\t\t\tdiagnostics\n\t\t\t\t}) : void 0;\n\t\t\t\tif (field.list || !(relation?.fields && relation?.references)) {\n\t\t\t\t\tbackrelationCandidates.push({\n\t\t\t\t\t\tmodelName: pslModel.name,\n\t\t\t\t\t\ttargetModelName: target.name,\n\t\t\t\t\t\t...ifDefined(\"relationName\", relation?.name),\n\t\t\t\t\t\tcardinality: field.list ? \"1:N\" : \"1:1\",\n\t\t\t\t\t\tfield,\n\t\t\t\t\t\tsources\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!physicalNames.has(target)) continue;\n\t\t\t\trelations.push({\n\t\t\t\t\trelationName: field.name,\n\t\t\t\t\ttoModel: target.name,\n\t\t\t\t\tcardinality: \"N:1\",\n\t\t\t\t\ton: {\n\t\t\t\t\t\tlocalFields: relation.fields,\n\t\t\t\t\t\ttargetFields: relation.references\n\t\t\t\t\t},\n\t\t\t\t\tnullable: field.optional\n\t\t\t\t});\n\t\t\t\tif (resolveToOneRelationNullable({\n\t\t\t\t\tdeclaredNullable: field.optional,\n\t\t\t\t\tlocalFieldNullability: relation.fields.map((localFieldName) => pslModel.fields[localFieldName]?.optional === true),\n\t\t\t\t\townsReference: true\n\t\t\t\t}).contradiction !== void 0) {\n\t\t\t\t\tinvalidFkPairings.push({\n\t\t\t\t\t\tpairKey: fkRelationPairKey(pslModel.name, target.name),\n\t\t\t\t\t\t...ifDefined(\"relationName\", relation.name)\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tallFkRelations.push({\n\t\t\t\t\tdeclaringModel: pslModel.name,\n\t\t\t\t\ttargetModel: target.name,\n\t\t\t\t\t...ifDefined(\"relationName\", relation.name),\n\t\t\t\t\tlocalFields: relation.fields,\n\t\t\t\t\ttargetFields: relation.references\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst resolved = resolveNonRelationField(field, {\n\t\t\t\tname: pslModel.name,\n\t\t\t\tkind: \"model\"\n\t\t\t}, resolution, codecIdByEnumName, fieldResolution, scalarNames, typeAliases, codecLookup);\n\t\t\tif (resolved === void 0 || resolved.typeAlias !== void 0 && !acceptsTypeAlias({\n\t\t\t\tfield,\n\t\t\t\tmodelName: pslModel.name,\n\t\t\t\ttypeAlias: resolved.typeAlias,\n\t\t\t\tsources,\n\t\t\t\tdiagnostics\n\t\t\t})) {\n\t\t\t\tdroppedFields.add(siteKey);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst storedName = physicalName(physicalNames, field);\n\t\t\tconst generated = lowerGeneratorAttributes({\n\t\t\t\tfield,\n\t\t\t\tmodelName: pslModel.name,\n\t\t\t\tresolved,\n\t\t\t\tspecContext: {\n\t\t\t\t\t...specContext,\n\t\t\t\t\tfield,\n\t\t\t\t\ttypeResolution: resolution,\n\t\t\t\t\tcontributedType: contributedTypeOf(resolution, binder, field.typeConstructor)\n\t\t\t\t},\n\t\t\t\tgeneratorFunctions,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tfields.push(fieldNodeOf(field.name, storedName, resolved, generated.values));\n\t\t\tfieldSites.set(siteKey, {\n\t\t\t\tsymbol: field,\n\t\t\t\tsource,\n\t\t\t\t...ifDefined(\"typeAlias\", resolved.typeAlias),\n\t\t\t\tgeneratorAttributes: generated.sites,\n\t\t\t\tstoredName\n\t\t\t});\n\t\t}\n\t\tconst idFields = [];\n\t\tfor (const field of Object.values(pslModel.fields)) {\n\t\t\tconst idNode = field.attributes.find((attr) => attr.name === \"id\")?.node;\n\t\t\tif (!idNode) continue;\n\t\t\tif (interpretFieldAttribute({\n\t\t\t\tsymbols: specContext.symbols,\n\t\t\t\tnode: idNode,\n\t\t\t\tspec: mongoAttributeSpecs.field.id({\n\t\t\t\t\t...specContext,\n\t\t\t\t\tfield,\n\t\t\t\t\ttypeResolution: fieldTypeResolution(field, binder),\n\t\t\t\t\tcontributedType: contributedTypeOf(fieldTypeResolution(field, binder), binder, field.typeConstructor)\n\t\t\t\t}),\n\t\t\t\tmodel: pslModel,\n\t\t\t\tfield,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t}) === void 0) continue;\n\t\t\tidFields.push(field);\n\t\t\tconst storedName = physicalName(physicalNames, field);\n\t\t\tif (storedName !== DOCUMENT_ID) diagnostics.push({\n\t\t\t\tcode: \"PSL_MONGO_ID_ATTRIBUTE_INVALID\",\n\t\t\t\tmessage: `Field \"${pslModel.name}.${field.name}\" has @id but is stored as \"${storedName}\". In MongoDB, @id marks the field stored as _id, the document id: add @map(\"_id\") to it, or remove @id.`,\n\t\t\t\t...diagnosticSource(sources, field.node.syntax).at(field.span)\n\t\t\t});\n\t\t}\n\t\tconst [, secondIdField] = idFields;\n\t\tif (secondIdField !== void 0) diagnostics.push({\n\t\t\tcode: \"PSL_MONGO_ID_ATTRIBUTE_INVALID\",\n\t\t\tmessage: `Model \"${pslModel.name}\" has @id on ${idFields.length} fields, ${idFields.map((field) => `\"${field.name}\"`).join(\" and \")}. A document has one id: keep @id only on the field stored as _id.`,\n\t\t\t...diagnosticSource(sources, secondIdField.node.syntax).at(secondIdField.span)\n\t\t});\n\t\tconst indexes = collectIndexes(pslModel, specContext, sources, binder, diagnostics);\n\t\tconst discriminator = polymorphism.discriminators.get(pslModel);\n\t\tconst base = polymorphism.bases.get(pslModel);\n\t\tmodelSites.set(pslModel.name, {\n\t\t\tindexes,\n\t\t\t...ifDefined(\"discriminator\", discriminator),\n\t\t\t...ifDefined(\"base\", base)\n\t\t});\n\t\tconst inheritsCollection = base !== void 0 && getAttribute(pslModel.attributes, \"map\") === void 0;\n\t\tmodelDrafts.push({\n\t\t\tsymbol: pslModel,\n\t\t\tnode: {\n\t\t\t\tmodelName: pslModel.name,\n\t\t\t\t...inheritsCollection ? {} : { collection: physicalName(physicalNames, pslModel) },\n\t\t\t\tfields,\n\t\t\t\tindexes: indexes.map(({ index }) => index),\n\t\t\t\t...discriminator === void 0 ? {} : { discriminator: { field: discriminator.fieldName } },\n\t\t\t\t...base === void 0 ? {} : { base: {\n\t\t\t\t\tmodel: base.base.name,\n\t\t\t\t\tvalue: base.written\n\t\t\t\t} }\n\t\t\t}\n\t\t});\n\t}\n\tconst valueObjects = [];\n\tfor (const compositeType of allCompositeTypes) {\n\t\tconst fields = [];\n\t\tfor (const field of Object.values(compositeType.fields)) {\n\t\t\tconst siteKey = fieldSiteKey(compositeType.name, field.name);\n\t\t\tconst fieldMap = field.attributes.find((attr) => attr.name === \"map\");\n\t\t\tconst resolved = resolveNonRelationField(field, {\n\t\t\t\tname: compositeType.name,\n\t\t\t\tkind: \"compositeType\"\n\t\t\t}, fieldTypeResolution(field, binder), codecIdByEnumName, fieldResolution, scalarNames, typeAliases, codecLookup);\n\t\t\tif (resolved === void 0) {\n\t\t\t\tdroppedFields.add(siteKey);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst storedName = fieldMap?.args[0]?.value.replace(/^\"|\"$/g, \"\") ?? field.name;\n\t\t\tfields.push({\n\t\t\t\t...fieldNodeOf(field.name, field.name, resolved, void 0),\n\t\t\t\t...fieldMap === void 0 ? {} : { storedName }\n\t\t\t});\n\t\t\tfieldSites.set(siteKey, {\n\t\t\t\tsymbol: field,\n\t\t\t\tsource: diagnosticSource(sources, field.node.syntax),\n\t\t\t\t...ifDefined(\"typeAlias\", resolved.typeAlias),\n\t\t\t\tgeneratorAttributes: {},\n\t\t\t\t...fieldMap === void 0 ? {} : { map: {\n\t\t\t\t\tsource: diagnosticSource(sources, fieldMap.node.syntax),\n\t\t\t\t\tspan: nodePslSpan(fieldMap.node.syntax, sources)\n\t\t\t\t} },\n\t\t\t\tstoredName\n\t\t\t});\n\t\t}\n\t\tvalueObjects.push({\n\t\t\tname: compositeType.name,\n\t\t\tfields\n\t\t});\n\t}\n\tconst paired = pairMongoBackRelations({\n\t\tforeignKeys: allFkRelations,\n\t\tcandidates: backrelationCandidates,\n\t\tinvalidFkPairings,\n\t\tnamespaceId: defaultNamespace.id\n\t});\n\tdiagnostics.push(...paired.diagnostics);\n\tfor (const { modelName, fieldName, relation } of paired.relations) relationsByModel.get(modelName)?.push(relationNodeOf(fieldName, relation));\n\tconst modelNodes = modelDrafts.map(({ node }) => ({\n\t\t...node,\n\t\trelations: relationsByModel.get(node.modelName) ?? []\n\t}));\n\tconst { definition, removedIndexes } = mergeRedundantIndexes(nameIndexes({\n\t\ttarget: input.target,\n\t\t...ifDefined(\"extensions\", input.extensionPacks),\n\t\tmodels: [...modelNodes.filter((model) => model.base === void 0), ...modelNodes.filter((model) => model.base !== void 0)],\n\t\tvalueObjects,\n\t\tenums: enumHandles,\n\t\twritesCollectionValidators: true,\n\t\twarnings: void 0\n\t}), codecLookup, input.dataTypes);\n\tconst sites = {\n\t\tmodels: withoutMergedIndexSites(modelSites, removedIndexes),\n\t\tfields: fieldSites,\n\t\tenums: enumSites\n\t};\n\tconst built = buildMongoContractFromDefinition(definition, codecLookup, input.dataTypes);\n\tfor (const refusal of built.ok ? [] : built.failure.refusals) {\n\t\tif (alreadyReported(refusal, droppedFields, polymorphism.reported)) continue;\n\t\tconst diagnostic = refusalDiagnostic(refusal, sites);\n\t\tif (\"range\" in diagnostic) diagnostics.push(diagnostic);\n\t\telse diagnostics.pushExternal(diagnostic);\n\t}\n\tif (!built.ok || diagnostics.length > 0 || (input.seedDiagnostics?.length ?? 0) > 0) return notOk({\n\t\tsummary: \"PSL to Mongo contract interpretation failed\",\n\t\tdiagnostics: [...input.seedDiagnostics ?? [], ...diagnostics.toExternal()]\n\t});\n\treturn ok(built.value.contract);\n}\n//#endregion\nexport { mongoAttributeSpecs as i, pairMongoBackRelations as n, describeUnsupportedMongoAttribute as r, interpretPslDocumentToMongoContract as t };\n\n//# sourceMappingURL=interpreter-v8GWMscU.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,uBA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