@carbonenginejs/runtime-resource 0.11.1 → 0.12.1

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 (211) hide show
  1. package/dist/CjsResMan.js +4 -4
  2. package/dist/CjsResMan.js.map +1 -1
  3. package/dist/_virtual/_rollupPluginBabelHelpers.js +1 -4
  4. package/dist/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
  5. package/dist/format/CjsByteReader.js +310 -0
  6. package/dist/format/CjsByteReader.js.map +1 -0
  7. package/dist/format/CjsByteWriter.js +242 -0
  8. package/dist/format/CjsByteWriter.js.map +1 -0
  9. package/dist/format/CjsFormatError.js +41 -0
  10. package/dist/format/CjsFormatError.js.map +1 -0
  11. package/dist/format/CjsStringTable.js +268 -0
  12. package/dist/format/CjsStringTable.js.map +1 -0
  13. package/dist/format/carbonEffect/CjsCarbonEffectReader.js +361 -0
  14. package/dist/format/carbonEffect/CjsCarbonEffectReader.js.map +1 -0
  15. package/dist/format/carbonEffect/CjsCarbonEffectWriter.js +373 -0
  16. package/dist/format/carbonEffect/CjsCarbonEffectWriter.js.map +1 -0
  17. package/dist/format/carbonEffect/carbonDescriptionFromPortable.js +372 -0
  18. package/dist/format/carbonEffect/carbonDescriptionFromPortable.js.map +1 -0
  19. package/dist/format/carbonEffect/carbonEffectBackendBlock.js +427 -0
  20. package/dist/format/carbonEffect/carbonEffectBackendBlock.js.map +1 -0
  21. package/dist/format/carbonEffect/carbonEffectRecords.js +955 -0
  22. package/dist/format/carbonEffect/carbonEffectRecords.js.map +1 -0
  23. package/dist/format/compareUtf8.js +36 -0
  24. package/dist/format/compareUtf8.js.map +1 -0
  25. package/dist/format/index.js +11 -0
  26. package/dist/format/index.js.map +1 -0
  27. package/dist/formats/bnk/CjsBnkFormat.js +18 -2
  28. package/dist/formats/bnk/CjsBnkFormat.js.map +1 -1
  29. package/dist/formats/bnk/core/eventAction.js +305 -0
  30. package/dist/formats/bnk/core/eventAction.js.map +1 -0
  31. package/dist/formats/bnk/core/graph.js +3 -6
  32. package/dist/formats/bnk/core/graph.js.map +1 -1
  33. package/dist/formats/bnk/core/helpers.js +62 -11
  34. package/dist/formats/bnk/core/helpers.js.map +1 -1
  35. package/dist/formats/bnk/core/nodeBase.js +532 -0
  36. package/dist/formats/bnk/core/nodeBase.js.map +1 -0
  37. package/dist/formats/bnk/core/sfxNodes.js +632 -0
  38. package/dist/formats/bnk/core/sfxNodes.js.map +1 -0
  39. package/dist/formats/bnk/core/soundbanksInfo.js +59 -51
  40. package/dist/formats/bnk/core/soundbanksInfo.js.map +1 -1
  41. package/dist/formats/gr2/CjsGr2Format.js +256 -13
  42. package/dist/formats/gr2/CjsGr2Format.js.map +1 -1
  43. package/dist/formats/gr2/core/helpers.js +15 -15
  44. package/dist/formats/gr2/core/helpers.js.map +1 -1
  45. package/dist/formats/gr2/core/json.js +1 -1
  46. package/dist/formats/gr2/core/json.js.map +1 -1
  47. package/dist/formats/gr2/core/targets.js +1 -1
  48. package/dist/formats/gr2/core/targets.js.map +1 -1
  49. package/dist/formats/gr2/index.js +0 -1
  50. package/dist/formats/gr2/index.js.map +1 -1
  51. package/dist/formats/hlsl/core/HlslReader.js +7 -257
  52. package/dist/formats/hlsl/core/HlslReader.js.map +1 -1
  53. package/dist/formats/hlsl/core/analysis.js +1 -1
  54. package/dist/formats/hlsl/core/carbonDescriptionToRuntime.js +781 -0
  55. package/dist/formats/hlsl/core/carbonDescriptionToRuntime.js.map +1 -0
  56. package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js +21 -1
  57. package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js.map +1 -1
  58. package/dist/formats/hlsl/index.js +1 -0
  59. package/dist/formats/hlsl/index.js.map +1 -1
  60. package/dist/formats/index.js +3 -6
  61. package/dist/formats/index.js.map +1 -1
  62. package/dist/formats/webgl/core/cewg/CewgPackage.js +2 -1
  63. package/dist/formats/webgl/core/cewg/CewgPackage.js.map +1 -1
  64. package/dist/formats/webgl/core/cewg/binary.js +11 -93
  65. package/dist/formats/webgl/core/cewg/binary.js.map +1 -1
  66. package/dist/formats/webgl/core/effectPackage.js +4 -1
  67. package/dist/formats/webgl/core/effectPackage.js.map +1 -1
  68. package/dist/formats/webgl/core/errors.js +3 -3
  69. package/dist/formats/webgl/core/errors.js.map +1 -1
  70. package/dist/formats/webgpu/CjsWebgpuFormat.js +4 -23
  71. package/dist/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
  72. package/dist/formats/webgpu/core/buildCarbonEffectContainer.js +197 -0
  73. package/dist/formats/webgpu/core/buildCarbonEffectContainer.js.map +1 -0
  74. package/dist/formats/webgpu/core/cewgpu/CewgpuContainer.js +368 -0
  75. package/dist/formats/webgpu/core/cewgpu/CewgpuContainer.js.map +1 -0
  76. package/dist/formats/webgpu/core/cewgpu/containerViews.js +355 -0
  77. package/dist/formats/webgpu/core/cewgpu/containerViews.js.map +1 -0
  78. package/dist/formats/webgpu/core/cewgpu/validateContainer.js +90 -0
  79. package/dist/formats/webgpu/core/cewgpu/validateContainer.js.map +1 -0
  80. package/dist/formats/webgpu/core/effectBackendBodySet.js +21 -20
  81. package/dist/formats/webgpu/core/effectBackendBodySet.js.map +1 -1
  82. package/dist/formats/webgpu/core/helpers.js +87 -92
  83. package/dist/formats/webgpu/core/helpers.js.map +1 -1
  84. package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js +14 -13
  85. package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js.map +1 -1
  86. package/dist/formats/webgpu/core/ir/inferValueTypes.js +10 -8
  87. package/dist/formats/webgpu/core/ir/inferValueTypes.js.map +1 -1
  88. package/dist/formats/webgpu/core/packageEffect.js +94 -9
  89. package/dist/formats/webgpu/core/packageEffect.js.map +1 -1
  90. package/dist/formats/webgpu/core/packageMetadata.js +10 -1
  91. package/dist/formats/webgpu/core/packageMetadata.js.map +1 -1
  92. package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js +17 -15
  93. package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js.map +1 -1
  94. package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js +13 -12
  95. package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js.map +1 -1
  96. package/dist/formats/webgpu/core/wgsl/buildWgslSet.js +9 -8
  97. package/dist/formats/webgpu/core/wgsl/buildWgslSet.js.map +1 -1
  98. package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js +23 -22
  99. package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js.map +1 -1
  100. package/dist/formats/webgpu/core/wgsl/selectionPlans.js +46 -44
  101. package/dist/formats/webgpu/core/wgsl/selectionPlans.js.map +1 -1
  102. package/dist/resource/CjsResource.js +700 -684
  103. package/dist/resource/CjsResource.js.map +1 -1
  104. package/dist/resource/Tr2LightProfileRes.js +18 -27
  105. package/dist/resource/Tr2LightProfileRes.js.map +1 -1
  106. package/dist/resource/audio/CjsAudioBufferRes.js +2 -2
  107. package/dist/resource/audio/CjsAudioBufferRes.js.map +1 -1
  108. package/dist/resource/audio/CjsAudioRes.js +2 -2
  109. package/dist/resource/audio/CjsAudioRes.js.map +1 -1
  110. package/dist/resource/geometry/TriGeometryRes.js +605 -586
  111. package/dist/resource/geometry/TriGeometryRes.js.map +1 -1
  112. package/dist/resource/geometry/granny/Tr2GrannyStateRes.js +21 -30
  113. package/dist/resource/geometry/granny/Tr2GrannyStateRes.js.map +1 -1
  114. package/dist/resource/geometry/granny/TriGrannyRes.js +21 -30
  115. package/dist/resource/geometry/granny/TriGrannyRes.js.map +1 -1
  116. package/dist/resource/shader/Tr2EffectRes.js +9 -7
  117. package/dist/resource/shader/Tr2EffectRes.js.map +1 -1
  118. package/dist/resource/shader/Tr2MaterialArea.js +5 -3
  119. package/dist/resource/shader/Tr2MaterialArea.js.map +1 -1
  120. package/dist/resource/shader/Tr2MaterialMesh.js +4 -2
  121. package/dist/resource/shader/Tr2MaterialMesh.js.map +1 -1
  122. package/dist/resource/shader/Tr2MaterialRes.js +5 -3
  123. package/dist/resource/shader/Tr2MaterialRes.js.map +1 -1
  124. package/dist/resource/shader/Tr2Shader.js +26 -21
  125. package/dist/resource/shader/Tr2Shader.js.map +1 -1
  126. package/dist/resource/shader/Tr2ShaderPermutation.js +8 -6
  127. package/dist/resource/shader/Tr2ShaderPermutation.js.map +1 -1
  128. package/dist/resource/shader/reflection/Tr2EffectDefine.js +5 -3
  129. package/dist/resource/shader/reflection/Tr2EffectDefine.js.map +1 -1
  130. package/dist/resource/shader/reflection/Tr2EffectDescription.js +5 -3
  131. package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -1
  132. package/dist/resource/shader/reflection/Tr2EffectLibrary.js +17 -15
  133. package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -1
  134. package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +11 -9
  135. package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -1
  136. package/dist/resource/shader/reflection/Tr2EffectResource.js +8 -6
  137. package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
  138. package/dist/resource/shader/reflection/Tr2EffectStageInput.js +15 -13
  139. package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -1
  140. package/dist/resource/shader/reflection/Tr2EffectTechnique.js +7 -5
  141. package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -1
  142. package/dist/resource/shader/reflection/Tr2Pass.js +11 -9
  143. package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
  144. package/dist/resource/shader/sampler/Tr2SamplerSetup.js +8 -6
  145. package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -1
  146. package/dist/resource/texture/CjsTextureArrayRes.js +400 -411
  147. package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -1
  148. package/dist/resource/texture/Tr2ImageRes.js +99 -95
  149. package/dist/resource/texture/Tr2ImageRes.js.map +1 -1
  150. package/dist/resource/texture/TriTextureRes.js +312 -273
  151. package/dist/resource/texture/TriTextureRes.js.map +1 -1
  152. package/docs/README.md +13 -1
  153. package/docs/architecture.md +3 -3
  154. package/docs/concepts/resource-lifecycle.md +9 -2
  155. package/docs/concepts/shader-resource-model.md +114 -0
  156. package/docs/concepts/writing-an-engine-adapter.md +115 -0
  157. package/docs/formats/README.md +24 -1
  158. package/docs/formats/carbon-effect-container.md +452 -0
  159. package/docs/formats/dxbc/README.md +68 -0
  160. package/docs/formats/dxbc/architecture.md +80 -0
  161. package/docs/formats/dxbc/reference/api.md +77 -0
  162. package/docs/formats/dxbc/reference/classes/README.md +9 -0
  163. package/docs/formats/dxbc/reference/decoded-output.md +122 -0
  164. package/docs/formats/gr2.md +3 -4
  165. package/docs/formats/hlsl/README.md +54 -0
  166. package/docs/formats/hlsl/architecture.md +67 -0
  167. package/docs/formats/hlsl/guides/hydrating-json-output.md +62 -0
  168. package/docs/formats/hlsl/guides/reading-effects.md +64 -0
  169. package/docs/formats/hlsl/reference/advanced-analysis.md +66 -0
  170. package/docs/formats/hlsl/reference/api.md +98 -0
  171. package/docs/formats/hlsl/reference/classes/README.md +11 -0
  172. package/docs/formats/hlsl/reference/json-graph.md +100 -0
  173. package/docs/formats/hlsl/reference/portable-reflection.md +141 -0
  174. package/docs/formats/provenance.md +32 -17
  175. package/docs/formats/webgl/README.md +57 -0
  176. package/docs/formats/webgl/architecture.md +70 -0
  177. package/docs/formats/webgl/carbon-constant-layouts.md +326 -0
  178. package/docs/formats/webgl/decl-io.md +1234 -0
  179. package/docs/formats/webgl/effect-reflection.md +127 -0
  180. package/docs/formats/webgl/memory-structured.md +871 -0
  181. package/docs/formats/webgl/reference/classes/README.md +9 -0
  182. package/docs/formats/webgl/texture-sample.md +964 -0
  183. package/docs/formats/webgpu/README.md +84 -0
  184. package/docs/formats/webgpu/architecture.md +96 -0
  185. package/docs/formats/webgpu/formats/cewgpu.md +216 -0
  186. package/docs/formats/webgpu/guides/effect-packaging.md +191 -0
  187. package/docs/formats/webgpu/reference/api.md +197 -0
  188. package/docs/formats/webgpu/reference/classes/README.md +9 -0
  189. package/docs/formats/webgpu/reference/wgsl-compatibility.md +1543 -0
  190. package/docs/formats/wwise.md +45 -4
  191. package/docs/reference/classes/core.md +80 -0
  192. package/docs/reference/classes/formats.md +24 -34
  193. package/docs/reference/events.md +25 -0
  194. package/docs/reference/motherlode-cache.md +22 -8
  195. package/docs/reference/workers.md +5 -5
  196. package/docs/roadmap.md +61 -41
  197. package/format-notices/bnk/NOTICE +5 -4
  198. package/format-notices/webgl/NOTICE +1 -1
  199. package/package.json +2 -1
  200. package/dist/formats/gr2/core/CjsFormatGr2.js +0 -273
  201. package/dist/formats/gr2/core/CjsFormatGr2.js.map +0 -1
  202. package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js +0 -415
  203. package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js.map +0 -1
  204. package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js +0 -100
  205. package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js.map +0 -1
  206. package/dist/formats/webgpu/core/cewgpu/binary.js +0 -93
  207. package/dist/formats/webgpu/core/cewgpu/binary.js.map +0 -1
  208. package/dist/formats/webgpu/core/cewgpu/tags.js +0 -17
  209. package/dist/formats/webgpu/core/cewgpu/tags.js.map +0 -1
  210. package/dist/formats/webgpu/core/effectPackageValidation.js +0 -1078
  211. package/dist/formats/webgpu/core/effectPackageValidation.js.map +0 -1
@@ -1,9 +1,6 @@
1
- import { identity as _identity, applyDecs2311 as _applyDecs2311 } from '../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import { CjsEventEmitter } from '@carbonenginejs/runtime-utils/model';
3
2
  import { normalizeResourcePath, normalizeResourceExtension, getResourceExtension } from '@carbonenginejs/runtime-utils/path';
4
- import { type, carbon, impl, CjsSchema } from '@carbonenginejs/runtime-utils/schema';
5
-
6
- let _initProto, _initClass, _init_path, _init_extra_path, _init_ext, _init_extra_ext, _init_requirement, _init_extra_requirement, _init_state, _init_extra_state;
3
+ import { CjsSchema, carbon, impl, type } from '@carbonenginejs/runtime-utils/schema';
7
4
 
8
5
  /**
9
6
  * Deterministic activity values accepted by resource-facing lease methods.
@@ -26,735 +23,715 @@ let _initProto, _initClass, _init_path, _init_extra_path, _init_ext, _init_extra
26
23
  * @property {Function} [lock] Adds one inactivity-purge lock and returns its count.
27
24
  * @property {Function} [unlock] Releases one inactivity-purge lock and returns its count.
28
25
  */
29
- let _CjsResource;
30
- new class extends _identity {
31
- static [class CjsResource extends CjsEventEmitter {
32
- static {
33
- ({
34
- e: [_init_path, _init_extra_path, _init_ext, _init_extra_ext, _init_requirement, _init_extra_requirement, _init_state, _init_extra_state, _initProto],
35
- c: [_CjsResource, _initClass]
36
- } = _applyDecs2311(this, [type.define({
37
- className: "CjsResource",
38
- family: "resource"
39
- })], [[[type, type.path], 16, "path"], [[type, type.string], 16, "ext"], [[type, type.string], 16, "requirement"], [[type, type.string], 16, "state"], [[carbon, carbon.method, impl, impl.adapted], 18, "Initialize"], [[carbon, carbon.method, impl, impl.adapted], 18, "GetPath"], [[carbon, carbon.method, impl, impl.adapted], 18, "GetExt"], [[carbon, carbon.method, impl, impl.adapted], 18, "IsLoading"], [[carbon, carbon.method, impl, impl.adapted], 18, "HasLoaded"], [[carbon, carbon.method, impl, impl.adapted], 18, "IsPrepared"], [[carbon, carbon.method, impl, impl.adapted], 18, "IsGood"], [[carbon, carbon.method, impl, impl.adapted], 18, "IsFailed"]], 0, void 0, CjsEventEmitter));
40
- }
41
- #payload = (_initProto(this), null);
42
-
43
- /** Reloads attempted since the last successful load. */
44
- #reloadAttempts = 0;
45
-
46
- /**
47
- * How many times a purged or failed resource reloads itself before giving up.
48
- *
49
- * Per class so a subclass can be more or less patient. Counted per resource
50
- * and reset on every successful load, so this bounds consecutive failures,
51
- * not the lifetime total.
52
- */
53
-
54
- path = _init_path(this, "");
55
- ext = (_init_extra_path(this), _init_ext(this, ""));
56
- requirement = (_init_extra_ext(this), _init_requirement(this, ""));
57
- state = (_init_extra_requirement(this), _init_state(this, _CjsResource.State.EMPTY));
58
-
59
- /**
60
- * Identifies this class as a runtime resource.
61
- *
62
- * Static, so a schema field declared as `@type.objectRef("TriGeometryRes")`
63
- * can be known to hold a resource without an instance existing - the
64
- * declaration alone is enough, resolved through `CjsSchema.GetConstructor`.
65
- */
66
-
67
- /** Identifies this handle as a runtime resource. */
68
- get isResource() {
69
- return this.constructor.isResource === true;
70
- }
71
26
 
72
- /**
73
- * Create a detached runtime resource with empty identity and payload state.
74
- * Schema values are applied without attaching manager lifecycle callbacks;
75
- * CjsResMan supplies those callbacks after canonical insertion.
76
- *
77
- * @param {object|null} [values=null] Initial decorated schema-field values.
78
- */
79
- constructor(values = null) {
80
- super(), _init_extra_state(this);
81
- Object.defineProperty(this, "__adapterResources", {
82
- value: Object.create(null),
83
- enumerable: false,
84
- configurable: true,
85
- writable: true
86
- });
87
- Object.defineProperty(this, "__objectLoader", {
88
- value: null,
89
- enumerable: false,
90
- configurable: true,
91
- writable: true
92
- });
93
- Object.defineProperty(this, "__objectRequest", {
94
- value: null,
95
- enumerable: false,
96
- configurable: true,
97
- writable: true
98
- });
99
- Object.defineProperty(this, "__lifecycleController", {
100
- value: null,
101
- enumerable: false,
102
- configurable: true,
103
- writable: true
104
- });
105
- Object.defineProperty(this, "__reloadHook", {
106
- value: null,
107
- enumerable: false,
108
- configurable: true,
109
- writable: true
110
- });
111
- if (values) {
112
- this.SetValues(values);
113
- }
114
- }
27
+ /**
28
+ * ResMan-owned runtime resource.
29
+ *
30
+ * Resources are not model graph objects: BLACK/RED graphs persist resource
31
+ * paths (including empty paths), while CjsResMan constructs, initializes,
32
+ * caches, and hydrates the corresponding runtime resource instances.
33
+ */
34
+ class CjsResource extends CjsEventEmitter {
35
+ #payload = null;
36
+
37
+ /** Reloads attempted since the last successful load. */
38
+ #reloadAttempts = 0;
39
+
40
+ /**
41
+ * How many times a purged or failed resource reloads itself before giving up.
42
+ *
43
+ * Per class so a subclass can be more or less patient. Counted per resource
44
+ * and reset on every successful load, so this bounds consecutive failures,
45
+ * not the lifetime total.
46
+ */
47
+ static maxReloadAttempts = 3;
48
+ path = "";
49
+ ext = "";
50
+ requirement = "";
51
+ state = CjsResource.State.EMPTY;
52
+
53
+ /**
54
+ * Identifies this class as a runtime resource.
55
+ *
56
+ * Static, so a schema field declared as `@type.objectRef("TriGeometryRes")`
57
+ * can be known to hold a resource without an instance existing - the
58
+ * declaration alone is enough, resolved through `CjsSchema.GetConstructor`.
59
+ */
60
+ static isResource = true;
61
+
62
+ /** Identifies this handle as a runtime resource. */
63
+ get isResource() {
64
+ return this.constructor.isResource === true;
65
+ }
115
66
 
116
- /**
117
- * Apply resource identity or metadata values without model graph semantics.
118
- *
119
- * @param {object|null} values
120
- * @returns {CjsResource}
121
- */
122
- SetValues(values = null) {
123
- if (!values || typeof values !== "object") return this;
124
- const fields = CjsSchema.getSchema(this.constructor).fields;
125
- for (const field of fields) {
126
- if (Object.prototype.hasOwnProperty.call(values, field.name)) {
127
- this[field.name] = values[field.name];
128
- }
129
- }
130
- return this;
67
+ /**
68
+ * Create a detached runtime resource with empty identity and payload state.
69
+ * Schema values are applied without attaching manager lifecycle callbacks;
70
+ * CjsResMan supplies those callbacks after canonical insertion.
71
+ *
72
+ * @param {object|null} [values=null] Initial decorated schema-field values.
73
+ */
74
+ constructor(values = null) {
75
+ super();
76
+ Object.defineProperty(this, "__adapterResources", {
77
+ value: Object.create(null),
78
+ enumerable: false,
79
+ configurable: true,
80
+ writable: true
81
+ });
82
+ Object.defineProperty(this, "__objectLoader", {
83
+ value: null,
84
+ enumerable: false,
85
+ configurable: true,
86
+ writable: true
87
+ });
88
+ Object.defineProperty(this, "__objectRequest", {
89
+ value: null,
90
+ enumerable: false,
91
+ configurable: true,
92
+ writable: true
93
+ });
94
+ Object.defineProperty(this, "__lifecycleController", {
95
+ value: null,
96
+ enumerable: false,
97
+ configurable: true,
98
+ writable: true
99
+ });
100
+ Object.defineProperty(this, "__reloadHook", {
101
+ value: null,
102
+ enumerable: false,
103
+ configurable: true,
104
+ writable: true
105
+ });
106
+ if (values) {
107
+ this.SetValues(values);
131
108
  }
109
+ }
132
110
 
133
- /**
134
- * Export resource identity and schema metadata. Runtime state is not a model
135
- * graph node; graph fields normally persist only their resource path.
136
- *
137
- * @returns {object}
138
- */
139
- GetValues() {
140
- const result = {};
141
- for (const field of CjsSchema.getSchema(this.constructor).fields) {
142
- result[field.name] = this[field.name];
111
+ /**
112
+ * Apply resource identity or metadata values without model graph semantics.
113
+ *
114
+ * @param {object|null} values
115
+ * @returns {CjsResource}
116
+ */
117
+ SetValues(values = null) {
118
+ if (!values || typeof values !== "object") return this;
119
+ const fields = CjsSchema.getSchema(this.constructor).fields;
120
+ for (const field of fields) {
121
+ if (Object.prototype.hasOwnProperty.call(values, field.name)) {
122
+ this[field.name] = values[field.name];
143
123
  }
144
- return result;
145
124
  }
125
+ return this;
126
+ }
146
127
 
147
- /**
148
- * Initialize the resource identity from a path and optional extension.
149
- *
150
- * @param {string} path
151
- * @param {string|null} ext
152
- * @param {string|null} requirement
153
- * @returns {CjsResource}
154
- */
155
- Initialize(path, ext = null, requirement = "") {
156
- this.path = normalizeResourcePath(path);
157
- this.ext = ext ? normalizeResourceExtension(ext) : getResourceExtension(this.path);
158
- this.requirement = requirement === null || requirement === undefined ? "" : String(requirement).trim().toLowerCase();
159
- this.state = _CjsResource.State.EMPTY;
160
- this.error = null;
161
- return this;
162
- }
128
+ /**
129
+ * Export resource identity and schema metadata. Runtime state is not a model
130
+ * graph node; graph fields normally persist only their resource path.
131
+ *
132
+ * @returns {object}
133
+ */
134
+ GetValues() {
135
+ const result = {};
136
+ for (const field of CjsSchema.getSchema(this.constructor).fields) {
137
+ result[field.name] = this[field.name];
138
+ }
139
+ return result;
140
+ }
163
141
 
164
- /**
165
- * Get the normalized resource path.
166
- *
167
- * @returns {string}
168
- */
169
- GetPath() {
170
- return this.path;
171
- }
142
+ /**
143
+ * Initialize the resource identity from a path and optional extension.
144
+ *
145
+ * @param {string} path
146
+ * @param {string|null} ext
147
+ * @param {string|null} requirement
148
+ * @returns {CjsResource}
149
+ */
150
+ Initialize(path, ext = null, requirement = "") {
151
+ this.path = normalizeResourcePath(path);
152
+ this.ext = ext ? normalizeResourceExtension(ext) : getResourceExtension(this.path);
153
+ this.requirement = requirement === null || requirement === undefined ? "" : String(requirement).trim().toLowerCase();
154
+ this.state = CjsResource.State.EMPTY;
155
+ this.error = null;
156
+ return this;
157
+ }
172
158
 
173
- /**
174
- * Get the normalized resource extension.
175
- *
176
- * @returns {string}
177
- */
178
- GetExt() {
179
- return this.ext;
180
- }
159
+ /**
160
+ * Get the normalized resource path.
161
+ *
162
+ * @returns {string}
163
+ */
164
+ GetPath() {
165
+ return this.path;
166
+ }
181
167
 
182
- /**
183
- * Return the normalized semantic outcome requested from this source path.
184
- * This metadata query is pure and does not renew manager activity.
185
- *
186
- * @returns {string} Lowercase requirement name, or an empty string.
187
- */
188
- GetRequirement() {
189
- return this.requirement;
190
- }
168
+ /**
169
+ * Get the normalized resource extension.
170
+ *
171
+ * @returns {string}
172
+ */
173
+ GetExt() {
174
+ return this.ext;
175
+ }
191
176
 
192
- /**
193
- * Return true when the resource is currently loading.
194
- *
195
- * @returns {boolean}
196
- */
197
- IsLoading() {
198
- return this.state === _CjsResource.State.REQUESTED || this.state === _CjsResource.State.LOADING;
199
- }
177
+ /**
178
+ * Return the normalized semantic outcome requested from this source path.
179
+ * This metadata query is pure and does not renew manager activity.
180
+ *
181
+ * @returns {string} Lowercase requirement name, or an empty string.
182
+ */
183
+ GetRequirement() {
184
+ return this.requirement;
185
+ }
200
186
 
201
- /**
202
- * Return true when CPU resource payload data has been loaded.
203
- *
204
- * @returns {boolean}
205
- */
206
- HasLoaded() {
207
- return this.state === _CjsResource.State.LOADED || this.state === _CjsResource.State.PREPARING || this.state === _CjsResource.State.PREPARED;
208
- }
187
+ /**
188
+ * Return true when the resource is currently loading.
189
+ *
190
+ * @returns {boolean}
191
+ */
192
+ IsLoading() {
193
+ return this.state === CjsResource.State.REQUESTED || this.state === CjsResource.State.LOADING;
194
+ }
209
195
 
210
- /**
211
- * Return true when preparation has completed or produced a good resource.
212
- *
213
- * @returns {boolean}
214
- */
215
- IsPrepared() {
216
- return this.state === _CjsResource.State.PREPARED;
217
- }
196
+ /**
197
+ * Return true when CPU resource payload data has been loaded.
198
+ *
199
+ * @returns {boolean}
200
+ */
201
+ HasLoaded() {
202
+ return this.state === CjsResource.State.LOADED || this.state === CjsResource.State.PREPARING || this.state === CjsResource.State.PREPARED;
203
+ }
218
204
 
219
- /**
220
- * Return true when this resource finished trying to load, either way.
221
- *
222
- * The pull form of the `completed` event. Carbon expresses this as a
223
- * predicate because it has no events - `m_isPrepared` is set on the failure
224
- * path too (`BlueAsyncRes.cpp:183`) - so `IsPrepared()` there means "finished
225
- * trying" while ours keeps the narrower "succeeded".
226
- *
227
- * `PURGED` is not completion: nothing was tried and nothing concluded, the
228
- * payload was simply taken away.
229
- *
230
- * @returns {boolean}
231
- */
232
- HasCompleted() {
233
- return this.state === _CjsResource.State.PREPARED || this.state === _CjsResource.State.FAILED;
234
- }
205
+ /**
206
+ * Return true when preparation has completed or produced a good resource.
207
+ *
208
+ * @returns {boolean}
209
+ */
210
+ IsPrepared() {
211
+ return this.state === CjsResource.State.PREPARED;
212
+ }
235
213
 
236
- /**
237
- * Return true when preparation completed successfully, and renew this
238
- * resource.
239
- *
240
- * Every caller of `IsGood()` is about to use the resource, so renewal always
241
- * follows the query. Merging them - as ccpwgl does in `Tw2Resource.js:108` -
242
- * closes that gap permanently instead of relying on call-site discipline, and
243
- * means a purged resource reloads itself the moment anything asks for it.
244
- *
245
- * @returns {boolean}
246
- */
247
- IsGood() {
248
- this.KeepAlive();
249
- return this.IsPrepared();
250
- }
214
+ /**
215
+ * Return true when this resource finished trying to load, either way.
216
+ *
217
+ * The pull form of the `completed` event. Carbon expresses this as a
218
+ * predicate because it has no events - `m_isPrepared` is set on the failure
219
+ * path too (`BlueAsyncRes.cpp:183`) - so `IsPrepared()` there means "finished
220
+ * trying" while ours keeps the narrower "succeeded".
221
+ *
222
+ * `PURGED` is not completion: nothing was tried and nothing concluded, the
223
+ * payload was simply taken away.
224
+ *
225
+ * @returns {boolean}
226
+ */
227
+ HasCompleted() {
228
+ return this.state === CjsResource.State.PREPARED || this.state === CjsResource.State.FAILED;
229
+ }
251
230
 
252
- /**
253
- * Return true when preparation failed.
254
- *
255
- * @returns {boolean}
256
- */
257
- IsFailed() {
258
- return this.state === _CjsResource.State.FAILED;
259
- }
231
+ /**
232
+ * Return true when preparation completed successfully, and renew this
233
+ * resource.
234
+ *
235
+ * Every caller of `IsGood()` is about to use the resource, so renewal always
236
+ * follows the query. Merging them - as ccpwgl does in `Tw2Resource.js:108` -
237
+ * closes that gap permanently instead of relying on call-site discipline, and
238
+ * means a purged resource reloads itself the moment anything asks for it.
239
+ *
240
+ * @returns {boolean}
241
+ */
242
+ IsGood() {
243
+ this.KeepAlive();
244
+ return this.IsPrepared();
245
+ }
260
246
 
261
- /**
262
- * Changes state and emits the state-specific, statechange, and - on reaching
263
- * a load outcome - completed events.
264
- */
265
- SetState(state, ...details) {
266
- if (!_CjsResource.isValidState(state)) {
267
- throw new TypeError(`Invalid CjsResource state: ${state}`);
268
- }
269
- const previous = this.state;
270
- if (previous === state) return this;
271
- this.state = state;
272
- // A successful load clears the budget, so the cap bounds consecutive
273
- // failures rather than how many times a resource may ever be purged.
274
- if (state === _CjsResource.State.PREPARED) this.#reloadAttempts = 0;
275
- this.EmitEvent?.(state, this, ...details);
276
- this.EmitEvent?.("statechange", this, state, previous);
277
- // Fires again after a purge and reload, so subscribers rebuild whatever
278
- // they derived from the payload that was deleted.
279
- if (this.HasCompleted()) this.EmitEvent?.("completed", this, ...details);
280
- return this;
281
- }
247
+ /**
248
+ * Return true when preparation failed.
249
+ *
250
+ * @returns {boolean}
251
+ */
252
+ IsFailed() {
253
+ return this.state === CjsResource.State.FAILED;
254
+ }
282
255
 
283
- /**
284
- * Subscribe to this resource finishing, firing immediately when it already
285
- * has.
286
- *
287
- * The immediate call is the point. A plain emitter drops late subscribers on
288
- * the floor - subscribe after `PREPARED` and nothing ever arrives - which is
289
- * why callers end up doing work synchronously "just in case" instead of
290
- * subscribing. ccpwgl solves this by replaying current state at registration
291
- * (`Tw2Resource.onNotification`), and a subscriber satisfied that way is
292
- * never stored at all, so only subscriptions genuinely still waiting
293
- * accumulate.
294
- *
295
- * The listener runs for both outcomes and branches itself:
296
- *
297
- * ```js
298
- * res.OnCompleted(res => { if (res.IsPrepared()) something; else somethingElse; });
299
- * ```
300
- *
301
- * It may run more than once - a purge and reload completes again - so
302
- * handlers must be written to be re-entered rather than assuming first load.
303
- *
304
- * @param {Function} listener Called with this resource once it has finished.
305
- * @param {*} [source=null] Optional owner used for bulk removal.
306
- * @returns {CjsResource} This resource.
307
- */
308
- OnCompleted(listener, source = null) {
309
- if (typeof listener !== "function") {
310
- throw new TypeError("CjsResource.OnCompleted requires a function.");
311
- }
312
- if (this.HasCompleted()) {
313
- listener(this);
314
- return this;
315
- }
316
- return this.OnEvent("completed", listener, source);
317
- }
256
+ /**
257
+ * Changes state and emits the state-specific, statechange, and - on reaching
258
+ * a load outcome - completed events.
259
+ */
260
+ SetState(state, ...details) {
261
+ if (!CjsResource.isValidState(state)) {
262
+ throw new TypeError(`Invalid CjsResource state: ${state}`);
263
+ }
264
+ const previous = this.state;
265
+ if (previous === state) return this;
266
+ this.state = state;
267
+ // A successful load clears the budget, so the cap bounds consecutive
268
+ // failures rather than how many times a resource may ever be purged.
269
+ if (state === CjsResource.State.PREPARED) this.#reloadAttempts = 0;
270
+ this.EmitEvent?.(state, this, ...details);
271
+ this.EmitEvent?.("statechange", this, state, previous);
272
+ // Fires again after a purge and reload, so subscribers rebuild whatever
273
+ // they derived from the payload that was deleted.
274
+ if (this.HasCompleted()) this.EmitEvent?.("completed", this, ...details);
275
+ return this;
276
+ }
318
277
 
319
- /** Marks this resource as requested. */
320
- MarkRequested() {
321
- return this.SetState(_CjsResource.State.REQUESTED);
278
+ /**
279
+ * Subscribe to this resource finishing, firing immediately when it already
280
+ * has.
281
+ *
282
+ * The immediate call is the point. A plain emitter drops late subscribers on
283
+ * the floor - subscribe after `PREPARED` and nothing ever arrives - which is
284
+ * why callers end up doing work synchronously "just in case" instead of
285
+ * subscribing. ccpwgl solves this by replaying current state at registration
286
+ * (`Tw2Resource.onNotification`), and a subscriber satisfied that way is
287
+ * never stored at all, so only subscriptions genuinely still waiting
288
+ * accumulate.
289
+ *
290
+ * The listener runs for both outcomes and branches itself:
291
+ *
292
+ * ```js
293
+ * res.OnCompleted(res => { if (res.IsPrepared()) something; else somethingElse; });
294
+ * ```
295
+ *
296
+ * It may run more than once - a purge and reload completes again - so
297
+ * handlers must be written to be re-entered rather than assuming first load.
298
+ *
299
+ * @param {Function} listener Called with this resource once it has finished.
300
+ * @param {*} [source=null] Optional owner used for bulk removal.
301
+ * @returns {CjsResource} This resource.
302
+ */
303
+ OnCompleted(listener, source = null) {
304
+ if (typeof listener !== "function") {
305
+ throw new TypeError("CjsResource.OnCompleted requires a function.");
306
+ }
307
+ if (this.HasCompleted()) {
308
+ listener(this);
309
+ return this;
322
310
  }
311
+ return this.OnEvent("completed", listener, source);
312
+ }
323
313
 
324
- /** Marks this resource as actively loading. */
325
- MarkLoading() {
326
- return this.SetState(_CjsResource.State.LOADING);
327
- }
314
+ /** Marks this resource as requested. */
315
+ MarkRequested() {
316
+ return this.SetState(CjsResource.State.REQUESTED);
317
+ }
328
318
 
329
- /** Marks this resource's CPU payload as loaded. */
330
- MarkLoaded() {
331
- return this.SetState(_CjsResource.State.LOADED);
332
- }
319
+ /** Marks this resource as actively loading. */
320
+ MarkLoading() {
321
+ return this.SetState(CjsResource.State.LOADING);
322
+ }
333
323
 
334
- /** Marks this resource as preparing its semantic result. */
335
- MarkPreparing() {
336
- return this.SetState(_CjsResource.State.PREPARING);
337
- }
324
+ /** Marks this resource's CPU payload as loaded. */
325
+ MarkLoaded() {
326
+ return this.SetState(CjsResource.State.LOADED);
327
+ }
338
328
 
339
- /** Marks this resource as successfully prepared. */
340
- MarkPrepared() {
341
- return this.SetState(_CjsResource.State.PREPARED);
342
- }
329
+ /** Marks this resource as preparing its semantic result. */
330
+ MarkPreparing() {
331
+ return this.SetState(CjsResource.State.PREPARING);
332
+ }
343
333
 
344
- /** Marks this resource as successfully prepared. */
345
- MarkGood() {
346
- return this.MarkPrepared();
347
- }
334
+ /** Marks this resource as successfully prepared. */
335
+ MarkPrepared() {
336
+ return this.SetState(CjsResource.State.PREPARED);
337
+ }
348
338
 
349
- /**
350
- * Mark this detached resource handle as purged after a successful
351
- * manager-owned policy eviction, such as inactivity or recorded-byte cache
352
- * pressure, released its adapter allocations and payload.
353
- *
354
- * @returns {CjsResource} This purged resource.
355
- */
356
- MarkPurged() {
357
- return this.SetState(_CjsResource.State.PURGED);
358
- }
339
+ /** Marks this resource as successfully prepared. */
340
+ MarkGood() {
341
+ return this.MarkPrepared();
342
+ }
359
343
 
360
- /**
361
- * Return whether deterministic manager cleanup has purged this handle.
362
- * This is a pure state query and never renews resource activity.
363
- *
364
- * @returns {boolean} `true` when the current state is `PURGED`.
365
- */
366
- IsPurged() {
367
- return this.state === _CjsResource.State.PURGED;
368
- }
344
+ /**
345
+ * Mark this detached resource handle as purged after a successful
346
+ * manager-owned policy eviction, such as inactivity or recorded-byte cache
347
+ * pressure, released its adapter allocations and payload.
348
+ *
349
+ * @returns {CjsResource} This purged resource.
350
+ */
351
+ MarkPurged() {
352
+ return this.SetState(CjsResource.State.PURGED);
353
+ }
369
354
 
370
- /** Stores a load failure and marks this resource as failed. */
371
- SetError(error) {
372
- this.error = error || null;
373
- return this.SetState(_CjsResource.State.FAILED, this.error);
374
- }
355
+ /**
356
+ * Return whether deterministic manager cleanup has purged this handle.
357
+ * This is a pure state query and never renews resource activity.
358
+ *
359
+ * @returns {boolean} `true` when the current state is `PURGED`.
360
+ */
361
+ IsPurged() {
362
+ return this.state === CjsResource.State.PURGED;
363
+ }
375
364
 
376
- /**
377
- * Store the plain CPU payload associated with this resource.
378
- * Concrete resource classes validate the fields they require before calling
379
- * this method. If the compatibility `object` property still aliases the
380
- * previous payload, it is updated to the replacement; semantic resources
381
- * whose `object` points to the resource itself are unaffected. A non-null
382
- * payload explicitly renews its manager-owned identity and payload leases;
383
- * payload reads remain pure and do not renew either lease.
384
- *
385
- * @param {*} payload Plain reader/converter output, or `null` to clear it.
386
- * @returns {CjsResource} This resource with the supplied payload reference.
387
- */
388
- SetPayload(payload = null) {
389
- const previous = this.#payload;
390
- this.#payload = payload;
391
- if (this.object === previous) this.object = payload;
392
- if (this.HasPayload()) this.KeepPayloadAlive();
393
- return this;
394
- }
365
+ /** Stores a load failure and marks this resource as failed. */
366
+ SetError(error) {
367
+ this.error = error || null;
368
+ return this.SetState(CjsResource.State.FAILED, this.error);
369
+ }
395
370
 
396
- /**
397
- * Read the plain CPU payload associated with this resource.
398
- *
399
- * The query is pure and does not renew the payload lease.
400
- *
401
- * @returns {*} Current payload reference, or `null` after release.
402
- */
403
- GetPayload() {
404
- return this.#payload;
405
- }
371
+ /**
372
+ * Store the plain CPU payload associated with this resource.
373
+ * Concrete resource classes validate the fields they require before calling
374
+ * this method. If the compatibility `object` property still aliases the
375
+ * previous payload, it is updated to the replacement; semantic resources
376
+ * whose `object` points to the resource itself are unaffected. A non-null
377
+ * payload explicitly renews its manager-owned identity and payload leases;
378
+ * payload reads remain pure and do not renew either lease.
379
+ *
380
+ * @param {*} payload Plain reader/converter output, or `null` to clear it.
381
+ * @returns {CjsResource} This resource with the supplied payload reference.
382
+ */
383
+ SetPayload(payload = null) {
384
+ const previous = this.#payload;
385
+ this.#payload = payload;
386
+ if (this.object === previous) this.object = payload;
387
+ if (this.HasPayload()) this.KeepPayloadAlive();
388
+ return this;
389
+ }
406
390
 
407
- /**
408
- * Return whether a payload has been explicitly assigned. This query is pure
409
- * and does not renew the payload lease.
410
- *
411
- * @returns {boolean} Whether a non-null payload is attached.
412
- */
413
- HasPayload() {
414
- return this.#payload !== null && this.#payload !== undefined;
415
- }
391
+ /**
392
+ * Read the plain CPU payload associated with this resource.
393
+ *
394
+ * The query is pure and does not renew the payload lease.
395
+ *
396
+ * @returns {*} Current payload reference, or `null` after release.
397
+ */
398
+ GetPayload() {
399
+ return this.#payload;
400
+ }
416
401
 
417
- /**
418
- * Release the complete payload reference after consumers have retained the
419
- * scalars and typed-array views they require. When the compatibility
420
- * `object` property still aliases that exact payload, it is cleared as part
421
- * of the same ownership release. Semantic resources whose `object` property
422
- * points to the resource itself are unaffected.
423
- *
424
- * @returns {CjsResource} This resource without its former payload reference.
425
- */
426
- ReleasePayload() {
427
- const payload = this.#payload;
428
- this.#payload = null;
429
- if (this.object === payload) this.object = null;
430
- return this;
431
- }
402
+ /**
403
+ * Return whether a payload has been explicitly assigned. This query is pure
404
+ * and does not renew the payload lease.
405
+ *
406
+ * @returns {boolean} Whether a non-null payload is attached.
407
+ */
408
+ HasPayload() {
409
+ return this.#payload !== null && this.#payload !== undefined;
410
+ }
432
411
 
433
- /**
434
- * Bind or detach the manager callbacks used by explicit resource-facing
435
- * liveness operations. Runtime resources remain usable when unbound; their
436
- * liveness methods then become deterministic no-ops.
437
- *
438
- * @param {CjsResourceLifecycleController|null} controller Manager callbacks, or `null` after canonical ownership ends.
439
- * @returns {CjsResource} This resource.
440
- * @throws {TypeError} If the controller or any supplied callback is invalid.
441
- */
442
- SetLifecycleController(controller = null) {
443
- if (controller !== null && (typeof controller !== "object" || Array.isArray(controller))) {
444
- throw new TypeError("CjsResource lifecycle controller must be an object or null.");
445
- }
446
- for (const name of ["isCurrent", "keepAlive", "keepPayloadAlive", "lock", "unlock"]) {
447
- if (controller?.[name] !== undefined && typeof controller[name] !== "function") {
448
- throw new TypeError(`CjsResource lifecycle controller ${name} must be a function.`);
449
- }
450
- }
451
- this.__lifecycleController = controller;
452
- return this;
453
- }
412
+ /**
413
+ * Release the complete payload reference after consumers have retained the
414
+ * scalars and typed-array views they require. When the compatibility
415
+ * `object` property still aliases that exact payload, it is cleared as part
416
+ * of the same ownership release. Semantic resources whose `object` property
417
+ * points to the resource itself are unaffected.
418
+ *
419
+ * @returns {CjsResource} This resource without its former payload reference.
420
+ */
421
+ ReleasePayload() {
422
+ const payload = this.#payload;
423
+ this.#payload = null;
424
+ if (this.object === payload) this.object = null;
425
+ return this;
426
+ }
454
427
 
455
- /**
456
- * Return whether this handle is still the manager's canonical resource.
457
- *
458
- * Engine adapters use this immediately before synchronously attaching a
459
- * completed backend candidate. Detached resources return `false`; the query
460
- * never renews activity, reloads data, or mutates lifecycle state.
461
- *
462
- * @returns {boolean} Whether the bound manager still owns this exact handle.
463
- */
464
- IsCurrent() {
465
- return Boolean(this.__lifecycleController?.isCurrent?.());
428
+ /**
429
+ * Bind or detach the manager callbacks used by explicit resource-facing
430
+ * liveness operations. Runtime resources remain usable when unbound; their
431
+ * liveness methods then become deterministic no-ops.
432
+ *
433
+ * @param {CjsResourceLifecycleController|null} controller Manager callbacks, or `null` after canonical ownership ends.
434
+ * @returns {CjsResource} This resource.
435
+ * @throws {TypeError} If the controller or any supplied callback is invalid.
436
+ */
437
+ SetLifecycleController(controller = null) {
438
+ if (controller !== null && (typeof controller !== "object" || Array.isArray(controller))) {
439
+ throw new TypeError("CjsResource lifecycle controller must be an object or null.");
440
+ }
441
+ for (const name of ["isCurrent", "keepAlive", "keepPayloadAlive", "lock", "unlock"]) {
442
+ if (controller?.[name] !== undefined && typeof controller[name] !== "function") {
443
+ throw new TypeError(`CjsResource lifecycle controller ${name} must be a function.`);
444
+ }
466
445
  }
446
+ this.__lifecycleController = controller;
447
+ return this;
448
+ }
467
449
 
468
- /**
469
- * Renew this resource's canonical identity activity, and reload it when
470
- * it has been purged.
471
- *
472
- * Purge is deletion - the payload is gone and nothing restores it - so
473
- * revival is an ordinary reload along the first-load path. Consumers
474
- * therefore never have to know a purge happened: they ask for what they need
475
- * and this makes it be there.
476
- *
477
- * `IsGood()` calls this, so most callers never invoke it directly.
478
- *
479
- * @param {CjsResourceActivityOptions} [options={}] Optional deterministic activity values.
480
- * @returns {CjsResource} This resource, whether bound or detached.
481
- * @throws {TypeError} If the bound manager rejects invalid activity values.
482
- */
483
- KeepAlive(options = {}) {
484
- this.__lifecycleController?.keepAlive?.(options);
485
- if (this.IsPurged()) this.Reload(options);
486
- return this;
487
- }
450
+ /**
451
+ * Return whether this handle is still the manager's canonical resource.
452
+ *
453
+ * Engine adapters use this immediately before synchronously attaching a
454
+ * completed backend candidate. Detached resources return `false`; the query
455
+ * never renews activity, reloads data, or mutates lifecycle state.
456
+ *
457
+ * @returns {boolean} Whether the bound manager still owns this exact handle.
458
+ */
459
+ IsCurrent() {
460
+ return Boolean(this.__lifecycleController?.isCurrent?.());
461
+ }
488
462
 
489
- /**
490
- * Re-register this handle with its manager and reload it into itself.
491
- *
492
- * Runs only from `PURGED` or `FAILED` - the two states where the payload is
493
- * absent but recoverable. It does nothing to a resource that is loaded or
494
- * still loading, so it is not a way to force a refetch of something already
495
- * there.
496
- *
497
- * Bounded by `maxReloadAttempts`, because `KeepAlive()` calls this and the
498
- * render path calls that every frame: without a cap, one missing texture
499
- * becomes a permanent retry storm against the thing least likely to succeed.
500
- * Attempts are spaced by real load round-trips rather than frames - starting
501
- * one leaves `PURGED`/`FAILED`, so nothing re-enters until it settles - and
502
- * the count resets on any successful load.
503
- *
504
- * The distinction that matters: the reload must fill THIS handle, not resolve
505
- * whatever the manager currently caches for the same path. A consumer holding
506
- * a purged handle has no way to discover a replacement, so handing it a fresh
507
- * instance elsewhere leaves it dead forever.
508
- *
509
- * Detached handles have no manager to re-register with and stay as they are.
510
- *
511
- * @param {CjsResourceActivityOptions} [options={}] Optional deterministic activity values.
512
- * @returns {boolean} Whether a reload was started.
513
- */
514
- Reload(options = {}) {
515
- if (!this.IsPurged() && !this.IsFailed()) return false;
516
- if (this.#reloadAttempts >= this.constructor.maxReloadAttempts) return false;
517
- if (typeof this.__reloadHook !== "function") return false;
518
- this.#reloadAttempts += 1;
519
- return this.__reloadHook(options) !== false;
520
- }
463
+ /**
464
+ * Renew this resource's canonical identity activity, and reload it when
465
+ * it has been purged.
466
+ *
467
+ * Purge is deletion - the payload is gone and nothing restores it - so
468
+ * revival is an ordinary reload along the first-load path. Consumers
469
+ * therefore never have to know a purge happened: they ask for what they need
470
+ * and this makes it be there.
471
+ *
472
+ * `IsGood()` calls this, so most callers never invoke it directly.
473
+ *
474
+ * @param {CjsResourceActivityOptions} [options={}] Optional deterministic activity values.
475
+ * @returns {CjsResource} This resource, whether bound or detached.
476
+ * @throws {TypeError} If the bound manager rejects invalid activity values.
477
+ */
478
+ KeepAlive(options = {}) {
479
+ this.__lifecycleController?.keepAlive?.(options);
480
+ if (this.IsPurged()) this.Reload(options);
481
+ return this;
482
+ }
521
483
 
522
- /**
523
- * Bind the manager callback that restores this handle after it loses its
524
- * payload.
525
- *
526
- * Deliberately separate from the lifecycle controller, which is detached the
527
- * moment canonical ownership ends. Recovery has to survive exactly that
528
- * event: a purged handle with no route back to its manager is unrecoverable,
529
- * which is the failure this whole contract exists to prevent.
530
- *
531
- * @param {Function|null} hook Manager callback, or `null` to detach it.
532
- * @returns {CjsResource} This resource.
533
- * @throws {TypeError} If the hook is neither a function nor null.
534
- */
535
- SetReloadHook(hook = null) {
536
- if (hook !== null && typeof hook !== "function") {
537
- throw new TypeError("CjsResource.SetReloadHook requires a function or null.");
538
- }
539
- this.__reloadHook = hook;
540
- return this;
541
- }
484
+ /**
485
+ * Re-register this handle with its manager and reload it into itself.
486
+ *
487
+ * Runs only from `PURGED` or `FAILED` - the two states where the payload is
488
+ * absent but recoverable. It does nothing to a resource that is loaded or
489
+ * still loading, so it is not a way to force a refetch of something already
490
+ * there.
491
+ *
492
+ * Bounded by `maxReloadAttempts`, because `KeepAlive()` calls this and the
493
+ * render path calls that every frame: without a cap, one missing texture
494
+ * becomes a permanent retry storm against the thing least likely to succeed.
495
+ * Attempts are spaced by real load round-trips rather than frames - starting
496
+ * one leaves `PURGED`/`FAILED`, so nothing re-enters until it settles - and
497
+ * the count resets on any successful load.
498
+ *
499
+ * The distinction that matters: the reload must fill THIS handle, not resolve
500
+ * whatever the manager currently caches for the same path. A consumer holding
501
+ * a purged handle has no way to discover a replacement, so handing it a fresh
502
+ * instance elsewhere leaves it dead forever.
503
+ *
504
+ * Detached handles have no manager to re-register with and stay as they are.
505
+ *
506
+ * @param {CjsResourceActivityOptions} [options={}] Optional deterministic activity values.
507
+ * @returns {boolean} Whether a reload was started.
508
+ */
509
+ Reload(options = {}) {
510
+ if (!this.IsPurged() && !this.IsFailed()) return false;
511
+ if (this.#reloadAttempts >= this.constructor.maxReloadAttempts) return false;
512
+ if (typeof this.__reloadHook !== "function") return false;
513
+ this.#reloadAttempts += 1;
514
+ return this.__reloadHook(options) !== false;
515
+ }
542
516
 
543
- /**
544
- * Return how many reloads have been attempted since the last successful load.
545
- *
546
- * @returns {number}
547
- */
548
- GetReloadAttempts() {
549
- return this.#reloadAttempts;
550
- }
517
+ /**
518
+ * Bind the manager callback that restores this handle after it loses its
519
+ * payload.
520
+ *
521
+ * Deliberately separate from the lifecycle controller, which is detached the
522
+ * moment canonical ownership ends. Recovery has to survive exactly that
523
+ * event: a purged handle with no route back to its manager is unrecoverable,
524
+ * which is the failure this whole contract exists to prevent.
525
+ *
526
+ * @param {Function|null} hook Manager callback, or `null` to detach it.
527
+ * @returns {CjsResource} This resource.
528
+ * @throws {TypeError} If the hook is neither a function nor null.
529
+ */
530
+ SetReloadHook(hook = null) {
531
+ if (hook !== null && typeof hook !== "function") {
532
+ throw new TypeError("CjsResource.SetReloadHook requires a function or null.");
533
+ }
534
+ this.__reloadHook = hook;
535
+ return this;
536
+ }
551
537
 
552
- /**
553
- * Clear the reload attempt count, so a resource that exhausted its attempts
554
- * can be asked again.
555
- *
556
- * This is the deliberate "try it again" gesture - a user retrying a failed
557
- * load, say. It is separate from `Reload()` because the cap exists precisely
558
- * to stop the automatic path retrying forever, so lifting it has to be a
559
- * decision someone made.
560
- *
561
- * @returns {CjsResource} This resource.
562
- */
563
- ResetReloadAttempts() {
564
- this.#reloadAttempts = 0;
565
- return this;
566
- }
538
+ /**
539
+ * Return how many reloads have been attempted since the last successful load.
540
+ *
541
+ * @returns {number}
542
+ */
543
+ GetReloadAttempts() {
544
+ return this.#reloadAttempts;
545
+ }
567
546
 
568
- /**
569
- * Explicitly renew both canonical identity activity and the attached CPU
570
- * payload lease. Reading the payload through `GetPayload()` or
571
- * `HasPayload()` remains pure.
572
- *
573
- * @param {CjsResourceActivityOptions} [options={}] Optional deterministic activity values.
574
- * @returns {CjsResource} This resource, whether a payload exists or not.
575
- * @throws {TypeError} If the bound manager rejects invalid activity values.
576
- */
577
- KeepPayloadAlive(options = {}) {
578
- this.__lifecycleController?.keepPayloadAlive?.(options);
579
- return this;
580
- }
547
+ /**
548
+ * Clear the reload attempt count, so a resource that exhausted its attempts
549
+ * can be asked again.
550
+ *
551
+ * This is the deliberate "try it again" gesture - a user retrying a failed
552
+ * load, say. It is separate from `Reload()` because the cap exists precisely
553
+ * to stop the automatic path retrying forever, so lifting it has to be a
554
+ * decision someone made.
555
+ *
556
+ * @returns {CjsResource} This resource.
557
+ */
558
+ ResetReloadAttempts() {
559
+ this.#reloadAttempts = 0;
560
+ return this;
561
+ }
581
562
 
582
- /**
583
- * Add one explicit purge lock through the bound manager and renew identity
584
- * activity. Locking never reloads or prepares a resource.
585
- *
586
- * @returns {number} New lock count, or `0` when this resource is detached.
587
- */
588
- Lock() {
589
- return this.__lifecycleController?.lock?.() || 0;
590
- }
563
+ /**
564
+ * Explicitly renew both canonical identity activity and the attached CPU
565
+ * payload lease. Reading the payload through `GetPayload()` or
566
+ * `HasPayload()` remains pure.
567
+ *
568
+ * @param {CjsResourceActivityOptions} [options={}] Optional deterministic activity values.
569
+ * @returns {CjsResource} This resource, whether a payload exists or not.
570
+ * @throws {TypeError} If the bound manager rejects invalid activity values.
571
+ */
572
+ KeepPayloadAlive(options = {}) {
573
+ this.__lifecycleController?.keepPayloadAlive?.(options);
574
+ return this;
575
+ }
591
576
 
592
- /**
593
- * Release one explicit purge lock without allowing the count to underflow.
594
- * Unlocking does not immediately purge or release a payload.
595
- *
596
- * @returns {number} Remaining lock count, or `0` when detached or unlocked.
597
- */
598
- Unlock() {
599
- return this.__lifecycleController?.unlock?.() || 0;
600
- }
577
+ /**
578
+ * Add one explicit purge lock through the bound manager and renew identity
579
+ * activity. Locking never reloads or prepares a resource.
580
+ *
581
+ * @returns {number} New lock count, or `0` when this resource is detached.
582
+ */
583
+ Lock() {
584
+ return this.__lifecycleController?.lock?.() || 0;
585
+ }
601
586
 
602
- /**
603
- * Bind the manager-owned object operation and compact reconstruction request
604
- * for this shared resource handle. The request contains source provenance
605
- * and requested-output defaults, not reader implementations or registry
606
- * history.
607
- *
608
- * @param {Function|null} loader Manager callback, or `null` to detach it.
609
- * @param {object|null} [request=null] Compact reconstruction defaults retained with the handle.
610
- * @returns {CjsResource} This resource with the supplied loader binding.
611
- * @throws {TypeError} If the loader or reconstruction request is invalid.
612
- */
613
- SetObjectLoader(loader = null, request = null) {
614
- if (loader !== null && typeof loader !== "function") {
615
- throw new TypeError("CjsResource.SetObjectLoader requires a function or null.");
616
- }
617
- if (request !== null && (!request || typeof request !== "object" || Array.isArray(request))) {
618
- throw new TypeError("CjsResource.SetObjectLoader request must be an object or null.");
619
- }
620
- this.__objectLoader = loader;
621
- this.__objectRequest = request === null ? null : Object.freeze({
622
- ...request
623
- });
624
- return this;
625
- }
587
+ /**
588
+ * Release one explicit purge lock without allowing the count to underflow.
589
+ * Unlocking does not immediately purge or release a payload.
590
+ *
591
+ * @returns {number} Remaining lock count, or `0` when detached or unlocked.
592
+ */
593
+ Unlock() {
594
+ return this.__lifecycleController?.unlock?.() || 0;
595
+ }
626
596
 
627
- /**
628
- * Return the compact manager request retained for explicit reconstruction.
629
- * This query is pure and exposes no reader, constructor, or implementation
630
- * identity.
631
- *
632
- * @returns {Readonly<object>|null} Frozen reconstruction defaults, or `null` when unbound.
633
- */
634
- GetObjectRequest() {
635
- return this.__objectRequest;
636
- }
597
+ /**
598
+ * Bind the manager-owned object operation and compact reconstruction request
599
+ * for this shared resource handle. The request contains source provenance
600
+ * and requested-output defaults, not reader implementations or registry
601
+ * history.
602
+ *
603
+ * @param {Function|null} loader Manager callback, or `null` to detach it.
604
+ * @param {object|null} [request=null] Compact reconstruction defaults retained with the handle.
605
+ * @returns {CjsResource} This resource with the supplied loader binding.
606
+ * @throws {TypeError} If the loader or reconstruction request is invalid.
607
+ */
608
+ SetObjectLoader(loader = null, request = null) {
609
+ if (loader !== null && typeof loader !== "function") {
610
+ throw new TypeError("CjsResource.SetObjectLoader requires a function or null.");
611
+ }
612
+ if (request !== null && (!request || typeof request !== "object" || Array.isArray(request))) {
613
+ throw new TypeError("CjsResource.SetObjectLoader request must be an object or null.");
614
+ }
615
+ this.__objectLoader = loader;
616
+ this.__objectRequest = request === null ? null : Object.freeze({
617
+ ...request
618
+ });
619
+ return this;
620
+ }
637
621
 
638
- /**
639
- * Return the manager-owned object outcome for this resource identity.
640
- * Concurrent callers share one in-flight operation. A resident payload is
641
- * returned without source work; after explicit payload release, this call is
642
- * an explicit reconstruction request and may load/prepare through the bound
643
- * manager. This loader resolves the manager's current canonical identity, so
644
- * on a purged handle it may answer with a different instance - use
645
- * `KeepAlive()`/`Reload()` to revive this handle itself.
646
- *
647
- * Promised-output fields retained by the handle take precedence over fields
648
- * supplied here; operation policy such as cache/reload controls may still be
649
- * overridden.
650
- *
651
- * @param {object} [options={}] Source, format, semantic outcome, and queue options forwarded to the manager.
652
- * @returns {Promise<*>} In-flight, resident, or reconstructed object outcome.
653
- */
654
- GetObject(options = {}) {
655
- if (!this.__objectLoader) {
656
- const error = new Error(`Resource has no object loader: ${this.path}`);
657
- error.code = "CJS_RESOURCE_LOADER_UNBOUND";
658
- return Promise.reject(error);
659
- }
660
- return this.__objectLoader(options);
661
- }
622
+ /**
623
+ * Return the compact manager request retained for explicit reconstruction.
624
+ * This query is pure and exposes no reader, constructor, or implementation
625
+ * identity.
626
+ *
627
+ * @returns {Readonly<object>|null} Frozen reconstruction defaults, or `null` when unbound.
628
+ */
629
+ GetObjectRequest() {
630
+ return this.__objectRequest;
631
+ }
662
632
 
663
- /**
664
- * Promise-shaped alias for {@link CjsResource#GetObject}. Readiness shares an
665
- * in-flight operation, returns resident payload without loading, and treats a
666
- * call after payload release as an explicit reconstruction request.
667
- *
668
- * @param {object} [options={}] Source, format, semantic outcome, and queue options forwarded to the manager.
669
- * @returns {Promise<*>} In-flight, resident, or reconstructed object outcome.
670
- */
671
- Ready(options = {}) {
672
- return this.GetObject(options);
673
- }
633
+ /**
634
+ * Return the manager-owned object outcome for this resource identity.
635
+ * Concurrent callers share one in-flight operation. A resident payload is
636
+ * returned without source work; after explicit payload release, this call is
637
+ * an explicit reconstruction request and may load/prepare through the bound
638
+ * manager. This loader resolves the manager's current canonical identity, so
639
+ * on a purged handle it may answer with a different instance - use
640
+ * `KeepAlive()`/`Reload()` to revive this handle itself.
641
+ *
642
+ * Promised-output fields retained by the handle take precedence over fields
643
+ * supplied here; operation policy such as cache/reload controls may still be
644
+ * overridden.
645
+ *
646
+ * @param {object} [options={}] Source, format, semantic outcome, and queue options forwarded to the manager.
647
+ * @returns {Promise<*>} In-flight, resident, or reconstructed object outcome.
648
+ */
649
+ GetObject(options = {}) {
650
+ if (!this.__objectLoader) {
651
+ const error = new Error(`Resource has no object loader: ${this.path}`);
652
+ error.code = "CJS_RESOURCE_LOADER_UNBOUND";
653
+ return Promise.reject(error);
654
+ }
655
+ return this.__objectLoader(options);
656
+ }
674
657
 
675
- /**
676
- * Attach an opaque engine-owned resource object.
677
- *
678
- * Runtime-resource stores this value but does not inspect GPU APIs.
679
- *
680
- * @param {string} key
681
- * @param {*} value
682
- * @returns {CjsResource}
683
- */
684
- SetAdapterResource(key, value) {
685
- if (!key) throw new TypeError("CjsResource.SetAdapterResource requires a key.");
686
- this.__adapterResources[String(key)] = value;
687
- return this;
688
- }
658
+ /**
659
+ * Promise-shaped alias for {@link CjsResource#GetObject}. Readiness shares an
660
+ * in-flight operation, returns resident payload without loading, and treats a
661
+ * call after payload release as an explicit reconstruction request.
662
+ *
663
+ * @param {object} [options={}] Source, format, semantic outcome, and queue options forwarded to the manager.
664
+ * @returns {Promise<*>} In-flight, resident, or reconstructed object outcome.
665
+ */
666
+ Ready(options = {}) {
667
+ return this.GetObject(options);
668
+ }
689
669
 
690
- /**
691
- * Get an opaque engine-owned resource object.
692
- *
693
- * @param {string} key
694
- * @returns {*}
695
- */
696
- GetAdapterResource(key) {
697
- return this.__adapterResources[String(key)] ?? null;
698
- }
670
+ /**
671
+ * Attach an opaque engine-owned resource object.
672
+ *
673
+ * Runtime-resource stores this value but does not inspect GPU APIs.
674
+ *
675
+ * @param {string} key
676
+ * @param {*} value
677
+ * @returns {CjsResource}
678
+ */
679
+ SetAdapterResource(key, value) {
680
+ if (!key) throw new TypeError("CjsResource.SetAdapterResource requires a key.");
681
+ this.__adapterResources[String(key)] = value;
682
+ return this;
683
+ }
699
684
 
700
- /**
701
- * Returns true when an adapter resource exists for the given key.
702
- *
703
- * @param {string} key
704
- * @returns {boolean}
705
- */
706
- HasAdapterResource(key) {
707
- return Object.prototype.hasOwnProperty.call(this.__adapterResources, String(key));
708
- }
685
+ /**
686
+ * Get an opaque engine-owned resource object.
687
+ *
688
+ * @param {string} key
689
+ * @returns {*}
690
+ */
691
+ GetAdapterResource(key) {
692
+ return this.__adapterResources[String(key)] ?? null;
693
+ }
709
694
 
710
- /**
711
- * Remove an adapter resource and optionally call its destroy/dispose method.
712
- *
713
- * @param {string} key
714
- * @param {object} options
715
- * @returns {CjsResource}
716
- */
717
- DestroyAdapterResource(key, options = {}) {
718
- const name = String(key);
719
- const value = this.__adapterResources[name];
720
- if (value && options.destroy !== false) {
721
- destroyAdapterValue(value);
722
- }
723
- delete this.__adapterResources[name];
724
- return this;
725
- }
695
+ /**
696
+ * Returns true when an adapter resource exists for the given key.
697
+ *
698
+ * @param {string} key
699
+ * @returns {boolean}
700
+ */
701
+ HasAdapterResource(key) {
702
+ return Object.prototype.hasOwnProperty.call(this.__adapterResources, String(key));
703
+ }
726
704
 
727
- /**
728
- * Remove all adapter resources and optionally call their destroy/dispose methods.
729
- *
730
- * @param {object} options
731
- * @returns {CjsResource}
732
- */
733
- DestroyAdapterResources(options = {}) {
734
- for (const key of Object.keys(this.__adapterResources)) {
735
- this.DestroyAdapterResource(key, options);
736
- }
737
- return this;
738
- }
739
- /** Returns true when a value belongs to the resource state vocabulary. */
740
- static isValidState(state) {
741
- return Object.values(_CjsResource.State).includes(state);
742
- }
705
+ /**
706
+ * Remove an adapter resource and optionally call its destroy/dispose method.
707
+ *
708
+ * @param {string} key
709
+ * @param {object} options
710
+ * @returns {CjsResource}
711
+ */
712
+ DestroyAdapterResource(key, options = {}) {
713
+ const name = String(key);
714
+ const value = this.__adapterResources[name];
715
+ if (value && options.destroy !== false) {
716
+ destroyAdapterValue(value);
717
+ }
718
+ delete this.__adapterResources[name];
719
+ return this;
720
+ }
743
721
 
744
- /**
745
- * Returns true when a resource state cannot continue its current operation.
746
- *
747
- * `PURGED` is deliberately absent: a purged resource reloads itself
748
- * through `KeepAlive()`, so purge is a transition out of a settled state
749
- * rather than a resting place.
750
- */
751
- static isTerminalState(state) {
752
- return state === _CjsResource.State.PREPARED || state === _CjsResource.State.FAILED || state === _CjsResource.State.UNLOADED;
753
- }
754
- }];
755
- maxReloadAttempts = 3;
756
- isResource = true;
757
- State = Object.freeze({
722
+ /**
723
+ * Remove all adapter resources and optionally call their destroy/dispose methods.
724
+ *
725
+ * @param {object} options
726
+ * @returns {CjsResource}
727
+ */
728
+ DestroyAdapterResources(options = {}) {
729
+ for (const key of Object.keys(this.__adapterResources)) {
730
+ this.DestroyAdapterResource(key, options);
731
+ }
732
+ return this;
733
+ }
734
+ static State = Object.freeze({
758
735
  EMPTY: "empty",
759
736
  REQUESTED: "requested",
760
737
  LOADING: "loading",
@@ -765,10 +742,49 @@ new class extends _identity {
765
742
  UNLOADED: "unloaded",
766
743
  PURGED: "purged"
767
744
  });
768
- constructor() {
769
- super(_CjsResource), _initClass();
745
+
746
+ /** Returns true when a value belongs to the resource state vocabulary. */
747
+ static isValidState(state) {
748
+ return Object.values(CjsResource.State).includes(state);
749
+ }
750
+
751
+ /**
752
+ * Returns true when a resource state cannot continue its current operation.
753
+ *
754
+ * `PURGED` is deliberately absent: a purged resource reloads itself
755
+ * through `KeepAlive()`, so purge is a transition out of a settled state
756
+ * rather than a resting place.
757
+ */
758
+ static isTerminalState(state) {
759
+ return state === CjsResource.State.PREPARED || state === CjsResource.State.FAILED || state === CjsResource.State.UNLOADED;
760
+ }
761
+ }
762
+
763
+ // Declared as data rather than with decorators, so the resource tree stays
764
+ // plain ESM that loads from source without a transform. Resources are not model
765
+ // graph nodes - there is no Copy or Clone here, and SetValues/GetValues are a
766
+ // flat schema-driven property copy - so nothing here needed the decorator form.
767
+ // Field order is key order, and GetValues() exports in that order.
768
+ CjsSchema.define(CjsResource, {
769
+ className: "CjsResource",
770
+ family: "resource",
771
+ fields: {
772
+ path: type.path,
773
+ ext: type.string,
774
+ requirement: type.string,
775
+ state: type.string
776
+ },
777
+ methods: {
778
+ Initialize: [carbon.method, impl.adapted],
779
+ GetPath: [carbon.method, impl.adapted],
780
+ GetExt: [carbon.method, impl.adapted],
781
+ IsLoading: [carbon.method, impl.adapted],
782
+ HasLoaded: [carbon.method, impl.adapted],
783
+ IsPrepared: [carbon.method, impl.adapted],
784
+ IsGood: [carbon.method, impl.adapted],
785
+ IsFailed: [carbon.method, impl.adapted]
770
786
  }
771
- }();
787
+ });
772
788
  function destroyAdapterValue(value) {
773
789
  if (!value || typeof value !== "object") return;
774
790
  const destroy = value.Destroy || value.Dispose || value.destroy || value.dispose;
@@ -777,5 +793,5 @@ function destroyAdapterValue(value) {
777
793
  }
778
794
  }
779
795
 
780
- export { _CjsResource as CjsResource };
796
+ export { CjsResource };
781
797
  //# sourceMappingURL=CjsResource.js.map