@fgv/ts-res 5.1.0-3 → 5.1.0-31

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 (545) hide show
  1. package/dist/index.browser.js.map +1 -0
  2. package/dist/index.js.map +1 -0
  3. package/dist/packlets/bundle/bundleBuilder.js.map +1 -0
  4. package/dist/packlets/bundle/bundleLoader.js.map +1 -0
  5. package/dist/packlets/bundle/bundleNormalizer.js.map +1 -0
  6. package/dist/packlets/bundle/bundleUtils.js.map +1 -0
  7. package/dist/packlets/bundle/convert.js.map +1 -0
  8. package/dist/packlets/bundle/index.js.map +1 -0
  9. package/dist/packlets/bundle/model.js.map +1 -0
  10. package/dist/packlets/common/conditions.js.map +1 -0
  11. package/dist/packlets/common/convert.js.map +1 -0
  12. package/dist/packlets/common/helpers/conditions.js.map +1 -0
  13. package/dist/packlets/common/helpers/context.js.map +1 -0
  14. package/dist/packlets/common/helpers/index.js.map +1 -0
  15. package/dist/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  16. package/dist/packlets/common/helpers/resources.js +2 -4
  17. package/dist/packlets/common/helpers/resources.js.map +1 -0
  18. package/dist/packlets/common/index.js.map +1 -0
  19. package/dist/packlets/common/resources.js.map +1 -0
  20. package/dist/packlets/common/validate/conditions.js +4 -4
  21. package/dist/packlets/common/validate/conditions.js.map +1 -0
  22. package/dist/packlets/common/validate/index.js.map +1 -0
  23. package/dist/packlets/common/validate/regularExpressions.js +2 -2
  24. package/dist/packlets/common/validate/regularExpressions.js.map +1 -0
  25. package/dist/packlets/common/validate/resources.js +1 -1
  26. package/dist/packlets/common/validate/resources.js.map +1 -0
  27. package/dist/packlets/conditions/condition.js +3 -7
  28. package/dist/packlets/conditions/condition.js.map +1 -0
  29. package/dist/packlets/conditions/conditionCollector.js.map +1 -0
  30. package/dist/packlets/conditions/conditionDecls.js.map +1 -0
  31. package/dist/packlets/conditions/conditionSet.js +14 -5
  32. package/dist/packlets/conditions/conditionSet.js.map +1 -0
  33. package/dist/packlets/conditions/conditionSetCollector.js.map +1 -0
  34. package/dist/packlets/conditions/conditionSetDecls.js.map +1 -0
  35. package/dist/packlets/conditions/conditionToken.js.map +1 -0
  36. package/dist/packlets/conditions/convert/conditionSetDecls.js +50 -6
  37. package/dist/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  38. package/dist/packlets/conditions/convert/decls.js +61 -5
  39. package/dist/packlets/conditions/convert/decls.js.map +1 -0
  40. package/dist/packlets/conditions/convert/index.js.map +1 -0
  41. package/dist/packlets/conditions/index.js.map +1 -0
  42. package/dist/packlets/config/common.js.map +1 -0
  43. package/dist/packlets/config/configInitFactory.js.map +1 -0
  44. package/dist/packlets/config/convert.js.map +1 -0
  45. package/dist/packlets/config/index.browser.js.map +1 -0
  46. package/dist/packlets/config/index.js.map +1 -0
  47. package/dist/packlets/config/json.js.map +1 -0
  48. package/dist/packlets/config/predefined/default.js.map +1 -0
  49. package/dist/packlets/config/predefined/extended.js.map +1 -0
  50. package/dist/packlets/config/predefined/index.js.map +1 -0
  51. package/dist/packlets/config/systemConfiguration.js.map +1 -0
  52. package/dist/packlets/context/contextDecls.js.map +1 -0
  53. package/dist/packlets/context/contextToken.js.map +1 -0
  54. package/dist/packlets/context/convert/decls.js.map +1 -0
  55. package/dist/packlets/context/convert/index.js.map +1 -0
  56. package/dist/packlets/context/index.js.map +1 -0
  57. package/dist/packlets/decisions/abstractDecision.js.map +1 -0
  58. package/dist/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  59. package/dist/packlets/decisions/candidate.js.map +1 -0
  60. package/dist/packlets/decisions/common.js.map +1 -0
  61. package/dist/packlets/decisions/concreteDecision.js.map +1 -0
  62. package/dist/packlets/decisions/decision.js +1 -1
  63. package/dist/packlets/decisions/decision.js.map +1 -0
  64. package/dist/packlets/decisions/index.js.map +1 -0
  65. package/dist/packlets/import/fsItem.js +1 -4
  66. package/dist/packlets/import/fsItem.js.map +1 -0
  67. package/dist/packlets/import/importContext.js +3 -3
  68. package/dist/packlets/import/importContext.js.map +1 -0
  69. package/dist/packlets/import/importManager.js +7 -3
  70. package/dist/packlets/import/importManager.js.map +1 -0
  71. package/dist/packlets/import/importable.js.map +1 -0
  72. package/dist/packlets/import/importers/collectionImporter.js +2 -2
  73. package/dist/packlets/import/importers/collectionImporter.js.map +1 -0
  74. package/dist/packlets/import/importers/fsItemImporter.js +30 -14
  75. package/dist/packlets/import/importers/fsItemImporter.js.map +1 -0
  76. package/dist/packlets/import/importers/importer.js.map +1 -0
  77. package/dist/packlets/import/importers/index.browser.js.map +1 -0
  78. package/dist/packlets/import/importers/index.js.map +1 -0
  79. package/dist/packlets/import/importers/jsonImporter.js +2 -2
  80. package/dist/packlets/import/importers/jsonImporter.js.map +1 -0
  81. package/dist/packlets/import/importers/pathImporter.js +1 -1
  82. package/dist/packlets/import/importers/pathImporter.js.map +1 -0
  83. package/dist/packlets/import/index.browser.js.map +1 -0
  84. package/dist/packlets/import/index.js.map +1 -0
  85. package/dist/packlets/qualifier-types/config/convert.js.map +1 -0
  86. package/dist/packlets/qualifier-types/config/index.js.map +1 -0
  87. package/dist/packlets/qualifier-types/config/json.js.map +1 -0
  88. package/dist/packlets/qualifier-types/convert.js.map +1 -0
  89. package/dist/packlets/qualifier-types/helpers.js.map +1 -0
  90. package/dist/packlets/qualifier-types/index.js.map +1 -0
  91. package/dist/packlets/qualifier-types/languageQualifierType.js +6 -7
  92. package/dist/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  93. package/dist/packlets/qualifier-types/literalQualifierType.js +7 -10
  94. package/dist/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  95. package/dist/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  96. package/dist/packlets/qualifier-types/qualifierType.js +12 -13
  97. package/dist/packlets/qualifier-types/qualifierType.js.map +1 -0
  98. package/dist/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  99. package/dist/packlets/qualifier-types/territoryQualifierType.js +5 -5
  100. package/dist/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  101. package/dist/packlets/qualifiers/convert/decls.js.map +1 -0
  102. package/dist/packlets/qualifiers/convert/index.js.map +1 -0
  103. package/dist/packlets/qualifiers/convert/qualifier.js.map +1 -0
  104. package/dist/packlets/qualifiers/index.js.map +1 -0
  105. package/dist/packlets/qualifiers/qualifier.js +6 -7
  106. package/dist/packlets/qualifiers/qualifier.js.map +1 -0
  107. package/dist/packlets/qualifiers/qualifierCollector.js +153 -9
  108. package/dist/packlets/qualifiers/qualifierCollector.js.map +1 -0
  109. package/dist/packlets/qualifiers/qualifierDecl.js.map +1 -0
  110. package/dist/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  111. package/dist/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  112. package/dist/packlets/resource-json/compiled/common.js.map +1 -0
  113. package/dist/packlets/resource-json/compiled/convert.js.map +1 -0
  114. package/dist/packlets/resource-json/compiled/index.js.map +1 -0
  115. package/dist/packlets/resource-json/compiled/json.js.map +1 -0
  116. package/dist/packlets/resource-json/convert.js +225 -0
  117. package/dist/packlets/resource-json/convert.js.map +1 -0
  118. package/dist/packlets/resource-json/helpers.js.map +1 -0
  119. package/dist/packlets/resource-json/index.js.map +1 -0
  120. package/dist/packlets/resource-json/json.js +2 -2
  121. package/dist/packlets/resource-json/json.js.map +1 -0
  122. package/dist/packlets/resource-json/normalized.js.map +1 -0
  123. package/dist/packlets/resource-json/resourceDeclCollection.js +1 -1
  124. package/dist/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  125. package/dist/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  126. package/dist/packlets/resource-json/resourceDeclTree.js +1 -1
  127. package/dist/packlets/resource-json/resourceDeclTree.js.map +1 -0
  128. package/dist/packlets/resource-types/config/convert.js.map +1 -0
  129. package/dist/packlets/resource-types/config/index.js.map +1 -0
  130. package/dist/packlets/resource-types/config/json.js.map +1 -0
  131. package/dist/packlets/resource-types/helpers.js.map +1 -0
  132. package/dist/packlets/resource-types/index.js.map +1 -0
  133. package/dist/packlets/resource-types/jsonResourceType.js +2 -2
  134. package/dist/packlets/resource-types/jsonResourceType.js.map +1 -0
  135. package/dist/packlets/resource-types/resourceType.js +2 -2
  136. package/dist/packlets/resource-types/resourceType.js.map +1 -0
  137. package/dist/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  138. package/dist/packlets/resources/candidateReducer.js.map +1 -0
  139. package/dist/packlets/resources/candidateValue.js.map +1 -0
  140. package/dist/packlets/resources/candidateValueCollector.js.map +1 -0
  141. package/dist/packlets/resources/common.js.map +1 -0
  142. package/dist/packlets/resources/deltaGenerator.js.map +1 -0
  143. package/dist/packlets/resources/index.js.map +1 -0
  144. package/dist/packlets/resources/resource.js.map +1 -0
  145. package/dist/packlets/resources/resourceBuilder.js +2 -2
  146. package/dist/packlets/resources/resourceBuilder.js.map +1 -0
  147. package/dist/packlets/resources/resourceCandidate.js.map +1 -0
  148. package/dist/packlets/resources/resourceManagerBuilder.js +5 -5
  149. package/dist/packlets/resources/resourceManagerBuilder.js.map +1 -0
  150. package/dist/packlets/runtime/cacheListener.js.map +1 -0
  151. package/dist/packlets/runtime/cacheMetrics.js.map +1 -0
  152. package/dist/packlets/runtime/compiledResourceCollection.js +5 -5
  153. package/dist/packlets/runtime/compiledResourceCollection.js.map +1 -0
  154. package/dist/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  155. package/dist/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  156. package/dist/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  157. package/dist/packlets/runtime/context/index.js.map +1 -0
  158. package/dist/packlets/runtime/context/simpleContextQualifierProvider.js +3 -0
  159. package/dist/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  160. package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +3 -5
  161. package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  162. package/dist/packlets/runtime/iResourceManager.js.map +1 -0
  163. package/dist/packlets/runtime/index.js.map +1 -0
  164. package/dist/packlets/runtime/resource-tree/common.js.map +1 -0
  165. package/dist/packlets/runtime/resource-tree/index.js.map +1 -0
  166. package/dist/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  167. package/dist/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  168. package/dist/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  169. package/dist/packlets/runtime/resourceResolver.js.map +1 -0
  170. package/dist/packlets/runtime/resourceTreeResolver.js.map +1 -0
  171. package/dist/packlets/runtime/validate.js.map +1 -0
  172. package/dist/packlets/zip-archive/convert.js.map +1 -0
  173. package/dist/packlets/zip-archive/index.browser.js.map +1 -0
  174. package/dist/packlets/zip-archive/index.js.map +1 -0
  175. package/dist/packlets/zip-archive/json.js.map +1 -0
  176. package/dist/packlets/zip-archive/types.js.map +1 -0
  177. package/dist/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
  178. package/dist/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
  179. package/dist/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
  180. package/dist/ts-res.d.ts +576 -164
  181. package/dist/tsdoc-metadata.json +1 -1
  182. package/lib/index.browser.d.ts.map +1 -0
  183. package/lib/index.browser.js.map +1 -0
  184. package/lib/index.d.ts.map +1 -0
  185. package/lib/index.js.map +1 -0
  186. package/lib/packlets/bundle/bundleBuilder.d.ts.map +1 -0
  187. package/lib/packlets/bundle/bundleBuilder.js.map +1 -0
  188. package/lib/packlets/bundle/bundleLoader.d.ts.map +1 -0
  189. package/lib/packlets/bundle/bundleLoader.js.map +1 -0
  190. package/lib/packlets/bundle/bundleNormalizer.d.ts.map +1 -0
  191. package/lib/packlets/bundle/bundleNormalizer.js.map +1 -0
  192. package/lib/packlets/bundle/bundleUtils.d.ts.map +1 -0
  193. package/lib/packlets/bundle/bundleUtils.js.map +1 -0
  194. package/lib/packlets/bundle/convert.d.ts.map +1 -0
  195. package/lib/packlets/bundle/convert.js.map +1 -0
  196. package/lib/packlets/bundle/index.d.ts.map +1 -0
  197. package/lib/packlets/bundle/index.js.map +1 -0
  198. package/lib/packlets/bundle/model.d.ts.map +1 -0
  199. package/lib/packlets/bundle/model.js.map +1 -0
  200. package/lib/packlets/common/conditions.d.ts.map +1 -0
  201. package/lib/packlets/common/conditions.js.map +1 -0
  202. package/lib/packlets/common/convert.d.ts.map +1 -0
  203. package/lib/packlets/common/convert.js.map +1 -0
  204. package/lib/packlets/common/helpers/conditions.d.ts.map +1 -0
  205. package/lib/packlets/common/helpers/conditions.js.map +1 -0
  206. package/lib/packlets/common/helpers/context.d.ts.map +1 -0
  207. package/lib/packlets/common/helpers/context.js.map +1 -0
  208. package/lib/packlets/common/helpers/index.d.ts.map +1 -0
  209. package/lib/packlets/common/helpers/index.js.map +1 -0
  210. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +1 -0
  211. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  212. package/lib/packlets/common/helpers/resources.d.ts +2 -4
  213. package/lib/packlets/common/helpers/resources.d.ts.map +1 -0
  214. package/lib/packlets/common/helpers/resources.js +2 -4
  215. package/lib/packlets/common/helpers/resources.js.map +1 -0
  216. package/lib/packlets/common/index.d.ts.map +1 -0
  217. package/lib/packlets/common/index.js.map +1 -0
  218. package/lib/packlets/common/resources.d.ts.map +1 -0
  219. package/lib/packlets/common/resources.js.map +1 -0
  220. package/lib/packlets/common/validate/conditions.d.ts +4 -4
  221. package/lib/packlets/common/validate/conditions.d.ts.map +1 -0
  222. package/lib/packlets/common/validate/conditions.js +4 -4
  223. package/lib/packlets/common/validate/conditions.js.map +1 -0
  224. package/lib/packlets/common/validate/index.d.ts.map +1 -0
  225. package/lib/packlets/common/validate/index.js.map +1 -0
  226. package/lib/packlets/common/validate/regularExpressions.d.ts +2 -2
  227. package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -0
  228. package/lib/packlets/common/validate/regularExpressions.js +2 -2
  229. package/lib/packlets/common/validate/regularExpressions.js.map +1 -0
  230. package/lib/packlets/common/validate/resources.d.ts +1 -1
  231. package/lib/packlets/common/validate/resources.d.ts.map +1 -0
  232. package/lib/packlets/common/validate/resources.js +1 -1
  233. package/lib/packlets/common/validate/resources.js.map +1 -0
  234. package/lib/packlets/conditions/condition.d.ts +3 -7
  235. package/lib/packlets/conditions/condition.d.ts.map +1 -0
  236. package/lib/packlets/conditions/condition.js +3 -7
  237. package/lib/packlets/conditions/condition.js.map +1 -0
  238. package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -0
  239. package/lib/packlets/conditions/conditionCollector.js.map +1 -0
  240. package/lib/packlets/conditions/conditionDecls.d.ts +6 -1
  241. package/lib/packlets/conditions/conditionDecls.d.ts.map +1 -0
  242. package/lib/packlets/conditions/conditionDecls.js.map +1 -0
  243. package/lib/packlets/conditions/conditionSet.d.ts.map +1 -0
  244. package/lib/packlets/conditions/conditionSet.js +14 -5
  245. package/lib/packlets/conditions/conditionSet.js.map +1 -0
  246. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -0
  247. package/lib/packlets/conditions/conditionSetCollector.js.map +1 -0
  248. package/lib/packlets/conditions/conditionSetDecls.d.ts +7 -2
  249. package/lib/packlets/conditions/conditionSetDecls.d.ts.map +1 -0
  250. package/lib/packlets/conditions/conditionSetDecls.js.map +1 -0
  251. package/lib/packlets/conditions/conditionToken.d.ts.map +1 -0
  252. package/lib/packlets/conditions/conditionToken.js.map +1 -0
  253. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts +30 -2
  254. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +1 -0
  255. package/lib/packlets/conditions/convert/conditionSetDecls.js +51 -5
  256. package/lib/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  257. package/lib/packlets/conditions/convert/decls.d.ts +39 -3
  258. package/lib/packlets/conditions/convert/decls.d.ts.map +1 -0
  259. package/lib/packlets/conditions/convert/decls.js +63 -5
  260. package/lib/packlets/conditions/convert/decls.js.map +1 -0
  261. package/lib/packlets/conditions/convert/index.d.ts.map +1 -0
  262. package/lib/packlets/conditions/convert/index.js.map +1 -0
  263. package/lib/packlets/conditions/index.d.ts.map +1 -0
  264. package/lib/packlets/conditions/index.js.map +1 -0
  265. package/lib/packlets/config/common.d.ts.map +1 -0
  266. package/lib/packlets/config/common.js.map +1 -0
  267. package/lib/packlets/config/configInitFactory.d.ts.map +1 -0
  268. package/lib/packlets/config/configInitFactory.js.map +1 -0
  269. package/lib/packlets/config/convert.d.ts.map +1 -0
  270. package/lib/packlets/config/convert.js.map +1 -0
  271. package/lib/packlets/config/index.browser.d.ts.map +1 -0
  272. package/lib/packlets/config/index.browser.js.map +1 -0
  273. package/lib/packlets/config/index.d.ts.map +1 -0
  274. package/lib/packlets/config/index.js.map +1 -0
  275. package/lib/packlets/config/json.d.ts.map +1 -0
  276. package/lib/packlets/config/json.js.map +1 -0
  277. package/lib/packlets/config/predefined/default.d.ts.map +1 -0
  278. package/lib/packlets/config/predefined/default.js.map +1 -0
  279. package/lib/packlets/config/predefined/extended.d.ts.map +1 -0
  280. package/lib/packlets/config/predefined/extended.js.map +1 -0
  281. package/lib/packlets/config/predefined/index.d.ts.map +1 -0
  282. package/lib/packlets/config/predefined/index.js.map +1 -0
  283. package/lib/packlets/config/systemConfiguration.d.ts.map +1 -0
  284. package/lib/packlets/config/systemConfiguration.js.map +1 -0
  285. package/lib/packlets/context/contextDecls.d.ts.map +1 -0
  286. package/lib/packlets/context/contextDecls.js.map +1 -0
  287. package/lib/packlets/context/contextToken.d.ts.map +1 -0
  288. package/lib/packlets/context/contextToken.js.map +1 -0
  289. package/lib/packlets/context/convert/decls.d.ts.map +1 -0
  290. package/lib/packlets/context/convert/decls.js.map +1 -0
  291. package/lib/packlets/context/convert/index.d.ts.map +1 -0
  292. package/lib/packlets/context/convert/index.js.map +1 -0
  293. package/lib/packlets/context/index.d.ts.map +1 -0
  294. package/lib/packlets/context/index.js.map +1 -0
  295. package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -0
  296. package/lib/packlets/decisions/abstractDecision.js.map +1 -0
  297. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -0
  298. package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  299. package/lib/packlets/decisions/candidate.d.ts.map +1 -0
  300. package/lib/packlets/decisions/candidate.js.map +1 -0
  301. package/lib/packlets/decisions/common.d.ts.map +1 -0
  302. package/lib/packlets/decisions/common.js.map +1 -0
  303. package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -0
  304. package/lib/packlets/decisions/concreteDecision.js.map +1 -0
  305. package/lib/packlets/decisions/decision.d.ts +1 -1
  306. package/lib/packlets/decisions/decision.d.ts.map +1 -0
  307. package/lib/packlets/decisions/decision.js +1 -1
  308. package/lib/packlets/decisions/decision.js.map +1 -0
  309. package/lib/packlets/decisions/index.d.ts.map +1 -0
  310. package/lib/packlets/decisions/index.js.map +1 -0
  311. package/lib/packlets/import/fsItem.d.ts +1 -4
  312. package/lib/packlets/import/fsItem.d.ts.map +1 -0
  313. package/lib/packlets/import/fsItem.js +1 -4
  314. package/lib/packlets/import/fsItem.js.map +1 -0
  315. package/lib/packlets/import/importContext.d.ts +5 -5
  316. package/lib/packlets/import/importContext.d.ts.map +1 -0
  317. package/lib/packlets/import/importContext.js +3 -3
  318. package/lib/packlets/import/importContext.js.map +1 -0
  319. package/lib/packlets/import/importManager.d.ts +15 -1
  320. package/lib/packlets/import/importManager.d.ts.map +1 -0
  321. package/lib/packlets/import/importManager.js +7 -3
  322. package/lib/packlets/import/importManager.js.map +1 -0
  323. package/lib/packlets/import/importable.d.ts.map +1 -0
  324. package/lib/packlets/import/importable.js.map +1 -0
  325. package/lib/packlets/import/importers/collectionImporter.d.ts +2 -2
  326. package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -0
  327. package/lib/packlets/import/importers/collectionImporter.js +2 -2
  328. package/lib/packlets/import/importers/collectionImporter.js.map +1 -0
  329. package/lib/packlets/import/importers/fsItemImporter.d.ts +16 -2
  330. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -0
  331. package/lib/packlets/import/importers/fsItemImporter.js +29 -13
  332. package/lib/packlets/import/importers/fsItemImporter.js.map +1 -0
  333. package/lib/packlets/import/importers/importer.d.ts.map +1 -0
  334. package/lib/packlets/import/importers/importer.js.map +1 -0
  335. package/lib/packlets/import/importers/index.browser.d.ts.map +1 -0
  336. package/lib/packlets/import/importers/index.browser.js.map +1 -0
  337. package/lib/packlets/import/importers/index.d.ts.map +1 -0
  338. package/lib/packlets/import/importers/index.js.map +1 -0
  339. package/lib/packlets/import/importers/jsonImporter.d.ts +2 -2
  340. package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -0
  341. package/lib/packlets/import/importers/jsonImporter.js +2 -2
  342. package/lib/packlets/import/importers/jsonImporter.js.map +1 -0
  343. package/lib/packlets/import/importers/pathImporter.d.ts +1 -1
  344. package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -0
  345. package/lib/packlets/import/importers/pathImporter.js +1 -1
  346. package/lib/packlets/import/importers/pathImporter.js.map +1 -0
  347. package/lib/packlets/import/index.browser.d.ts.map +1 -0
  348. package/lib/packlets/import/index.browser.js.map +1 -0
  349. package/lib/packlets/import/index.d.ts.map +1 -0
  350. package/lib/packlets/import/index.js.map +1 -0
  351. package/lib/packlets/qualifier-types/config/convert.d.ts.map +1 -0
  352. package/lib/packlets/qualifier-types/config/convert.js.map +1 -0
  353. package/lib/packlets/qualifier-types/config/index.d.ts.map +1 -0
  354. package/lib/packlets/qualifier-types/config/index.js.map +1 -0
  355. package/lib/packlets/qualifier-types/config/json.d.ts.map +1 -0
  356. package/lib/packlets/qualifier-types/config/json.js.map +1 -0
  357. package/lib/packlets/qualifier-types/convert.d.ts.map +1 -0
  358. package/lib/packlets/qualifier-types/convert.js.map +1 -0
  359. package/lib/packlets/qualifier-types/helpers.d.ts.map +1 -0
  360. package/lib/packlets/qualifier-types/helpers.js.map +1 -0
  361. package/lib/packlets/qualifier-types/index.d.ts.map +1 -0
  362. package/lib/packlets/qualifier-types/index.js.map +1 -0
  363. package/lib/packlets/qualifier-types/languageQualifierType.d.ts +6 -7
  364. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -0
  365. package/lib/packlets/qualifier-types/languageQualifierType.js +6 -7
  366. package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  367. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +7 -10
  368. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -0
  369. package/lib/packlets/qualifier-types/literalQualifierType.js +7 -10
  370. package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  371. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -0
  372. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  373. package/lib/packlets/qualifier-types/qualifierType.d.ts +17 -18
  374. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -0
  375. package/lib/packlets/qualifier-types/qualifierType.js +12 -13
  376. package/lib/packlets/qualifier-types/qualifierType.js.map +1 -0
  377. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -0
  378. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  379. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +8 -8
  380. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -0
  381. package/lib/packlets/qualifier-types/territoryQualifierType.js +5 -5
  382. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  383. package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -0
  384. package/lib/packlets/qualifiers/convert/decls.js.map +1 -0
  385. package/lib/packlets/qualifiers/convert/index.d.ts.map +1 -0
  386. package/lib/packlets/qualifiers/convert/index.js.map +1 -0
  387. package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +1 -0
  388. package/lib/packlets/qualifiers/convert/qualifier.js.map +1 -0
  389. package/lib/packlets/qualifiers/index.d.ts.map +1 -0
  390. package/lib/packlets/qualifiers/index.js.map +1 -0
  391. package/lib/packlets/qualifiers/qualifier.d.ts +6 -7
  392. package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -0
  393. package/lib/packlets/qualifiers/qualifier.js +6 -7
  394. package/lib/packlets/qualifiers/qualifier.js.map +1 -0
  395. package/lib/packlets/qualifiers/qualifierCollector.d.ts +107 -9
  396. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -0
  397. package/lib/packlets/qualifiers/qualifierCollector.js +152 -8
  398. package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -0
  399. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -0
  400. package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -0
  401. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +1 -0
  402. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  403. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +1 -0
  404. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  405. package/lib/packlets/resource-json/compiled/common.d.ts.map +1 -0
  406. package/lib/packlets/resource-json/compiled/common.js.map +1 -0
  407. package/lib/packlets/resource-json/compiled/convert.d.ts.map +1 -0
  408. package/lib/packlets/resource-json/compiled/convert.js.map +1 -0
  409. package/lib/packlets/resource-json/compiled/index.d.ts.map +1 -0
  410. package/lib/packlets/resource-json/compiled/index.js.map +1 -0
  411. package/lib/packlets/resource-json/compiled/json.d.ts.map +1 -0
  412. package/lib/packlets/resource-json/compiled/json.js.map +1 -0
  413. package/lib/packlets/resource-json/convert.d.ts +85 -0
  414. package/lib/packlets/resource-json/convert.d.ts.map +1 -0
  415. package/lib/packlets/resource-json/convert.js +237 -0
  416. package/lib/packlets/resource-json/convert.js.map +1 -0
  417. package/lib/packlets/resource-json/helpers.d.ts.map +1 -0
  418. package/lib/packlets/resource-json/helpers.js.map +1 -0
  419. package/lib/packlets/resource-json/index.d.ts.map +1 -0
  420. package/lib/packlets/resource-json/index.js.map +1 -0
  421. package/lib/packlets/resource-json/json.d.ts +128 -39
  422. package/lib/packlets/resource-json/json.d.ts.map +1 -0
  423. package/lib/packlets/resource-json/json.js +2 -2
  424. package/lib/packlets/resource-json/json.js.map +1 -0
  425. package/lib/packlets/resource-json/normalized.d.ts.map +1 -0
  426. package/lib/packlets/resource-json/normalized.js.map +1 -0
  427. package/lib/packlets/resource-json/resourceDeclCollection.d.ts +1 -1
  428. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -0
  429. package/lib/packlets/resource-json/resourceDeclCollection.js +1 -1
  430. package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  431. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -0
  432. package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  433. package/lib/packlets/resource-json/resourceDeclTree.d.ts +1 -1
  434. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -0
  435. package/lib/packlets/resource-json/resourceDeclTree.js +1 -1
  436. package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -0
  437. package/lib/packlets/resource-types/config/convert.d.ts.map +1 -0
  438. package/lib/packlets/resource-types/config/convert.js.map +1 -0
  439. package/lib/packlets/resource-types/config/index.d.ts.map +1 -0
  440. package/lib/packlets/resource-types/config/index.js.map +1 -0
  441. package/lib/packlets/resource-types/config/json.d.ts.map +1 -0
  442. package/lib/packlets/resource-types/config/json.js.map +1 -0
  443. package/lib/packlets/resource-types/helpers.d.ts.map +1 -0
  444. package/lib/packlets/resource-types/helpers.js.map +1 -0
  445. package/lib/packlets/resource-types/index.d.ts.map +1 -0
  446. package/lib/packlets/resource-types/index.js.map +1 -0
  447. package/lib/packlets/resource-types/jsonResourceType.d.ts +17 -5
  448. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -0
  449. package/lib/packlets/resource-types/jsonResourceType.js +2 -2
  450. package/lib/packlets/resource-types/jsonResourceType.js.map +1 -0
  451. package/lib/packlets/resource-types/resourceType.d.ts +5 -5
  452. package/lib/packlets/resource-types/resourceType.d.ts.map +1 -0
  453. package/lib/packlets/resource-types/resourceType.js +2 -2
  454. package/lib/packlets/resource-types/resourceType.js.map +1 -0
  455. package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +1 -0
  456. package/lib/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  457. package/lib/packlets/resources/candidateReducer.d.ts.map +1 -0
  458. package/lib/packlets/resources/candidateReducer.js.map +1 -0
  459. package/lib/packlets/resources/candidateValue.d.ts.map +1 -0
  460. package/lib/packlets/resources/candidateValue.js.map +1 -0
  461. package/lib/packlets/resources/candidateValueCollector.d.ts.map +1 -0
  462. package/lib/packlets/resources/candidateValueCollector.js.map +1 -0
  463. package/lib/packlets/resources/common.d.ts.map +1 -0
  464. package/lib/packlets/resources/common.js.map +1 -0
  465. package/lib/packlets/resources/deltaGenerator.d.ts.map +1 -0
  466. package/lib/packlets/resources/deltaGenerator.js.map +1 -0
  467. package/lib/packlets/resources/index.d.ts.map +1 -0
  468. package/lib/packlets/resources/index.js.map +1 -0
  469. package/lib/packlets/resources/resource.d.ts.map +1 -0
  470. package/lib/packlets/resources/resource.js.map +1 -0
  471. package/lib/packlets/resources/resourceBuilder.d.ts +2 -2
  472. package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -0
  473. package/lib/packlets/resources/resourceBuilder.js +2 -2
  474. package/lib/packlets/resources/resourceBuilder.js.map +1 -0
  475. package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -0
  476. package/lib/packlets/resources/resourceCandidate.js.map +1 -0
  477. package/lib/packlets/resources/resourceManagerBuilder.d.ts +5 -5
  478. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -0
  479. package/lib/packlets/resources/resourceManagerBuilder.js +5 -5
  480. package/lib/packlets/resources/resourceManagerBuilder.js.map +1 -0
  481. package/lib/packlets/runtime/cacheListener.d.ts.map +1 -0
  482. package/lib/packlets/runtime/cacheListener.js.map +1 -0
  483. package/lib/packlets/runtime/cacheMetrics.d.ts.map +1 -0
  484. package/lib/packlets/runtime/cacheMetrics.js.map +1 -0
  485. package/lib/packlets/runtime/compiledResourceCollection.d.ts +5 -5
  486. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -0
  487. package/lib/packlets/runtime/compiledResourceCollection.js +5 -5
  488. package/lib/packlets/runtime/compiledResourceCollection.js.map +1 -0
  489. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +1 -0
  490. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  491. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +1 -0
  492. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  493. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +1 -0
  494. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  495. package/lib/packlets/runtime/context/index.d.ts.map +1 -0
  496. package/lib/packlets/runtime/context/index.js.map +1 -0
  497. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +9 -2
  498. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +1 -0
  499. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +3 -0
  500. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  501. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +8 -1
  502. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +1 -0
  503. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +3 -5
  504. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  505. package/lib/packlets/runtime/iResourceManager.d.ts.map +1 -0
  506. package/lib/packlets/runtime/iResourceManager.js.map +1 -0
  507. package/lib/packlets/runtime/index.d.ts.map +1 -0
  508. package/lib/packlets/runtime/index.js.map +1 -0
  509. package/lib/packlets/runtime/resource-tree/common.d.ts.map +1 -0
  510. package/lib/packlets/runtime/resource-tree/common.js.map +1 -0
  511. package/lib/packlets/runtime/resource-tree/index.d.ts.map +1 -0
  512. package/lib/packlets/runtime/resource-tree/index.js.map +1 -0
  513. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +1 -0
  514. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  515. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +1 -0
  516. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  517. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +1 -0
  518. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  519. package/lib/packlets/runtime/resourceResolver.d.ts.map +1 -0
  520. package/lib/packlets/runtime/resourceResolver.js.map +1 -0
  521. package/lib/packlets/runtime/resourceTreeResolver.d.ts.map +1 -0
  522. package/lib/packlets/runtime/resourceTreeResolver.js.map +1 -0
  523. package/lib/packlets/runtime/validate.d.ts.map +1 -0
  524. package/lib/packlets/runtime/validate.js.map +1 -0
  525. package/lib/packlets/zip-archive/convert.d.ts.map +1 -0
  526. package/lib/packlets/zip-archive/convert.js.map +1 -0
  527. package/lib/packlets/zip-archive/index.browser.d.ts.map +1 -0
  528. package/lib/packlets/zip-archive/index.browser.js.map +1 -0
  529. package/lib/packlets/zip-archive/index.d.ts.map +1 -0
  530. package/lib/packlets/zip-archive/index.js.map +1 -0
  531. package/lib/packlets/zip-archive/json.d.ts.map +1 -0
  532. package/lib/packlets/zip-archive/json.js.map +1 -0
  533. package/lib/packlets/zip-archive/types.d.ts.map +1 -0
  534. package/lib/packlets/zip-archive/types.js.map +1 -0
  535. package/lib/packlets/zip-archive/zipArchiveCreator.d.ts.map +1 -0
  536. package/lib/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
  537. package/lib/packlets/zip-archive/zipArchiveFormat.d.ts.map +1 -0
  538. package/lib/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
  539. package/lib/packlets/zip-archive/zipArchiveLoader.d.ts.map +1 -0
  540. package/lib/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
  541. package/package.json +12 -10
  542. package/dist/test/data/sample.json +0 -32
  543. package/dist/test/unit/qualifier-types/testQualifierType.js +0 -76
  544. package/dist/test/unit/resource-types/testDerivedResourceType.js +0 -109
  545. package/dist/test/unit/resources/deltaGenerator.helpers.js +0 -282
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/qualifiers/convert/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nexport * from './decls';\nexport * from './qualifier';\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualifier.js","sourceRoot":"","sources":["../../../../src/packlets/qualifiers/convert/qualifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,UAAU,EAAU,IAAI,EAAE,MAAM,eAAe,CAAC;AAezD;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,CACzC,CAAC,IAAa,EAAE,MAAM,EAAE,OAAkC,EAAqB,EAAE;IAC/E,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC,wCAAwC,CAAC,CAAC;IACxD,CAAC;IACD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;SAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,IAAI,CAAC,iDAAiD,CAAC,CAAC;AACjE,CAAC,CACF,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Converters, Result, fail } from '@fgv/ts-utils';\nimport { IReadOnlyQualifierCollector } from '../qualifierCollector';\nimport { Qualifier } from '../qualifier';\n\n/* eslint-disable @rushstack/typedef-var */\n\n/**\n * Context necessary to convert a string or number to a\n * {@link Qualifiers.Qualifier | Qualifier} object.\n * @public\n */\nexport interface IQualifierConvertContext {\n qualifiers: IReadOnlyQualifierCollector;\n}\n\n/**\n * Converter which choose a qualifier by name or number from a\n * supplied {@link Qualifiers.Convert.IQualifierConvertContext | conversion context}.\n * @public\n */\nexport const qualifier = Converters.generic<Qualifier, IQualifierConvertContext>(\n (from: unknown, __self, context?: IQualifierConvertContext): Result<Qualifier> => {\n if (context === undefined) {\n return fail('qualifier converter requires a context');\n }\n if (typeof from === 'string') {\n return context.qualifiers.validating.get(from);\n } else if (typeof from === 'number') {\n return context.qualifiers.getAt(from);\n }\n return fail('qualifier converter requires a string or number');\n }\n);\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/qualifiers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAE,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Convert from './convert';\n\nexport * from './qualifier';\nexport * from './qualifierDecl';\nexport * from './qualifierCollector';\nexport * from './qualifierDefaultValueDecls';\nexport * from './qualifierDefaultValueToken';\n\nexport { Convert };\n"]}
@@ -42,9 +42,8 @@ export class Qualifier {
42
42
  /**
43
43
  * Constructs a new instance of a {@link Qualifiers.Qualifier | Qualifier} from the
44
44
  * supplied {@link Qualifiers.IValidatedQualifierDecl | validated declaration}.
45
- * @param name - The name of the qualifier.
46
- * @param type - The {@link QualifierTypes.QualifierType | type} of the qualifier.
47
- * @param defaultPriority - The default {@link ConditionPriority | priority} of conditions
45
+ * @param decl - The {@link Qualifiers.IValidatedQualifierDecl | validated declaration}
46
+ * describing the qualifier to construct.
48
47
  * @public
49
48
  */
50
49
  constructor({ name, token, type, defaultPriority, tokenIsOptional, defaultValue, index }) {
@@ -81,25 +80,25 @@ export class Qualifier {
81
80
  return this._collectible.setIndex(index);
82
81
  }
83
82
  /**
84
- * {@inheritdoc QualifierTypes.QualifierType.isValidContextValue}
83
+ * {@inheritDoc QualifierTypes.QualifierType.isValidContextValue}
85
84
  */
86
85
  isValidContextValue(value) {
87
86
  return this.type.isValidContextValue(value);
88
87
  }
89
88
  /**
90
- * {@inheritdoc QualifierTypes.QualifierType.isValidConditionValue}
89
+ * {@inheritDoc QualifierTypes.QualifierType.isValidConditionValue}
91
90
  */
92
91
  isValidConditionValue(value) {
93
92
  return this.type.isValidConditionValue(value);
94
93
  }
95
94
  /**
96
- * {@inheritdoc QualifierTypes.QualifierType.validateCondition}
95
+ * {@inheritDoc QualifierTypes.QualifierType.validateCondition}
97
96
  */
98
97
  validateCondition(value, operator) {
99
98
  return this.type.validateCondition(value, operator);
100
99
  }
101
100
  /**
102
- * {@inheritdoc QualifierTypes.QualifierType.validateContextValue}
101
+ * {@inheritDoc QualifierTypes.QualifierType.validateContextValue}
103
102
  */
104
103
  validateContextValue(value) {
105
104
  return this.type.validateContextValue(value);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualifier.js","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAwB,MAAM,eAAe,CAAC;AACjF,OAAO,EAIL,OAAO,IAAI,aAAa,EAIzB,MAAM,WAAW,CAAC;AAInB;;;;GAIG;AACH,MAAM,OAAO,SAAS;IA2BpB;;OAEG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,IAAW,GAAG;QACZ,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC;IAC/B,CAAC;IAUD;;;;;;OAMG;IACH,YAAsB,EACpB,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,eAAe,EACf,eAAe,EACf,YAAY,EACZ,KAAK,EACmB;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,YAAY,GAAG,IAAI,WAAW,CAAC,WAAW,CAAgC;YAC7E,GAAG,EAAE,IAAI;YACT,KAAK;YACL,cAAc,EAAE,aAAa,CAAC,cAAc;SAC7C,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACI,MAAM,CAAC,MAAM,CAAC,IAA6B;QAChD,OAAO,aAAa,CAAC,GAAG,EAAE,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAClD,CAAC;IAED;;;;OAIG;IACI,QAAQ,CAAC,KAAqB;QACnC,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACI,mBAAmB,CAAC,KAAa;QACtC,OAAO,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACI,qBAAqB,CAAC,KAAa;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;IAED;;OAEG;IACI,iBAAiB,CAAC,KAAa,EAAE,QAA4B;QAClE,OAAO,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACI,oBAAoB,CAAC,KAAa;QACvC,OAAO,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, Collections, ICollectible, Result } from '@fgv/ts-utils';\nimport {\n ConditionPriority,\n QualifierIndex,\n QualifierName,\n Convert as CommonConvert,\n QualifierContextValue,\n QualifierConditionValue,\n ConditionOperator\n} from '../common';\nimport { QualifierType } from '../qualifier-types';\nimport { IValidatedQualifierDecl } from './qualifierDecl';\n\n/**\n * Represents a qualifier that can be used to identify the context in\n * which a resource is used.\n * @public\n */\nexport class Qualifier implements IValidatedQualifierDecl, ICollectible<QualifierName, QualifierIndex> {\n /**\n * The name of the qualifier.\n */\n public readonly name: QualifierName;\n\n /**\n * The token used to identify the qualifier in the name or\n * path of a resource being imported.\n */\n public readonly token: QualifierName;\n\n /**\n * The {@link QualifierTypes.QualifierType | type} of the qualifier.\n */\n public readonly type: QualifierType;\n\n /**\n * Indicates whether the token is optional in the name or path of a resource being imported.\n */\n public readonly tokenIsOptional: boolean;\n\n /**\n * Optional default value for the qualifier.\n */\n public readonly defaultValue?: QualifierContextValue;\n\n /**\n * The index of the qualifier.\n */\n public get index(): QualifierIndex | undefined {\n return this._collectible.index;\n }\n\n /**\n * The collector key for this qualifier.\n */\n public get key(): QualifierName {\n return this._collectible.key;\n }\n\n /**\n * The default {@link ConditionPriority | priority} of conditions\n * that depend on this qualifier.\n */\n public readonly defaultPriority: ConditionPriority;\n\n protected readonly _collectible: Collections.Collectible<QualifierName, QualifierIndex>;\n\n /**\n * Constructs a new instance of a {@link Qualifiers.Qualifier | Qualifier} from the\n * supplied {@link Qualifiers.IValidatedQualifierDecl | validated declaration}.\n * @param decl - The {@link Qualifiers.IValidatedQualifierDecl | validated declaration}\n * describing the qualifier to construct.\n * @public\n */\n protected constructor({\n name,\n token,\n type,\n defaultPriority,\n tokenIsOptional,\n defaultValue,\n index\n }: IValidatedQualifierDecl) {\n this.name = name;\n this.token = token;\n this.type = type;\n this.defaultPriority = defaultPriority;\n this.tokenIsOptional = tokenIsOptional;\n this.defaultValue = defaultValue;\n this._collectible = new Collections.Collectible<QualifierName, QualifierIndex>({\n key: name,\n index,\n indexConverter: CommonConvert.qualifierIndex\n });\n }\n\n /**\n * Creates a new instance of a {@link Qualifiers.Qualifier | Qualifier} from the\n * supplied {@link Qualifiers.IValidatedQualifierDecl | validated declaration}.\n * @param decl - The {@link Qualifiers.IValidatedQualifierDecl | validated declaration}\n * for the new instance.\n * @returns `Success` with the new {@link Qualifiers.Qualifier | Qualifier} if successful,\n * `Failure` with an error message otherwise.\n * @public\n */\n public static create(decl: IValidatedQualifierDecl): Result<Qualifier> {\n return captureResult(() => new Qualifier(decl));\n }\n\n /**\n * Sets the index of this qualifier. Once set, the index cannot be changed.\n * @param index - The index to set.\n * @returns `Success` with the index if successful, `Failure` with an error message otherwise.\n */\n public setIndex(index: QualifierIndex): Result<QualifierIndex> {\n return this._collectible.setIndex(index);\n }\n\n /**\n * {@inheritDoc QualifierTypes.QualifierType.isValidContextValue}\n */\n public isValidContextValue(value: string): value is QualifierContextValue {\n return this.type.isValidContextValue(value);\n }\n\n /**\n * {@inheritDoc QualifierTypes.QualifierType.isValidConditionValue}\n */\n public isValidConditionValue(value: string): value is QualifierConditionValue {\n return this.type.isValidConditionValue(value);\n }\n\n /**\n * {@inheritDoc QualifierTypes.QualifierType.validateCondition}\n */\n public validateCondition(value: string, operator?: ConditionOperator): Result<QualifierConditionValue> {\n return this.type.validateCondition(value, operator);\n }\n\n /**\n * {@inheritDoc QualifierTypes.QualifierType.validateContextValue}\n */\n public validateContextValue(value: string): Result<QualifierContextValue> {\n return this.type.validateContextValue(value);\n }\n}\n"]}
@@ -20,9 +20,20 @@
20
20
  * SOFTWARE.
21
21
  */
22
22
  import * as Common from '../common';
23
- import { captureResult, Collections, failWithDetail, fail, succeed, succeedWithDetail, ValidatingConvertingCollector } from '@fgv/ts-utils';
23
+ import { captureResult, Collections, Converters, failWithDetail, mapResults, fail, succeed, succeedWithDetail, ValidatingConvertingCollector } from '@fgv/ts-utils';
24
+ import { MaxConditionPriority, MinConditionPriority } from '../common';
24
25
  import { Qualifier } from './qualifier';
25
26
  import { qualifierDecl, validatedQualifierDecl } from './convert';
27
+ import { LiteralQualifierType, QualifierTypeCollector } from '../qualifier-types';
28
+ /**
29
+ * Converter for a single entry in the mixed-shape
30
+ * {@link Qualifiers.IQualifierCollectorCreateParams.qualifiers | qualifiers}
31
+ * input — either a bare axis-name string or a full
32
+ * {@link Qualifiers.IQualifierDecl | declaration}. Validates the entry
33
+ * shape at the public-API boundary rather than deferring to the
34
+ * internal qualifier factory.
35
+ */
36
+ const _qualifierEntriesConverter = Converters.arrayOf(Converters.oneOf([Converters.string, qualifierDecl]));
26
37
  /**
27
38
  * Collects {@link Qualifiers.Qualifier | Qualifiers} from {@link Qualifiers.IQualifierDecl | declarations},
28
39
  * with strongly-typed ({@link QualifierName | QualifierName} and {@link QualifierIndex | QualifierIndex}) key
@@ -32,11 +43,12 @@ import { qualifierDecl, validatedQualifierDecl } from './convert';
32
43
  export class QualifierCollector extends ValidatingConvertingCollector {
33
44
  /**
34
45
  * Constructor for a {@link Qualifiers.QualifierCollector | QualifierCollector} object.
35
- * @param params - Parameters for creating the collector.
46
+ * @param qualifierTypes - The {@link QualifierTypes.ReadOnlyQualifierTypeCollector | qualifier types}
47
+ * used to validate declarations.
48
+ * @param qualifiers - Optional list of fully-resolved {@link Qualifiers.IQualifierDecl | declarations}.
36
49
  * @public
37
50
  */
38
- constructor(params) {
39
- var _a;
51
+ constructor(qualifierTypes, qualifiers) {
40
52
  super({
41
53
  factory: (k, i, v) => this._qualifierFactory(k, i, v),
42
54
  converters: new Collections.KeyValueConverters({
@@ -44,20 +56,152 @@ export class QualifierCollector extends ValidatingConvertingCollector {
44
56
  value: qualifierDecl
45
57
  })
46
58
  });
47
- this.qualifierTypes = params.qualifierTypes;
59
+ this.qualifierTypes = qualifierTypes;
48
60
  /* c8 ignore next 1 - coverage misses the branch intermittently */
49
- (_a = params.qualifiers) === null || _a === void 0 ? void 0 : _a.forEach((q) => this.validating.add(q.name, q).orThrow());
61
+ qualifiers === null || qualifiers === void 0 ? void 0 : qualifiers.forEach((q) => this.validating.add(q.name, q).orThrow());
50
62
  }
51
63
  /**
52
64
  * Creates a new {@link Qualifiers.QualifierCollector | QualifierCollector} object.
53
65
  * @param params - {@link Qualifiers.IQualifierCollectorCreateParams | Parameters} for creating a new {@link Qualifiers.QualifierCollector | QualifierCollector}.
54
66
  * @returns `Success` with the new collector if successful, or `Failure` if not.
67
+ *
68
+ * @remarks
69
+ * Accepts a mixed array of bare axis-name strings and full
70
+ * {@link Qualifiers.IQualifierDecl | declarations}. String elements are sugar
71
+ * for a literal qualifier: the library synthesizes a
72
+ * {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType} named
73
+ * after the string and a declaration `{ name, typeName: name, defaultPriority }`.
74
+ * Synthesized priorities are distributed across the
75
+ * `[MinConditionPriority..MaxConditionPriority]` range adaptively to the
76
+ * input length (`step = max(1, floor((Max - Min) / length))`,
77
+ * `priority = max(Min, Max - index * step)`). Earlier elements get higher
78
+ * priority — matching the "earlier qualifier wins when multiple match"
79
+ * mental model — and the formula never overflows the `ConditionPriority`
80
+ * range regardless of input length.
81
+ *
82
+ * `qualifierTypes` may be omitted only when every element of `qualifiers`
83
+ * is a string. If any element is a declaration, `qualifierTypes` is
84
+ * required (and must include the referenced typeNames); the error message
85
+ * names the offending typeName when it is missing.
55
86
  */
56
87
  static create(params) {
57
- return captureResult(() => new QualifierCollector(params));
88
+ return QualifierCollector._resolveCreateParams(params).onSuccess(({ qualifierTypes, qualifiers }) => {
89
+ return captureResult(() => new QualifierCollector(qualifierTypes, qualifiers));
90
+ });
91
+ }
92
+ /**
93
+ * Resolves the public {@link Qualifiers.IQualifierCollectorCreateParams | create params}
94
+ * into the concrete `(qualifierTypes, qualifiers)` pair the constructor expects.
95
+ *
96
+ * @remarks
97
+ * Validates the mixed-shape `qualifiers` input through
98
+ * {@link Converters.oneOf} (string vs {@link Qualifiers.IQualifierDecl})
99
+ * at the public-API boundary, then partitions into bare-string and decl
100
+ * buckets to drive type synthesis. If any decl is present and
101
+ * `qualifierTypes` is omitted, fails with an error that names the
102
+ * offending typeNames.
103
+ *
104
+ * @internal
105
+ */
106
+ static _resolveCreateParams(params) {
107
+ const raw = params.qualifiers;
108
+ if (raw === undefined || raw.length === 0) {
109
+ if (params.qualifierTypes === undefined) {
110
+ return succeed({ qualifierTypes: QualifierCollector._emptyQualifierTypes(), qualifiers: undefined });
111
+ }
112
+ return succeed({ qualifierTypes: params.qualifierTypes, qualifiers: undefined });
113
+ }
114
+ return _qualifierEntriesConverter.convert(raw).onSuccess((entries) => {
115
+ const stringNames = [];
116
+ const declTypeNames = [];
117
+ for (const entry of entries) {
118
+ if (typeof entry === 'string') {
119
+ stringNames.push(entry);
120
+ }
121
+ else {
122
+ declTypeNames.push(entry.typeName);
123
+ }
124
+ }
125
+ if (declTypeNames.length > 0 && params.qualifierTypes === undefined) {
126
+ const unique = Array.from(new Set(declTypeNames));
127
+ return fail(`qualifierTypes must be supplied when qualifiers include declarations; ` +
128
+ `missing types for: ${unique.map((n) => `'${n}'`).join(', ')}`);
129
+ }
130
+ return QualifierCollector._resolveQualifierTypes(params.qualifierTypes, stringNames).onSuccess((qualifierTypes) => {
131
+ const decls = QualifierCollector._normalizeQualifierDecls(entries);
132
+ return succeed({ qualifierTypes, qualifiers: decls });
133
+ });
134
+ });
135
+ }
136
+ /**
137
+ * Returns the provided {@link QualifierTypes.ReadOnlyQualifierTypeCollector | qualifier-type collector}
138
+ * (or synthesizes a new one) augmented with synthesized literal qualifier types for the supplied
139
+ * string names that are not already present.
140
+ *
141
+ * @internal
142
+ */
143
+ static _resolveQualifierTypes(provided, stringNames) {
144
+ if (stringNames.length === 0) {
145
+ // No bare names to synthesize. The all-decls case requires `provided` to be defined
146
+ // (else _resolveCreateParams would have failed before calling us); fall back to an
147
+ // empty type collector only as a defensive measure.
148
+ /* c8 ignore next 1 - defensive: unreachable when called from _resolveCreateParams */
149
+ return succeed(provided !== null && provided !== void 0 ? provided : QualifierCollector._emptyQualifierTypes());
150
+ }
151
+ return mapResults(stringNames.map((name) => LiteralQualifierType.create({ name }))).onSuccess((literalTypes) => {
152
+ return QualifierTypeCollector.create().onSuccess((collector) => {
153
+ const existingAdds = provided !== undefined
154
+ ? Array.from(provided.values()).map((existing) => collector.add(existing))
155
+ : [];
156
+ const literalAdds = literalTypes
157
+ .filter((lit) => !collector.has(lit.name))
158
+ .map((lit) => collector.add(lit));
159
+ return mapResults([...existingAdds, ...literalAdds]).onSuccess(() => succeed(collector));
160
+ });
161
+ });
162
+ }
163
+ /**
164
+ * Normalizes a mixed `(string | IQualifierDecl)[]` into a fully-resolved
165
+ * `IQualifierDecl[]`, assigning descending default priorities to synthesized
166
+ * decls within the `[MinConditionPriority..MaxConditionPriority]` range.
167
+ *
168
+ * @remarks
169
+ * Step size is adaptive to input length:
170
+ * `step = max(1, floor((Max - Min) / length))`. Each synthesized priority
171
+ * is `max(Min, Max - index * step)` — clamped at the bottom so length
172
+ * extremes (\>1000 axes) degrade gracefully into a tail of equal-`Min`
173
+ * priorities rather than overflowing the `ConditionPriority` range.
174
+ *
175
+ * @internal
176
+ */
177
+ static _normalizeQualifierDecls(qualifiers) {
178
+ const range = MaxConditionPriority - MinConditionPriority;
179
+ const step = Math.max(1, Math.floor(range / qualifiers.length));
180
+ return qualifiers.map((q, index) => {
181
+ if (typeof q === 'string') {
182
+ const raw = MaxConditionPriority - index * step;
183
+ return {
184
+ name: q,
185
+ typeName: q,
186
+ defaultPriority: Math.max(MinConditionPriority, raw)
187
+ };
188
+ }
189
+ return q;
190
+ });
191
+ }
192
+ /**
193
+ * Returns an empty {@link QualifierTypes.ReadOnlyQualifierTypeCollector | qualifier-type collector}
194
+ * used as a placeholder when no qualifiers are supplied and the caller omits
195
+ * `qualifierTypes`.
196
+ *
197
+ * @internal
198
+ */
199
+ static _emptyQualifierTypes() {
200
+ /* c8 ignore next 1 - QualifierTypeCollector.create() is total for the empty case */
201
+ return QualifierTypeCollector.create().orThrow();
58
202
  }
59
203
  /**
60
- * {@inheritdoc Qualifiers.IReadOnlyQualifierCollector.getByNameOrToken}
204
+ * {@inheritDoc Qualifiers.IReadOnlyQualifierCollector.getByNameOrToken}
61
205
  */
62
206
  getByNameOrToken(nameOrToken) {
63
207
  return this.validating.get(nameOrToken).onFailure((message) => {
@@ -70,7 +214,7 @@ export class QualifierCollector extends ValidatingConvertingCollector {
70
214
  });
71
215
  }
72
216
  /**
73
- * {@inheritdoc Qualifiers.IReadOnlyQualifierCollector.hasNameOrToken}
217
+ * {@inheritDoc Qualifiers.IReadOnlyQualifierCollector.hasNameOrToken}
74
218
  */
75
219
  hasNameOrToken(nameOrToken) {
76
220
  /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualifierCollector.js","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierCollector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,aAAa,EACb,WAAW,EAEX,UAAU,EACV,cAAc,EACd,UAAU,EAEV,IAAI,EACJ,OAAO,EAC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AsB;aAC1B,OAAO,CAAC,IAAI,EAAE,cAAc,CAAC;aAC7B,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE;YACvB,kEAAkE;YAClE,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzC,OAAO,IAAI,CACT,oBAAoB,SAAS,CAAC,KAAK,uCAAuC,CAC3E,CAAC;YACJ,CAAC;iBAAM,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC/C,OAAO,IAAI,CACT,mBAAmB,SAAS,CAAC,IAAI,wCAAwC,CAC1E,CAAC;YACJ,CAAC;YACD,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC,CAAC;aACD,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Common from '../common';\nimport {\n captureResult,\n Collections,\n Converter,\n Converters,\n failWithDetail,\n mapResults,\n Result,\n fail,\n succeed,\n succeedWithDetail,\n ValidatingConvertingCollector\n} from '@fgv/ts-utils';\nimport { IQualifierDecl, IValidatedQualifierDecl } from './qualifierDecl';\nimport { MaxConditionPriority, MinConditionPriority, QualifierName } from '../common';\nimport { Qualifier } from './qualifier';\nimport { IQualifierDeclConvertContext, qualifierDecl, validatedQualifierDecl } from './convert';\nimport {\n LiteralQualifierType,\n QualifierTypeCollector,\n ReadOnlyQualifierTypeCollector\n} from '../qualifier-types';\n\n/**\n * Converter for a single entry in the mixed-shape\n * {@link Qualifiers.IQualifierCollectorCreateParams.qualifiers | qualifiers}\n * input — either a bare axis-name string or a full\n * {@link Qualifiers.IQualifierDecl | declaration}. Validates the entry\n * shape at the public-API boundary rather than deferring to the\n * internal qualifier factory.\n */\nconst _qualifierEntriesConverter: Converter<ReadonlyArray<string | IQualifierDecl>> = Converters.arrayOf(\n Converters.oneOf<string | IQualifierDecl>([Converters.string, qualifierDecl])\n);\n\n/**\n * Readonly version of {@link Qualifiers.QualifierCollector | QualifierCollector}.\n * @public\n */\nexport interface IReadOnlyQualifierCollector extends Collections.IReadOnlyValidatingCollector<Qualifier> {\n /**\n * {@inheritDoc Qualifiers.QualifierCollector.qualifierTypes}\n */\n readonly qualifierTypes: ReadOnlyQualifierTypeCollector;\n\n /**\n * Gets a {@link Qualifiers.Qualifier | qualifier} by name or token.\n * @param nameOrToken - The name or token of the qualifier to retrieve.\n * @returns `Success` with the qualifier if found, or `Failure` if not.\n */\n getByNameOrToken(nameOrToken: string): Result<Qualifier>;\n\n /**\n * Checks if a qualifier with a given name or token is in the collection.\n * @param nameOrToken - The name or token of the qualifier to check.\n * @returns `true` if the qualifier is in the collection, `false` if not.\n */\n hasNameOrToken(nameOrToken: string): boolean;\n}\n\n/**\n * Parameters for creating a new {@link Qualifiers.QualifierCollector}.\n * @public\n *\n * @remarks\n * `qualifiers` accepts a mixed array of bare axis-name strings and full\n * {@link Qualifiers.IQualifierDecl | declarations}. A string element is\n * sugar for \"literal qualifier with this name\"; the library synthesizes a\n * {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType} and a\n * declaration `{ name, typeName: name, defaultPriority: <descending> }`.\n *\n * Synthesized priorities are distributed across the\n * `[MinConditionPriority..MaxConditionPriority]` range adaptively to the\n * array length: `step = max(1, floor((Max - Min) / length))`,\n * `priority = max(Min, Max - index * step)`. Earlier elements get higher\n * priority. The formula never overflows the `ConditionPriority` range\n * regardless of input length; for inputs whose length exceeds the range\n * cardinality (\\>1000 axes), trailing priorities collapse at\n * `MinConditionPriority` — supply explicit priorities in that regime\n * if uniqueness matters.\n *\n * `qualifierTypes` may be omitted only when every element of `qualifiers`\n * is a string. If any element is an {@link Qualifiers.IQualifierDecl},\n * `qualifierTypes` must be supplied and must contain the referenced\n * {@link Qualifiers.IQualifierDecl.typeName | typeNames}.\n */\nexport interface IQualifierCollectorCreateParams {\n /**\n * The {@link QualifierTypes.QualifierTypeCollector | qualifier types} used to\n * create {@link Qualifiers.Qualifier | qualifiers} from {@link Qualifiers.IQualifierDecl | declarations}.\n *\n * Optional only when every entry in `qualifiers` is a bare axis-name string\n * (in which case the library synthesizes a literal qualifier type per name).\n */\n qualifierTypes?: ReadOnlyQualifierTypeCollector;\n\n /**\n * Optional list of {@link Qualifiers.IQualifierDecl | declarations} or bare\n * axis-name strings for the qualifiers to add to the collection on creation.\n *\n * @remarks\n * A string element `'foo'` is sugar for a literal qualifier:\n * `{ name: 'foo', typeName: 'foo', defaultPriority: <descending> }` backed by\n * a synthesized {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType}\n * named `'foo'`.\n */\n qualifiers?: ReadonlyArray<string | IQualifierDecl>;\n}\n\n/**\n * Collects {@link Qualifiers.Qualifier | Qualifiers} from {@link Qualifiers.IQualifierDecl | declarations},\n * with strongly-typed ({@link QualifierName | QualifierName} and {@link QualifierIndex | QualifierIndex}) key\n * and index.\n * @public\n */\nexport class QualifierCollector\n extends ValidatingConvertingCollector<Qualifier, IQualifierDecl>\n implements IReadOnlyQualifierCollector\n{\n /**\n * The {@link QualifierTypes.QualifierTypeCollector | qualifier types} that this collector uses.\n */\n public qualifierTypes: ReadOnlyQualifierTypeCollector;\n\n /**\n * Constructor for a {@link Qualifiers.QualifierCollector | QualifierCollector} object.\n * @param qualifierTypes - The {@link QualifierTypes.ReadOnlyQualifierTypeCollector | qualifier types}\n * used to validate declarations.\n * @param qualifiers - Optional list of fully-resolved {@link Qualifiers.IQualifierDecl | declarations}.\n * @public\n */\n protected constructor(\n qualifierTypes: ReadOnlyQualifierTypeCollector,\n qualifiers?: ReadonlyArray<IQualifierDecl>\n ) {\n super({\n factory: (k, i, v) => this._qualifierFactory(k, i, v),\n converters: new Collections.KeyValueConverters({\n key: Common.Convert.qualifierName,\n value: qualifierDecl\n })\n });\n this.qualifierTypes = qualifierTypes;\n /* c8 ignore next 1 - coverage misses the branch intermittently */\n qualifiers?.forEach((q) => this.validating.add(q.name, q).orThrow());\n }\n\n /**\n * Creates a new {@link Qualifiers.QualifierCollector | QualifierCollector} object.\n * @param params - {@link Qualifiers.IQualifierCollectorCreateParams | Parameters} for creating a new {@link Qualifiers.QualifierCollector | QualifierCollector}.\n * @returns `Success` with the new collector if successful, or `Failure` if not.\n *\n * @remarks\n * Accepts a mixed array of bare axis-name strings and full\n * {@link Qualifiers.IQualifierDecl | declarations}. String elements are sugar\n * for a literal qualifier: the library synthesizes a\n * {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType} named\n * after the string and a declaration `{ name, typeName: name, defaultPriority }`.\n * Synthesized priorities are distributed across the\n * `[MinConditionPriority..MaxConditionPriority]` range adaptively to the\n * input length (`step = max(1, floor((Max - Min) / length))`,\n * `priority = max(Min, Max - index * step)`). Earlier elements get higher\n * priority — matching the \"earlier qualifier wins when multiple match\"\n * mental model — and the formula never overflows the `ConditionPriority`\n * range regardless of input length.\n *\n * `qualifierTypes` may be omitted only when every element of `qualifiers`\n * is a string. If any element is a declaration, `qualifierTypes` is\n * required (and must include the referenced typeNames); the error message\n * names the offending typeName when it is missing.\n */\n public static create(params: IQualifierCollectorCreateParams): Result<QualifierCollector> {\n return QualifierCollector._resolveCreateParams(params).onSuccess(({ qualifierTypes, qualifiers }) => {\n return captureResult(() => new QualifierCollector(qualifierTypes, qualifiers));\n });\n }\n\n /**\n * Resolves the public {@link Qualifiers.IQualifierCollectorCreateParams | create params}\n * into the concrete `(qualifierTypes, qualifiers)` pair the constructor expects.\n *\n * @remarks\n * Validates the mixed-shape `qualifiers` input through\n * {@link Converters.oneOf} (string vs {@link Qualifiers.IQualifierDecl})\n * at the public-API boundary, then partitions into bare-string and decl\n * buckets to drive type synthesis. If any decl is present and\n * `qualifierTypes` is omitted, fails with an error that names the\n * offending typeNames.\n *\n * @internal\n */\n private static _resolveCreateParams(params: IQualifierCollectorCreateParams): Result<{\n qualifierTypes: ReadOnlyQualifierTypeCollector;\n qualifiers?: ReadonlyArray<IQualifierDecl>;\n }> {\n const raw = params.qualifiers;\n if (raw === undefined || raw.length === 0) {\n if (params.qualifierTypes === undefined) {\n return succeed({ qualifierTypes: QualifierCollector._emptyQualifierTypes(), qualifiers: undefined });\n }\n return succeed({ qualifierTypes: params.qualifierTypes, qualifiers: undefined });\n }\n\n return _qualifierEntriesConverter.convert(raw).onSuccess((entries) => {\n const stringNames: string[] = [];\n const declTypeNames: string[] = [];\n for (const entry of entries) {\n if (typeof entry === 'string') {\n stringNames.push(entry);\n } else {\n declTypeNames.push(entry.typeName);\n }\n }\n\n if (declTypeNames.length > 0 && params.qualifierTypes === undefined) {\n const unique = Array.from(new Set(declTypeNames));\n return fail<{\n qualifierTypes: ReadOnlyQualifierTypeCollector;\n qualifiers?: ReadonlyArray<IQualifierDecl>;\n }>(\n `qualifierTypes must be supplied when qualifiers include declarations; ` +\n `missing types for: ${unique.map((n) => `'${n}'`).join(', ')}`\n );\n }\n\n return QualifierCollector._resolveQualifierTypes(params.qualifierTypes, stringNames).onSuccess(\n (qualifierTypes) => {\n const decls = QualifierCollector._normalizeQualifierDecls(entries);\n return succeed({ qualifierTypes, qualifiers: decls });\n }\n );\n });\n }\n\n /**\n * Returns the provided {@link QualifierTypes.ReadOnlyQualifierTypeCollector | qualifier-type collector}\n * (or synthesizes a new one) augmented with synthesized literal qualifier types for the supplied\n * string names that are not already present.\n *\n * @internal\n */\n private static _resolveQualifierTypes(\n provided: ReadOnlyQualifierTypeCollector | undefined,\n stringNames: ReadonlyArray<string>\n ): Result<ReadOnlyQualifierTypeCollector> {\n if (stringNames.length === 0) {\n // No bare names to synthesize. The all-decls case requires `provided` to be defined\n // (else _resolveCreateParams would have failed before calling us); fall back to an\n // empty type collector only as a defensive measure.\n /* c8 ignore next 1 - defensive: unreachable when called from _resolveCreateParams */\n return succeed(provided ?? QualifierCollector._emptyQualifierTypes());\n }\n return mapResults(stringNames.map((name) => LiteralQualifierType.create({ name }))).onSuccess(\n (literalTypes) => {\n return QualifierTypeCollector.create().onSuccess((collector) => {\n const existingAdds: ReadonlyArray<Result<unknown>> =\n provided !== undefined\n ? Array.from(provided.values()).map((existing) => collector.add(existing))\n : [];\n const literalAdds: ReadonlyArray<Result<unknown>> = literalTypes\n .filter((lit) => !collector.has(lit.name))\n .map((lit) => collector.add(lit));\n return mapResults([...existingAdds, ...literalAdds]).onSuccess(() =>\n succeed(collector as ReadOnlyQualifierTypeCollector)\n );\n });\n }\n );\n }\n\n /**\n * Normalizes a mixed `(string | IQualifierDecl)[]` into a fully-resolved\n * `IQualifierDecl[]`, assigning descending default priorities to synthesized\n * decls within the `[MinConditionPriority..MaxConditionPriority]` range.\n *\n * @remarks\n * Step size is adaptive to input length:\n * `step = max(1, floor((Max - Min) / length))`. Each synthesized priority\n * is `max(Min, Max - index * step)` — clamped at the bottom so length\n * extremes (\\>1000 axes) degrade gracefully into a tail of equal-`Min`\n * priorities rather than overflowing the `ConditionPriority` range.\n *\n * @internal\n */\n private static _normalizeQualifierDecls(\n qualifiers: ReadonlyArray<string | IQualifierDecl>\n ): ReadonlyArray<IQualifierDecl> {\n const range = MaxConditionPriority - MinConditionPriority;\n const step = Math.max(1, Math.floor(range / qualifiers.length));\n return qualifiers.map((q, index) => {\n if (typeof q === 'string') {\n const raw = MaxConditionPriority - index * step;\n return {\n name: q,\n typeName: q,\n defaultPriority: Math.max(MinConditionPriority, raw)\n };\n }\n return q;\n });\n }\n\n /**\n * Returns an empty {@link QualifierTypes.ReadOnlyQualifierTypeCollector | qualifier-type collector}\n * used as a placeholder when no qualifiers are supplied and the caller omits\n * `qualifierTypes`.\n *\n * @internal\n */\n private static _emptyQualifierTypes(): ReadOnlyQualifierTypeCollector {\n /* c8 ignore next 1 - QualifierTypeCollector.create() is total for the empty case */\n return QualifierTypeCollector.create().orThrow();\n }\n\n /**\n * {@inheritDoc Qualifiers.IReadOnlyQualifierCollector.getByNameOrToken}\n */\n public getByNameOrToken(nameOrToken: string): Result<Qualifier> {\n return this.validating.get(nameOrToken).onFailure((message) => {\n for (const q of this.values()) {\n if (q.token === nameOrToken) {\n return succeedWithDetail(q, 'success');\n }\n }\n return failWithDetail(`Qualifier token '${nameOrToken}' not found`, 'not-found');\n });\n }\n\n /**\n * {@inheritDoc Qualifiers.IReadOnlyQualifierCollector.hasNameOrToken}\n */\n public hasNameOrToken(nameOrToken: string): boolean {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (this.validating.has(nameOrToken)) {\n return true;\n }\n for (const q of this.values()) {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (q.token === nameOrToken) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets a read-only view of this collector.\n * @returns A read-only view of this collector.\n */\n public toReadOnly(): IReadOnlyQualifierCollector {\n return this;\n }\n\n /**\n * Factory method for creating a {@link Qualifiers.Qualifier | Qualifier} from a {@link Qualifiers.IQualifierDecl | declaration}.\n * @param __key - The key for the qualifier.\n * @param index - The index of the qualifier.\n * @param decl - The {@link Qualifiers.IQualifierDecl | declaration} for the qualifier.\n * @returns `Success` with the new {@link Qualifiers.Qualifier | Qualifier} if successful, or `Failure` if not.\n * @public\n */\n protected _qualifierFactory(__key: QualifierName, index: number, decl: IQualifierDecl): Result<Qualifier> {\n const convertContext: IQualifierDeclConvertContext = {\n qualifierTypes: this.qualifierTypes,\n qualifierIndex: index\n };\n return validatedQualifierDecl\n .convert(decl, convertContext)\n .onSuccess((validated) => {\n /* c8 ignore next 9 - coverage intermittently misses this block */\n if (this.hasNameOrToken(validated.token)) {\n return fail<IValidatedQualifierDecl>(\n `Qualifier token '${validated.token}' is not unique or collides with name`\n );\n } else if (this.hasNameOrToken(validated.name)) {\n return fail<IValidatedQualifierDecl>(\n `Qualifier name '${validated.name}' is not unique or collides with token`\n );\n }\n return succeed(validated);\n })\n .onSuccess(Qualifier.create);\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualifierDecl.js","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierDecl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { ConditionPriority, QualifierContextValue, QualifierIndex, QualifierName } from '../common';\nimport { QualifierType } from '../qualifier-types';\n\n/**\n * Simple declaration for a {@link Qualifiers.Qualifier | Qualifier}.\n * @public\n */\nexport interface IQualifierDecl {\n name: string;\n typeName: string;\n defaultPriority: number;\n token?: string;\n tokenIsOptional?: boolean;\n defaultValue?: string;\n}\n\n/**\n * Validated declaration for a {@link Qualifiers.Qualifier | Qualifier}.\n * @public\n */\nexport interface IValidatedQualifierDecl {\n /**\n * The name of the qualifier.\n */\n name: QualifierName;\n\n /**\n * The token used to identify the qualifier in the name or\n * path of a resource being imported.\n */\n token: QualifierName;\n\n /**\n * The {@link QualifierTypes.QualifierType | type} of the qualifier.\n */\n type: QualifierType;\n\n /**\n * The default {@link ConditionPriority | priority} of conditions\n * that depend on this qualifier.\n */\n defaultPriority: ConditionPriority;\n\n /**\n * Indicates whether the token is optional when parsing a resource token.\n */\n tokenIsOptional: boolean;\n\n /**\n * Optional default value for the qualifier.\n */\n defaultValue?: QualifierContextValue;\n\n /**\n * Index of the qualifier.\n */\n index: QualifierIndex | undefined;\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualifierDefaultValueDecls.js","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierDefaultValueDecls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { QualifierContextValue, QualifierName } from '../common';\nimport { Qualifier } from './qualifier';\n\n/**\n * Non-validated declaration of a single qualifier default value.\n * @public\n */\nexport interface IQualifierDefaultValueDecl {\n qualifier: string;\n value: string;\n}\n\n/**\n * Non-validated declaration of qualifier default values, consisting of named\n * default values.\n * @public\n */\nexport type IQualifierDefaultValuesDecl = Record<string, string>;\n\n/**\n * Validated declaration of a single qualifier default value.\n * @public\n */\nexport interface IValidatedQualifierDefaultValueDecl {\n qualifier: Qualifier;\n value: QualifierContextValue;\n}\n\n/**\n * Validated declaration of qualifier default values, a record with strongly-typed\n * {@link QualifierName | qualifier names} as keys and\n * {@link QualifierContextValue | qualifier context values} as values.\n * @public\n */\nexport type IValidatedQualifierDefaultValuesDecl = Record<QualifierName, QualifierContextValue>;\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualifierDefaultValueToken.js","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierDefaultValueToken.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,UAAU,EAAU,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAwC,MAAM,WAAW,CAAC;AAO3F;;;GAGG;AACH,MA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IAAI,CAAC,GAAG,SAAS,CAAC,IAAI,+CAA+C,CAAC,CAAC;gBAChF,CAAC;gBAED,2DAA2D;gBAC3D,IAAI,YAAY,KAAK,EAAE,EAAE,CAAC;oBACxB,aAAa,CAAC,aAAa,CAAC,GAAG,YAAY,CAAC;gBAC9C,CAAC;YACH,CAAC;YAED,OAAO,OAAO,CAAC,aAAa,CAAC,CAAC;QAChC,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,iCAAiC,CAC7C,IAA0C;QAE1C,MAAM,MAAM,GAAa,EAAE,CAAC;QAE5B,KAAK,MAAM,CAAC,aAAa,EAAE,YAAY,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACjE,mCAAmC;YACnC,MAAM,CAAC,IAAI,CAAC,GAAG,aAAa,IAAI,YAAY,EAAE,CAAC,CAAC;QAClD,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,OAAO,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC;QAED,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAErC,+BAA+B;QAC/B,OAAO,aAAa,CAAC,gCAAgC,CACnD,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACnB,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC5C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;QAC9B,CAAC,CAAC,CACH,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1C,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { mapResults, Result, fail, succeed } from '@fgv/ts-utils';\nimport { Helpers as CommonHelpers, QualifierName, QualifierContextValue } from '../common';\nimport {\n IValidatedQualifierDefaultValueDecl,\n IValidatedQualifierDefaultValuesDecl\n} from './qualifierDefaultValueDecls';\nimport { IReadOnlyQualifierCollector } from './qualifierCollector';\n\n/**\n * Helper class to parse and validate qualifier default value tokens.\n * @public\n */\nexport class QualifierDefaultValueTokens {\n /**\n * The {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} used to validate\n * qualifier names and values.\n */\n public readonly qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Constructs a new {@link Qualifiers.QualifierDefaultValueTokens | QualifierDefaultValueTokens } instance.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n */\n public constructor(qualifiers: IReadOnlyQualifierCollector) {\n this.qualifiers = qualifiers;\n }\n\n /**\n * Parses a {@link QualifierDefaultValueToken | qualifier default value token} string and validates the parts\n * against the qualifiers present in the {@link Qualifiers.QualifierDefaultValueTokens.qualifiers | qualifier collector}.\n * @param token - the token string to parse.\n * @returns `Success` with the {@link Qualifiers.IValidatedQualifierDefaultValueDecl | validated qualifier default value declaration}\n * if successful, `Failure` with an error message if not.\n */\n public parseQualifierDefaultValueToken(token: string): Result<IValidatedQualifierDefaultValueDecl> {\n return QualifierDefaultValueTokens.parseQualifierDefaultValueToken(token, this.qualifiers);\n }\n\n /**\n * Parses a {@link QualifierDefaultValuesToken | qualifier default values token} string and validates the parts\n * against the qualifiers present in the {@link Qualifiers.QualifierDefaultValueTokens.qualifiers | qualifier collector}.\n * @param token - the token string to parse.\n * @returns `Success` with the array of {@link Qualifiers.IValidatedQualifierDefaultValueDecl | validated qualifier default value declarations}\n * if successful, `Failure` with an error message if not.\n */\n public parseQualifierDefaultValuesToken(token: string): Result<IValidatedQualifierDefaultValueDecl[]> {\n return QualifierDefaultValueTokens.parseQualifierDefaultValuesToken(token, this.qualifiers);\n }\n\n /**\n * Validates the {@link Helpers.IQualifierDefaultValueTokenParts | parts} of a {@link QualifierDefaultValueToken | qualifier default value token}.\n * @param parts - the parts to validate\n * @returns `Success` with the validated declaration if successful, `Failure` with an error message if not.\n */\n public validateQualifierDefaultValueTokenParts(\n parts: CommonHelpers.IQualifierDefaultValueTokenParts\n ): Result<IValidatedQualifierDefaultValueDecl> {\n return QualifierDefaultValueTokens.validateQualifierDefaultValueTokenParts(parts, this.qualifiers);\n }\n\n /**\n * Converts a {@link QualifierDefaultValuesToken | qualifier default values token} to a validated qualifier default values declaration.\n * @param token - the qualifier default values token to convert\n * @returns `Success` with the validated qualifier default values declaration if successful, `Failure` with an error message if not.\n */\n public qualifierDefaultValuesTokenToDecl(token: string): Result<IValidatedQualifierDefaultValuesDecl> {\n return QualifierDefaultValueTokens.qualifierDefaultValuesTokenToDecl(token, this.qualifiers);\n }\n\n /**\n * Converts a validated qualifier default values declaration to a {@link QualifierDefaultValuesToken | qualifier default values token}.\n * @param decl - the validated qualifier default values declaration to convert\n * @returns `Success` with the qualifier default values token if successful, `Failure` with an error message if not.\n */\n public declToQualifierDefaultValuesToken(decl: IValidatedQualifierDefaultValuesDecl): Result<string> {\n return QualifierDefaultValueTokens.declToQualifierDefaultValuesToken(decl);\n }\n\n /**\n * Parses a {@link QualifierDefaultValueToken | qualifier default value token} and validates it against the qualifiers\n * present in the supplied {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param token - the token string to parse.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n * @returns `Success` with a {@link Qualifiers.IValidatedQualifierDefaultValueDecl | validated qualifier default value declaration} if successful,\n * `Failure` with an error message if not.\n */\n public static parseQualifierDefaultValueToken(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedQualifierDefaultValueDecl> {\n return CommonHelpers.parseQualifierDefaultValueTokenParts(token).onSuccess((parts) => {\n return QualifierDefaultValueTokens.validateQualifierDefaultValueTokenParts(parts, qualifiers);\n });\n }\n\n /**\n * Parses a {@link QualifierDefaultValuesToken | qualifier default values token} and validates it against the qualifiers\n * present in the supplied {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param token - the token string to parse.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n * @returns `Success` with an array of {@link Qualifiers.IValidatedQualifierDefaultValueDecl | validated qualifier default value declarations}\n * if successful, `Failure` with an error message if not\n */\n public static parseQualifierDefaultValuesToken(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedQualifierDefaultValueDecl[]> {\n return CommonHelpers.parseQualifierDefaultValuesTokenParts(token).onSuccess((parts) => {\n return mapResults(\n parts.map((part) =>\n QualifierDefaultValueTokens.validateQualifierDefaultValueTokenParts(part, qualifiers)\n )\n );\n });\n }\n\n /**\n * Validates the parts of a qualifier default value token against the qualifiers present in the supplied\n * {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param parts - the {@link Helpers.IQualifierDefaultValueTokenParts | qualifier default value token parts} to validate.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} used to\n * validate qualifier names and values.\n * @returns `Success` with a {@link Qualifiers.IValidatedQualifierDefaultValueDecl | validated qualifier default value declaration} if successful,\n * `Failure` with an error message if not.\n */\n public static validateQualifierDefaultValueTokenParts(\n parts: CommonHelpers.IQualifierDefaultValueTokenParts,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedQualifierDefaultValueDecl> {\n return qualifiers.getByNameOrToken(parts.qualifier).onSuccess((qualifier) => {\n // Allow empty values to remove defaults\n if (parts.value === '') {\n return succeed({ qualifier, value: '' as QualifierContextValue });\n }\n\n return qualifier.type\n .validateContextValue(parts.value)\n .onSuccess((value) => {\n return succeed({ qualifier, value });\n })\n .withDetail('failure', 'success');\n });\n }\n\n /**\n * Converts a {@link QualifierDefaultValuesToken | qualifier default values token} to a validated qualifier default values declaration.\n * @param token - the qualifier default values token to convert\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n * @returns `Success` with the validated qualifier default values declaration if successful, `Failure` with an error message if not.\n */\n public static qualifierDefaultValuesTokenToDecl(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedQualifierDefaultValuesDecl> {\n return QualifierDefaultValueTokens.parseQualifierDefaultValuesToken(token, qualifiers).onSuccess(\n (qualifierDefaultValues) => {\n const defaultValues: IValidatedQualifierDefaultValuesDecl = {};\n\n for (const { qualifier, value } of qualifierDefaultValues) {\n const qualifierName = qualifier.name as QualifierName;\n const contextValue = value as QualifierContextValue;\n\n // Check for duplicate qualifiers\n if (qualifierName in defaultValues) {\n return fail(`${qualifier.name}: duplicate qualifier in default values token`);\n }\n\n // Only add non-empty values (empty values remove defaults)\n if (contextValue !== '') {\n defaultValues[qualifierName] = contextValue;\n }\n }\n\n return succeed(defaultValues);\n }\n );\n }\n\n /**\n * Converts a validated qualifier default values declaration to a {@link QualifierDefaultValuesToken | qualifier default values token}.\n * @param decl - the validated qualifier default values declaration to convert\n * @returns `Success` with the qualifier default values token if successful, `Failure` with an error message if not.\n */\n public static declToQualifierDefaultValuesToken(\n decl: IValidatedQualifierDefaultValuesDecl\n ): Result<string> {\n const tokens: string[] = [];\n\n for (const [qualifierName, contextValue] of Object.entries(decl)) {\n // Build token as \"qualifier=value\"\n tokens.push(`${qualifierName}=${contextValue}`);\n }\n\n if (tokens.length === 0) {\n return succeed('');\n }\n\n const tokenString = tokens.join('|');\n\n // Validate the generated token\n return CommonHelpers.buildQualifierDefaultValuesToken(\n tokens.map((token) => {\n const [qualifier, value] = token.split('=');\n return { qualifier, value };\n })\n ).onSuccess(() => succeed(tokenString));\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/packlets/resource-json/compiled/common.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * Options for controlling the compilation of resource objects.\n * @public\n */\nexport interface ICompiledResourceOptions {\n /**\n * Whether to include metadata in the compiled objects.\n * Metadata includes human-readable information like semantic keys\n * that can be useful for debugging or tooling.\n * @defaultValue false\n */\n includeMetadata?: boolean;\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../../src/packlets/resource-json/compiled/convert.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGjE,2CAA2C;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,UAAU,CAAC,YAAY,CAAmC;IACjG,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,YAAY;CACjC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,UAAU,CAAC,YAAY,CAAsC;IACvG,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,eAAe;CACpC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,UAAU,CAAC,YAAY,CAAkC;IAC/F,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,WAAW;CAChC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,UAAU,CAAC,YAAY,CAA+B;IACzF,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,iBAAiB;CACvC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC,YAAY,CAA2B;IACjF,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,aAAa;IAClC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,kBAAkB;IACvC,eAAe,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AO;IAC7B,WAAW,EAAE,MAAM,CAAC,OAAO,CAAC,wBAAwB;CACrD,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC,YAAY,CAA0B;IAC/E,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU;IAC7B,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,iBAAiB;IACtC,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,aAAa;IACtC,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,iBAAiB,CAAC;CAClD,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,UAAU,CAAC,YAAY,CAAoC;IACnG,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,iBAAiB,CAAC;IACjD,cAAc,EAAE,UAAU,CAAC,OAAO,CAAC,qBAAqB,CAAC;IACzD,aAAa,EAAE,UAAU,CAAC,OAAO,CAAC,oBAAoB,CAAC;IACvD,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,iBAAiB,CAAC;IACjD,aAAa,EAAE,UAAU,CAAC,OAAO,CAAC,oBAAoB,CAAC;IACvD,SAAS,EAAE,UAAU,CAAC,OAAO,CAAC,wBAAwB,CAAC;IACvD,eAAe,EAAE,UAAU,CAAC,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC;IAC7D,SAAS,EAAE,UAAU,CAAC,OAAO,CAAC,gBAAgB,CAAC;CAChD,CAAC,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nimport * as Common from '../../common';\nimport { Converters } from '@fgv/ts-utils';\nimport { Converters as JsonConverters } from '@fgv/ts-json-base';\nimport * as Model from './json';\n\n/* eslint-disable @rushstack/typedef-var */\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledConditionMetadata | compiled condition metadata}.\n * @public\n */\nexport const compiledConditionMetadata = Converters.strictObject<Model.ICompiledConditionMetadata>({\n key: Common.Convert.conditionKey\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledConditionSetMetadata | compiled condition set metadata}.\n * @public\n */\nexport const compiledConditionSetMetadata = Converters.strictObject<Model.ICompiledConditionSetMetadata>({\n key: Common.Convert.conditionSetKey\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledDecisionMetadata | compiled decision metadata}.\n * @public\n */\nexport const compiledDecisionMetadata = Converters.strictObject<Model.ICompiledDecisionMetadata>({\n key: Common.Convert.decisionKey\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledQualifierType | compiled qualifier type}.\n * @public\n */\nexport const compiledQualifierType = Converters.strictObject<Model.ICompiledQualifierType>({\n name: Common.Convert.qualifierTypeName\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledQualifier | compiled qualifier}.\n * @public\n */\nexport const compiledQualifier = Converters.strictObject<Model.ICompiledQualifier>({\n name: Common.Convert.qualifierName,\n type: Common.Convert.qualifierTypeIndex,\n defaultPriority: Common.Convert.conditionPriority\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledResourceType | compiled resource type}.\n * @public\n */\nexport const compiledResourceType = Converters.strictObject<Model.ICompiledResourceType>({\n name: Common.Convert.resourceTypeName\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledCondition | compiled condition}.\n * @public\n */\nexport const compiledCondition = Converters.strictObject<Model.ICompiledCondition>({\n qualifierIndex: Common.Convert.qualifierIndex,\n operator: Common.Convert.conditionOperator.optional(),\n value: Converters.string,\n priority: Common.Convert.conditionPriority,\n scoreAsDefault: Common.Convert.qualifierMatchScore.optional(),\n metadata: compiledConditionMetadata.optional()\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledConditionSet | compiled condition set}.\n * @public\n */\nexport const compiledConditionSet = Converters.strictObject<Model.ICompiledConditionSet>({\n conditions: Converters.arrayOf(Common.Convert.conditionIndex),\n metadata: compiledConditionSetMetadata.optional()\n});\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledAbstractDecision | compiled abstract decision}.\n * @public\n */\nexport const compiledAbstractDecision = Converters.strictObject<Model.ICompiledAbstractDecision>({\n conditionSets: Converters.arrayOf(Common.Convert.conditionSetIndex),\n metadata: compiledDecisionMetadata.optional()\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledCandidate | compiled candidate}.\n * @public\n */\nexport const compiledCandidate = Converters.strictObject<Model.ICompiledCandidate>({\n valueIndex: Common.Convert.candidateValueIndex,\n isPartial: Converters.boolean,\n mergeMethod: Common.Convert.resourceValueMergeMethod\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledResource | compiled resource}.\n * @public\n */\nexport const compiledResource = Converters.strictObject<Model.ICompiledResource>({\n id: Common.Convert.resourceId,\n type: Common.Convert.resourceTypeIndex,\n decision: Common.Convert.decisionIndex,\n candidates: Converters.arrayOf(compiledCandidate)\n});\n\n/**\n * Converter for a {@link ResourceJson.Compiled.ICompiledResourceCollection | compiled resource collection}.\n * This combines all the individual converters into a single converter for the entire resource collection.\n * @public\n */\nexport const compiledResourceCollection = Converters.strictObject<Model.ICompiledResourceCollection>({\n qualifiers: Converters.arrayOf(compiledQualifier),\n qualifierTypes: Converters.arrayOf(compiledQualifierType),\n resourceTypes: Converters.arrayOf(compiledResourceType),\n conditions: Converters.arrayOf(compiledCondition),\n conditionSets: Converters.arrayOf(compiledConditionSet),\n decisions: Converters.arrayOf(compiledAbstractDecision),\n candidateValues: Converters.arrayOf(JsonConverters.jsonValue),\n resources: Converters.arrayOf(compiledResource)\n});\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/resource-json/compiled/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Convert from './convert';\n\nexport * from './common';\nexport * from './json';\nexport { Convert };\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.js","sourceRoot":"","sources":["../../../../src/packlets/resource-json/compiled/json.ts"],"names":[],"mappings":"","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nimport * as Common from '../../common';\nimport { JsonValue } from '@fgv/ts-json-base';\n\n/**\n * Metadata for a compiled condition, containing human-readable information.\n * @public\n */\nexport interface ICompiledConditionMetadata {\n /**\n * The semantic key of the condition (e.g., \"language=en-US\").\n */\n key: Common.ConditionKey;\n}\n\n/**\n * Metadata for a compiled condition set, containing human-readable information.\n * @public\n */\nexport interface ICompiledConditionSetMetadata {\n /**\n * The semantic key of the condition set (e.g., \"language=en-US,territory=US\").\n */\n key: Common.ConditionSetKey;\n}\n\n/**\n * Metadata for a compiled decision, containing human-readable information.\n * @public\n */\nexport interface ICompiledDecisionMetadata {\n /**\n * The semantic key of the decision (e.g., \"language=en-US,territory=US OR language=fr,territory=CA\").\n */\n key: Common.DecisionKey;\n}\n\n/**\n * Represents a compiled qualifier type with a name.\n * @public\n */\nexport interface ICompiledQualifierType {\n /**\n * The name of the qualifier type.\n */\n name: Common.QualifierTypeName;\n}\n\n/**\n * Represents a compiled qualifier with a name and type reference.\n * @public\n */\nexport interface ICompiledQualifier {\n /**\n * The name of the qualifier.\n */\n name: Common.QualifierName;\n /**\n * Index reference to the qualifier type.\n */\n type: Common.QualifierTypeIndex;\n\n /**\n * The token used to identify the qualifier in resource names or paths.\n */\n defaultPriority: Common.ConditionPriority;\n}\n\n/**\n * Represents a compiled resource type with a name.\n * @public\n */\nexport interface ICompiledResourceType {\n /**\n * The name of the resource type.\n */\n name: Common.ResourceTypeName;\n}\n\n/**\n * Represents a compiled condition used for resource selection.\n * @public\n */\nexport interface ICompiledCondition {\n /**\n * Index reference to the qualifier being evaluated.\n */\n qualifierIndex: Common.QualifierIndex;\n /**\n * Optional operator to apply in the condition evaluation.\n */\n operator?: Common.ConditionOperator;\n /**\n * The value to compare against when evaluating the condition.\n */\n value: string;\n /**\n * The priority of the condition when multiple conditions match.\n */\n priority: Common.ConditionPriority;\n /**\n * Optional score to use when treating this condition as a default.\n */\n scoreAsDefault?: Common.QualifierMatchScore;\n /**\n * Optional metadata containing human-readable information about this condition.\n */\n metadata?: ICompiledConditionMetadata;\n}\n\n/**\n * Represents a compiled set of conditions that must be satisfied together.\n * @public\n */\nexport interface ICompiledConditionSet {\n /**\n * Array of indices referencing the conditions in this set.\n */\n conditions: ReadonlyArray<Common.ConditionIndex>;\n /**\n * Optional metadata containing human-readable information about this condition set.\n */\n metadata?: ICompiledConditionSetMetadata;\n}\n\n/**\n * Represents a compiled abstract decision with condition sets.\n * @public\n */\nexport interface ICompiledAbstractDecision {\n /**\n * Array of indices referencing the condition sets for this decision.\n */\n conditionSets: ReadonlyArray<Common.ConditionSetIndex>;\n /**\n * Optional metadata containing human-readable information about this decision.\n */\n metadata?: ICompiledDecisionMetadata;\n}\n\n/**\n * Represents a compiled resource candidate with JSON value and merge properties.\n * @public\n */\nexport interface ICompiledCandidate {\n /**\n * The global index of the JSON value of the candidate.\n */\n valueIndex: Common.CandidateValueIndex;\n /**\n * Indicates if this is a partial resource that needs to be merged.\n */\n isPartial: boolean;\n /**\n * The method to use when merging this candidate with others.\n */\n mergeMethod: Common.ResourceValueMergeMethod;\n}\n\n/**\n * Represents a compiled resource with an identifier and associated candidates.\n * @public\n */\nexport interface ICompiledResource {\n /**\n * The unique identifier of the resource.\n */\n id: Common.ResourceId;\n\n /**\n * Index reference to the resource type of this resource.\n */\n type: Common.ResourceTypeIndex;\n\n /**\n * Index reference to the decision that determines when this resource applies.\n */\n decision: Common.DecisionIndex;\n /**\n * Array of candidate values for this resource.\n */\n candidates: ReadonlyArray<ICompiledCandidate>;\n}\n\n/**\n * Represents a complete compiled collection of resources with their associated\n * qualifiers, types, conditions, and decisions.\n * @public\n */\nexport interface ICompiledResourceCollection {\n /**\n * Array of all qualifier types in the collection.\n */\n qualifierTypes: ReadonlyArray<ICompiledQualifierType>;\n /**\n * Array of all qualifiers in the collection.\n */\n qualifiers: ReadonlyArray<ICompiledQualifier>;\n /**\n * Array of all resource types in the collection.\n */\n resourceTypes: ReadonlyArray<ICompiledResourceType>;\n /**\n * Array of all conditions in the collection.\n */\n conditions: ReadonlyArray<ICompiledCondition>;\n /**\n * Array of all condition sets in the collection.\n */\n conditionSets: ReadonlyArray<ICompiledConditionSet>;\n /**\n * Array of all decisions in the collection.\n */\n decisions: ReadonlyArray<ICompiledAbstractDecision>;\n /**\n * Array of all candidate values in the collection.\n */\n candidateValues: ReadonlyArray<JsonValue>;\n /**\n * Array of all resources in the collection.\n */\n resources: ReadonlyArray<ICompiledResource>;\n}\n"]}