@prisma/orm-framework 8.0.0-rc.24-dev.28 → 8.0.0-rc.24-dev.29

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.
Files changed (119) hide show
  1. package/README.md +2 -0
  2. package/dist/{authoring-DnYn5EZT.mjs → authoring-BoRTq-7r.mjs} +2 -2
  3. package/dist/{authoring-DnYn5EZT.mjs.map → authoring-BoRTq-7r.mjs.map} +1 -1
  4. package/dist/{binder-CMy3WM5A-gjYNJqla.d.mts → binder-CMy3WM5A-BjkRdpH6.d.mts} +4 -4
  5. package/dist/{binder-CMy3WM5A-gjYNJqla.d.mts.map → binder-CMy3WM5A-BjkRdpH6.d.mts.map} +1 -1
  6. package/dist/boolean-C37kSXDF.mjs +14 -0
  7. package/dist/boolean-C37kSXDF.mjs.map +1 -0
  8. package/dist/boolean-CcUSuhCU.d.mts +9 -0
  9. package/dist/boolean-CcUSuhCU.d.mts.map +1 -0
  10. package/dist/{codec-yFwW7XRh.mjs → codec-CBJNOQS4.mjs} +2 -2
  11. package/dist/{codec-yFwW7XRh.mjs.map → codec-CBJNOQS4.mjs.map} +1 -1
  12. package/dist/{components-BaV9iCkq.mjs → components-Bx7dm2HO.mjs} +2 -2
  13. package/dist/{components-BaV9iCkq.mjs.map → components-Bx7dm2HO.mjs.map} +1 -1
  14. package/dist/components.d.mts +5 -5
  15. package/dist/components.mjs +7 -8
  16. package/dist/components__authoring.mjs +2 -2
  17. package/dist/components__codec.mjs +1 -1
  18. package/dist/components__components.mjs +2 -2
  19. package/dist/components__control.d.mts +1 -1
  20. package/dist/components__control.mjs +2 -2
  21. package/dist/components__emission.d.mts +3 -3
  22. package/dist/components__emission.mjs +1 -2
  23. package/dist/{config-types-D0mYyP62.mjs → config-types-DlaG0ylV.mjs} +4 -2
  24. package/dist/config-types-DlaG0ylV.mjs.map +1 -0
  25. package/dist/{config-types-Ck3UXVIU.d.mts → config-types-DvM9eXG7.d.mts} +6 -2
  26. package/dist/{config-types-Ck3UXVIU.d.mts.map → config-types-DvM9eXG7.d.mts.map} +1 -1
  27. package/dist/config.d.mts +1 -1
  28. package/dist/config.mjs +1 -1
  29. package/dist/config__config-types.d.mts +1 -1
  30. package/dist/config__config-types.mjs +1 -1
  31. package/dist/contract-authoring.mjs +3 -3
  32. package/dist/{control-BeXOxtXA-CoPQgVyR.d.mts → control-BeXOxtXA-D1DDBvDL.d.mts} +2 -2
  33. package/dist/{control-BeXOxtXA-CoPQgVyR.d.mts.map → control-BeXOxtXA-D1DDBvDL.d.mts.map} +1 -1
  34. package/dist/control-DI1fnOUO.d.mts +1 -0
  35. package/dist/{control-B0KO727Y.mjs → control-DNwP6V2m.mjs} +3 -3
  36. package/dist/{control-B0KO727Y.mjs.map → control-DNwP6V2m.mjs.map} +1 -1
  37. package/dist/{control-MllEQmML-IlhSvGbE.mjs → control-MllEQmML-aKdJLwRB.mjs} +2 -2
  38. package/dist/{control-MllEQmML-IlhSvGbE.mjs.map → control-MllEQmML-aKdJLwRB.mjs.map} +1 -1
  39. package/dist/{control-B3QHYJcv.d.mts → control-rzZBO0wp.d.mts} +116 -121
  40. package/dist/control-rzZBO0wp.d.mts.map +1 -0
  41. package/dist/decimal-CetFpCr5.mjs +49 -0
  42. package/dist/decimal-CetFpCr5.mjs.map +1 -0
  43. package/dist/decimal-DpMh1SwW.d.mts +15 -0
  44. package/dist/decimal-DpMh1SwW.d.mts.map +1 -0
  45. package/dist/{declarations-8CRDqUTt-B0YG2lqY.mjs → declarations-8CRDqUTt-BZ6aspIz.mjs} +2 -2
  46. package/dist/{declarations-8CRDqUTt-B0YG2lqY.mjs.map → declarations-8CRDqUTt-BZ6aspIz.mjs.map} +1 -1
  47. package/dist/{dist-D1f6xr7F.mjs → dist-s8Mn2iIF.mjs} +7 -10
  48. package/dist/dist-s8Mn2iIF.mjs.map +1 -0
  49. package/dist/{emission-DGYCaKjl.d.mts → emission-ZgkI1aFl.d.mts} +1 -1
  50. package/dist/{emission-types-bX2HmNSC-vaRddb1_.d.mts → emission-types-BuZVDb1i-BnSb9rsQ.d.mts} +6 -42
  51. package/dist/emission-types-BuZVDb1i-BnSb9rsQ.d.mts.map +1 -0
  52. package/dist/errors.d.mts +4 -4
  53. package/dist/errors.mjs +3 -3
  54. package/dist/errors__control.d.mts +2 -2
  55. package/dist/errors__control.mjs +1 -1
  56. package/dist/errors__execution.d.mts +1 -1
  57. package/dist/errors__execution.mjs +1 -1
  58. package/dist/errors__migration.d.mts +1 -1
  59. package/dist/errors__migration.mjs +1 -1
  60. package/dist/{execution-DLAnWNAh.d.mts → execution-Bbc4v1Vn.d.mts} +2 -2
  61. package/dist/{execution-DLAnWNAh.d.mts.map → execution-Bbc4v1Vn.d.mts.map} +1 -1
  62. package/dist/{execution-DE_55Rj3.mjs → execution-DMqI5fFP.mjs} +2 -2
  63. package/dist/{execution-DE_55Rj3.mjs.map → execution-DMqI5fFP.mjs.map} +1 -1
  64. package/dist/{expressions-BlhT51Ib-CQCMuQD8.mjs → expressions-BlhT51Ib-DfkeWOwr.mjs} +2 -2
  65. package/dist/{expressions-BlhT51Ib-CQCMuQD8.mjs.map → expressions-BlhT51Ib-DfkeWOwr.mjs.map} +1 -1
  66. package/dist/{generator-functions-CXbQfvYu-BIFU1Ryx.mjs → generator-functions-VMolCOGa-xY11fV0Q.mjs} +4 -3
  67. package/dist/generator-functions-VMolCOGa-xY11fV0Q.mjs.map +1 -0
  68. package/dist/json-Cjj5_v0y.mjs +67 -0
  69. package/dist/json-Cjj5_v0y.mjs.map +1 -0
  70. package/dist/json-oOHvzn6v.d.mts +18 -0
  71. package/dist/json-oOHvzn6v.d.mts.map +1 -0
  72. package/dist/{migration-rWN1KSXH.mjs → migration-BfPqhbjG.mjs} +2 -2
  73. package/dist/{migration-rWN1KSXH.mjs.map → migration-BfPqhbjG.mjs.map} +1 -1
  74. package/dist/{migration-KEyQBpKF.d.mts → migration-BiqyI92H.d.mts} +2 -2
  75. package/dist/{migration-KEyQBpKF.d.mts.map → migration-BiqyI92H.d.mts.map} +1 -1
  76. package/dist/{parse-D-B_nrfC-FsqZwLif.mjs → parse-D-B_nrfC-agY84gQk.mjs} +3 -3
  77. package/dist/{parse-D-B_nrfC-FsqZwLif.mjs.map → parse-D-B_nrfC-agY84gQk.mjs.map} +1 -1
  78. package/dist/{parse-djL5wker-Bx0JH2c_.d.mts → parse-djL5wker-DNAOL0Cj.d.mts} +2 -2
  79. package/dist/{parse-djL5wker-Bx0JH2c_.d.mts.map → parse-djL5wker-DNAOL0Cj.d.mts.map} +1 -1
  80. package/dist/psl-parser.d.mts +3 -3
  81. package/dist/psl-parser.mjs +5 -5
  82. package/dist/psl-parser__format.d.mts +1 -1
  83. package/dist/psl-parser__format.mjs +3 -3
  84. package/dist/psl-parser__interpret.d.mts +3 -3
  85. package/dist/psl-parser__interpret.mjs +2 -2
  86. package/dist/psl-parser__syntax.d.mts +1 -1
  87. package/dist/psl-parser__syntax.mjs +3 -3
  88. package/dist/psl-printer.mjs +5 -2
  89. package/dist/psl-printer.mjs.map +1 -1
  90. package/dist/target-package-config.d.mts +2 -0
  91. package/dist/target-package-config.mjs +2 -0
  92. package/dist/target-package-config__type-declarations.d.mts +2 -0
  93. package/dist/target-package-config__type-declarations.mjs +2 -0
  94. package/dist/{temporal-type-aliases-CFh3BW2a-DOlmiuQn.mjs → temporal-type-aliases-CFh3BW2a-CeZV7A5h.mjs} +2 -2
  95. package/dist/{temporal-type-aliases-CFh3BW2a-DOlmiuQn.mjs.map → temporal-type-aliases-CFh3BW2a-CeZV7A5h.mjs.map} +1 -1
  96. package/dist/ts-render.mjs +1 -1
  97. package/dist/{type-constructor-calls-Bfg5ojed-Ld7LE20u.mjs → type-constructor-calls-Bfg5ojed-DlLeoRYW.mjs} +4 -4
  98. package/dist/{type-constructor-calls-Bfg5ojed-Ld7LE20u.mjs.map → type-constructor-calls-Bfg5ojed-DlLeoRYW.mjs.map} +1 -1
  99. package/dist/type-declarations-CPPGpPSj.mjs +58 -0
  100. package/dist/type-declarations-CPPGpPSj.mjs.map +1 -0
  101. package/dist/type-declarations-C_77eFnt.d.mts +11 -0
  102. package/dist/type-declarations-C_77eFnt.d.mts.map +1 -0
  103. package/dist/type-implementations.d.mts +4 -1
  104. package/dist/type-implementations.mjs +4 -1
  105. package/dist/type-implementations__boolean.d.mts +2 -0
  106. package/dist/type-implementations__boolean.mjs +2 -0
  107. package/dist/type-implementations__decimal.d.mts +2 -0
  108. package/dist/type-implementations__decimal.mjs +2 -0
  109. package/dist/type-implementations__json.d.mts +2 -0
  110. package/dist/type-implementations__json.mjs +2 -0
  111. package/package.json +22 -16
  112. package/dist/config-types-D0mYyP62.mjs.map +0 -1
  113. package/dist/control-B0WmeKXX.d.mts +0 -1
  114. package/dist/control-B3QHYJcv.d.mts.map +0 -1
  115. package/dist/dist-D1f6xr7F.mjs.map +0 -1
  116. package/dist/emission-CeoAV9mj.mjs +0 -26
  117. package/dist/emission-CeoAV9mj.mjs.map +0 -1
  118. package/dist/emission-types-bX2HmNSC-vaRddb1_.d.mts.map +0 -1
  119. package/dist/generator-functions-CXbQfvYu-BIFU1Ryx.mjs.map +0 -1
package/README.md CHANGED
@@ -17,6 +17,8 @@ Each subpath namespace consolidates one internal framework module; a bare namesp
17
17
  | `/config` | configuration types and validation |
18
18
  | `/errors` | control, execution, and migration error types |
19
19
  | `/ids`, `/operations`, `/ts-render`, `/utils` | identifiers, operation model, TypeScript rendering, shared utilities |
20
+ | `/type-implementations` | value logic that more than one target's codecs, data types and `now()` generators share |
21
+ | `/target-package-config` | what a target package uses to restate its components' type declarations with its own module |
20
22
 
21
23
  ## Responsibilities
22
24
 
@@ -5,7 +5,7 @@ import { n as notOk, r as ok } from "./result-8OXF26MN.mjs";
5
5
  import { t as canonicalizeJson } from "./canonicalize-json-ZPawceQR-Dua1VNEB.mjs";
6
6
  import { d as dataTypeParams, u as dataTypeId } from "./data-type-V6mcDhcG-DVQAPOQT.mjs";
7
7
  import { r as codecForRef } from "./resolve-codec-qqMjZrmn-Cok8elAo.mjs";
8
- import { B as resolveAuthoringTypeChoice, C as instantiateAuthoringTypeCall, E as isAuthoringArgRef, L as printTaggedLiteral, M as isAuthoringTypeChoiceOption, N as isAuthoringTypeConstructorDescriptor, P as isAuthoringTypeDescriptor, R as printedTaggedLiteralReadsBack, X as typeConstructorLookup, d as authoringTypeNamespaceLevel, j as isAuthoringTypeChoiceDescriptor, w as instantiateAuthoringTypeConstructor } from "./temporal-type-aliases-CFh3BW2a-DOlmiuQn.mjs";
8
+ import { B as resolveAuthoringTypeChoice, C as instantiateAuthoringTypeCall, E as isAuthoringArgRef, L as printTaggedLiteral, M as isAuthoringTypeChoiceOption, N as isAuthoringTypeConstructorDescriptor, P as isAuthoringTypeDescriptor, R as printedTaggedLiteralReadsBack, X as typeConstructorLookup, d as authoringTypeNamespaceLevel, j as isAuthoringTypeChoiceDescriptor, w as instantiateAuthoringTypeConstructor } from "./temporal-type-aliases-CFh3BW2a-CeZV7A5h.mjs";
9
9
  import { a as numeralText, i as enumRefusalOf, o as readContractValue } from "./codec-descriptor-CPSGZunM-DxrbRHX1.mjs";
10
10
  //#region ../../../1-framework/1-core/framework-components/dist/authoring.mjs
11
11
  /** Every type constructor of `namespace`, with its path, in namespace order. */
@@ -1085,4 +1085,4 @@ function encodeEnumMembers(decodedEnum, codecLookup) {
1085
1085
  //#endregion
1086
1086
  export { readWrittenValueAs as C, writeTypedLiteral as D, writeDataTypeValue as E, writtenTypeArguments as O, readWrittenValue as S, tagForm as T, exactRewrite as _, authoringTypeConstructors as a, knownTags as b, describeDiscriminatorRefusal as c, describeRefusedValueType as d, duplicateStoredMembers as f, enumMemberProblemDiagnostic as g, entryForTag as h, authoringTypeConstructorArguments as i, writtenTypeConstructorCall as k, describeExpected as l, entryForPlain as m, admittedTags as n, castTypedValue as o, encodeEnumMembers as p, applyDiscriminatorRule as r, describeAdmittedForms as s, admittedForms as t, describeRefusal as u, findAuthoringTypeChoiceCall as v, readWrittenValueIntoCodec as w, readEnumBlockMembers as x, findAuthoringTypeConstructorCall as y };
1087
1087
 
1088
- //# sourceMappingURL=authoring-DnYn5EZT.mjs.map
1088
+ //# sourceMappingURL=authoring-BoRTq-7r.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"authoring-DnYn5EZT.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/authoring.mjs"],"sourcesContent":["import { a as dataTypeId, o as dataTypeParams } from \"./data-type-V6mcDhcG.mjs\";\nimport { a as readContractValue, o as numeralText, r as enumRefusalOf } from \"./codec-descriptor-CPSGZunM.mjs\";\nimport { t as canonicalizeJson } from \"./canonicalize-json-ZPawceQR.mjs\";\nimport { r as codecForRef } from \"./resolve-codec-qqMjZrmn.mjs\";\nimport { $ as validateAuthoringTypeChoiceParams, A as assertTypeAliasesValid, B as isAuthoringEntityTypeDescriptor, C as typeChoiceCombinationText, D as assertNoAuthoringFieldNamespace, E as AUTHORING_TYPE_DESCRIPTOR_KINDS, F as instantiateAuthoringEntityType, G as isAuthoringTypeConstructorDescriptor, H as isAuthoringPslBlockDescriptor, I as instantiateAuthoringTypeAlias, J as mergeAuthoringNamespaces, K as isAuthoringTypeDescriptor, L as instantiateAuthoringTypeConstructor, N as flushAuthoringWarnings, O as assertNoCrossRegistryCollisions, P as getAuthoringTypeConstructor, Q as validateAuthoringHelperArguments, R as instantiateAuthoringTypeConstructorFromValues, S as typeChoiceArgumentsFromObject, T as unknownTypeChoiceArgumentMessage, U as isAuthoringTypeAliasDescriptor, V as isAuthoringModelAttributeDescriptor, W as isAuthoringTypeChoiceDescriptor, X as resolveEnumCodecId, Y as resolveAuthoringTemplateValue, Z as resolveTypeAliasGenerators, _ as collectScalarTypeConstructors, a as assembleDataTypeSupport, b as isAuthoringTypeChoiceOption, c as canonicalizeTaggedLiteralBody, d as printedTaggedLiteralReadsBack, et as validateAuthoringTypeParams, g as authoringTypeNamespaceLevel, h as assertTypeChoicesValid, i as assembleAuthoringDataTypes, j as classifyEnumMemberType, k as assertResolvableTypeConstructorTemplates, l as describeTaggedLiteralFailure, m as tsTaggedTemplateSource, n as temporalTypeAliases, p as resolveTemplateTagEscapes, t as TIMESTAMP_NOW_GENERATOR_ID, u as printTaggedLiteral, v as getAuthoringTypeChoice, w as typeConstructorLookup, x as resolveAuthoringTypeChoice, y as instantiateAuthoringTypeCall, z as isAuthoringArgRef } from \"./temporal-type-aliases-CFh3BW2a.mjs\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\n//#region src/shared/authoring-type-constructor-call.ts\n/** Every type constructor of `namespace`, with its path, in namespace order. */\nfunction* authoringTypeConstructors(namespace, path = []) {\n\tfor (const [name, value] of Object.entries(namespace)) if (isAuthoringTypeConstructorDescriptor(value)) yield {\n\t\tpath: [...path, name],\n\t\tdescriptor: value\n\t};\n\telse if (!isAuthoringTypeDescriptor(value)) yield* authoringTypeConstructors(value, [...path, name]);\n}\n/** Whether `produced` is exactly `wanted`: the same codec and the same type parameters, an absent set of parameters counting as an empty one. */\nfunction sameAuthoringTypeConstructorOutput(produced, wanted) {\n\tconst wantedFields = {\n\t\t...wanted,\n\t\ttypeParams: wanted.typeParams ?? {}\n\t};\n\treturn Object.entries({\n\t\t...produced,\n\t\ttypeParams: produced.typeParams ?? {}\n\t}).every(([key, value]) => canonicalizeJson(value) === canonicalizeJson(wantedFields[key]));\n}\n/**\n* The arguments that make `descriptor` produce exactly `output`, when each of its type parameters\n* comes straight from one argument; `undefined` when it cannot produce `output`, including when\n* `output` has no value for an argument the constructor requires.\n*/\nfunction authoringTypeConstructorArguments(descriptor, output) {\n\tif (descriptor.entityRefArg !== void 0 || descriptor.output.codecId !== output.codecId) return;\n\tconst args = [];\n\tfor (const [key, template] of Object.entries(descriptor.output.typeParams ?? {})) {\n\t\tconst value = output.typeParams?.[key];\n\t\tif (value !== void 0 && isAuthoringArgRef(template)) args[template.index] = value;\n\t}\n\tconst requiredArgs = (descriptor.args ?? []).filter((arg) => arg.optional !== true).length;\n\tif (args.length < requiredArgs || Array.from(args).includes(void 0)) return void 0;\n\ttry {\n\t\treturn sameAuthoringTypeConstructorOutput(instantiateAuthoringTypeConstructor(descriptor, args), output) ? args : void 0;\n\t} catch {\n\t\treturn;\n\t}\n}\n/**\n* The first call, in namespace order, to a type constructor in `namespace` that produces exactly\n* `output`. The inverse of {@link instantiateAuthoringTypeConstructor} for constructors whose type\n* parameters each come straight from one argument. A constructor whose argument names another\n* entity is never chosen. `undefined` when no call produces `output`.\n*/\nfunction findAuthoringTypeConstructorCall(namespace, output) {\n\tfor (const { path, descriptor } of authoringTypeConstructors(namespace)) {\n\t\tconst args = authoringTypeConstructorArguments(descriptor, output);\n\t\tif (args !== void 0) return {\n\t\t\tpath,\n\t\t\targs\n\t\t};\n\t}\n}\n//#endregion\n//#region src/shared/authoring-type-choice-call.ts\nfunction choicesNaming(level, constructorName) {\n\treturn Object.entries(level).flatMap(([name, member]) => {\n\t\tif (!isAuthoringTypeChoiceDescriptor(member)) return [];\n\t\tconst row = member.choices.find((candidate) => candidate.type === constructorName);\n\t\treturn row === void 0 ? [] : [{\n\t\t\tname,\n\t\t\tdescriptor: member,\n\t\t\twhen: row.when\n\t\t}];\n\t});\n}\nfunction outputOf(produce) {\n\ttry {\n\t\treturn produce();\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn;\n\t}\n}\n/**\n* The call to a type choice that becomes the type constructor call `call`: of the type choices at the constructor's level with a row naming the constructor, the first in namespace order whose call gives the same output. Its options come from that row and its passed-on arguments from the call, and every argument whose omission still gives the same output is left out. `sameOutput` decides what counts as the same output; by default the codec and type parameters must be exactly equal. `undefined` when no type choice names the constructor or no call to one gives the same output.\n*/\nfunction findAuthoringTypeChoiceCall(input) {\n\tconst { call } = input;\n\tconst sameOutput = input.sameOutput ?? sameAuthoringTypeConstructorOutput;\n\tconst prefix = call.path.slice(0, -1);\n\tconst constructorName = call.path.at(-1);\n\tconst level = authoringTypeNamespaceLevel(input.namespace, prefix);\n\tif (level === void 0 || constructorName === void 0) return void 0;\n\tconst explicit = typeConstructorLookup(level)(constructorName);\n\tconst wanted = explicit && outputOf(() => instantiateAuthoringTypeConstructor(explicit, call.args));\n\tif (explicit === void 0 || wanted === void 0) return void 0;\n\tconst passedValue = (name) => call.args[(explicit.args ?? []).findIndex((parameter) => parameter.name === name)];\n\tfor (const choice of choicesNaming(level, constructorName)) {\n\t\tconst found = choiceCallReproducing({\n\t\t\tlevel,\n\t\t\tprefix,\n\t\t\tchoice,\n\t\t\tpassedValue,\n\t\t\treproduces: (produced) => sameOutput(produced, wanted)\n\t\t});\n\t\tif (found !== void 0) return found;\n\t}\n}\nfunction choiceCallReproducing(input) {\n\tconst { level, prefix, choice } = input;\n\tconst reproduces = (args) => {\n\t\tconst produced = outputOf(() => instantiateAuthoringTypeCall(level, choice.name, args));\n\t\treturn produced !== void 0 && input.reproduces(produced);\n\t};\n\tconst args = choice.descriptor.args.map((argument) => isAuthoringTypeChoiceOption(argument) ? choice.when[argument.name] : input.passedValue(argument.name));\n\tif (!reproduces(args)) return void 0;\n\tfor (const index of args.keys()) {\n\t\tconst without = args.map((value, at) => at === index ? void 0 : value);\n\t\tif (args[index] !== void 0 && reproduces(without)) args[index] = void 0;\n\t}\n\tconst chosen = resolveAuthoringTypeChoice({\n\t\thelperPath: choice.name,\n\t\tdescriptor: choice.descriptor,\n\t\targs,\n\t\tconstructorNamed: typeConstructorLookup(level)\n\t});\n\tconst chosenArgs = [...chosen.args];\n\twhile (chosenArgs.length > 0 && chosenArgs.at(-1) === void 0) chosenArgs.pop();\n\treturn {\n\t\tpath: [...prefix, choice.name],\n\t\targs: choice.descriptor.args.flatMap((argument, index) => args[index] === void 0 ? [] : [{\n\t\t\tname: argument.name,\n\t\t\tvalue: args[index]\n\t\t}]),\n\t\tbecomes: {\n\t\t\tpath: [...prefix, chosen.type],\n\t\t\targs: chosenArgs\n\t\t}\n\t};\n}\n//#endregion\n//#region src/shared/written-value.ts\n/**\n* Words a refusal of the cast rule. The message leads with what to write; the types are named only when the value has a form the position admits and its type is still refused, such as a number too large for the receiving type.\n*/\nfunction describeRefusal(refusal, support, guidance) {\n\tswitch (refusal.kind) {\n\t\tcase \"unknown-tag\": return {\n\t\t\tcode: \"PSL_UNKNOWN_LITERAL_TAG\",\n\t\t\tmessage: `Unknown literal tag \"${refusal.tag}\". Known tags: ${refusal.known.join(\", \")}.`\n\t\t};\n\t\tcase \"unwritable\": return {\n\t\t\tcode: \"PSL_VALUE_TYPE_INCOMPATIBLE\",\n\t\t\tmessage: `${describeExpected(guidance.forms)}; this target has no data type for a ${refusal.syntax} value`\n\t\t};\n\t\tcase \"unreadable\":\n\t\tcase \"refused-by-type\": return {\n\t\t\tcode: \"PSL_INVALID_LITERAL\",\n\t\t\tmessage: refusal.message\n\t\t};\n\t\tcase \"no-cast\": return {\n\t\t\tcode: \"PSL_VALUE_TYPE_INCOMPATIBLE\",\n\t\t\tmessage: describeRefusedValueType(refusal, support, guidance)\n\t\t};\n\t}\n}\n/** `Expected <forms>`, the forms joined with `or`: the start of every refusal that says what to write. */\nfunction describeExpected(forms) {\n\treturn `Expected ${joinForms(forms)}`;\n}\n/**\n* Words a value of type `valueType` that `receivingType` refuses, where `guidance.forms` may be written. The types are named only when the value has one of those forms.\n*/\nfunction describeRefusedValueType(refused, support, guidance) {\n\tconst expected = describeExpected(guidance.forms);\n\tconst valueForm = writtenForm(support, refused.valueType);\n\tif (valueForm !== void 0 && guidance.forms.some((form) => isSameForm(form, valueForm))) return `${expected} that ${refused.receivingType} can hold; got ${refused.valueType}`;\n\treturn guidance.rewrite === void 0 ? expected : `${expected}; write ${guidance.rewrite}`;\n}\nfunction isSameForm(a, b) {\n\treturn a.kind === \"tag\" && b.kind === \"tag\" ? a.tag === b.tag : a.kind === b.kind;\n}\n/** Text a contract source reads as a number literal. */\nconst NUMBER_TEXT = /^[+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?$|^[+-]?(?:NaN|Infinity)$/;\nconst DECIMAL_TEXT = /^([+-]?)0*(\\d*?)(?:\\.(\\d*?))?0*$/;\n/** A decimal numeral in one form: no plus sign, no leading or trailing zeros, the sign of zero kept. Other text is itself. */\nfunction canonicalNumber(text) {\n\tconst match = text.includes(\".\") ? DECIMAL_TEXT.exec(text) : /^([+-]?)0*(\\d*)$/.exec(text);\n\tif (match === null) return text;\n\tconst [, sign = \"\", whole = \"\", fraction = \"\"] = match;\n\treturn `${sign === \"-\" ? \"-\" : \"\"}${whole === \"\" ? \"0\" : whole}${fraction === \"\" ? \"\" : `.${fraction}`}`;\n}\n/** Whether a stored value is the number `text` writes, digit for digit and with its sign, so writing the text unquoted stores what it says. */\nfunction sameNumber(text, stored) {\n\tconst storedText = typeof stored === \"number\" ? Object.is(stored, -0) ? \"-0\" : numeralText(stored) : typeof stored === \"string\" ? stored : void 0;\n\treturn storedText !== void 0 && canonicalNumber(storedText) === canonicalNumber(text);\n}\n/**\n* The literal to write in place of a quoted string that `receivingType` refuses under `receivingParams`: the string as a literal of the first tag the type admits, or else the string's text unquoted, as a number or a boolean. `undefined` when the value is not a quoted string, no such literal reads back as the same text, the type would refuse each of them too, or the number the text writes would be stored as another number, as `-0` is stored without its sign or `9007199254740993` as the nearest double.\n*/\nfunction exactRewrite(support, receiving, written) {\n\tif (written.kind !== \"string\") return void 0;\n\tconst castOf = (candidate) => {\n\t\tconst read = readWrittenValue(support, candidate);\n\t\tif (!read.ok) return void 0;\n\t\tconst cast = castTypedValue(support, receiving.receivingType, receiving.receivingParams, read.value);\n\t\treturn cast.ok ? cast.value : void 0;\n\t};\n\tconst admits = (candidate) => castOf(candidate) !== void 0;\n\tconst [tag] = admittedTags(support, receiving.receivingType);\n\tif (tag !== void 0 && printedTaggedLiteralReadsBack(written.text) && admits({\n\t\tkind: \"tag\",\n\t\ttag,\n\t\ttext: written.text\n\t})) return printTaggedLiteral(tag, written.text);\n\tif (NUMBER_TEXT.test(written.text)) {\n\t\tconst stored = castOf({\n\t\t\tkind: \"number\",\n\t\t\ttext: written.text\n\t\t});\n\t\tif (stored !== void 0 && sameNumber(written.text, stored.value)) return written.text;\n\t}\n\tif ((written.text === \"true\" || written.text === \"false\") && admits({\n\t\tkind: \"boolean\",\n\t\tvalue: written.text === \"true\"\n\t})) return written.text;\n}\nfunction findEntry(support, matches) {\n\tfor (const [key, entry] of Object.entries(support.entries)) if (matches(entry)) return {\n\t\tkey,\n\t\tentry\n\t};\n}\n/** The entry a tag names, or `undefined` when no pack registered that tag. */\nfunction entryForTag(support, tag) {\n\treturn findEntry(support, ({ written }) => written.kind === \"tag\" && written.tag === tag);\n}\n/** The entry that reads a plain string, boolean or number, or `undefined` when none does. */\nfunction entryForPlain(support, syntax) {\n\treturn findEntry(support, ({ written }) => written.kind === \"plain\" && written.syntax === syntax);\n}\n/** Every tag a stack registers, in the order the entries were merged. */\nfunction knownTags(support) {\n\treturn Object.values(support.entries).flatMap((entry) => entry.written.kind === \"tag\" ? [entry.written.tag] : []);\n}\nfunction textOf(written) {\n\treturn written.kind === \"boolean\" ? String(written.value) : written.text;\n}\nfunction messageOf(error) {\n\treturn error instanceof Error ? error.message : String(error);\n}\n/** The value of `type` that `json` gives under `params`, constructed by that type; a refusal is worded for a diagnostic. */\nfunction valueOfType(support, type, json, params, refuse) {\n\tconst declaration = support.lookup.get(type);\n\tif (declaration === void 0) throw new InternalError(`A value of \"${type}\" was written, and this stack does not register it.`);\n\ttry {\n\t\treturn ok(declaration.valueFrom(json(), params));\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn notOk(refuse(messageOf(error)));\n\t}\n}\n/** Read one written value through the authoring entry for its syntax, as a value its type constructs. */\nfunction readWrittenValue(support, written) {\n\tconst found = written.kind === \"tag\" ? entryForTag(support, written.tag) : entryForPlain(support, written.kind);\n\tif (found === void 0) return written.kind === \"tag\" ? notOk({\n\t\tkind: \"unknown-tag\",\n\t\ttag: written.tag,\n\t\tknown: knownTags(support)\n\t}) : notOk({\n\t\tkind: \"unwritable\",\n\t\tsyntax: written.kind\n\t});\n\tconst text = textOf(written);\n\tconst form = found.entry.written;\n\tconst unreadable = (message) => ({\n\t\tkind: \"unreadable\",\n\t\tmessage\n\t});\n\tif (form.kind === \"plain\" && form.syntax === \"number\") {\n\t\tconst classified = form.classify(text);\n\t\treturn classified === void 0 ? notOk(unreadable(`no data type of this target holds the number ${text}`)) : valueOfType(support, classified.type, () => classified.value, {}, unreadable);\n\t}\n\treturn valueOfType(support, dataTypeId(found.key), () => form.parse(text), {}, unreadable);\n}\n/** Take a value into the receiving type, directly or through the cast that type declares; the receiving type constructs the result under `receivingParams`, the parameters of the position that receives it. */\nfunction castTypedValue(support, receivingType, receivingParams, value) {\n\tconst refusedByType = (message) => ({\n\t\tkind: \"refused-by-type\",\n\t\treceivingType,\n\t\tmessage\n\t});\n\tif (value.type === receivingType) return valueOfType(support, receivingType, () => value.value, receivingParams, refusedByType);\n\tconst declaration = support.lookup.get(receivingType);\n\tconst cast = declaration?.casts[value.type];\n\tif (cast === void 0) return notOk({\n\t\tkind: \"no-cast\",\n\t\treceivingType,\n\t\treceivingParams,\n\t\tvalueType: value.type,\n\t\tcasts: Object.keys(declaration?.casts ?? {})\n\t});\n\tconst source = support.lookup.get(value.type);\n\tif (source === void 0) throw new InternalError(`A value of \"${value.type}\" was cast, and this stack does not register it.`);\n\tlet json;\n\ttry {\n\t\tjson = cast(source.toContract(value));\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn notOk({\n\t\t\tkind: \"unreadable\",\n\t\t\tmessage: messageOf(error)\n\t\t});\n\t}\n\treturn valueOfType(support, receivingType, () => json, receivingParams, refusedByType);\n}\n/**\n* Reads `written` as a value of `receivingType`: through the authoring entry for its syntax, then into `receivingType` directly or through a cast it declares. A refusal is worded for a diagnostic at the written value. The read every value of a fixed receiving type takes: an attribute argument, a type-constructor argument, and its TypeScript counterpart. ADR 254.\n*/\nfunction readWrittenValueAs(support, receivingType, written) {\n\tconst forms = admittedForms(support, [receivingType]);\n\tconst read = readWrittenValue(support, written);\n\tif (!read.ok) return notOk(describeRefusal(read.failure, support, {\n\t\tforms,\n\t\trewrite: void 0\n\t}));\n\tconst cast = castTypedValue(support, receivingType, {}, read.value);\n\tif (cast.ok) return cast;\n\tconst rewrite = exactRewrite(support, {\n\t\treceivingType,\n\t\treceivingParams: {}\n\t}, written);\n\treturn notOk(describeRefusal(cast.failure, support, {\n\t\tforms,\n\t\trewrite\n\t}));\n}\n/**\n* Reads `written` into the codec `ref` names, built with `ref`'s type parameters: the authoring entry for its syntax reads it, the codec's data type takes it directly or through a cast, the data type constructs it under the type parameters, and the codec checks it. Returns the value as the data type stores it. A written list is read element by element into the element types of the data type's list cast, then through the list cast.\n*\n* A refusal is worded for a diagnostic, after `subject` and the element it is about, as in `enum \"Ratio\" member \"Half\" at element 2: Expected a number`: syntax no entry reads or a cast refuses is `PSL_INVALID_LITERAL`, a value of a type the data type neither is nor casts from is `PSL_VALUE_TYPE_INCOMPATIBLE`, and a value the data type under the type parameters or the codec refuses is `PSL_VALUE_REFUSED`. ADR 254.\n*/\nfunction readWrittenValueIntoCodec(input) {\n\tconst { support, ref, written, subject } = input;\n\tconst codec = codecForRef(input.codecLookup, ref);\n\tif (codec === void 0) throw new InternalError(`${subject}: no codec descriptor is registered for \"${ref.codecId}\", but the value was read for it.`);\n\tconst receivingType = codec.dataType.id;\n\tconst receivingParams = dataTypeParams(codec.dataType, ref.typeParams);\n\tconst refused = (elementIndex, { code, message }) => notOk({\n\t\tcode,\n\t\tmessage: `${elementIndex === void 0 ? subject : `${subject} at element ${elementIndex + 1}`}: ${message}`\n\t});\n\tconst stored = (json) => {\n\t\ttry {\n\t\t\tconst value = codec.dataType.valueFrom(json, receivingParams);\n\t\t\tcodec.fromDataTypeValue(value);\n\t\t\treturn ok(codec.dataType.toContract(value));\n\t\t} catch (error) {\n\t\t\tif (isInternalError(error)) throw error;\n\t\t\treturn refused(void 0, {\n\t\t\t\tcode: \"PSL_VALUE_REFUSED\",\n\t\t\t\tmessage: messageOf(error)\n\t\t\t});\n\t\t}\n\t};\n\tconst forms = admittedForms(support, [receivingType]);\n\tif (written.kind === \"list\") {\n\t\tconst listCast = support.lookup.get(receivingType)?.listCast;\n\t\tif (listCast === void 0) return refused(void 0, {\n\t\t\tcode: \"PSL_VALUE_TYPE_INCOMPATIBLE\",\n\t\t\tmessage: `${describeExpected(forms)}; got a list`\n\t\t});\n\t\tconst elementGuidance = {\n\t\t\tforms: admittedForms(support, listCast.of),\n\t\t\trewrite: void 0\n\t\t};\n\t\tconst elements = [];\n\t\tfor (const [index, element] of written.elements.entries()) {\n\t\t\tif (element.kind === \"list\") return refused(index, {\n\t\t\t\tcode: \"PSL_INVALID_LITERAL\",\n\t\t\t\tmessage: \"a list holds values, not other lists\"\n\t\t\t});\n\t\t\tconst read = readWrittenValue(support, element);\n\t\t\tif (!read.ok) return refused(index, describeRefusal(read.failure, support, elementGuidance));\n\t\t\tif (!listCast.of.includes(read.value.type)) return refused(index, {\n\t\t\t\tcode: \"PSL_VALUE_TYPE_INCOMPATIBLE\",\n\t\t\t\tmessage: describeRefusedValueType({\n\t\t\t\t\treceivingType,\n\t\t\t\t\tvalueType: read.value.type\n\t\t\t\t}, support, elementGuidance)\n\t\t\t});\n\t\t\telements.push(read.value.value);\n\t\t}\n\t\tlet json;\n\t\ttry {\n\t\t\tjson = listCast.cast(elements);\n\t\t} catch (error) {\n\t\t\tif (isInternalError(error)) throw error;\n\t\t\treturn refused(void 0, {\n\t\t\t\tcode: \"PSL_INVALID_LITERAL\",\n\t\t\t\tmessage: messageOf(error)\n\t\t\t});\n\t\t}\n\t\treturn stored(json);\n\t}\n\tconst read = readWrittenValue(support, written);\n\tif (!read.ok) return refused(void 0, describeRefusal(read.failure, support, {\n\t\tforms,\n\t\trewrite: void 0\n\t}));\n\tconst cast = castTypedValue(support, receivingType, receivingParams, read.value);\n\tif (cast.ok) return stored(cast.value.value);\n\tconst { failure } = cast;\n\tif (failure.kind === \"refused-by-type\") return refused(void 0, {\n\t\tcode: \"PSL_VALUE_REFUSED\",\n\t\tmessage: failure.message\n\t});\n\treturn refused(void 0, describeRefusal(failure, support, {\n\t\tforms,\n\t\trewrite: failure.kind === \"no-cast\" ? exactRewrite(support, failure, written) : void 0\n\t}));\n}\n/** The type itself, then each type it casts from, in key order. */\nfunction admittedTypes(support, dataType) {\n\treturn [dataType, ...Object.keys(support.lookup.get(dataType)?.casts ?? {})];\n}\n/** The tags a position of `dataType` admits: its own tag, then the tags of the types it casts from. */\nfunction admittedTags(support, dataType) {\n\tconst tags = admittedTypes(support, dataType).flatMap((type) => {\n\t\tconst written = support.entries[type]?.written;\n\t\treturn written?.kind === \"tag\" ? [written.tag] : [];\n\t});\n\treturn [...new Set(tags)];\n}\n/** The form a value of a tagged literal's type is written in. */\nfunction tagForm(tag) {\n\treturn {\n\t\tkind: \"tag\",\n\t\ttag,\n\t\tphrase: `${tag}\\`...\\``\n\t};\n}\nconst PLAIN_PHRASES = {\n\tstring: \"a quoted string\",\n\tboolean: \"true or false\",\n\tnumber: \"a number\"\n};\nfunction writtenForm(support, type) {\n\tconst written = support.entries[type]?.written;\n\tif (written?.kind === \"tag\") return tagForm(written.tag);\n\tif (written?.kind === \"plain\" && written.syntax !== \"number\") return {\n\t\tkind: written.syntax,\n\t\tphrase: PLAIN_PHRASES[written.syntax]\n\t};\n\treturn Object.entries(support.entries).some(([key, entry]) => entry.written.kind === \"plain\" && entry.written.syntax === \"number\" && (key === type || entry.written.types.some((listed) => listed === type))) ? {\n\t\tkind: \"number\",\n\t\tphrase: PLAIN_PHRASES.number\n\t} : void 0;\n}\n/** What {@link describeAdmittedForms} returns for a type that nothing writes. */\nconst NO_WRITTEN_FORM = \"no written form\";\n/** Each form a position receiving every one of `receivingTypes` admits, once, in order: ``sql`...` ``, `true or false`. */\nfunction admittedForms(support, receivingTypes) {\n\tconst forms = [];\n\tfor (const type of receivingTypes.flatMap((receiving) => admittedTypes(support, receiving))) {\n\t\tconst form = writtenForm(support, type);\n\t\tif (form !== void 0 && !forms.some((listed) => isSameForm(listed, form))) forms.push(form);\n\t}\n\treturn forms;\n}\nfunction joinForms(forms) {\n\treturn forms.length === 0 ? NO_WRITTEN_FORM : forms.map((form) => form.phrase).join(\" or \");\n}\n/** How a position of `dataType` can be written, for a diagnostic: ``sql`...` ``, `true or false`. */\nfunction describeAdmittedForms(support, dataType) {\n\treturn joinForms(admittedForms(support, [dataType]));\n}\n//#endregion\n//#region src/shared/data-type-literal.ts\n/** A string as a contract source writes it, with the escapes its string reader resolves. */\nfunction escapePslString(value) {\n\treturn value.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\");\n}\nfunction writingSurface(support) {\n\tconst entryOf = /* @__PURE__ */ new Map();\n\tconst tagTypes = [];\n\tfor (const [key, entry] of Object.entries(support.entries)) {\n\t\tconst written = entry.written;\n\t\tif (written.kind === \"tag\") {\n\t\t\tconst type = dataTypeId(key);\n\t\t\tif (!entryOf.has(type)) entryOf.set(type, entry);\n\t\t\ttagTypes.push(type);\n\t\t\tcontinue;\n\t\t}\n\t\tif (written.syntax === \"number\") {\n\t\t\tfor (const type of written.types) entryOf.set(type, entry);\n\t\t\tcontinue;\n\t\t}\n\t\tentryOf.set(key, entry);\n\t}\n\treturn {\n\t\tsupport,\n\t\tentryOf,\n\t\ttagTypes\n\t};\n}\nfunction readValue(surface, written) {\n\tconst read = readWrittenValue(surface.support, written);\n\treturn read.ok ? read.value : void 0;\n}\n/** The value of a tag's type that a stored document is, constructed by that type. */\nfunction tagValue(surface, type, value) {\n\ttry {\n\t\treturn surface.support.lookup.get(type)?.valueFrom(value, {});\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn;\n\t}\n}\n/**\n* Every value the stored form could be, in the order a written value would be read: a number or\n* numeral text through the number entry first, then the plain syntax that matches the shape, then\n* each tag, whose stored form is a whole document, which may itself be a number or a boolean.\n*/\nfunction classifications(value, surface) {\n\tconst found = [];\n\tif (typeof value === \"number\") found.push(readValue(surface, {\n\t\tkind: \"number\",\n\t\ttext: numeralText(value)\n\t}));\n\telse if (typeof value === \"boolean\") found.push(readValue(surface, {\n\t\tkind: \"boolean\",\n\t\tvalue\n\t}));\n\telse if (typeof value === \"string\") {\n\t\tfound.push(readValue(surface, {\n\t\t\tkind: \"number\",\n\t\t\ttext: value\n\t\t}));\n\t\tfound.push(readValue(surface, {\n\t\t\tkind: \"string\",\n\t\t\ttext: value\n\t\t}));\n\t}\n\tfor (const type of surface.tagTypes) found.push(tagValue(surface, type, value));\n\treturn found.filter((candidate) => candidate !== void 0);\n}\n/** What the receiving type stores for `json` under its parameters, or `undefined` when it holds no such value. */\nfunction storedUnder(json, receiver, lookup) {\n\tconst type = lookup.get(receiver.id);\n\tif (type === void 0) return void 0;\n\ttry {\n\t\treturn type.toContract(type.valueFrom(json, receiver.params));\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn;\n\t}\n}\n/** The stored form the receiving type takes this value as, spelled as its parameters give it, or `undefined` when its type takes no such value. */\nfunction admitted(candidate, receiver, surface) {\n\tconst cast = castTypedValue(surface.support, receiver.id, receiver.params, candidate);\n\treturn cast.ok ? cast.value.value : void 0;\n}\n/** The text of the literal: what the entry prints, before the syntax that fences it. */\nfunction printedText(entry, value) {\n\ttry {\n\t\treturn entry.print(value);\n\t} catch {\n\t\treturn;\n\t}\n}\n/** The printed text as the entry's syntax writes it, for reading back. */\nfunction writtenAs(entry, text) {\n\tconst written = entry.written;\n\tif (written.kind === \"tag\") return {\n\t\tkind: \"tag\",\n\t\ttag: written.tag,\n\t\ttext\n\t};\n\tif (written.syntax !== \"boolean\") return {\n\t\tkind: written.syntax,\n\t\ttext\n\t};\n\treturn text === \"true\" || text === \"false\" ? {\n\t\tkind: \"boolean\",\n\t\tvalue: text === \"true\"\n\t} : void 0;\n}\n/** What the printed text reads back as, through the same read a written value takes. */\nfunction readBack(surface, entry, text) {\n\tconst written = writtenAs(entry, text);\n\treturn written === void 0 ? void 0 : readValue(surface, written);\n}\nfunction literalText(entry, text) {\n\tconst written = entry.written;\n\tif (written.kind === \"tag\") return printTaggedLiteral(written.tag, text);\n\treturn written.syntax === \"string\" ? `\"${escapePslString(text)}\"` : text;\n}\n/**\n* The value written as the literal of one of its types, proven by reading the text straight back:\n* the same read, the same cast, and the stored form again. A number is tried first without the\n* trailing fraction zeros the receiving type's scale spells it with.\n*/\nfunction writeScalar(value, receiver, surface) {\n\tconst shortest = withoutTrailingFractionZeros(value);\n\tconst candidates = [...shortest === void 0 ? [] : classifications(shortest, surface), ...classifications(value, surface)];\n\tfor (const candidate of candidates) {\n\t\tconst entry = surface.entryOf.get(candidate.type);\n\t\tif (entry === void 0) continue;\n\t\tconst stored = admitted(candidate, receiver, surface);\n\t\tif (stored === void 0 || !sameForm(stored, value)) continue;\n\t\tconst text = printedText(entry, candidate.value);\n\t\tif (text === void 0) continue;\n\t\tconst reread = readBack(surface, entry, text);\n\t\tif (reread === void 0) continue;\n\t\tconst restored = admitted(reread, receiver, surface);\n\t\tif (restored === void 0 || !sameForm(restored, value)) continue;\n\t\treturn literalText(entry, text);\n\t}\n}\n/**\n* `value`, a value of `dataType` as `contract.json` stores it, written as the literal of a type that `dataType` takes, proven to read back as `value`: `255` for `pg/int4`, ``sql`\"MyType\"[]` `` for `sql/expression`. `undefined` when no literal reads back as it.\n*/\nfunction writeDataTypeValue(value, dataType, support) {\n\treturn writeScalar(value, {\n\t\tid: dataType,\n\t\tparams: {}\n\t}, writingSurface(support));\n}\nconst DECIMAL_WITH_FRACTION = /^-?\\d+\\.\\d+$/;\nfunction withoutTrailingFractionZeros(value) {\n\tif (typeof value !== \"string\" || !DECIMAL_WITH_FRACTION.test(value)) return void 0;\n\tconst shortened = value.replace(/0+$/, \"\").replace(/\\.$/, \"\");\n\treturn shortened === value ? void 0 : shortened;\n}\n/** One written element of a list, printed as a value of any type, with no receiving type to admit it. */\nfunction writeElement(value, of, surface) {\n\tfor (const candidate of classifications(value, surface)) {\n\t\tif (!of.includes(candidate.type)) continue;\n\t\tconst entry = surface.entryOf.get(candidate.type);\n\t\tif (entry === void 0) continue;\n\t\tconst text = printedText(entry, candidate.value);\n\t\tif (text === void 0) continue;\n\t\tconst reread = readBack(surface, entry, text);\n\t\tif (reread === void 0 || !of.includes(reread.type)) continue;\n\t\treturn {\n\t\t\ttext: literalText(entry, text),\n\t\t\tvalue: reread.value\n\t\t};\n\t}\n}\n/**\n* A written list for a scalar data type, which that type's list cast turns into its one value,\n* constructed by the type. Each element is classified on its own and must be of a type the\n* cast takes.\n*/\nfunction writeListCast(value, receiver, surface) {\n\tconst listCast = surface.support.lookup.get(receiver.id)?.listCast;\n\tif (listCast === void 0) return void 0;\n\tconst parts = [];\n\tconst elements = [];\n\tfor (const element of value) {\n\t\tconst written = writeElement(element, listCast.of, surface);\n\t\tif (written === void 0) return void 0;\n\t\tparts.push(written.text);\n\t\telements.push(written.value);\n\t}\n\tlet cast;\n\ttry {\n\t\tcast = listCast.cast(elements);\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn;\n\t}\n\tconst stored = storedUnder(cast, receiver, surface.support.lookup);\n\treturn stored !== void 0 && sameForm(stored, value) ? `[${parts.join(\", \")}]` : void 0;\n}\n/** The PSL literal a stored value is written as for the data type `options` describe, or `undefined` when it has no written form that reads back as that value. */\nfunction writeTypedLiteral(value, options) {\n\tif (value instanceof Date) return void 0;\n\tconst { dataTypes, dataType } = options ?? {};\n\tif (dataTypes === void 0 || dataType === void 0) return void 0;\n\tconst { lookup } = dataTypes;\n\tconst receivingType = lookup.get(dataType);\n\tconst receiver = {\n\t\tid: dataType,\n\t\tparams: receivingType === void 0 ? {} : dataTypeParams(receivingType, options?.typeParams)\n\t};\n\tconst surface = writingSurface(dataTypes);\n\tif (options?.list === true) {\n\t\tif (!Array.isArray(value)) return void 0;\n\t\tconst parts = [];\n\t\tfor (const element of value) {\n\t\t\tconst written = writeScalar(element, receiver, surface);\n\t\t\tif (written === void 0) return void 0;\n\t\t\tparts.push(written);\n\t\t}\n\t\treturn `[${parts.join(\", \")}]`;\n\t}\n\tconst written = writeScalar(value, receiver, surface);\n\tif (written !== void 0) return written;\n\treturn Array.isArray(value) ? writeListCast(value, receiver, surface) : void 0;\n}\n/** Whether two stored forms are the same JSON value, member by member and element by element. */\nfunction sameForm(left, right) {\n\tif (left === right) return true;\n\tif (Array.isArray(left) !== Array.isArray(right)) return false;\n\tif (typeof left !== \"object\" || typeof right !== \"object\" || left === null || right === null) return false;\n\tconst members = Object.entries(left);\n\tconst others = new Map(Object.entries(right));\n\treturn members.length === others.size && members.every(([key, member]) => {\n\t\tconst other = others.get(key);\n\t\treturn other !== void 0 && sameForm(member, other);\n\t});\n}\n/** A value argument of a type constructor, written as a literal of its data type. */\nfunction writtenArgument(argument, value, dataTypes) {\n\treturn writeDataTypeValue(blindCast(value), dataTypeId(argument.dataType), dataTypes);\n}\n/**\n* Each argument of a call to `descriptor` as PSL writes it: a value argument as a literal of its data type that reads back as the same value. `undefined` when an argument is not a value argument or no literal reads back as it.\n*/\nfunction writtenTypeArguments(descriptor, args, dataTypes) {\n\tconst written = [];\n\tfor (const [index, value] of args.entries()) {\n\t\tconst argument = descriptor.args?.[index];\n\t\tconst text = argument && writtenArgument(argument, value, dataTypes);\n\t\tif (text === void 0) return void 0;\n\t\twritten.push(text);\n\t}\n\treturn written;\n}\n/**\n* The call to the type constructor `descriptor` at `path` as PSL writes it, with each argument that has a value written by its name as a literal of its data type, and the bare path when none has one. `undefined` when no literal reads back as one of the values.\n*/\nfunction writtenTypeConstructorCall(path, descriptor, args, dataTypes) {\n\tconst written = [];\n\tfor (const [index, argument] of (descriptor.args ?? []).entries()) {\n\t\tconst value = args[index];\n\t\tif (value === void 0) continue;\n\t\tconst text = writtenArgument(argument, value, dataTypes);\n\t\tif (text === void 0) return void 0;\n\t\twritten.push(argument.name === void 0 ? text : `${argument.name}: ${text}`);\n\t}\n\tconst name = path.join(\".\");\n\treturn written.length === 0 ? name : `${name}(${written.join(\", \")})`;\n}\n//#endregion\n//#region src/shared/enum-stored-members.ts\nfunction storedFormOf(stored) {\n\treturn canonicalStringify(JSON.parse(JSON.stringify(stored)));\n}\n/** The key two stored values are equal by: the data type's `equalityKey` when it declares one, else the stored form as `contract.json` holds it, compared by `canonicalStringify`. */\nfunction storedValueKey(stored, equalityKey) {\n\treturn equalityKey?.(stored) ?? storedFormOf(stored);\n}\n/**\n* Each enum member whose stored form equals an earlier member's, paired with the first such member. Stored forms are compared as `contract.json` holds them, so negative zero is zero, and by `canonicalStringify`, so two objects with the same entries in a different order are equal; or, when the enum's data type declares an `equalityKey`, by that key, so `0.5` and `0.50` are one `numeric` value. Every enum authoring surface refuses the members this returns.\n*/\nfunction duplicateStoredMembers(members, equalityKey) {\n\tconst memberByKey = /* @__PURE__ */ new Map();\n\tconst duplicates = [];\n\tfor (const member of members) {\n\t\tconst { name, stored } = member;\n\t\tconst key = storedValueKey(stored, equalityKey);\n\t\tconst earlier = memberByKey.get(key);\n\t\tif (earlier === void 0) memberByKey.set(key, member);\n\t\telse if (storedFormOf(earlier.stored) === storedFormOf(stored)) duplicates.push({\n\t\t\tearlier: earlier.name,\n\t\t\tlater: name,\n\t\t\tstored\n\t\t});\n\t\telse duplicates.push({\n\t\t\tearlier: earlier.name,\n\t\t\tlater: name,\n\t\t\tstored,\n\t\t\tearlierStored: earlier.stored\n\t\t});\n\t}\n\treturn duplicates;\n}\n//#endregion\n//#region src/shared/discriminator-rule.ts\n/**\n* The refusals of a discriminator: the field must be required, hold one value, and have one of the stack's text data types; and when an enum types it, each variant's value, as the field stores it, must be one of the enum's members, compared by the field's data type's equality. Returns no refusals for a discriminator that is valid.\n*/\nfunction discriminatorRefusals(input) {\n\tconst { field } = input;\n\tconst textDataTypes = input.dataTypes.textDataTypes ?? [];\n\tif (textDataTypes.length === 0) throw new InternalError(\"The stack names no text data types, so no field can be a discriminator; the target names its text types in its authoring contributions.\");\n\tconst refusals = [];\n\tif (field.nullable) refusals.push({ kind: \"optional\" });\n\tif (field.many) refusals.push({ kind: \"list\" });\n\tconst dataType = field.ref === void 0 ? void 0 : input.codecLookup.descriptorFor(field.ref.codecId)?.dataType;\n\tif (dataType === void 0 || !textDataTypes.includes(dataType)) refusals.push({\n\t\tkind: \"not-text\",\n\t\tdataType,\n\t\ttextDataTypes\n\t});\n\tconst members = field.enumMembers;\n\tif (members !== void 0) {\n\t\tconst equalityKey = dataType === void 0 ? void 0 : input.dataTypes.lookup.get(dataType)?.equalityKey;\n\t\tconst memberKeys = new Set(members.map((member) => storedValueKey(member, equalityKey)));\n\t\tfor (const { key, stored } of input.variantValues) if (!memberKeys.has(storedValueKey(stored, equalityKey))) refusals.push({\n\t\t\tkind: \"not-a-member\",\n\t\t\tkey,\n\t\t\tstored,\n\t\t\tmembers\n\t\t});\n\t}\n\treturn refusals;\n}\n/**\n* A discriminator refusal worded as a PSL diagnostic: a refusal of the field at its `@@discriminator`, and a value that is not a member at its `@@base`. The wording names PSL syntax, so PSL sources word the refusals with this; a TypeScript source words them in its own terms.\n*/\nfunction describeDiscriminatorRefusal(refusal, subject) {\n\tconst field = `Discriminator field \"${subject.fieldName}\" on model \"${subject.modelName}\"`;\n\tswitch (refusal.kind) {\n\t\tcase \"optional\": return `${field} must be required, but it is optional. Remove the \"?\"`;\n\t\tcase \"list\": return `${field} must hold one value, but it is a list. Remove the \"[]\"`;\n\t\tcase \"not-text\": return `${field} must be text, such as String, but is \"${subject.typeName}\"`;\n\t\tcase \"not-a-member\": return `Model \"${subject.variantName(refusal.key)}\" declares @@base value ${JSON.stringify(refusal.stored)}, which is not a member of enum \"${subject.enumName}\", the type of discriminator field \"${subject.modelName}.${subject.fieldName}\". Write one of: ${refusal.members.map((member) => JSON.stringify(member)).join(\", \")}`;\n\t}\n}\n/**\n* Applies the discriminator rule to one discriminator and its variants: reads each variant's written value into the field's codec with {@link readWrittenValueIntoCodec}, worded after `subject`, then decides with {@link discriminatorRefusals}. A refused field refuses the whole discriminator, so its variants' values are neither read nor refused. A discriminator is text, so a stored value that is not a string is a bug in a text data type.\n*/\nfunction applyDiscriminatorRule(input) {\n\tconst { field, codecLookup, dataTypes } = input;\n\tconst fieldOnly = discriminatorRefusals({\n\t\tfield,\n\t\tvariantValues: [],\n\t\tcodecLookup,\n\t\tdataTypes\n\t}).filter(isFieldRefusal);\n\tif (fieldOnly.length > 0) return {\n\t\tfieldRefusals: fieldOnly,\n\t\tvariantRefusals: [],\n\t\tvalues: /* @__PURE__ */ new Map()\n\t};\n\tconst ref = field.ref;\n\tif (ref === void 0) throw new InternalError(\"A discriminator field the rule accepts has a codec.\");\n\tconst reads = input.variants.map(({ key, written }) => ({\n\t\tkey,\n\t\treading: readWrittenValueIntoCodec({\n\t\t\tsupport: dataTypes,\n\t\t\tcodecLookup,\n\t\t\tref,\n\t\t\twritten,\n\t\t\tsubject: input.subject\n\t\t})\n\t}));\n\tconst notMembers = new Map(discriminatorRefusals({\n\t\tfield,\n\t\tvariantValues: reads.flatMap(({ key, reading }) => reading.ok ? [{\n\t\t\tkey,\n\t\t\tstored: reading.value\n\t\t}] : []),\n\t\tcodecLookup,\n\t\tdataTypes\n\t}).flatMap((refusal) => refusal.kind === \"not-a-member\" ? [[refusal.key, refusal]] : []));\n\tconst variantRefusals = [];\n\tconst values = /* @__PURE__ */ new Map();\n\tfor (const { key, reading } of reads) {\n\t\tif (!reading.ok) {\n\t\t\tvariantRefusals.push({\n\t\t\t\tkind: \"unreadable\",\n\t\t\t\tkey,\n\t\t\t\trefusal: reading.failure\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst notMember = notMembers.get(key);\n\t\tif (notMember !== void 0) {\n\t\t\tvariantRefusals.push(notMember);\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof reading.value !== \"string\") throw new InternalError(`Discriminator field codec \"${ref.codecId}\" stores a text value as ${typeof reading.value}.`);\n\t\tvalues.set(key, reading.value);\n\t}\n\treturn {\n\t\tfieldRefusals: [],\n\t\tvariantRefusals,\n\t\tvalues\n\t};\n}\nfunction isFieldRefusal(refusal) {\n\treturn refusal.kind !== \"not-a-member\";\n}\n//#endregion\n//#region src/shared/enum-block-members.ts\n/**\n* A problem with an enum's members as a diagnostic at the member, or at the block when the problem is the enum's codec.\n*/\nfunction enumMemberProblemDiagnostic(problem, site) {\n\tconst { enumName, codecId, sourceId } = site;\n\tconst at = (member) => ({\n\t\tsourceId,\n\t\tspan: site.memberSpans[member] ?? site.span\n\t});\n\tswitch (problem.kind) {\n\t\tcase \"codec-not-for-enums\": return {\n\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\tmessage: `enum \"${enumName}\" cannot use the codec \"${codecId}\". ${problem.refusal}`,\n\t\t\tsourceId,\n\t\t\tspan: site.span\n\t\t};\n\t\tcase \"codec-missing\": return {\n\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\tmessage: `enum \"${enumName}\" uses codec \"${codecId}\", which no pack in the contract provides`,\n\t\t\tsourceId,\n\t\t\tspan: site.span\n\t\t};\n\t\tcase \"codec-refused-member\": return {\n\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\tmessage: `enum \"${enumName}\" member \"${problem.member}\" was rejected by codec \"${codecId}\": ${problem.reason}`,\n\t\t\t...at(problem.member)\n\t\t};\n\t\tcase \"member-not-stored-as-written\": return {\n\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\tmessage: `enum \"${enumName}\" member \"${problem.member}\" is written ${problem.written}, but its codec stores ${JSON.stringify(problem.stored)}. Write the member as ${problem.writeAs}.`,\n\t\t\t...at(problem.member)\n\t\t};\n\t\tcase \"duplicate-member-value\": return {\n\t\t\tcode: \"PSL_ENUM_DUPLICATE_MEMBER_VALUE\",\n\t\t\tmessage: problem.earlierStored === void 0 ? `enum \"${enumName}\": members \"${problem.earlier}\" and \"${problem.later}\" both store ${JSON.stringify(problem.stored)}` : `enum \"${enumName}\": members \"${problem.earlier}\" and \"${problem.later}\" store ${JSON.stringify(problem.earlierStored)} and ${JSON.stringify(problem.stored)}, which the database holds equal`,\n\t\t\t...at(problem.later)\n\t\t};\n\t}\n}\n/** A member as it is written: its recorded written value, or a bare member's name, as text. */\nfunction writtenMember(block, memberName, memberValue) {\n\tconst written = block.writtenValues?.[memberName];\n\tif (written !== void 0) return written;\n\tif (memberValue === void 0) return {\n\t\tkind: \"string\",\n\t\ttext: memberName\n\t};\n\tthrow new InternalError(`enum \"${block.name}\" member \"${memberName}\" has a value, but the block holds no written value for it.`);\n}\n/**\n* Reads the members of an `enum` block through its codec with {@link readWrittenValueIntoCodec}: each member's syntax gives it a data type, the codec's data type takes it directly or through a cast, and the codec checks it, so a number keeps every digit and a quoted value is text. A bare member is read from its own name, as text.\n* Pushes a diagnostic and returns `undefined` when a member is refused, when two members\n* store the same value, or when the block has no members. Shared by every family's enum factory.\n*/\nfunction readEnumBlockMembers(block, codecId, codec, ctx) {\n\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\tconst diagnostics = ctx.diagnostics;\n\tconst site = {\n\t\tenumName: block.name,\n\t\tcodecId,\n\t\tsourceId,\n\t\tspan: block.span,\n\t\tmemberSpans: block.parameterSpans\n\t};\n\tconst members = [];\n\tconst storedMembers = [];\n\tlet memberError = false;\n\tfor (const [memberName, memberValue] of Object.entries(block.values)) {\n\t\tconst span = block.parameterSpans[memberName] ?? block.span;\n\t\tconst reading = readWrittenValueIntoCodec({\n\t\t\tsupport: ctx.dataTypes,\n\t\t\tcodecLookup: ctx.codecLookup,\n\t\t\tref: { codecId },\n\t\t\twritten: writtenMember(block, memberName, memberValue),\n\t\t\tsubject: `enum \"${block.name}\" member \"${memberName}\"`\n\t\t});\n\t\tif (!reading.ok) {\n\t\t\tdiagnostics?.push(memberValue === void 0 ? {\n\t\t\t\tcode: \"PSL_ENUM_BARE_MEMBER_NON_STRING_CODEC\",\n\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" has no value and codec \"${codecId}\" does not accept a bare name as input`,\n\t\t\t\tsourceId,\n\t\t\t\tspan\n\t\t\t} : {\n\t\t\t\t...reading.failure,\n\t\t\t\tsourceId,\n\t\t\t\tspan\n\t\t\t});\n\t\t\tmemberError = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconst read = readContractValue(codec, reading.value, void 0);\n\t\tmembers.push({\n\t\t\tname: memberName,\n\t\t\tvalue: read\n\t\t});\n\t\tstoredMembers.push({\n\t\t\tname: memberName,\n\t\t\tstored: codec.dataType.toContract(codec.toDataTypeValue(read))\n\t\t});\n\t}\n\tfor (const duplicate of duplicateStoredMembers(storedMembers, codec.dataType.equalityKey)) {\n\t\tdiagnostics?.push(enumMemberProblemDiagnostic({\n\t\t\tkind: \"duplicate-member-value\",\n\t\t\t...duplicate\n\t\t}, site));\n\t\tmemberError = true;\n\t}\n\tif (memberError) return void 0;\n\tif (members.length === 0) {\n\t\tdiagnostics?.push({\n\t\t\tcode: \"PSL_ENUM_MISSING_TYPE\",\n\t\t\tmessage: `enum \"${block.name}\" must have at least one member`,\n\t\t\tsourceId,\n\t\t\tspan: block.span\n\t\t});\n\t\treturn;\n\t}\n\treturn members;\n}\n//#endregion\n//#region src/shared/enum-members.ts\n/** Whether TypeScript gives the value a literal type: a primitive, or an array or plain object of them. */\nfunction hasLiteralType(value) {\n\tif ([\n\t\t\"string\",\n\t\t\"number\",\n\t\t\"boolean\",\n\t\t\"bigint\"\n\t].includes(typeof value)) return true;\n\tif (Array.isArray(value)) return value.every(hasLiteralType);\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn (prototype === Object.prototype || prototype === null) && Object.values(value).every(hasLiteralType);\n}\n/**\n* A member's value in the form its codec stores it, and that form read back by the codec. A codec that throws on either is a refusal naming the member; an internal error is not the member's fault and propagates.\n*/\nfunction encodeEnumMember(member, codec) {\n\ttry {\n\t\tconst stored = codec.dataType.toContract(codec.toDataTypeValue(member.value));\n\t\treturn ok({\n\t\t\tstored,\n\t\t\treadBack: readContractValue(codec, stored, void 0)\n\t\t});\n\t} catch (cause) {\n\t\tif (isInternalError(cause)) throw cause;\n\t\treturn notOk({\n\t\t\tkind: \"codec-refused-member\",\n\t\t\tmember: member.name,\n\t\t\treason: cause instanceof Error ? cause.message : String(cause),\n\t\t\tcause\n\t\t});\n\t}\n}\n/**\n* Refuses a member its codec reads back as a different value from the one written. A member with no literal type has nothing to compare.\n*/\nfunction notStoredAsWritten(member, stored, readBack) {\n\tif (!hasLiteralType(member.value)) return void 0;\n\tif (hasLiteralType(readBack) && canonicalStringify(readBack) === canonicalStringify(member.value)) return void 0;\n\treturn {\n\t\tkind: \"member-not-stored-as-written\",\n\t\tmember: member.name,\n\t\twritten: canonicalStringify(member.value),\n\t\tstored,\n\t\twriteAs: hasLiteralType(readBack) ? canonicalStringify(readBack) : JSON.stringify(stored)\n\t};\n}\n/**\n* Each member of an enum in the form its codec stores it. Refuses a codec an enum cannot use, a codec the lookup does not have, a member the codec refuses, a member the codec reads back as another value, and two members stored as the same value. Every family's contract build calls this, and reports the problems in its own terms.\n*/\nfunction encodeEnumMembers(decodedEnum, codecLookup) {\n\tconst descriptor = codecLookup.descriptorFor(decodedEnum.codecId);\n\tconst refusal = descriptor === void 0 ? void 0 : enumRefusalOf(descriptor);\n\tif (refusal !== void 0) return notOk([{\n\t\tkind: \"codec-not-for-enums\",\n\t\trefusal\n\t}]);\n\tconst codec = codecLookup.get(decodedEnum.codecId);\n\tif (codec === void 0) return notOk([{ kind: \"codec-missing\" }]);\n\tconst problems = [];\n\tconst members = [];\n\tfor (const member of decodedEnum.enumMembers) {\n\t\tconst encoded = encodeEnumMember(member, codec);\n\t\tif (!encoded.ok) {\n\t\t\tproblems.push(encoded.failure);\n\t\t\tcontinue;\n\t\t}\n\t\tconst { stored, readBack } = encoded.value;\n\t\tconst mismatch = notStoredAsWritten(member, stored, readBack);\n\t\tif (mismatch !== void 0) problems.push(mismatch);\n\t\tmembers.push({\n\t\t\tname: member.name,\n\t\t\tvalue: stored\n\t\t});\n\t}\n\tfor (const duplicate of duplicateStoredMembers(members.map(({ name, value }) => ({\n\t\tname,\n\t\tstored: value\n\t})), codec.dataType.equalityKey)) problems.push({\n\t\tkind: \"duplicate-member-value\",\n\t\t...duplicate\n\t});\n\treturn problems.length > 0 ? notOk(problems) : ok(members);\n}\n//#endregion\nexport { AUTHORING_TYPE_DESCRIPTOR_KINDS, TIMESTAMP_NOW_GENERATOR_ID, admittedForms, admittedTags, applyDiscriminatorRule, assembleAuthoringDataTypes, assembleDataTypeSupport, assertNoAuthoringFieldNamespace, assertNoCrossRegistryCollisions, assertResolvableTypeConstructorTemplates, assertTypeAliasesValid, assertTypeChoicesValid, authoringTypeConstructorArguments, authoringTypeConstructors, canonicalizeTaggedLiteralBody, castTypedValue, classifyEnumMemberType, collectScalarTypeConstructors, describeAdmittedForms, describeDiscriminatorRefusal, describeExpected, describeRefusal, describeRefusedValueType, describeTaggedLiteralFailure, duplicateStoredMembers, encodeEnumMembers, entryForPlain, entryForTag, enumMemberProblemDiagnostic, exactRewrite, findAuthoringTypeChoiceCall, findAuthoringTypeConstructorCall, flushAuthoringWarnings, getAuthoringTypeChoice, getAuthoringTypeConstructor, instantiateAuthoringEntityType, instantiateAuthoringTypeAlias, instantiateAuthoringTypeCall, instantiateAuthoringTypeConstructor, instantiateAuthoringTypeConstructorFromValues, isAuthoringArgRef, isAuthoringEntityTypeDescriptor, isAuthoringModelAttributeDescriptor, isAuthoringPslBlockDescriptor, isAuthoringTypeAliasDescriptor, isAuthoringTypeChoiceDescriptor, isAuthoringTypeChoiceOption, isAuthoringTypeConstructorDescriptor, isAuthoringTypeDescriptor, knownTags, mergeAuthoringNamespaces, printTaggedLiteral, printedTaggedLiteralReadsBack, readEnumBlockMembers, readWrittenValue, readWrittenValueAs, readWrittenValueIntoCodec, resolveAuthoringTemplateValue, resolveAuthoringTypeChoice, resolveEnumCodecId, resolveTemplateTagEscapes, resolveTypeAliasGenerators, tagForm, temporalTypeAliases, tsTaggedTemplateSource, typeChoiceArgumentsFromObject, typeChoiceCombinationText, typeConstructorLookup, unknownTypeChoiceArgumentMessage, validateAuthoringHelperArguments, validateAuthoringTypeChoiceParams, validateAuthoringTypeParams, writeDataTypeValue, writeTypedLiteral, writtenTypeArguments, writtenTypeConstructorCall };\n\n//# sourceMappingURL=authoring.mjs.map"],"mappings":";;;;;;;;;;;AAWA,UAAU,0BAA0B,WAAW,OAAO,CAAC,GAAG;CACzD,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,SAAS,GAAG,IAAI,qCAAqC,KAAK,GAAG,MAAM;EAC7G,MAAM,CAAC,GAAG,MAAM,IAAI;EACpB,YAAY;CACb;MACK,IAAI,CAAC,0BAA0B,KAAK,GAAG,OAAO,0BAA0B,OAAO,CAAC,GAAG,MAAM,IAAI,CAAC;AACpG;;AAEA,SAAS,mCAAmC,UAAU,QAAQ;CAC7D,MAAM,eAAe;EACpB,GAAG;EACH,YAAY,OAAO,cAAc,CAAC;CACnC;CACA,OAAO,OAAO,QAAQ;EACrB,GAAG;EACH,YAAY,SAAS,cAAc,CAAC;CACrC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,WAAW,iBAAiB,KAAK,MAAM,iBAAiB,aAAa,IAAI,CAAC;AAC3F;;;;;;AAMA,SAAS,kCAAkC,YAAY,QAAQ;CAC9D,IAAI,WAAW,iBAAiB,KAAK,KAAK,WAAW,OAAO,YAAY,OAAO,SAAS;CACxF,MAAM,OAAO,CAAC;CACd,KAAK,MAAM,CAAC,KAAK,aAAa,OAAO,QAAQ,WAAW,OAAO,cAAc,CAAC,CAAC,GAAG;EACjF,MAAM,QAAQ,OAAO,aAAa;EAClC,IAAI,UAAU,KAAK,KAAK,kBAAkB,QAAQ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,QAAQ,OAAO;GAC7B;EACD;EACA,MAAM,EAAE,QAAQ,aAAa,QAAQ;EACrC,MAAM,WAAW,mBAAmB,QAAQ,QAAQ,QAAQ;EAC5D,IAAI,aAAa,KAAK,GAAG,SAAS,KAAK,QAAQ;EAC/C,QAAQ,KAAK;GACZ,MAAM,OAAO;GACb,OAAO;EACR,CAAC;CACF;CACA,KAAK,MAAM,aAAa,uBAAuB,QAAQ,KAAK,EAAE,MAAM,aAAa;EAChF;EACA,QAAQ;CACT,EAAE,GAAG,MAAM,SAAS,WAAW,GAAG,SAAS,KAAK;EAC/C,MAAM;EACN,GAAG;CACJ,CAAC;CACD,OAAO,SAAS,SAAS,IAAI,MAAM,QAAQ,IAAI,GAAG,OAAO;AAC1D"}
1
+ {"version":3,"file":"authoring-BoRTq-7r.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/authoring.mjs"],"sourcesContent":["import { a as dataTypeId, o as dataTypeParams } from \"./data-type-V6mcDhcG.mjs\";\nimport { a as readContractValue, o as numeralText, r as enumRefusalOf } from \"./codec-descriptor-CPSGZunM.mjs\";\nimport { t as canonicalizeJson } from \"./canonicalize-json-ZPawceQR.mjs\";\nimport { r as codecForRef } from \"./resolve-codec-qqMjZrmn.mjs\";\nimport { $ as validateAuthoringTypeChoiceParams, A as assertTypeAliasesValid, B as isAuthoringEntityTypeDescriptor, C as typeChoiceCombinationText, D as assertNoAuthoringFieldNamespace, E as AUTHORING_TYPE_DESCRIPTOR_KINDS, F as instantiateAuthoringEntityType, G as isAuthoringTypeConstructorDescriptor, H as isAuthoringPslBlockDescriptor, I as instantiateAuthoringTypeAlias, J as mergeAuthoringNamespaces, K as isAuthoringTypeDescriptor, L as instantiateAuthoringTypeConstructor, N as flushAuthoringWarnings, O as assertNoCrossRegistryCollisions, P as getAuthoringTypeConstructor, Q as validateAuthoringHelperArguments, R as instantiateAuthoringTypeConstructorFromValues, S as typeChoiceArgumentsFromObject, T as unknownTypeChoiceArgumentMessage, U as isAuthoringTypeAliasDescriptor, V as isAuthoringModelAttributeDescriptor, W as isAuthoringTypeChoiceDescriptor, X as resolveEnumCodecId, Y as resolveAuthoringTemplateValue, Z as resolveTypeAliasGenerators, _ as collectScalarTypeConstructors, a as assembleDataTypeSupport, b as isAuthoringTypeChoiceOption, c as canonicalizeTaggedLiteralBody, d as printedTaggedLiteralReadsBack, et as validateAuthoringTypeParams, g as authoringTypeNamespaceLevel, h as assertTypeChoicesValid, i as assembleAuthoringDataTypes, j as classifyEnumMemberType, k as assertResolvableTypeConstructorTemplates, l as describeTaggedLiteralFailure, m as tsTaggedTemplateSource, n as temporalTypeAliases, p as resolveTemplateTagEscapes, t as TIMESTAMP_NOW_GENERATOR_ID, u as printTaggedLiteral, v as getAuthoringTypeChoice, w as typeConstructorLookup, x as resolveAuthoringTypeChoice, y as instantiateAuthoringTypeCall, z as isAuthoringArgRef } from \"./temporal-type-aliases-CFh3BW2a.mjs\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\n//#region src/shared/authoring-type-constructor-call.ts\n/** Every type constructor of `namespace`, with its path, in namespace order. */\nfunction* authoringTypeConstructors(namespace, path = []) {\n\tfor (const [name, value] of Object.entries(namespace)) if (isAuthoringTypeConstructorDescriptor(value)) yield {\n\t\tpath: [...path, name],\n\t\tdescriptor: value\n\t};\n\telse if (!isAuthoringTypeDescriptor(value)) yield* authoringTypeConstructors(value, [...path, name]);\n}\n/** Whether `produced` is exactly `wanted`: the same codec and the same type parameters, an absent set of parameters counting as an empty one. */\nfunction sameAuthoringTypeConstructorOutput(produced, wanted) {\n\tconst wantedFields = {\n\t\t...wanted,\n\t\ttypeParams: wanted.typeParams ?? {}\n\t};\n\treturn Object.entries({\n\t\t...produced,\n\t\ttypeParams: produced.typeParams ?? {}\n\t}).every(([key, value]) => canonicalizeJson(value) === canonicalizeJson(wantedFields[key]));\n}\n/**\n* The arguments that make `descriptor` produce exactly `output`, when each of its type parameters\n* comes straight from one argument; `undefined` when it cannot produce `output`, including when\n* `output` has no value for an argument the constructor requires.\n*/\nfunction authoringTypeConstructorArguments(descriptor, output) {\n\tif (descriptor.entityRefArg !== void 0 || descriptor.output.codecId !== output.codecId) return;\n\tconst args = [];\n\tfor (const [key, template] of Object.entries(descriptor.output.typeParams ?? {})) {\n\t\tconst value = output.typeParams?.[key];\n\t\tif (value !== void 0 && isAuthoringArgRef(template)) args[template.index] = value;\n\t}\n\tconst requiredArgs = (descriptor.args ?? []).filter((arg) => arg.optional !== true).length;\n\tif (args.length < requiredArgs || Array.from(args).includes(void 0)) return void 0;\n\ttry {\n\t\treturn sameAuthoringTypeConstructorOutput(instantiateAuthoringTypeConstructor(descriptor, args), output) ? args : void 0;\n\t} catch {\n\t\treturn;\n\t}\n}\n/**\n* The first call, in namespace order, to a type constructor in `namespace` that produces exactly\n* `output`. The inverse of {@link instantiateAuthoringTypeConstructor} for constructors whose type\n* parameters each come straight from one argument. A constructor whose argument names another\n* entity is never chosen. `undefined` when no call produces `output`.\n*/\nfunction findAuthoringTypeConstructorCall(namespace, output) {\n\tfor (const { path, descriptor } of authoringTypeConstructors(namespace)) {\n\t\tconst args = authoringTypeConstructorArguments(descriptor, output);\n\t\tif (args !== void 0) return {\n\t\t\tpath,\n\t\t\targs\n\t\t};\n\t}\n}\n//#endregion\n//#region src/shared/authoring-type-choice-call.ts\nfunction choicesNaming(level, constructorName) {\n\treturn Object.entries(level).flatMap(([name, member]) => {\n\t\tif (!isAuthoringTypeChoiceDescriptor(member)) return [];\n\t\tconst row = member.choices.find((candidate) => candidate.type === constructorName);\n\t\treturn row === void 0 ? [] : [{\n\t\t\tname,\n\t\t\tdescriptor: member,\n\t\t\twhen: row.when\n\t\t}];\n\t});\n}\nfunction outputOf(produce) {\n\ttry {\n\t\treturn produce();\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn;\n\t}\n}\n/**\n* The call to a type choice that becomes the type constructor call `call`: of the type choices at the constructor's level with a row naming the constructor, the first in namespace order whose call gives the same output. Its options come from that row and its passed-on arguments from the call, and every argument whose omission still gives the same output is left out. `sameOutput` decides what counts as the same output; by default the codec and type parameters must be exactly equal. `undefined` when no type choice names the constructor or no call to one gives the same output.\n*/\nfunction findAuthoringTypeChoiceCall(input) {\n\tconst { call } = input;\n\tconst sameOutput = input.sameOutput ?? sameAuthoringTypeConstructorOutput;\n\tconst prefix = call.path.slice(0, -1);\n\tconst constructorName = call.path.at(-1);\n\tconst level = authoringTypeNamespaceLevel(input.namespace, prefix);\n\tif (level === void 0 || constructorName === void 0) return void 0;\n\tconst explicit = typeConstructorLookup(level)(constructorName);\n\tconst wanted = explicit && outputOf(() => instantiateAuthoringTypeConstructor(explicit, call.args));\n\tif (explicit === void 0 || wanted === void 0) return void 0;\n\tconst passedValue = (name) => call.args[(explicit.args ?? []).findIndex((parameter) => parameter.name === name)];\n\tfor (const choice of choicesNaming(level, constructorName)) {\n\t\tconst found = choiceCallReproducing({\n\t\t\tlevel,\n\t\t\tprefix,\n\t\t\tchoice,\n\t\t\tpassedValue,\n\t\t\treproduces: (produced) => sameOutput(produced, wanted)\n\t\t});\n\t\tif (found !== void 0) return found;\n\t}\n}\nfunction choiceCallReproducing(input) {\n\tconst { level, prefix, choice } = input;\n\tconst reproduces = (args) => {\n\t\tconst produced = outputOf(() => instantiateAuthoringTypeCall(level, choice.name, args));\n\t\treturn produced !== void 0 && input.reproduces(produced);\n\t};\n\tconst args = choice.descriptor.args.map((argument) => isAuthoringTypeChoiceOption(argument) ? choice.when[argument.name] : input.passedValue(argument.name));\n\tif (!reproduces(args)) return void 0;\n\tfor (const index of args.keys()) {\n\t\tconst without = args.map((value, at) => at === index ? void 0 : value);\n\t\tif (args[index] !== void 0 && reproduces(without)) args[index] = void 0;\n\t}\n\tconst chosen = resolveAuthoringTypeChoice({\n\t\thelperPath: choice.name,\n\t\tdescriptor: choice.descriptor,\n\t\targs,\n\t\tconstructorNamed: typeConstructorLookup(level)\n\t});\n\tconst chosenArgs = [...chosen.args];\n\twhile (chosenArgs.length > 0 && chosenArgs.at(-1) === void 0) chosenArgs.pop();\n\treturn {\n\t\tpath: [...prefix, choice.name],\n\t\targs: choice.descriptor.args.flatMap((argument, index) => args[index] === void 0 ? [] : [{\n\t\t\tname: argument.name,\n\t\t\tvalue: args[index]\n\t\t}]),\n\t\tbecomes: {\n\t\t\tpath: [...prefix, chosen.type],\n\t\t\targs: chosenArgs\n\t\t}\n\t};\n}\n//#endregion\n//#region src/shared/written-value.ts\n/**\n* Words a refusal of the cast rule. The message leads with what to write; the types are named only when the value has a form the position admits and its type is still refused, such as a number too large for the receiving type.\n*/\nfunction describeRefusal(refusal, support, guidance) {\n\tswitch (refusal.kind) {\n\t\tcase \"unknown-tag\": return {\n\t\t\tcode: \"PSL_UNKNOWN_LITERAL_TAG\",\n\t\t\tmessage: `Unknown literal tag \"${refusal.tag}\". Known tags: ${refusal.known.join(\", \")}.`\n\t\t};\n\t\tcase \"unwritable\": return {\n\t\t\tcode: \"PSL_VALUE_TYPE_INCOMPATIBLE\",\n\t\t\tmessage: `${describeExpected(guidance.forms)}; this target has no data type for a ${refusal.syntax} value`\n\t\t};\n\t\tcase \"unreadable\":\n\t\tcase \"refused-by-type\": return {\n\t\t\tcode: \"PSL_INVALID_LITERAL\",\n\t\t\tmessage: refusal.message\n\t\t};\n\t\tcase \"no-cast\": return {\n\t\t\tcode: \"PSL_VALUE_TYPE_INCOMPATIBLE\",\n\t\t\tmessage: describeRefusedValueType(refusal, support, guidance)\n\t\t};\n\t}\n}\n/** `Expected <forms>`, the forms joined with `or`: the start of every refusal that says what to write. */\nfunction describeExpected(forms) {\n\treturn `Expected ${joinForms(forms)}`;\n}\n/**\n* Words a value of type `valueType` that `receivingType` refuses, where `guidance.forms` may be written. The types are named only when the value has one of those forms.\n*/\nfunction describeRefusedValueType(refused, support, guidance) {\n\tconst expected = describeExpected(guidance.forms);\n\tconst valueForm = writtenForm(support, refused.valueType);\n\tif (valueForm !== void 0 && guidance.forms.some((form) => isSameForm(form, valueForm))) return `${expected} that ${refused.receivingType} can hold; got ${refused.valueType}`;\n\treturn guidance.rewrite === void 0 ? expected : `${expected}; write ${guidance.rewrite}`;\n}\nfunction isSameForm(a, b) {\n\treturn a.kind === \"tag\" && b.kind === \"tag\" ? a.tag === b.tag : a.kind === b.kind;\n}\n/** Text a contract source reads as a number literal. */\nconst NUMBER_TEXT = /^[+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?$|^[+-]?(?:NaN|Infinity)$/;\nconst DECIMAL_TEXT = /^([+-]?)0*(\\d*?)(?:\\.(\\d*?))?0*$/;\n/** A decimal numeral in one form: no plus sign, no leading or trailing zeros, the sign of zero kept. Other text is itself. */\nfunction canonicalNumber(text) {\n\tconst match = text.includes(\".\") ? DECIMAL_TEXT.exec(text) : /^([+-]?)0*(\\d*)$/.exec(text);\n\tif (match === null) return text;\n\tconst [, sign = \"\", whole = \"\", fraction = \"\"] = match;\n\treturn `${sign === \"-\" ? \"-\" : \"\"}${whole === \"\" ? \"0\" : whole}${fraction === \"\" ? \"\" : `.${fraction}`}`;\n}\n/** Whether a stored value is the number `text` writes, digit for digit and with its sign, so writing the text unquoted stores what it says. */\nfunction sameNumber(text, stored) {\n\tconst storedText = typeof stored === \"number\" ? Object.is(stored, -0) ? \"-0\" : numeralText(stored) : typeof stored === \"string\" ? stored : void 0;\n\treturn storedText !== void 0 && canonicalNumber(storedText) === canonicalNumber(text);\n}\n/**\n* The literal to write in place of a quoted string that `receivingType` refuses under `receivingParams`: the string as a literal of the first tag the type admits, or else the string's text unquoted, as a number or a boolean. `undefined` when the value is not a quoted string, no such literal reads back as the same text, the type would refuse each of them too, or the number the text writes would be stored as another number, as `-0` is stored without its sign or `9007199254740993` as the nearest double.\n*/\nfunction exactRewrite(support, receiving, written) {\n\tif (written.kind !== \"string\") return void 0;\n\tconst castOf = (candidate) => {\n\t\tconst read = readWrittenValue(support, candidate);\n\t\tif (!read.ok) return void 0;\n\t\tconst cast = castTypedValue(support, receiving.receivingType, receiving.receivingParams, read.value);\n\t\treturn cast.ok ? cast.value : void 0;\n\t};\n\tconst admits = (candidate) => castOf(candidate) !== void 0;\n\tconst [tag] = admittedTags(support, receiving.receivingType);\n\tif (tag !== void 0 && printedTaggedLiteralReadsBack(written.text) && admits({\n\t\tkind: \"tag\",\n\t\ttag,\n\t\ttext: written.text\n\t})) return printTaggedLiteral(tag, written.text);\n\tif (NUMBER_TEXT.test(written.text)) {\n\t\tconst stored = castOf({\n\t\t\tkind: \"number\",\n\t\t\ttext: written.text\n\t\t});\n\t\tif (stored !== void 0 && sameNumber(written.text, stored.value)) return written.text;\n\t}\n\tif ((written.text === \"true\" || written.text === \"false\") && admits({\n\t\tkind: \"boolean\",\n\t\tvalue: written.text === \"true\"\n\t})) return written.text;\n}\nfunction findEntry(support, matches) {\n\tfor (const [key, entry] of Object.entries(support.entries)) if (matches(entry)) return {\n\t\tkey,\n\t\tentry\n\t};\n}\n/** The entry a tag names, or `undefined` when no pack registered that tag. */\nfunction entryForTag(support, tag) {\n\treturn findEntry(support, ({ written }) => written.kind === \"tag\" && written.tag === tag);\n}\n/** The entry that reads a plain string, boolean or number, or `undefined` when none does. */\nfunction entryForPlain(support, syntax) {\n\treturn findEntry(support, ({ written }) => written.kind === \"plain\" && written.syntax === syntax);\n}\n/** Every tag a stack registers, in the order the entries were merged. */\nfunction knownTags(support) {\n\treturn Object.values(support.entries).flatMap((entry) => entry.written.kind === \"tag\" ? [entry.written.tag] : []);\n}\nfunction textOf(written) {\n\treturn written.kind === \"boolean\" ? String(written.value) : written.text;\n}\nfunction messageOf(error) {\n\treturn error instanceof Error ? error.message : String(error);\n}\n/** The value of `type` that `json` gives under `params`, constructed by that type; a refusal is worded for a diagnostic. */\nfunction valueOfType(support, type, json, params, refuse) {\n\tconst declaration = support.lookup.get(type);\n\tif (declaration === void 0) throw new InternalError(`A value of \"${type}\" was written, and this stack does not register it.`);\n\ttry {\n\t\treturn ok(declaration.valueFrom(json(), params));\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn notOk(refuse(messageOf(error)));\n\t}\n}\n/** Read one written value through the authoring entry for its syntax, as a value its type constructs. */\nfunction readWrittenValue(support, written) {\n\tconst found = written.kind === \"tag\" ? entryForTag(support, written.tag) : entryForPlain(support, written.kind);\n\tif (found === void 0) return written.kind === \"tag\" ? notOk({\n\t\tkind: \"unknown-tag\",\n\t\ttag: written.tag,\n\t\tknown: knownTags(support)\n\t}) : notOk({\n\t\tkind: \"unwritable\",\n\t\tsyntax: written.kind\n\t});\n\tconst text = textOf(written);\n\tconst form = found.entry.written;\n\tconst unreadable = (message) => ({\n\t\tkind: \"unreadable\",\n\t\tmessage\n\t});\n\tif (form.kind === \"plain\" && form.syntax === \"number\") {\n\t\tconst classified = form.classify(text);\n\t\treturn classified === void 0 ? notOk(unreadable(`no data type of this target holds the number ${text}`)) : valueOfType(support, classified.type, () => classified.value, {}, unreadable);\n\t}\n\treturn valueOfType(support, dataTypeId(found.key), () => form.parse(text), {}, unreadable);\n}\n/** Take a value into the receiving type, directly or through the cast that type declares; the receiving type constructs the result under `receivingParams`, the parameters of the position that receives it. */\nfunction castTypedValue(support, receivingType, receivingParams, value) {\n\tconst refusedByType = (message) => ({\n\t\tkind: \"refused-by-type\",\n\t\treceivingType,\n\t\tmessage\n\t});\n\tif (value.type === receivingType) return valueOfType(support, receivingType, () => value.value, receivingParams, refusedByType);\n\tconst declaration = support.lookup.get(receivingType);\n\tconst cast = declaration?.casts[value.type];\n\tif (cast === void 0) return notOk({\n\t\tkind: \"no-cast\",\n\t\treceivingType,\n\t\treceivingParams,\n\t\tvalueType: value.type,\n\t\tcasts: Object.keys(declaration?.casts ?? {})\n\t});\n\tconst source = support.lookup.get(value.type);\n\tif (source === void 0) throw new InternalError(`A value of \"${value.type}\" was cast, and this stack does not register it.`);\n\tlet json;\n\ttry {\n\t\tjson = cast(source.toContract(value));\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn notOk({\n\t\t\tkind: \"unreadable\",\n\t\t\tmessage: messageOf(error)\n\t\t});\n\t}\n\treturn valueOfType(support, receivingType, () => json, receivingParams, refusedByType);\n}\n/**\n* Reads `written` as a value of `receivingType`: through the authoring entry for its syntax, then into `receivingType` directly or through a cast it declares. A refusal is worded for a diagnostic at the written value. The read every value of a fixed receiving type takes: an attribute argument, a type-constructor argument, and its TypeScript counterpart. ADR 254.\n*/\nfunction readWrittenValueAs(support, receivingType, written) {\n\tconst forms = admittedForms(support, [receivingType]);\n\tconst read = readWrittenValue(support, written);\n\tif (!read.ok) return notOk(describeRefusal(read.failure, support, {\n\t\tforms,\n\t\trewrite: void 0\n\t}));\n\tconst cast = castTypedValue(support, receivingType, {}, read.value);\n\tif (cast.ok) return cast;\n\tconst rewrite = exactRewrite(support, {\n\t\treceivingType,\n\t\treceivingParams: {}\n\t}, written);\n\treturn notOk(describeRefusal(cast.failure, support, {\n\t\tforms,\n\t\trewrite\n\t}));\n}\n/**\n* Reads `written` into the codec `ref` names, built with `ref`'s type parameters: the authoring entry for its syntax reads it, the codec's data type takes it directly or through a cast, the data type constructs it under the type parameters, and the codec checks it. Returns the value as the data type stores it. A written list is read element by element into the element types of the data type's list cast, then through the list cast.\n*\n* A refusal is worded for a diagnostic, after `subject` and the element it is about, as in `enum \"Ratio\" member \"Half\" at element 2: Expected a number`: syntax no entry reads or a cast refuses is `PSL_INVALID_LITERAL`, a value of a type the data type neither is nor casts from is `PSL_VALUE_TYPE_INCOMPATIBLE`, and a value the data type under the type parameters or the codec refuses is `PSL_VALUE_REFUSED`. ADR 254.\n*/\nfunction readWrittenValueIntoCodec(input) {\n\tconst { support, ref, written, subject } = input;\n\tconst codec = codecForRef(input.codecLookup, ref);\n\tif (codec === void 0) throw new InternalError(`${subject}: no codec descriptor is registered for \"${ref.codecId}\", but the value was read for it.`);\n\tconst receivingType = codec.dataType.id;\n\tconst receivingParams = dataTypeParams(codec.dataType, ref.typeParams);\n\tconst refused = (elementIndex, { code, message }) => notOk({\n\t\tcode,\n\t\tmessage: `${elementIndex === void 0 ? subject : `${subject} at element ${elementIndex + 1}`}: ${message}`\n\t});\n\tconst stored = (json) => {\n\t\ttry {\n\t\t\tconst value = codec.dataType.valueFrom(json, receivingParams);\n\t\t\tcodec.fromDataTypeValue(value);\n\t\t\treturn ok(codec.dataType.toContract(value));\n\t\t} catch (error) {\n\t\t\tif (isInternalError(error)) throw error;\n\t\t\treturn refused(void 0, {\n\t\t\t\tcode: \"PSL_VALUE_REFUSED\",\n\t\t\t\tmessage: messageOf(error)\n\t\t\t});\n\t\t}\n\t};\n\tconst forms = admittedForms(support, [receivingType]);\n\tif (written.kind === \"list\") {\n\t\tconst listCast = support.lookup.get(receivingType)?.listCast;\n\t\tif (listCast === void 0) return refused(void 0, {\n\t\t\tcode: \"PSL_VALUE_TYPE_INCOMPATIBLE\",\n\t\t\tmessage: `${describeExpected(forms)}; got a list`\n\t\t});\n\t\tconst elementGuidance = {\n\t\t\tforms: admittedForms(support, listCast.of),\n\t\t\trewrite: void 0\n\t\t};\n\t\tconst elements = [];\n\t\tfor (const [index, element] of written.elements.entries()) {\n\t\t\tif (element.kind === \"list\") return refused(index, {\n\t\t\t\tcode: \"PSL_INVALID_LITERAL\",\n\t\t\t\tmessage: \"a list holds values, not other lists\"\n\t\t\t});\n\t\t\tconst read = readWrittenValue(support, element);\n\t\t\tif (!read.ok) return refused(index, describeRefusal(read.failure, support, elementGuidance));\n\t\t\tif (!listCast.of.includes(read.value.type)) return refused(index, {\n\t\t\t\tcode: \"PSL_VALUE_TYPE_INCOMPATIBLE\",\n\t\t\t\tmessage: describeRefusedValueType({\n\t\t\t\t\treceivingType,\n\t\t\t\t\tvalueType: read.value.type\n\t\t\t\t}, support, elementGuidance)\n\t\t\t});\n\t\t\telements.push(read.value.value);\n\t\t}\n\t\tlet json;\n\t\ttry {\n\t\t\tjson = listCast.cast(elements);\n\t\t} catch (error) {\n\t\t\tif (isInternalError(error)) throw error;\n\t\t\treturn refused(void 0, {\n\t\t\t\tcode: \"PSL_INVALID_LITERAL\",\n\t\t\t\tmessage: messageOf(error)\n\t\t\t});\n\t\t}\n\t\treturn stored(json);\n\t}\n\tconst read = readWrittenValue(support, written);\n\tif (!read.ok) return refused(void 0, describeRefusal(read.failure, support, {\n\t\tforms,\n\t\trewrite: void 0\n\t}));\n\tconst cast = castTypedValue(support, receivingType, receivingParams, read.value);\n\tif (cast.ok) return stored(cast.value.value);\n\tconst { failure } = cast;\n\tif (failure.kind === \"refused-by-type\") return refused(void 0, {\n\t\tcode: \"PSL_VALUE_REFUSED\",\n\t\tmessage: failure.message\n\t});\n\treturn refused(void 0, describeRefusal(failure, support, {\n\t\tforms,\n\t\trewrite: failure.kind === \"no-cast\" ? exactRewrite(support, failure, written) : void 0\n\t}));\n}\n/** The type itself, then each type it casts from, in key order. */\nfunction admittedTypes(support, dataType) {\n\treturn [dataType, ...Object.keys(support.lookup.get(dataType)?.casts ?? {})];\n}\n/** The tags a position of `dataType` admits: its own tag, then the tags of the types it casts from. */\nfunction admittedTags(support, dataType) {\n\tconst tags = admittedTypes(support, dataType).flatMap((type) => {\n\t\tconst written = support.entries[type]?.written;\n\t\treturn written?.kind === \"tag\" ? [written.tag] : [];\n\t});\n\treturn [...new Set(tags)];\n}\n/** The form a value of a tagged literal's type is written in. */\nfunction tagForm(tag) {\n\treturn {\n\t\tkind: \"tag\",\n\t\ttag,\n\t\tphrase: `${tag}\\`...\\``\n\t};\n}\nconst PLAIN_PHRASES = {\n\tstring: \"a quoted string\",\n\tboolean: \"true or false\",\n\tnumber: \"a number\"\n};\nfunction writtenForm(support, type) {\n\tconst written = support.entries[type]?.written;\n\tif (written?.kind === \"tag\") return tagForm(written.tag);\n\tif (written?.kind === \"plain\" && written.syntax !== \"number\") return {\n\t\tkind: written.syntax,\n\t\tphrase: PLAIN_PHRASES[written.syntax]\n\t};\n\treturn Object.entries(support.entries).some(([key, entry]) => entry.written.kind === \"plain\" && entry.written.syntax === \"number\" && (key === type || entry.written.types.some((listed) => listed === type))) ? {\n\t\tkind: \"number\",\n\t\tphrase: PLAIN_PHRASES.number\n\t} : void 0;\n}\n/** What {@link describeAdmittedForms} returns for a type that nothing writes. */\nconst NO_WRITTEN_FORM = \"no written form\";\n/** Each form a position receiving every one of `receivingTypes` admits, once, in order: ``sql`...` ``, `true or false`. */\nfunction admittedForms(support, receivingTypes) {\n\tconst forms = [];\n\tfor (const type of receivingTypes.flatMap((receiving) => admittedTypes(support, receiving))) {\n\t\tconst form = writtenForm(support, type);\n\t\tif (form !== void 0 && !forms.some((listed) => isSameForm(listed, form))) forms.push(form);\n\t}\n\treturn forms;\n}\nfunction joinForms(forms) {\n\treturn forms.length === 0 ? NO_WRITTEN_FORM : forms.map((form) => form.phrase).join(\" or \");\n}\n/** How a position of `dataType` can be written, for a diagnostic: ``sql`...` ``, `true or false`. */\nfunction describeAdmittedForms(support, dataType) {\n\treturn joinForms(admittedForms(support, [dataType]));\n}\n//#endregion\n//#region src/shared/data-type-literal.ts\n/** A string as a contract source writes it, with the escapes its string reader resolves. */\nfunction escapePslString(value) {\n\treturn value.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\");\n}\nfunction writingSurface(support) {\n\tconst entryOf = /* @__PURE__ */ new Map();\n\tconst tagTypes = [];\n\tfor (const [key, entry] of Object.entries(support.entries)) {\n\t\tconst written = entry.written;\n\t\tif (written.kind === \"tag\") {\n\t\t\tconst type = dataTypeId(key);\n\t\t\tif (!entryOf.has(type)) entryOf.set(type, entry);\n\t\t\ttagTypes.push(type);\n\t\t\tcontinue;\n\t\t}\n\t\tif (written.syntax === \"number\") {\n\t\t\tfor (const type of written.types) entryOf.set(type, entry);\n\t\t\tcontinue;\n\t\t}\n\t\tentryOf.set(key, entry);\n\t}\n\treturn {\n\t\tsupport,\n\t\tentryOf,\n\t\ttagTypes\n\t};\n}\nfunction readValue(surface, written) {\n\tconst read = readWrittenValue(surface.support, written);\n\treturn read.ok ? read.value : void 0;\n}\n/** The value of a tag's type that a stored document is, constructed by that type. */\nfunction tagValue(surface, type, value) {\n\ttry {\n\t\treturn surface.support.lookup.get(type)?.valueFrom(value, {});\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn;\n\t}\n}\n/**\n* Every value the stored form could be, in the order a written value would be read: a number or\n* numeral text through the number entry first, then the plain syntax that matches the shape, then\n* each tag, whose stored form is a whole document, which may itself be a number or a boolean.\n*/\nfunction classifications(value, surface) {\n\tconst found = [];\n\tif (typeof value === \"number\") found.push(readValue(surface, {\n\t\tkind: \"number\",\n\t\ttext: numeralText(value)\n\t}));\n\telse if (typeof value === \"boolean\") found.push(readValue(surface, {\n\t\tkind: \"boolean\",\n\t\tvalue\n\t}));\n\telse if (typeof value === \"string\") {\n\t\tfound.push(readValue(surface, {\n\t\t\tkind: \"number\",\n\t\t\ttext: value\n\t\t}));\n\t\tfound.push(readValue(surface, {\n\t\t\tkind: \"string\",\n\t\t\ttext: value\n\t\t}));\n\t}\n\tfor (const type of surface.tagTypes) found.push(tagValue(surface, type, value));\n\treturn found.filter((candidate) => candidate !== void 0);\n}\n/** What the receiving type stores for `json` under its parameters, or `undefined` when it holds no such value. */\nfunction storedUnder(json, receiver, lookup) {\n\tconst type = lookup.get(receiver.id);\n\tif (type === void 0) return void 0;\n\ttry {\n\t\treturn type.toContract(type.valueFrom(json, receiver.params));\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn;\n\t}\n}\n/** The stored form the receiving type takes this value as, spelled as its parameters give it, or `undefined` when its type takes no such value. */\nfunction admitted(candidate, receiver, surface) {\n\tconst cast = castTypedValue(surface.support, receiver.id, receiver.params, candidate);\n\treturn cast.ok ? cast.value.value : void 0;\n}\n/** The text of the literal: what the entry prints, before the syntax that fences it. */\nfunction printedText(entry, value) {\n\ttry {\n\t\treturn entry.print(value);\n\t} catch {\n\t\treturn;\n\t}\n}\n/** The printed text as the entry's syntax writes it, for reading back. */\nfunction writtenAs(entry, text) {\n\tconst written = entry.written;\n\tif (written.kind === \"tag\") return {\n\t\tkind: \"tag\",\n\t\ttag: written.tag,\n\t\ttext\n\t};\n\tif (written.syntax !== \"boolean\") return {\n\t\tkind: written.syntax,\n\t\ttext\n\t};\n\treturn text === \"true\" || text === \"false\" ? {\n\t\tkind: \"boolean\",\n\t\tvalue: text === \"true\"\n\t} : void 0;\n}\n/** What the printed text reads back as, through the same read a written value takes. */\nfunction readBack(surface, entry, text) {\n\tconst written = writtenAs(entry, text);\n\treturn written === void 0 ? void 0 : readValue(surface, written);\n}\nfunction literalText(entry, text) {\n\tconst written = entry.written;\n\tif (written.kind === \"tag\") return printTaggedLiteral(written.tag, text);\n\treturn written.syntax === \"string\" ? `\"${escapePslString(text)}\"` : text;\n}\n/**\n* The value written as the literal of one of its types, proven by reading the text straight back:\n* the same read, the same cast, and the stored form again. A number is tried first without the\n* trailing fraction zeros the receiving type's scale spells it with.\n*/\nfunction writeScalar(value, receiver, surface) {\n\tconst shortest = withoutTrailingFractionZeros(value);\n\tconst candidates = [...shortest === void 0 ? [] : classifications(shortest, surface), ...classifications(value, surface)];\n\tfor (const candidate of candidates) {\n\t\tconst entry = surface.entryOf.get(candidate.type);\n\t\tif (entry === void 0) continue;\n\t\tconst stored = admitted(candidate, receiver, surface);\n\t\tif (stored === void 0 || !sameForm(stored, value)) continue;\n\t\tconst text = printedText(entry, candidate.value);\n\t\tif (text === void 0) continue;\n\t\tconst reread = readBack(surface, entry, text);\n\t\tif (reread === void 0) continue;\n\t\tconst restored = admitted(reread, receiver, surface);\n\t\tif (restored === void 0 || !sameForm(restored, value)) continue;\n\t\treturn literalText(entry, text);\n\t}\n}\n/**\n* `value`, a value of `dataType` as `contract.json` stores it, written as the literal of a type that `dataType` takes, proven to read back as `value`: `255` for `pg/int4`, ``sql`\"MyType\"[]` `` for `sql/expression`. `undefined` when no literal reads back as it.\n*/\nfunction writeDataTypeValue(value, dataType, support) {\n\treturn writeScalar(value, {\n\t\tid: dataType,\n\t\tparams: {}\n\t}, writingSurface(support));\n}\nconst DECIMAL_WITH_FRACTION = /^-?\\d+\\.\\d+$/;\nfunction withoutTrailingFractionZeros(value) {\n\tif (typeof value !== \"string\" || !DECIMAL_WITH_FRACTION.test(value)) return void 0;\n\tconst shortened = value.replace(/0+$/, \"\").replace(/\\.$/, \"\");\n\treturn shortened === value ? void 0 : shortened;\n}\n/** One written element of a list, printed as a value of any type, with no receiving type to admit it. */\nfunction writeElement(value, of, surface) {\n\tfor (const candidate of classifications(value, surface)) {\n\t\tif (!of.includes(candidate.type)) continue;\n\t\tconst entry = surface.entryOf.get(candidate.type);\n\t\tif (entry === void 0) continue;\n\t\tconst text = printedText(entry, candidate.value);\n\t\tif (text === void 0) continue;\n\t\tconst reread = readBack(surface, entry, text);\n\t\tif (reread === void 0 || !of.includes(reread.type)) continue;\n\t\treturn {\n\t\t\ttext: literalText(entry, text),\n\t\t\tvalue: reread.value\n\t\t};\n\t}\n}\n/**\n* A written list for a scalar data type, which that type's list cast turns into its one value,\n* constructed by the type. Each element is classified on its own and must be of a type the\n* cast takes.\n*/\nfunction writeListCast(value, receiver, surface) {\n\tconst listCast = surface.support.lookup.get(receiver.id)?.listCast;\n\tif (listCast === void 0) return void 0;\n\tconst parts = [];\n\tconst elements = [];\n\tfor (const element of value) {\n\t\tconst written = writeElement(element, listCast.of, surface);\n\t\tif (written === void 0) return void 0;\n\t\tparts.push(written.text);\n\t\telements.push(written.value);\n\t}\n\tlet cast;\n\ttry {\n\t\tcast = listCast.cast(elements);\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn;\n\t}\n\tconst stored = storedUnder(cast, receiver, surface.support.lookup);\n\treturn stored !== void 0 && sameForm(stored, value) ? `[${parts.join(\", \")}]` : void 0;\n}\n/** The PSL literal a stored value is written as for the data type `options` describe, or `undefined` when it has no written form that reads back as that value. */\nfunction writeTypedLiteral(value, options) {\n\tif (value instanceof Date) return void 0;\n\tconst { dataTypes, dataType } = options ?? {};\n\tif (dataTypes === void 0 || dataType === void 0) return void 0;\n\tconst { lookup } = dataTypes;\n\tconst receivingType = lookup.get(dataType);\n\tconst receiver = {\n\t\tid: dataType,\n\t\tparams: receivingType === void 0 ? {} : dataTypeParams(receivingType, options?.typeParams)\n\t};\n\tconst surface = writingSurface(dataTypes);\n\tif (options?.list === true) {\n\t\tif (!Array.isArray(value)) return void 0;\n\t\tconst parts = [];\n\t\tfor (const element of value) {\n\t\t\tconst written = writeScalar(element, receiver, surface);\n\t\t\tif (written === void 0) return void 0;\n\t\t\tparts.push(written);\n\t\t}\n\t\treturn `[${parts.join(\", \")}]`;\n\t}\n\tconst written = writeScalar(value, receiver, surface);\n\tif (written !== void 0) return written;\n\treturn Array.isArray(value) ? writeListCast(value, receiver, surface) : void 0;\n}\n/** Whether two stored forms are the same JSON value, member by member and element by element. */\nfunction sameForm(left, right) {\n\tif (left === right) return true;\n\tif (Array.isArray(left) !== Array.isArray(right)) return false;\n\tif (typeof left !== \"object\" || typeof right !== \"object\" || left === null || right === null) return false;\n\tconst members = Object.entries(left);\n\tconst others = new Map(Object.entries(right));\n\treturn members.length === others.size && members.every(([key, member]) => {\n\t\tconst other = others.get(key);\n\t\treturn other !== void 0 && sameForm(member, other);\n\t});\n}\n/** A value argument of a type constructor, written as a literal of its data type. */\nfunction writtenArgument(argument, value, dataTypes) {\n\treturn writeDataTypeValue(blindCast(value), dataTypeId(argument.dataType), dataTypes);\n}\n/**\n* Each argument of a call to `descriptor` as PSL writes it: a value argument as a literal of its data type that reads back as the same value. `undefined` when an argument is not a value argument or no literal reads back as it.\n*/\nfunction writtenTypeArguments(descriptor, args, dataTypes) {\n\tconst written = [];\n\tfor (const [index, value] of args.entries()) {\n\t\tconst argument = descriptor.args?.[index];\n\t\tconst text = argument && writtenArgument(argument, value, dataTypes);\n\t\tif (text === void 0) return void 0;\n\t\twritten.push(text);\n\t}\n\treturn written;\n}\n/**\n* The call to the type constructor `descriptor` at `path` as PSL writes it, with each argument that has a value written by its name as a literal of its data type, and the bare path when none has one. `undefined` when no literal reads back as one of the values.\n*/\nfunction writtenTypeConstructorCall(path, descriptor, args, dataTypes) {\n\tconst written = [];\n\tfor (const [index, argument] of (descriptor.args ?? []).entries()) {\n\t\tconst value = args[index];\n\t\tif (value === void 0) continue;\n\t\tconst text = writtenArgument(argument, value, dataTypes);\n\t\tif (text === void 0) return void 0;\n\t\twritten.push(argument.name === void 0 ? text : `${argument.name}: ${text}`);\n\t}\n\tconst name = path.join(\".\");\n\treturn written.length === 0 ? name : `${name}(${written.join(\", \")})`;\n}\n//#endregion\n//#region src/shared/enum-stored-members.ts\nfunction storedFormOf(stored) {\n\treturn canonicalStringify(JSON.parse(JSON.stringify(stored)));\n}\n/** The key two stored values are equal by: the data type's `equalityKey` when it declares one, else the stored form as `contract.json` holds it, compared by `canonicalStringify`. */\nfunction storedValueKey(stored, equalityKey) {\n\treturn equalityKey?.(stored) ?? storedFormOf(stored);\n}\n/**\n* Each enum member whose stored form equals an earlier member's, paired with the first such member. Stored forms are compared as `contract.json` holds them, so negative zero is zero, and by `canonicalStringify`, so two objects with the same entries in a different order are equal; or, when the enum's data type declares an `equalityKey`, by that key, so `0.5` and `0.50` are one `numeric` value. Every enum authoring surface refuses the members this returns.\n*/\nfunction duplicateStoredMembers(members, equalityKey) {\n\tconst memberByKey = /* @__PURE__ */ new Map();\n\tconst duplicates = [];\n\tfor (const member of members) {\n\t\tconst { name, stored } = member;\n\t\tconst key = storedValueKey(stored, equalityKey);\n\t\tconst earlier = memberByKey.get(key);\n\t\tif (earlier === void 0) memberByKey.set(key, member);\n\t\telse if (storedFormOf(earlier.stored) === storedFormOf(stored)) duplicates.push({\n\t\t\tearlier: earlier.name,\n\t\t\tlater: name,\n\t\t\tstored\n\t\t});\n\t\telse duplicates.push({\n\t\t\tearlier: earlier.name,\n\t\t\tlater: name,\n\t\t\tstored,\n\t\t\tearlierStored: earlier.stored\n\t\t});\n\t}\n\treturn duplicates;\n}\n//#endregion\n//#region src/shared/discriminator-rule.ts\n/**\n* The refusals of a discriminator: the field must be required, hold one value, and have one of the stack's text data types; and when an enum types it, each variant's value, as the field stores it, must be one of the enum's members, compared by the field's data type's equality. Returns no refusals for a discriminator that is valid.\n*/\nfunction discriminatorRefusals(input) {\n\tconst { field } = input;\n\tconst textDataTypes = input.dataTypes.textDataTypes ?? [];\n\tif (textDataTypes.length === 0) throw new InternalError(\"The stack names no text data types, so no field can be a discriminator; the target names its text types in its authoring contributions.\");\n\tconst refusals = [];\n\tif (field.nullable) refusals.push({ kind: \"optional\" });\n\tif (field.many) refusals.push({ kind: \"list\" });\n\tconst dataType = field.ref === void 0 ? void 0 : input.codecLookup.descriptorFor(field.ref.codecId)?.dataType;\n\tif (dataType === void 0 || !textDataTypes.includes(dataType)) refusals.push({\n\t\tkind: \"not-text\",\n\t\tdataType,\n\t\ttextDataTypes\n\t});\n\tconst members = field.enumMembers;\n\tif (members !== void 0) {\n\t\tconst equalityKey = dataType === void 0 ? void 0 : input.dataTypes.lookup.get(dataType)?.equalityKey;\n\t\tconst memberKeys = new Set(members.map((member) => storedValueKey(member, equalityKey)));\n\t\tfor (const { key, stored } of input.variantValues) if (!memberKeys.has(storedValueKey(stored, equalityKey))) refusals.push({\n\t\t\tkind: \"not-a-member\",\n\t\t\tkey,\n\t\t\tstored,\n\t\t\tmembers\n\t\t});\n\t}\n\treturn refusals;\n}\n/**\n* A discriminator refusal worded as a PSL diagnostic: a refusal of the field at its `@@discriminator`, and a value that is not a member at its `@@base`. The wording names PSL syntax, so PSL sources word the refusals with this; a TypeScript source words them in its own terms.\n*/\nfunction describeDiscriminatorRefusal(refusal, subject) {\n\tconst field = `Discriminator field \"${subject.fieldName}\" on model \"${subject.modelName}\"`;\n\tswitch (refusal.kind) {\n\t\tcase \"optional\": return `${field} must be required, but it is optional. Remove the \"?\"`;\n\t\tcase \"list\": return `${field} must hold one value, but it is a list. Remove the \"[]\"`;\n\t\tcase \"not-text\": return `${field} must be text, such as String, but is \"${subject.typeName}\"`;\n\t\tcase \"not-a-member\": return `Model \"${subject.variantName(refusal.key)}\" declares @@base value ${JSON.stringify(refusal.stored)}, which is not a member of enum \"${subject.enumName}\", the type of discriminator field \"${subject.modelName}.${subject.fieldName}\". Write one of: ${refusal.members.map((member) => JSON.stringify(member)).join(\", \")}`;\n\t}\n}\n/**\n* Applies the discriminator rule to one discriminator and its variants: reads each variant's written value into the field's codec with {@link readWrittenValueIntoCodec}, worded after `subject`, then decides with {@link discriminatorRefusals}. A refused field refuses the whole discriminator, so its variants' values are neither read nor refused. A discriminator is text, so a stored value that is not a string is a bug in a text data type.\n*/\nfunction applyDiscriminatorRule(input) {\n\tconst { field, codecLookup, dataTypes } = input;\n\tconst fieldOnly = discriminatorRefusals({\n\t\tfield,\n\t\tvariantValues: [],\n\t\tcodecLookup,\n\t\tdataTypes\n\t}).filter(isFieldRefusal);\n\tif (fieldOnly.length > 0) return {\n\t\tfieldRefusals: fieldOnly,\n\t\tvariantRefusals: [],\n\t\tvalues: /* @__PURE__ */ new Map()\n\t};\n\tconst ref = field.ref;\n\tif (ref === void 0) throw new InternalError(\"A discriminator field the rule accepts has a codec.\");\n\tconst reads = input.variants.map(({ key, written }) => ({\n\t\tkey,\n\t\treading: readWrittenValueIntoCodec({\n\t\t\tsupport: dataTypes,\n\t\t\tcodecLookup,\n\t\t\tref,\n\t\t\twritten,\n\t\t\tsubject: input.subject\n\t\t})\n\t}));\n\tconst notMembers = new Map(discriminatorRefusals({\n\t\tfield,\n\t\tvariantValues: reads.flatMap(({ key, reading }) => reading.ok ? [{\n\t\t\tkey,\n\t\t\tstored: reading.value\n\t\t}] : []),\n\t\tcodecLookup,\n\t\tdataTypes\n\t}).flatMap((refusal) => refusal.kind === \"not-a-member\" ? [[refusal.key, refusal]] : []));\n\tconst variantRefusals = [];\n\tconst values = /* @__PURE__ */ new Map();\n\tfor (const { key, reading } of reads) {\n\t\tif (!reading.ok) {\n\t\t\tvariantRefusals.push({\n\t\t\t\tkind: \"unreadable\",\n\t\t\t\tkey,\n\t\t\t\trefusal: reading.failure\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst notMember = notMembers.get(key);\n\t\tif (notMember !== void 0) {\n\t\t\tvariantRefusals.push(notMember);\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof reading.value !== \"string\") throw new InternalError(`Discriminator field codec \"${ref.codecId}\" stores a text value as ${typeof reading.value}.`);\n\t\tvalues.set(key, reading.value);\n\t}\n\treturn {\n\t\tfieldRefusals: [],\n\t\tvariantRefusals,\n\t\tvalues\n\t};\n}\nfunction isFieldRefusal(refusal) {\n\treturn refusal.kind !== \"not-a-member\";\n}\n//#endregion\n//#region src/shared/enum-block-members.ts\n/**\n* A problem with an enum's members as a diagnostic at the member, or at the block when the problem is the enum's codec.\n*/\nfunction enumMemberProblemDiagnostic(problem, site) {\n\tconst { enumName, codecId, sourceId } = site;\n\tconst at = (member) => ({\n\t\tsourceId,\n\t\tspan: site.memberSpans[member] ?? site.span\n\t});\n\tswitch (problem.kind) {\n\t\tcase \"codec-not-for-enums\": return {\n\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\tmessage: `enum \"${enumName}\" cannot use the codec \"${codecId}\". ${problem.refusal}`,\n\t\t\tsourceId,\n\t\t\tspan: site.span\n\t\t};\n\t\tcase \"codec-missing\": return {\n\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\tmessage: `enum \"${enumName}\" uses codec \"${codecId}\", which no pack in the contract provides`,\n\t\t\tsourceId,\n\t\t\tspan: site.span\n\t\t};\n\t\tcase \"codec-refused-member\": return {\n\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\tmessage: `enum \"${enumName}\" member \"${problem.member}\" was rejected by codec \"${codecId}\": ${problem.reason}`,\n\t\t\t...at(problem.member)\n\t\t};\n\t\tcase \"member-not-stored-as-written\": return {\n\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\tmessage: `enum \"${enumName}\" member \"${problem.member}\" is written ${problem.written}, but its codec stores ${JSON.stringify(problem.stored)}. Write the member as ${problem.writeAs}.`,\n\t\t\t...at(problem.member)\n\t\t};\n\t\tcase \"duplicate-member-value\": return {\n\t\t\tcode: \"PSL_ENUM_DUPLICATE_MEMBER_VALUE\",\n\t\t\tmessage: problem.earlierStored === void 0 ? `enum \"${enumName}\": members \"${problem.earlier}\" and \"${problem.later}\" both store ${JSON.stringify(problem.stored)}` : `enum \"${enumName}\": members \"${problem.earlier}\" and \"${problem.later}\" store ${JSON.stringify(problem.earlierStored)} and ${JSON.stringify(problem.stored)}, which the database holds equal`,\n\t\t\t...at(problem.later)\n\t\t};\n\t}\n}\n/** A member as it is written: its recorded written value, or a bare member's name, as text. */\nfunction writtenMember(block, memberName, memberValue) {\n\tconst written = block.writtenValues?.[memberName];\n\tif (written !== void 0) return written;\n\tif (memberValue === void 0) return {\n\t\tkind: \"string\",\n\t\ttext: memberName\n\t};\n\tthrow new InternalError(`enum \"${block.name}\" member \"${memberName}\" has a value, but the block holds no written value for it.`);\n}\n/**\n* Reads the members of an `enum` block through its codec with {@link readWrittenValueIntoCodec}: each member's syntax gives it a data type, the codec's data type takes it directly or through a cast, and the codec checks it, so a number keeps every digit and a quoted value is text. A bare member is read from its own name, as text.\n* Pushes a diagnostic and returns `undefined` when a member is refused, when two members\n* store the same value, or when the block has no members. Shared by every family's enum factory.\n*/\nfunction readEnumBlockMembers(block, codecId, codec, ctx) {\n\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\tconst diagnostics = ctx.diagnostics;\n\tconst site = {\n\t\tenumName: block.name,\n\t\tcodecId,\n\t\tsourceId,\n\t\tspan: block.span,\n\t\tmemberSpans: block.parameterSpans\n\t};\n\tconst members = [];\n\tconst storedMembers = [];\n\tlet memberError = false;\n\tfor (const [memberName, memberValue] of Object.entries(block.values)) {\n\t\tconst span = block.parameterSpans[memberName] ?? block.span;\n\t\tconst reading = readWrittenValueIntoCodec({\n\t\t\tsupport: ctx.dataTypes,\n\t\t\tcodecLookup: ctx.codecLookup,\n\t\t\tref: { codecId },\n\t\t\twritten: writtenMember(block, memberName, memberValue),\n\t\t\tsubject: `enum \"${block.name}\" member \"${memberName}\"`\n\t\t});\n\t\tif (!reading.ok) {\n\t\t\tdiagnostics?.push(memberValue === void 0 ? {\n\t\t\t\tcode: \"PSL_ENUM_BARE_MEMBER_NON_STRING_CODEC\",\n\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" has no value and codec \"${codecId}\" does not accept a bare name as input`,\n\t\t\t\tsourceId,\n\t\t\t\tspan\n\t\t\t} : {\n\t\t\t\t...reading.failure,\n\t\t\t\tsourceId,\n\t\t\t\tspan\n\t\t\t});\n\t\t\tmemberError = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconst read = readContractValue(codec, reading.value, void 0);\n\t\tmembers.push({\n\t\t\tname: memberName,\n\t\t\tvalue: read\n\t\t});\n\t\tstoredMembers.push({\n\t\t\tname: memberName,\n\t\t\tstored: codec.dataType.toContract(codec.toDataTypeValue(read))\n\t\t});\n\t}\n\tfor (const duplicate of duplicateStoredMembers(storedMembers, codec.dataType.equalityKey)) {\n\t\tdiagnostics?.push(enumMemberProblemDiagnostic({\n\t\t\tkind: \"duplicate-member-value\",\n\t\t\t...duplicate\n\t\t}, site));\n\t\tmemberError = true;\n\t}\n\tif (memberError) return void 0;\n\tif (members.length === 0) {\n\t\tdiagnostics?.push({\n\t\t\tcode: \"PSL_ENUM_MISSING_TYPE\",\n\t\t\tmessage: `enum \"${block.name}\" must have at least one member`,\n\t\t\tsourceId,\n\t\t\tspan: block.span\n\t\t});\n\t\treturn;\n\t}\n\treturn members;\n}\n//#endregion\n//#region src/shared/enum-members.ts\n/** Whether TypeScript gives the value a literal type: a primitive, or an array or plain object of them. */\nfunction hasLiteralType(value) {\n\tif ([\n\t\t\"string\",\n\t\t\"number\",\n\t\t\"boolean\",\n\t\t\"bigint\"\n\t].includes(typeof value)) return true;\n\tif (Array.isArray(value)) return value.every(hasLiteralType);\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn (prototype === Object.prototype || prototype === null) && Object.values(value).every(hasLiteralType);\n}\n/**\n* A member's value in the form its codec stores it, and that form read back by the codec. A codec that throws on either is a refusal naming the member; an internal error is not the member's fault and propagates.\n*/\nfunction encodeEnumMember(member, codec) {\n\ttry {\n\t\tconst stored = codec.dataType.toContract(codec.toDataTypeValue(member.value));\n\t\treturn ok({\n\t\t\tstored,\n\t\t\treadBack: readContractValue(codec, stored, void 0)\n\t\t});\n\t} catch (cause) {\n\t\tif (isInternalError(cause)) throw cause;\n\t\treturn notOk({\n\t\t\tkind: \"codec-refused-member\",\n\t\t\tmember: member.name,\n\t\t\treason: cause instanceof Error ? cause.message : String(cause),\n\t\t\tcause\n\t\t});\n\t}\n}\n/**\n* Refuses a member its codec reads back as a different value from the one written. A member with no literal type has nothing to compare.\n*/\nfunction notStoredAsWritten(member, stored, readBack) {\n\tif (!hasLiteralType(member.value)) return void 0;\n\tif (hasLiteralType(readBack) && canonicalStringify(readBack) === canonicalStringify(member.value)) return void 0;\n\treturn {\n\t\tkind: \"member-not-stored-as-written\",\n\t\tmember: member.name,\n\t\twritten: canonicalStringify(member.value),\n\t\tstored,\n\t\twriteAs: hasLiteralType(readBack) ? canonicalStringify(readBack) : JSON.stringify(stored)\n\t};\n}\n/**\n* Each member of an enum in the form its codec stores it. Refuses a codec an enum cannot use, a codec the lookup does not have, a member the codec refuses, a member the codec reads back as another value, and two members stored as the same value. Every family's contract build calls this, and reports the problems in its own terms.\n*/\nfunction encodeEnumMembers(decodedEnum, codecLookup) {\n\tconst descriptor = codecLookup.descriptorFor(decodedEnum.codecId);\n\tconst refusal = descriptor === void 0 ? void 0 : enumRefusalOf(descriptor);\n\tif (refusal !== void 0) return notOk([{\n\t\tkind: \"codec-not-for-enums\",\n\t\trefusal\n\t}]);\n\tconst codec = codecLookup.get(decodedEnum.codecId);\n\tif (codec === void 0) return notOk([{ kind: \"codec-missing\" }]);\n\tconst problems = [];\n\tconst members = [];\n\tfor (const member of decodedEnum.enumMembers) {\n\t\tconst encoded = encodeEnumMember(member, codec);\n\t\tif (!encoded.ok) {\n\t\t\tproblems.push(encoded.failure);\n\t\t\tcontinue;\n\t\t}\n\t\tconst { stored, readBack } = encoded.value;\n\t\tconst mismatch = notStoredAsWritten(member, stored, readBack);\n\t\tif (mismatch !== void 0) problems.push(mismatch);\n\t\tmembers.push({\n\t\t\tname: member.name,\n\t\t\tvalue: stored\n\t\t});\n\t}\n\tfor (const duplicate of duplicateStoredMembers(members.map(({ name, value }) => ({\n\t\tname,\n\t\tstored: value\n\t})), codec.dataType.equalityKey)) problems.push({\n\t\tkind: \"duplicate-member-value\",\n\t\t...duplicate\n\t});\n\treturn problems.length > 0 ? notOk(problems) : ok(members);\n}\n//#endregion\nexport { AUTHORING_TYPE_DESCRIPTOR_KINDS, TIMESTAMP_NOW_GENERATOR_ID, admittedForms, admittedTags, applyDiscriminatorRule, assembleAuthoringDataTypes, assembleDataTypeSupport, assertNoAuthoringFieldNamespace, assertNoCrossRegistryCollisions, assertResolvableTypeConstructorTemplates, assertTypeAliasesValid, assertTypeChoicesValid, authoringTypeConstructorArguments, authoringTypeConstructors, canonicalizeTaggedLiteralBody, castTypedValue, classifyEnumMemberType, collectScalarTypeConstructors, describeAdmittedForms, describeDiscriminatorRefusal, describeExpected, describeRefusal, describeRefusedValueType, describeTaggedLiteralFailure, duplicateStoredMembers, encodeEnumMembers, entryForPlain, entryForTag, enumMemberProblemDiagnostic, exactRewrite, findAuthoringTypeChoiceCall, findAuthoringTypeConstructorCall, flushAuthoringWarnings, getAuthoringTypeChoice, getAuthoringTypeConstructor, instantiateAuthoringEntityType, instantiateAuthoringTypeAlias, instantiateAuthoringTypeCall, instantiateAuthoringTypeConstructor, instantiateAuthoringTypeConstructorFromValues, isAuthoringArgRef, isAuthoringEntityTypeDescriptor, isAuthoringModelAttributeDescriptor, isAuthoringPslBlockDescriptor, isAuthoringTypeAliasDescriptor, isAuthoringTypeChoiceDescriptor, isAuthoringTypeChoiceOption, isAuthoringTypeConstructorDescriptor, isAuthoringTypeDescriptor, knownTags, mergeAuthoringNamespaces, printTaggedLiteral, printedTaggedLiteralReadsBack, readEnumBlockMembers, readWrittenValue, readWrittenValueAs, readWrittenValueIntoCodec, resolveAuthoringTemplateValue, resolveAuthoringTypeChoice, resolveEnumCodecId, resolveTemplateTagEscapes, resolveTypeAliasGenerators, tagForm, temporalTypeAliases, tsTaggedTemplateSource, typeChoiceArgumentsFromObject, typeChoiceCombinationText, typeConstructorLookup, unknownTypeChoiceArgumentMessage, validateAuthoringHelperArguments, validateAuthoringTypeChoiceParams, validateAuthoringTypeParams, writeDataTypeValue, writeTypedLiteral, writtenTypeArguments, writtenTypeConstructorCall };\n\n//# sourceMappingURL=authoring.mjs.map"],"mappings":";;;;;;;;;;;AAWA,UAAU,0BAA0B,WAAW,OAAO,CAAC,GAAG;CACzD,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,SAAS,GAAG,IAAI,qCAAqC,KAAK,GAAG,MAAM;EAC7G,MAAM,CAAC,GAAG,MAAM,IAAI;EACpB,YAAY;CACb;MACK,IAAI,CAAC,0BAA0B,KAAK,GAAG,OAAO,0BAA0B,OAAO,CAAC,GAAG,MAAM,IAAI,CAAC;AACpG;;AAEA,SAAS,mCAAmC,UAAU,QAAQ;CAC7D,MAAM,eAAe;EACpB,GAAG;EACH,YAAY,OAAO,cAAc,CAAC;CACnC;CACA,OAAO,OAAO,QAAQ;EACrB,GAAG;EACH,YAAY,SAAS,cAAc,CAAC;CACrC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,WAAW,iBAAiB,KAAK,MAAM,iBA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AM;EACN;CACD,CAAC,CAAC;CACF,MAAM,QAAQ,YAAY,IAAI,YAAY,OAAO;CACjD,IAAI,UAAU,KAAK,GAAG,OAAO,MAAM,CAAC,EAAE,MAAM,gBAAgB,CAAC,CAAC;CAC9D,MAAM,WAAW,CAAC;CAClB,MAAM,UAAU,CAAC;CACjB,KAAK,MAAM,UAAU,YAAY,aAAa;EAC7C,MAAM,UAAU,iBAAiB,QAAQ,KAAK;EAC9C,IAAI,CAAC,QAAQ,IAAI;GAChB,SAAS,KAAK,QAAQ,OAAO;GAC7B;EACD;EACA,MAAM,EAAE,QAAQ,aAAa,QAAQ;EACrC,MAAM,WAAW,mBAAmB,QAAQ,QAAQ,QAAQ;EAC5D,IAAI,aAAa,KAAK,GAAG,SAAS,KAAK,QAAQ;EAC/C,QAAQ,KAAK;GACZ,MAAM,OAAO;GACb,OAAO;EACR,CAAC;CACF;CACA,KAAK,MAAM,aAAa,uBAAuB,QAAQ,KAAK,EAAE,MAAM,aAAa;EAChF;EACA,QAAQ;CACT,EAAE,GAAG,MAAM,SAAS,WAAW,GAAG,SAAS,KAAK;EAC/C,MAAM;EACN,GAAG;CACJ,CAAC;CACD,OAAO,SAAS,SAAS,IAAI,MAAM,QAAQ,IAAI,GAAG,OAAO;AAC1D"}
@@ -6,10 +6,10 @@ import { o as TaggedLiteralCanonicalization } from "./temporal-type-aliases-D5QW
6
6
  import "./authoring-BKOoGNxH.mjs";
7
7
  import "./codec-h0kvF5B8.mjs";
8
8
  import { l as SignatureArgumentOutput, u as SignatureOptionalArgument } from "./components-BvnVHOK3.mjs";
9
- import "./control-B3QHYJcv.mjs";
9
+ import "./control-rzZBO0wp.mjs";
10
10
  import "./psl-ast-Dsf1-QLK.mjs";
11
- import { n as ContractSourceContext } from "./config-types-Ck3UXVIU.mjs";
12
- import { $ as TypeAnnotationAst, A as NamespaceDeclarationAst, D as ModelAttributeAst, F as ParseDiagnostic, O as ModelDeclarationAst, T as MixinDeclarationAst, V as PslSources, Y as SyntaxNode, _ as GenericBlockDeclarationAst, f as DocumentAst, h as FieldDeclarationAst, k as NamedTypeDeclarationAst, l as CompositeTypeDeclarationAst, m as FieldAttributeAst, n as AstNode, p as ExpressionAst, r as AttributeArgAst, w as KeyValuePairAst, z as PslDiagnostic } from "./parse-djL5wker-Bx0JH2c_.mjs";
11
+ import { n as ContractSourceContext } from "./config-types-DvM9eXG7.mjs";
12
+ import { $ as TypeAnnotationAst, A as NamespaceDeclarationAst, D as ModelAttributeAst, F as ParseDiagnostic, O as ModelDeclarationAst, T as MixinDeclarationAst, V as PslSources, Y as SyntaxNode, _ as GenericBlockDeclarationAst, f as DocumentAst, h as FieldDeclarationAst, k as NamedTypeDeclarationAst, l as CompositeTypeDeclarationAst, m as FieldAttributeAst, n as AstNode, p as ExpressionAst, r as AttributeArgAst, w as KeyValuePairAst, z as PslDiagnostic } from "./parse-djL5wker-DNAOL0Cj.mjs";
13
13
  import { n as UnionToIntersection, t as Simplify } from "./types-DGxlljKG.mjs";
14
14
  //#region ../../../1-framework/2-authoring/psl-parser/dist/binder-CMy3WM5A.d.mts
15
15
  //#region src/resolve.d.ts
@@ -539,4 +539,4 @@ declare function contributedTypeOf(resolution: Resolution | undefined, binder: B
539
539
  declare function createBinder(input: CreateBinderInput): BinderResult;
540
540
  //#endregion
541
541
  export { MixinSymbol as $, readResolvedAttribute as $t, DataTypeValueArgType as A, ScopeResolution as At, FixedIdentifierArgType as B, buildSymbolTable as Bt, ContributedTypeDescriptor as C, Resolution as Ct, ContributedTypeUse as D, ResolvedNamedTypeBinding as Dt, ContributedTypeSymbol as E, ResolvedEntityReference as Et, EntityRefArgType as F, UnresolvedTypeReference as Ft, FunctionSymbol as G, createBinder as Gt, FixedStrArgType as H, contributedTypeAt as Ht, EntitySelector as I, UnrestrictedIdentifierArgType as It, InspectableArgType as J, isNamespaceLike as Jt, IdentifierArgType as K, entityReference as Kt, FieldAttributeCtx as L, UnrestrictedNumArgType as Lt, DescribeUnresolvedType as M, SymbolTableResult as Mt, DescribeUnsupportedAttribute as N, TaggedLiteralArgType as Nt, CreateBinderInput as O, ResolvedTypeConstructorCall as Ot, EntityDeclaration as P, TypedFuncCall as Pt, ListArgType as Q, nodePslSpan as Qt, FieldRefArgType as R, UnrestrictedStrArgType as Rt, ContributedTypeChoiceSymbol as S, RequiredContextFor as St, ContributedTypeScope as T, ResolvedAttributeArg as Tt, FuncCallArgType as U, contributedTypeCodecId as Ut, FixedNumArgType as V, chosenTypeConstructor as Vt, FuncCallSig as W, contributedTypeOf as Wt, JsonArgType as X, matchesSelector as Xt, IntArgType as Y, keywordPslSpan as Yt, JsonValueArgType as Z, memberEntries as Zt, CompositeTypeSymbol as _, PositionalParam as _t, AttributeLevel as a, NullArgType as at, ContributedMember as b, ReferencedFieldRefArgType as bt, AttributeSymbol as c, OneOfArgType as ct, BinderResult as d, PSL_UNRESOLVED_REFERENCE as dt, readResolvedAttributes as en, ModelAttributeCtx as et, BlockAttributeCtx as f, Param as ft, BuildSymbolTableOptions as g, PosOut as gt, BoundSpec as h, ParsedTypedValue as ht, AttributeCtx as i, NamespaceSymbol as it, DeclarationFor as j, SymbolTable as jt, CtxOf as k, Scope as kt, Binder as l, OptionalArgType as lt, BoolArgType as m, ParsedTaggedLiteral as mt, ArgType as n, typeReferenceNode as nn, NamedOut as nt, AttributeOut as o, NumLiteral as ot, BlockSymbol as p, ParameterSymbol as pt, InferAttr as q, isContributedTypeChoice as qt, ArgTypeKind as r, NamedTypeSymbol as rt, AttributeSpec as s, NumLiteralArgType as st, AnyArgType as t, readResolvedConstructorCall as tn, ModelSymbol as tt, BinderContext as u, OutOf as ut, ConstantSymbol as v, PslSymbol as vt, ContributedTypeNamespace as w, ResolvedAttribute as wt, ContributedNamespaceSymbol as x, RejectingArgType as xt, ContextForRequirement as y, RecordArgType as yt, FieldSymbol as z, UnsupportedAttribute as zt };
542
- //# sourceMappingURL=binder-CMy3WM5A-gjYNJqla.d.mts.map
542
+ //# sourceMappingURL=binder-CMy3WM5A-BjkRdpH6.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"binder-CMy3WM5A-gjYNJqla.d.mts","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/binder-CMy3WM5A.d.mts"],"mappings":";;;;;;;;;;;;;;;UAWU;WACC;WACA;WACA;WACA,aAAa;WACb,MAAM;;WAEN,OAAO;;UAER,kBAAkB,cAAc,oBAAoB,oBAAoB,oBAAoB;WAC3F;WACA,eAAe;WACf,MAAM;WACN,MAAM;;UAEP;WACC;WACA,eAAe;WACf,MAAM;;iBAEA,sBAAsB,cAAc,oBAAoB,mBAAmB,WAAW,OAAO,SAAS,aAAa,kBAAkB;iBACrI,uBAAuB,cAAc,oBAAoB,mBAAmB,YAAY,SAAS,QAAQ,SAAS,sBAAsB,kBAAkB;iBAC1J,4BAA4B,YAAY,+BAA+B,SAAS,aAAa;iBAC7F,YAAY,MAAM,YAAY,SAAS,aAAa;;iBAEpD,eAAe,MAAM,YAAY,iBAAiB,SAAS,aAAa;;;UAG/E;WACC,kBAAkB;WAClB,YAAY,eAAe;WAC3B,YAAY,eAAe;;UAE5B;WACC,MAAM;WACN,MAAM;;UAEP;WACC;WACA;WACA;WACA,uBAAuB;WACvB,QAAQ,eAAe;WACvB,gBAAgB,eAAe;WAC/B,QAAQ,eAAe;WACvB,QAAQ,eAAe;;UAExB;WACC;WACA;WACA,MAAM;WACN,MAAM;EACf,QAAQ,eAAe;EACvB,qBAAqB,kBAAkB;;UAE/B;WACC;WACA;WACA,MAAM;WACN,MAAM;EACf,QAAQ,eAAe;EACvB,qBAAqB,kBAAkB;;UAE/B;WACC;WACA;WACA;WACA,MAAM;WACN,MAAM;EACf,kBAAkB;EAClB,qBAAqB,kBAAkB;;UAE/B;WACC;WACA;WACA;WACA,MAAM;WACN,MAAM;WACN,QAAQ,eAAe;WACvB,kBAAkB;WAClB,qBAAqB,kBAAkB;;UAExC;WACC;WACA,kBAAkB;WAClB;WACA,qBAAqB,kBAAkB;;;;;;;UAO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C;iBACtH,aAAa,OAAO,oBAAoB"}
1
+ {"version":3,"file":"binder-CMy3WM5A-BjkRdpH6.d.mts","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/binder-CMy3WM5A.d.mts"],"mappings":";;;;;;;;;;;;;;;UAWU;WACC;WACA;WACA;WACA,aAAa;WACb,MAAM;;WAEN,OAAO;;UAER,kBAAkB,cAAc,oBAAoB,oBAAoB,oBAAoB;WAC3F;WACA,eAAe;WACf,MAAM;WACN,MAAM;;UAEP;WACC;WACA,eAAe;WACf,MAAM;;iBAEA,sBAAsB,cAAc,oBAAoB,mBAAmB,WAAW,OAAO,SAAS,aAAa,kBAAkB;iBACrI,uBAAuB,cAAc,oBAAoB,mBAAmB,YAAY,SAAS,QAAQ,SAAS,sBAAsB,kBAAkB;iBAC1J,4BAA4B,YAAY,+BAA+B,SAAS,aAAa;iBAC7F,YAAY,MAAM,YAAY,SAAS,aAAa;;iBAEpD,eAAe,MAAM,YAAY,iBAAiB,SAAS,aAAa;;;UAG/E;WACC,kBAAkB;WAClB,YAAY,eAAe;WAC3B,YAAY,eAAe;;UAE5B;WACC,MAAM;WACN,MAAM;;UAEP;WACC;WACA;WACA;WACA,uBAAuB;WACvB,QAAQ,eAAe;WACvB,gBAAgB,eAAe;WAC/B,QAAQ,eAAe;WACvB,QAAQ,eAAe;;UAExB;WACC;WACA;WACA,MAAM;WACN,MAAM;EACf,QAAQ,eAAe;EACvB,qBAAqB,kBAAkB;;UAE/B;WACC;WACA;WACA,MAAM;WACN,MAAM;EACf,QAAQ,eAAe;EACvB,qBAAqB,kBAAkB;;UAE/B;WACC;WACA;WACA;WACA,MAAM;WACN,MAAM;EACf,kBAAkB;EAClB,qBAAqB,kBAAkB;;UAE/B;WACC;WACA;WACA;WACA,MAAM;WACN,MAAM;WACN,QAAQ,eAAe;WACvB,kBAAkB;WAClB,qBAAqB,kBAAkB;;UAExC;WACC;WACA,kBAAkB;WAClB;WACA,qBAAqB,kBAAkB;;;;;;;UAO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C;iBACtH,aAAa,OAAO,oBAAoB"}
@@ -0,0 +1,14 @@
1
+ //#region ../../../3-targets/0-shared/type-implementations/dist/boolean.mjs
2
+ /** The boolean a stored integer names: `false` for 0 and `true` for 1, read from a number, a bigint or the integer's decimal text. `undefined` for any other value. */
3
+ function booleanFromInteger(stored) {
4
+ if (stored === 0 || stored === 0n || stored === "0") return false;
5
+ if (stored === 1 || stored === 1n || stored === "1") return true;
6
+ }
7
+ /** The integer a boolean is stored as: 1 for `true` and 0 for `false`. */
8
+ function integerFromBoolean(value) {
9
+ return value ? 1 : 0;
10
+ }
11
+ //#endregion
12
+ export { integerFromBoolean as n, booleanFromInteger as t };
13
+
14
+ //# sourceMappingURL=boolean-C37kSXDF.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boolean-C37kSXDF.mjs","names":[],"sources":["../../../../3-targets/0-shared/type-implementations/dist/boolean.mjs"],"sourcesContent":["//#region src/boolean.ts\n/** The boolean a stored integer names: `false` for 0 and `true` for 1, read from a number, a bigint or the integer's decimal text. `undefined` for any other value. */\nfunction booleanFromInteger(stored) {\n\tif (stored === 0 || stored === 0n || stored === \"0\") return false;\n\tif (stored === 1 || stored === 1n || stored === \"1\") return true;\n}\n/** The integer a boolean is stored as: 1 for `true` and 0 for `false`. */\nfunction integerFromBoolean(value) {\n\treturn value ? 1 : 0;\n}\n//#endregion\nexport { booleanFromInteger, integerFromBoolean };\n\n//# sourceMappingURL=boolean.mjs.map"],"mappings":";;AAEA,SAAS,mBAAmB,QAAQ;CACnC,IAAI,WAAW,KAAK,WAAW,MAAM,WAAW,KAAK,OAAO;CAC5D,IAAI,WAAW,KAAK,WAAW,MAAM,WAAW,KAAK,OAAO;AAC7D;;AAEA,SAAS,mBAAmB,OAAO;CAClC,OAAO,QAAQ,IAAI;AACpB"}
@@ -0,0 +1,9 @@
1
+ //#region ../../../3-targets/0-shared/type-implementations/dist/boolean.d.mts
2
+ //#region src/boolean.d.ts
3
+ /** The boolean a stored integer names: `false` for 0 and `true` for 1, read from a number, a bigint or the integer's decimal text. `undefined` for any other value. */
4
+ declare function booleanFromInteger(stored: unknown): boolean | undefined;
5
+ /** The integer a boolean is stored as: 1 for `true` and 0 for `false`. */
6
+ declare function integerFromBoolean(value: boolean): 0 | 1;
7
+ //#endregion
8
+ export { integerFromBoolean as n, booleanFromInteger as t };
9
+ //# sourceMappingURL=boolean-CcUSuhCU.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boolean-CcUSuhCU.d.mts","names":[],"sources":["../../../../3-targets/0-shared/type-implementations/dist/boolean.d.mts"],"mappings":";;;iBAEiB,mBAAmB;;iBAEnB,mBAAmB"}
@@ -1,7 +1,7 @@
1
1
  import { o as structuredError } from "./structured-error-BXbihKQ-.mjs";
2
2
  import { t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
3
3
  import { g as isNonFiniteText } from "./data-type-V6mcDhcG-DVQAPOQT.mjs";
4
- import { s as tsStringLiteral } from "./dist-D1f6xr7F.mjs";
4
+ import { s as tsStringLiteral } from "./dist-s8Mn2iIF.mjs";
5
5
  import { a as numeralText } from "./codec-descriptor-CPSGZunM-DxrbRHX1.mjs";
6
6
  //#region ../../../1-framework/1-core/framework-components/dist/codec.mjs
7
7
  /** A cast between two types that store the same shape: the value is already the form this type stores. */
@@ -454,4 +454,4 @@ function floatNumberLiteral(value) {
454
454
  //#endregion
455
455
  export { signedRange as _, createNumberClassifier as a, decimalTextEqualityKey as c, isNumeralText as d, isoDateStringText as f, renderTsLiteral as g, refuseWrongShape as h, column as i, decimalTextNumberLiteral as l, printJsonText as m, asNumeralText as n, dateTimeStoredText as o, parseJsonText as p, castUnchanged as r, decimalTextBigintLiteral as s, asFloat as t, floatNumberLiteral as u, storedNumeralText as v };
456
456
 
457
- //# sourceMappingURL=codec-yFwW7XRh.mjs.map
457
+ //# sourceMappingURL=codec-CBJNOQS4.mjs.map