@daffodil/product 0.38.9 → 0.39.0

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 (257) hide show
  1. package/bundles/daffodil-product-driver-in-memory.umd.js +77 -160
  2. package/bundles/daffodil-product-driver-in-memory.umd.js.map +1 -1
  3. package/bundles/daffodil-product-driver-in-memory.umd.min.js +1 -1
  4. package/bundles/daffodil-product-driver-in-memory.umd.min.js.map +1 -1
  5. package/bundles/daffodil-product-driver-magento-testing.umd.js +12 -140
  6. package/bundles/daffodil-product-driver-magento-testing.umd.js.map +1 -1
  7. package/bundles/daffodil-product-driver-magento-testing.umd.min.js +1 -1
  8. package/bundles/daffodil-product-driver-magento-testing.umd.min.js.map +1 -1
  9. package/bundles/daffodil-product-driver-magento.umd.js +87 -676
  10. package/bundles/daffodil-product-driver-magento.umd.js.map +1 -1
  11. package/bundles/daffodil-product-driver-magento.umd.min.js +2 -2
  12. package/bundles/daffodil-product-driver-magento.umd.min.js.map +1 -1
  13. package/bundles/daffodil-product-driver-shopify.umd.js +14 -160
  14. package/bundles/daffodil-product-driver-shopify.umd.js.map +1 -1
  15. package/bundles/daffodil-product-driver-shopify.umd.min.js +1 -1
  16. package/bundles/daffodil-product-driver-shopify.umd.min.js.map +1 -1
  17. package/bundles/daffodil-product-driver-testing.umd.js +4 -62
  18. package/bundles/daffodil-product-driver-testing.umd.js.map +1 -1
  19. package/bundles/daffodil-product-driver-testing.umd.min.js +1 -1
  20. package/bundles/daffodil-product-driver-testing.umd.min.js.map +1 -1
  21. package/bundles/daffodil-product-driver.umd.js +12 -64
  22. package/bundles/daffodil-product-driver.umd.js.map +1 -1
  23. package/bundles/daffodil-product-routing.umd.js +4 -112
  24. package/bundles/daffodil-product-routing.umd.js.map +1 -1
  25. package/bundles/daffodil-product-routing.umd.min.js +1 -1
  26. package/bundles/daffodil-product-routing.umd.min.js.map +1 -1
  27. package/bundles/daffodil-product-state-testing.umd.js +15 -240
  28. package/bundles/daffodil-product-state-testing.umd.js.map +1 -1
  29. package/bundles/daffodil-product-state-testing.umd.min.js +1 -1
  30. package/bundles/daffodil-product-state-testing.umd.min.js.map +1 -1
  31. package/bundles/daffodil-product-state.umd.js +347 -2359
  32. package/bundles/daffodil-product-state.umd.js.map +1 -1
  33. package/bundles/daffodil-product-state.umd.min.js +1 -1
  34. package/bundles/daffodil-product-state.umd.min.js.map +1 -1
  35. package/bundles/daffodil-product-testing.umd.js +20 -230
  36. package/bundles/daffodil-product-testing.umd.js.map +1 -1
  37. package/bundles/daffodil-product-testing.umd.min.js +1 -1
  38. package/bundles/daffodil-product-testing.umd.min.js.map +1 -1
  39. package/bundles/daffodil-product.umd.js +21 -209
  40. package/bundles/daffodil-product.umd.js.map +1 -1
  41. package/bundles/daffodil-product.umd.min.js +1 -1
  42. package/bundles/daffodil-product.umd.min.js.map +1 -1
  43. package/driver/in-memory/backend/product.service.d.ts +3 -2
  44. package/driver/in-memory/daffodil-product-driver-in-memory.metadata.json +1 -1
  45. package/driver/in-memory/package.json +1 -1
  46. package/driver/magento/package.json +1 -1
  47. package/driver/magento/testing/package.json +1 -1
  48. package/driver/package.json +1 -1
  49. package/driver/shopify/package.json +1 -1
  50. package/driver/testing/package.json +1 -1
  51. package/esm2015/daffodil-product.js +2 -7
  52. package/esm2015/driver/daffodil-product-driver.js +2 -7
  53. package/esm2015/driver/in-memory/backend/product.service.js +62 -83
  54. package/esm2015/driver/in-memory/daffodil-product-driver-in-memory.js +2 -7
  55. package/esm2015/driver/in-memory/driver/product-driver.module.js +1 -9
  56. package/esm2015/driver/in-memory/driver/product.service.js +11 -53
  57. package/esm2015/driver/in-memory/index.js +2 -7
  58. package/esm2015/driver/in-memory/public_api.js +1 -6
  59. package/esm2015/driver/index.js +2 -7
  60. package/esm2015/driver/interfaces/product-service.interface.js +1 -39
  61. package/esm2015/driver/magento/config/default.js +2 -8
  62. package/esm2015/driver/magento/config/public_api.js +1 -6
  63. package/esm2015/driver/magento/daffodil-product-driver-magento.js +2 -7
  64. package/esm2015/driver/magento/index.js +2 -7
  65. package/esm2015/driver/magento/injection-tokens/fragments/product-preview.token.js +7 -22
  66. package/esm2015/driver/magento/injection-tokens/fragments/product.token.js +5 -20
  67. package/esm2015/driver/magento/injection-tokens/public_api.js +1 -6
  68. package/esm2015/driver/magento/injection-tokens/transforms/product-preview/preview-extra.token.js +6 -21
  69. package/esm2015/driver/magento/injection-tokens/transforms/product-preview/preview.token.js +4 -24
  70. package/esm2015/driver/magento/injection-tokens/transforms/product-response/response-extra.token.js +5 -20
  71. package/esm2015/driver/magento/injection-tokens/transforms/product-response/response.token.js +4 -25
  72. package/esm2015/driver/magento/interfaces/config.interface.js +3 -38
  73. package/esm2015/driver/magento/interfaces/product-preview-extra-transform.type.js +2 -6
  74. package/esm2015/driver/magento/interfaces/product-preview-transform.type.js +2 -6
  75. package/esm2015/driver/magento/interfaces/product-response-extra-transform.type.js +2 -6
  76. package/esm2015/driver/magento/interfaces/product-response-transform.type.js +2 -6
  77. package/esm2015/driver/magento/interfaces/public_api.js +6 -11
  78. package/esm2015/driver/magento/models/bundled-product.js +9 -65
  79. package/esm2015/driver/magento/models/configurable-product.js +2 -72
  80. package/esm2015/driver/magento/models/get-product-response.interface.js +2 -16
  81. package/esm2015/driver/magento/models/magento-product.js +7 -38
  82. package/esm2015/driver/magento/models/product-preview.interface.js +6 -40
  83. package/esm2015/driver/magento/models/public_api.js +4 -9
  84. package/esm2015/driver/magento/models/simple-product.js +2 -18
  85. package/esm2015/driver/magento/product-driver.module.js +3 -12
  86. package/esm2015/driver/magento/product.service.js +7 -78
  87. package/esm2015/driver/magento/public_api.js +7 -12
  88. package/esm2015/driver/magento/queries/fragments/bundled-product.js +2 -8
  89. package/esm2015/driver/magento/queries/fragments/configurable-product.js +1 -7
  90. package/esm2015/driver/magento/queries/fragments/product-preview.js +1 -7
  91. package/esm2015/driver/magento/queries/fragments/product.js +1 -7
  92. package/esm2015/driver/magento/queries/fragments/simple-product.js +1 -7
  93. package/esm2015/driver/magento/queries/get-all-products.js +3 -14
  94. package/esm2015/driver/magento/queries/get-product-by-url.js +3 -14
  95. package/esm2015/driver/magento/queries/get-product.js +3 -14
  96. package/esm2015/driver/magento/queries/public_api.js +4 -9
  97. package/esm2015/driver/magento/testing/daffodil-product-driver-magento-testing.js +2 -7
  98. package/esm2015/driver/magento/testing/factories/bundle/bundle.factory.js +4 -15
  99. package/esm2015/driver/magento/testing/factories/configurable/configurable.factory.js +3 -46
  100. package/esm2015/driver/magento/testing/factories/core/product-preview.factory.js +2 -29
  101. package/esm2015/driver/magento/testing/factories/core/product.factory.js +3 -46
  102. package/esm2015/driver/magento/testing/factories/public_api.js +6 -11
  103. package/esm2015/driver/magento/testing/factories/simple/simple.factory.js +3 -12
  104. package/esm2015/driver/magento/testing/index.js +2 -7
  105. package/esm2015/driver/magento/testing/public_api.js +2 -7
  106. package/esm2015/driver/magento/transforms/bundled-product-transformers.js +4 -25
  107. package/esm2015/driver/magento/transforms/configurable-product-transformers.js +4 -38
  108. package/esm2015/driver/magento/transforms/product-preview.js +5 -35
  109. package/esm2015/driver/magento/transforms/product-response.js +2 -23
  110. package/esm2015/driver/magento/transforms/product-transformers.js +5 -32
  111. package/esm2015/driver/magento/transforms/public_api.js +7 -12
  112. package/esm2015/driver/magento/transforms/simple-product-transformers.js +3 -31
  113. package/esm2015/driver/magento/transforms/truncate-url.js +2 -12
  114. package/esm2015/driver/models/public_api.js +2 -6
  115. package/esm2015/driver/models/response.interface.js +2 -28
  116. package/esm2015/driver/public_api.js +2 -7
  117. package/esm2015/driver/shopify/daffodil-product-driver-shopify.js +2 -7
  118. package/esm2015/driver/shopify/index.js +2 -7
  119. package/esm2015/driver/shopify/product-driver.module.js +2 -10
  120. package/esm2015/driver/shopify/product.service.js +12 -132
  121. package/esm2015/driver/shopify/public_api.js +1 -6
  122. package/esm2015/driver/testing/daffodil-product-driver-testing.js +2 -7
  123. package/esm2015/driver/testing/drivers/product-driver.module.js +2 -10
  124. package/esm2015/driver/testing/drivers/product.service.js +3 -39
  125. package/esm2015/driver/testing/index.js +2 -7
  126. package/esm2015/driver/testing/public_api.js +1 -6
  127. package/esm2015/helpers.js +7 -22
  128. package/esm2015/index.js +2 -7
  129. package/esm2015/injection-tokens/error-matcher.token.js +3 -12
  130. package/esm2015/injection-tokens/public_api.js +1 -6
  131. package/esm2015/models/composite-configuration-item.js +2 -25
  132. package/esm2015/models/composite-product-item.js +8 -62
  133. package/esm2015/models/composite-product.js +2 -25
  134. package/esm2015/models/configurable-product.js +2 -125
  135. package/esm2015/models/prices.js +2 -45
  136. package/esm2015/models/product-image.js +2 -18
  137. package/esm2015/models/product.js +8 -105
  138. package/esm2015/public_api.js +10 -15
  139. package/esm2015/routing/daffodil-product-routing.js +2 -7
  140. package/esm2015/routing/index.js +2 -7
  141. package/esm2015/routing/public_api.js +2 -7
  142. package/esm2015/routing/resolvers/product-page/product-page.resolver.js +2 -21
  143. package/esm2015/routing/resolvers/product-page-id/product-page-id.resolver.js +2 -33
  144. package/esm2015/routing/resolvers/product-page-url/product-page-url.resolver.js +2 -40
  145. package/esm2015/routing/resolvers/public_api.js +1 -6
  146. package/esm2015/state/actions/best-sellers.actions.js +9 -39
  147. package/esm2015/state/actions/composite-product.actions.js +9 -29
  148. package/esm2015/state/actions/configurable-product.actions.js +8 -56
  149. package/esm2015/state/actions/product-grid.actions.js +9 -39
  150. package/esm2015/state/actions/product-page.actions.js +10 -60
  151. package/esm2015/state/actions/product.actions.js +8 -39
  152. package/esm2015/state/actions/public_api.js +7 -12
  153. package/esm2015/state/daffodil-product-state.js +2 -7
  154. package/esm2015/state/effects/best-seller.effects.js +4 -52
  155. package/esm2015/state/effects/product-grid.effects.js +4 -52
  156. package/esm2015/state/effects/product-page.effects.js +6 -68
  157. package/esm2015/state/effects/product.effects.js +4 -52
  158. package/esm2015/state/effects/public_api.js +1 -6
  159. package/esm2015/state/facades/best-sellers/best-sellers.facade.js +4 -31
  160. package/esm2015/state/facades/composite-product/composite-product-facade.interface.js +2 -86
  161. package/esm2015/state/facades/composite-product/composite-product.facade.js +4 -61
  162. package/esm2015/state/facades/configurable-product/configurable-product-facade.interface.js +2 -108
  163. package/esm2015/state/facades/configurable-product/configurable-product.facade.js +4 -78
  164. package/esm2015/state/facades/product/product-facade.interface.js +2 -70
  165. package/esm2015/state/facades/product/product.facade.js +3 -58
  166. package/esm2015/state/facades/product-grid/product-grid-facade.interface.js +2 -23
  167. package/esm2015/state/facades/product-grid/product-grid.facade.js +3 -27
  168. package/esm2015/state/facades/product-page/facade.interface.js +2 -24
  169. package/esm2015/state/facades/product-page/facade.js +3 -32
  170. package/esm2015/state/facades/public_api.js +1 -6
  171. package/esm2015/state/index.js +2 -7
  172. package/esm2015/state/product-state.module.js +1 -6
  173. package/esm2015/state/public_api.js +6 -11
  174. package/esm2015/state/reducers/best-sellers/best-sellers-reducer-state.interface.js +2 -28
  175. package/esm2015/state/reducers/best-sellers/best-sellers.reducer.js +3 -24
  176. package/esm2015/state/reducers/composite-product-entities/composite-product-entities-reducer-adapter.js +5 -18
  177. package/esm2015/state/reducers/composite-product-entities/composite-product-entities.reducer.js +12 -46
  178. package/esm2015/state/reducers/composite-product-entities/composite-product-entity.js +2 -25
  179. package/esm2015/state/reducers/configurable-product-entities/configurable-product-entities-reducer-adapter.js +4 -17
  180. package/esm2015/state/reducers/configurable-product-entities/configurable-product-entities.reducer.js +11 -67
  181. package/esm2015/state/reducers/configurable-product-entities/configurable-product-entity.js +2 -40
  182. package/esm2015/state/reducers/injection-tokens/config.token.js +4 -13
  183. package/esm2015/state/reducers/injection-tokens/meta.token.js +5 -21
  184. package/esm2015/state/reducers/injection-tokens/public_api.js +1 -6
  185. package/esm2015/state/reducers/product/product-reducer-state.interface.js +2 -33
  186. package/esm2015/state/reducers/product/product.reducer.js +4 -11
  187. package/esm2015/state/reducers/product-entities/product-entities-reducer-adapter.js +4 -18
  188. package/esm2015/state/reducers/product-entities/product-entities.reducer.js +4 -11
  189. package/esm2015/state/reducers/product-grid/product-grid-reducer-state.interface.js +2 -29
  190. package/esm2015/state/reducers/product-grid/product-grid.reducer.js +4 -11
  191. package/esm2015/state/reducers/product-reducers-state.interface.js +1 -35
  192. package/esm2015/state/reducers/product-reducers.js +1 -7
  193. package/esm2015/state/reducers/product-store-feature-key.js +1 -7
  194. package/esm2015/state/reducers/public_api.js +3 -8
  195. package/esm2015/state/selectors/all-selectors.selectors.js +3 -19
  196. package/esm2015/state/selectors/best-sellers/best-sellers.selectors.js +12 -84
  197. package/esm2015/state/selectors/composite-product/composite-product.selectors.js +48 -254
  198. package/esm2015/state/selectors/composite-product-entities/composite-product-entities.selectors.js +16 -122
  199. package/esm2015/state/selectors/configurable-product/configurable-product.selectors.js +41 -387
  200. package/esm2015/state/selectors/configurable-product-entities/configurable-product-entities.selectors.js +12 -106
  201. package/esm2015/state/selectors/product/product.selectors.js +12 -80
  202. package/esm2015/state/selectors/product-entities/product-entities.selectors.js +16 -191
  203. package/esm2015/state/selectors/product-feature.selector.js +5 -29
  204. package/esm2015/state/selectors/product-grid/product-grid.selectors.js +10 -57
  205. package/esm2015/state/selectors/public_api.js +11 -16
  206. package/esm2015/state/testing/daffodil-product-state-testing.js +2 -7
  207. package/esm2015/state/testing/index.js +2 -7
  208. package/esm2015/state/testing/mock-best-sellers.facade.js +3 -18
  209. package/esm2015/state/testing/mock-composite-product-facade.js +4 -52
  210. package/esm2015/state/testing/mock-configurable-product-facade.js +4 -65
  211. package/esm2015/state/testing/mock-product-facade.js +3 -53
  212. package/esm2015/state/testing/mock-product-grid-facade.js +3 -19
  213. package/esm2015/state/testing/mock-product-page-facade.js +3 -19
  214. package/esm2015/state/testing/product-testing.module.js +1 -6
  215. package/esm2015/state/testing/public_api.js +1 -6
  216. package/esm2015/testing/daffodil-product-testing.js +2 -7
  217. package/esm2015/testing/factories/composite-product.factory.js +3 -14
  218. package/esm2015/testing/factories/configurable-product.factory.js +2 -45
  219. package/esm2015/testing/factories/default-product.factory.js +2 -53
  220. package/esm2015/testing/factories/extension.factory.js +3 -30
  221. package/esm2015/testing/factories/kind.factory.js +2 -23
  222. package/esm2015/testing/factories/product-image.factory.js +2 -16
  223. package/esm2015/testing/factories/public_api.js +7 -12
  224. package/esm2015/testing/helpers.js +2 -8
  225. package/esm2015/testing/index.js +2 -7
  226. package/esm2015/testing/injection-tokens/factories/extra.token.js +6 -22
  227. package/esm2015/testing/injection-tokens/factories/type.token.js +5 -21
  228. package/esm2015/testing/injection-tokens/public_api.js +1 -6
  229. package/esm2015/testing/public_api.js +4 -9
  230. package/esm2015/testing/testing.module.js +1 -6
  231. package/fesm2015/daffodil-product-driver-in-memory.js +73 -158
  232. package/fesm2015/daffodil-product-driver-in-memory.js.map +1 -1
  233. package/fesm2015/daffodil-product-driver-magento-testing.js +12 -165
  234. package/fesm2015/daffodil-product-driver-magento-testing.js.map +1 -1
  235. package/fesm2015/daffodil-product-driver-magento.js +81 -801
  236. package/fesm2015/daffodil-product-driver-magento.js.map +1 -1
  237. package/fesm2015/daffodil-product-driver-shopify.js +14 -156
  238. package/fesm2015/daffodil-product-driver-shopify.js.map +1 -1
  239. package/fesm2015/daffodil-product-driver-testing.js +5 -63
  240. package/fesm2015/daffodil-product-driver-testing.js.map +1 -1
  241. package/fesm2015/daffodil-product-driver.js +1 -59
  242. package/fesm2015/daffodil-product-driver.js.map +1 -1
  243. package/fesm2015/daffodil-product-routing.js +5 -113
  244. package/fesm2015/daffodil-product-routing.js.map +1 -1
  245. package/fesm2015/daffodil-product-state-testing.js +16 -241
  246. package/fesm2015/daffodil-product-state-testing.js.map +1 -1
  247. package/fesm2015/daffodil-product-state.js +294 -2412
  248. package/fesm2015/daffodil-product-state.js.map +1 -1
  249. package/fesm2015/daffodil-product-testing.js +20 -256
  250. package/fesm2015/daffodil-product-testing.js.map +1 -1
  251. package/fesm2015/daffodil-product.js +23 -454
  252. package/fesm2015/daffodil-product.js.map +1 -1
  253. package/package.json +3 -3
  254. package/routing/package.json +1 -1
  255. package/state/package.json +1 -1
  256. package/state/testing/package.json +1 -1
  257. package/testing/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../node_modules/tslib/tslib.es6.js","../../../libs/product/testing/src/factories/default-product.factory.ts","../../../libs/product/testing/src/factories/composite-product.factory.ts","../../../libs/product/testing/src/factories/configurable-product.factory.ts","../../../libs/product/testing/src/factories/product-image.factory.ts","../../../libs/product/testing/src/injection-tokens/factories/type.token.ts","../../../libs/product/testing/src/injection-tokens/factories/extra.token.ts","../../../libs/product/testing/src/factories/kind.factory.ts","../../../libs/product/testing/src/factories/extension.factory.ts","../../../libs/product/testing/src/testing.module.ts","../../../libs/product/testing/src/helpers.ts"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","__read","o","n","m","Symbol","iterator","r","e","i","ar","next","done","push","value","error","__spread","arguments","length","concat","stubPrice","faker.datatype","number","min","max","stubDiscount","type","DaffProductTypeEnum","Simple","id","uuid","url","faker.random","word","canonicalUrl","faker.internet","price","in_stock","discount","amount","percent","Math","floor","images","thumbnail","name","faker.commerce","productName","brand","faker.company","companyName","description","short_description","meta_title","meta_description","related","upsell","DaffDefaultProductFactory","_super","MockProduct","DaffModelFactory","Injectable","args","providedIn","MockCompositeProduct","_this","apply","Composite","items","required","boolean","title","input_type","DaffCompositeProductItemInputEnum","select","options","productMaterial","quantity","is_default","DaffCompositeProductFactory","MockConfigurableProduct","stubPriceVariant1","stubDiscountVariant1","stubPriceVariant2","stubDiscountVariant2","stubPriceVariant3","stubDiscountVariant3","Configurable","configurableAttributes","code","label","order","values","swatch","variants","appliedAttributes","color","size","material","DaffConfigurableProductFactory","productImageUrlsList","faker.lorem","sentence","DaffProductImageFactory","MockProductImage","DAFF_PRODUCT_TYPE_FACTORIES","InjectionToken","factory","DAFF_PRODUCT_EXTRA_FACTORIES","DaffProductKindFactory","productTypeFactories","defineProperty","sample","partial","_randomFactory","Inject","DaffProductExtensionFactory","extraFactories","productKindFactory","assign","map","NgModule","providers","provide","useExisting","multi","factoryTypes","_i","factoryType","product"],"mappings":";;;;;;;;;;;;;;oFAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOC,OAAOK,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,MAC3EN,EAAGC,aAGZS,EAAUV,EAAGC,GACzB,GAAiB,mBAANA,GAA0B,OAANA,EAC3B,MAAM,IAAIU,UAAU,uBAAyBC,OAAOX,GAAK,iCAE7D,SAASY,IAAOC,KAAKC,YAAcf,EADnCD,EAAcC,EAAGC,GAEjBD,EAAEO,UAAkB,OAANN,EAAaC,OAAOc,OAAOf,IAAMY,EAAGN,UAAYN,EAAEM,UAAW,IAAIM,GA+EtDX,OAAOc,gBAwBpBC,EAAOC,EAAGC,GACtB,IAAIC,EAAsB,mBAAXC,QAAyBH,EAAEG,OAAOC,UACjD,IAAKF,EAAG,OAAOF,EACf,IAAmBK,EAAYC,EAA3BC,EAAIL,EAAEX,KAAKS,GAAOQ,EAAK,GAC3B,IACI,WAAc,IAANP,GAAgBA,KAAM,MAAQI,EAAIE,EAAEE,QAAQC,MAAMF,EAAGG,KAAKN,EAAEO,OAExE,MAAOC,GAASP,EAAI,CAAEO,MAAOA,WAEzB,IACQR,IAAMA,EAAEK,OAASR,EAAIK,EAAU,SAAIL,EAAEX,KAAKgB,WAExC,GAAID,EAAG,MAAMA,EAAEO,OAE7B,OAAOL,WAIKM,IACZ,IAAK,IAAIN,EAAK,GAAID,EAAI,EAAGA,EAAIQ,UAAUC,OAAQT,IAC3CC,EAAKA,EAAGS,OAAOlB,EAAOgB,UAAUR,KACpC,OAAOC,EAyDcxB,OAAOc,aCrMhC,WAC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AAK,KAAM6D,IAAY7D,YAH4BmE,EAAAoD,eAAAA,EACtCpD,EAAAqD,mBAAAA,WAHqC5H,EAAA0H,EAAA1D,GAa/C0D,EAAA7H,UAAAS,OAAA,SAAOiH,GACL,YADK,IAAAA,IAAAA,EAAA,IACE/H,OAAOqI,OAAMrD,MAAbhF,OAAM8B,EAAA,CACX,IACGlB,KAAKuH,eAAeG,KAAG,SAACb,GAAW,OAAAA,EAAQ3G,OAAOiH,MAAS,CAE9DnH,KAAKwH,mBAAmBtH,OAAOiH,UAlBYrD,EAAAA,sCAHhDC,EAAAA,WAAUC,KAAA,CAAC,CACVC,WAAY,4EAIToD,EAAAA,OAAMrD,KAAA,CAAC8C,YAXHC,mICOT,iCATCY,EAAAA,SAAQ3D,KAAA,CAAC,CACR4D,UAAW,CACT,CACEC,QAASlB,EACTmB,YAAanE,EACboE,OAAO,ocJoB4E,IAAAC,EAAA,GAAAC,EAAA,EAAAA,EAAA9G,UAAAC,OAAA6G,IAAAD,EAAAC,GAAA9G,UAAA8G,GACvF,OAAOD,EAAaN,KAAG,SAACQ,GAAe,MAAA,CACrCL,QAASlB,EACTmB,YAAaI,EACbH,OAAO,gECFkF,IAAAC,EAAA,GAAAC,EAAA,EAAAA,EAAA9G,UAAAC,OAAA6G,IAAAD,EAAAC,GAAA9G,UAAA8G,GAC3F,OAAOD,EAAaN,KAAG,SAACQ,GAAe,MAAA,CACrCL,QAASf,EACTgB,YAAaI,EACbH,OAAO,4BIhCeI,GACxB,SAASA,EAAQpG,IACVoG,EAAQ7F,OACR6F,EAAQpF,MACRoF,EAAQjF,OACRiF,EAAQ9E,aACR8E,EAAQtF","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || from);\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","import { Injectable } from '@angular/core';\nimport * as faker from 'faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n DaffProduct,\n DaffProductTypeEnum,\n} from '@daffodil/product';\n\n/**\n * Mocked DaffProduct object.\n */\nexport class MockProduct implements DaffProduct {\n\tprivate stubPrice = faker.datatype.number({ min: 1, max: 1500 });\n\tprivate stubDiscount = faker.datatype.number({ min: 0, max: this.stubPrice - 1 });\n\n\ttype = DaffProductTypeEnum.Simple;\n\tid = faker.datatype.uuid();\n\turl = `/${faker.random.word()}.html`;\n\tcanonicalUrl = faker.internet.url();\n\tprice = this.stubPrice;\n\tin_stock = true;\n\tdiscount = {\n\t amount: this.stubDiscount,\n\t percent: Math.floor((this.stubDiscount/this.stubPrice) * 100),\n\t};\n\timages = [];\n thumbnail = null;\n name = faker.commerce.productName();\n brand = faker.company.companyName();\n description = 'Lorem ipsum dolor sit amet, accumsan ullamcorper ei eam. Sint appetere ocurreret no per, et cum lorem disputationi. Sit ut magna delenit, assum vidisse vocibus sed ut. In aperiri malorum accusamus sea, novum mediocritatem ius at. Duo agam probo honestatis ut. Nec regione splendide cu, unum graeco vivendum in duo.';\n short_description = 'Lorem ipsum dolor sit amet, accumsan ullamcorper ei eam. Sint appetere ocurreret no per, et cum lorem disputationi. Sit ut magna delenit, assum vidisse vocibus sed ut. In aperiri malorum accusamus sea, novum mediocritatem ius at. Duo agam probo honestatis ut.';\n meta_title = faker.commerce.productName();\n meta_description = 'Lorem ipsum dolor sit amet, accumsan ullamcorper ei eam. Sint appetere ocurreret no per, et cum lorem disputationi. Sit ut magna delenit, assum vidisse vocibus sed ut. In aperiri malorum accusamus sea, novum mediocritatem ius at. Duo agam probo honestatis ut. Nec regione splendide cu, unum graeco vivendum in duo.';\n related = [];\n upsell = [];\n}\n\n/**\n * Factory for creating simple `DaffProduct`s of no special kind.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffDefaultProductFactory extends DaffModelFactory<DaffProduct> {\n constructor() {\n super(MockProduct);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from 'faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n DaffCompositeProduct,\n DaffProductTypeEnum,\n DaffCompositeProductItemInputEnum,\n} from '@daffodil/product';\n\nimport { MockProduct } from './default-product.factory';\n\n/**\n * Mocked DaffCompositeProduct object.\n *\n * @deprecated import from @daffodil/composite-product/testing instead.\n */\nexport class MockCompositeProduct extends MockProduct implements DaffCompositeProduct {\n\ttype = DaffProductTypeEnum.Composite;\n\titems = [\n\t {\n\t id: faker.datatype.uuid(),\n\t url: `/${faker.random.word()}.html`,\n\t required: faker.datatype.boolean(),\n\t title: faker.commerce.productName(),\n\t input_type: DaffCompositeProductItemInputEnum.select,\n\t options: [\n\t {\n\t id: faker.datatype.uuid(),\n\t type: DaffProductTypeEnum.Simple,\n\t url: `/${faker.random.word()}.html`,\n\t name: faker.commerce.productMaterial(),\n\t price: faker.datatype.number({ min: 1, max: 100 }),\n\t images: [],\n\t thumbnail: null,\n\t discount: {\n\t amount: 0,\n\t percent: 0,\n\t },\n\t quantity: faker.datatype.number({ min: 1, max: 9 }),\n\t is_default: true,\n\t in_stock: true,\n\t related: [],\n\t upsell: [],\n\t },\n\t {\n\t id: faker.datatype.uuid(),\n\t type: DaffProductTypeEnum.Simple,\n\t url: `/${faker.random.word()}.html`,\n\t name: faker.commerce.productMaterial(),\n\t price: faker.datatype.number({ min: 1, max: 100 }),\n\t images: [],\n\t thumbnail: null,\n\t discount: {\n\t amount: 0,\n\t percent: 0,\n\t },\n\t quantity: faker.datatype.number({ min: 1, max: 9 }),\n\t is_default: false,\n\t in_stock: true,\n\t related: [],\n\t upsell: [],\n\t },\n\t ],\n\t },\n\t {\n\t id: faker.datatype.uuid(),\n\t url: `/${faker.random.word()}.html`,\n\t required: faker.datatype.boolean(),\n\t title: faker.commerce.productName(),\n\t input_type: DaffCompositeProductItemInputEnum.select,\n\t options: [\n\t {\n\t id: faker.datatype.uuid(),\n\t type: DaffProductTypeEnum.Simple,\n\t url: `/${faker.random.word()}.html`,\n\t name: faker.commerce.productMaterial(),\n\t price: faker.datatype.number({ min: 1, max: 100 }),\n\t images: [],\n\t thumbnail: null,\n\t discount: {\n\t amount: 0,\n\t percent: 0,\n\t },\n\t quantity: faker.datatype.number({ min: 1, max: 9 }),\n\t is_default: true,\n\t in_stock: true,\n\t related: [],\n\t upsell: [],\n\t },\n\t {\n\t id: faker.datatype.uuid(),\n\t type: DaffProductTypeEnum.Simple,\n\t url: `/${faker.random.word()}.html`,\n\t name: faker.commerce.productMaterial(),\n\t price: faker.datatype.number({ min: 1, max: 100 }),\n\t images: [],\n\t thumbnail: null,\n\t discount: {\n\t amount: 0,\n\t percent: 0,\n\t },\n\t quantity: faker.datatype.number({ min: 1, max: 9 }),\n\t is_default: false,\n\t in_stock: true,\n\t related: [],\n\t upsell: [],\n\t },\n\t ],\n\t },\n\t];\n}\n\n/**\n * Factory for creating DaffCompositeProducts.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCompositeProductFactory extends DaffModelFactory<DaffCompositeProduct>{\n constructor(){\n super(MockCompositeProduct);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from 'faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n DaffConfigurableProduct,\n DaffProductTypeEnum,\n} from '@daffodil/product';\n\nimport { MockProduct } from './default-product.factory';\n\n/**\n * Mocked DaffConfigurableProduct object.\n */\nexport class MockConfigurableProduct extends MockProduct implements DaffConfigurableProduct {\n\tprivate stubPriceVariant1 = faker.datatype.number({ min: 1, max: 1500 });\n\tprivate stubDiscountVariant1 = faker.datatype.number({ min: 0, max: this.stubPriceVariant1 - 1 });\n\tprivate stubPriceVariant2 = faker.datatype.number({ min: 1, max: 1500 });\n\tprivate stubDiscountVariant2 = faker.datatype.number({ min: 0, max: this.stubPriceVariant2 - 1 });\n\tprivate stubPriceVariant3 = faker.datatype.number({ min: 1, max: 1500 });\n\tprivate stubDiscountVariant3 = faker.datatype.number({ min: 0, max: this.stubPriceVariant3 - 1 });\n\n\ttype = DaffProductTypeEnum.Configurable;\n\tconfigurableAttributes = [\n\t {\n\t code: 'color',\n\t label: 'Color',\n\t order: 0,\n\t values: [\n\t {\n\t value: '0',\n\t label: 'Blue',\n\t swatch: {\n\t value: '#0000FF',\n\t thumbnail: null,\n\t },\n\t },\n\t {\n\t value: '1',\n\t label: 'Yellow',\n\t swatch: {\n\t value: '#FFFF00',\n\t thumbnail: null,\n\t },\n\t },\n\t {\n\t value: '2',\n\t label: 'Red',\n\t swatch: {\n\t value: '#FF0000',\n\t thumbnail: null,\n\t },\n\t },\n\t ],\n\t },\n\t {\n\t code: 'size',\n\t label: 'Size',\n\t order: 1,\n\t values: [\n\t {\n\t value: '0',\n\t label: 'Small',\n\t swatch: null,\n\t },\n\t {\n\t value: '1',\n\t label: 'Medium',\n\t swatch: null,\n\t },\n\t {\n\t value: '2',\n\t label: 'Large',\n\t swatch: null,\n\t },\n\t ],\n\t },\n\t {\n\t code: 'material',\n\t label: 'Material',\n\t order: 2,\n\t values: [\n\t {\n\t value: '0',\n\t label: 'Cotton',\n\t swatch: null,\n\t },\n\t {\n\t value: '1',\n\t label: 'Polyester',\n\t swatch: null,\n\t },\n\t {\n\t value: '2',\n\t label: 'Spandex',\n\t swatch: null,\n\t },\n\t ],\n\t },\n\t];\n\tvariants = [\n\t {\n\t appliedAttributes: {\n\t color: '0',\n\t size: '0',\n\t material: '0',\n\t },\n\t price: this.stubPriceVariant1,\n\t discount: {\n\t amount: this.stubDiscountVariant1,\n\t percent: Math.floor((this.stubDiscountVariant1/this.stubPriceVariant1) * 100),\n\t },\n\t id: faker.datatype.uuid(),\n\t in_stock: true,\n\t },\n\t {\n\t appliedAttributes: {\n\t color: '0',\n\t size: '1',\n\t material: '0',\n\t },\n\t price: this.stubPriceVariant1,\n\t discount: {\n\t amount: this.stubDiscountVariant1,\n\t percent: Math.floor((this.stubDiscountVariant1/this.stubPriceVariant1) * 100),\n\t },\n\t id: faker.datatype.uuid(),\n\t in_stock: true,\n\t },\n\t {\n\t appliedAttributes: {\n\t color: '0',\n\t size: '1',\n\t material: '2',\n\t },\n\t price: this.stubPriceVariant3,\n\t discount: {\n\t amount: this.stubDiscountVariant3,\n\t percent: Math.floor((this.stubDiscountVariant3/this.stubPriceVariant3) * 100),\n\t },\n\t id: faker.datatype.uuid(),\n\t in_stock: true,\n\t },\n\t {\n\t appliedAttributes: {\n\t color: '0',\n\t size: '2',\n\t material: '0',\n\t },\n\t price: this.stubPriceVariant1,\n\t discount: {\n\t amount: this.stubDiscountVariant1,\n\t percent: Math.floor((this.stubDiscountVariant1/this.stubPriceVariant1) * 100),\n\t },\n\t id: faker.datatype.uuid(),\n\t in_stock: true,\n\t },\n\t {\n\t appliedAttributes: {\n\t color: '1',\n\t size: '0',\n\t material: '0',\n\t },\n\t price: this.stubPriceVariant1,\n\t discount: {\n\t amount: this.stubDiscountVariant1,\n\t percent: Math.floor((this.stubDiscountVariant1/this.stubPriceVariant1) * 100),\n\t },\n\t id: faker.datatype.uuid(),\n\t in_stock: true,\n\t },\n\t {\n\t appliedAttributes: {\n\t color: '1',\n\t size: '0',\n\t material: '2',\n\t },\n\t price: this.stubPriceVariant3,\n\t discount: {\n\t amount: this.stubDiscountVariant3,\n\t percent: Math.floor((this.stubDiscountVariant3/this.stubPriceVariant3) * 100),\n\t },\n\t id: faker.datatype.uuid(),\n\t in_stock: true,\n\t },\n\t {\n\t appliedAttributes: {\n\t color: '1',\n\t size: '2',\n\t material: '0',\n\t },\n\t price: this.stubPriceVariant1,\n\t discount: {\n\t amount: this.stubDiscountVariant1,\n\t percent: Math.floor((this.stubDiscountVariant1/this.stubPriceVariant1) * 100),\n\t },\n\t id: faker.datatype.uuid(),\n\t in_stock: true,\n\t },\n\t {\n\t appliedAttributes: {\n\t color: '1',\n\t size: '2',\n\t material: '1',\n\t },\n\t price: this.stubPriceVariant2,\n\t discount: {\n\t amount: this.stubDiscountVariant2,\n\t percent: Math.floor((this.stubDiscountVariant2/this.stubPriceVariant2) * 100),\n\t },\n\t id: faker.datatype.uuid(),\n\t in_stock: true,\n\t },\n\t {\n\t appliedAttributes: {\n\t color: '2',\n\t size: '0',\n\t material: '0',\n\t },\n\t price: this.stubPriceVariant3,\n\t discount: {\n\t amount: this.stubDiscountVariant3,\n\t percent: Math.floor((this.stubDiscountVariant3/this.stubPriceVariant3) * 100),\n\t },\n\t id: faker.datatype.uuid(),\n\t in_stock: true,\n\t },\n\t {\n\t appliedAttributes: {\n\t color: '2',\n\t size: '2',\n\t material: '0',\n\t },\n\t price: this.stubPriceVariant1,\n\t discount: {\n\t amount: this.stubDiscountVariant1,\n\t percent: Math.floor((this.stubDiscountVariant1/this.stubPriceVariant1) * 100),\n\t },\n\t id: faker.datatype.uuid(),\n\t in_stock: true,\n\t },\n\t];\n}\n\n/**\n * Factory for creating DaffConfigurableProducts.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffConfigurableProductFactory extends DaffModelFactory<DaffConfigurableProduct>{\n constructor(){\n super(MockConfigurableProduct);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from 'faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffProductImage } from '@daffodil/product';\n\nconst productImageUrlsList: string[] = [\n '/assets/products/0.jpg',\n '/assets/products/1.jpg',\n '/assets/products/2.jpg',\n '/assets/products/3.jpg',\n '/assets/products/4.jpg',\n '/assets/products/5.jpg',\n '/assets/products/6.jpg',\n '/assets/products/7.jpg',\n '/assets/products/8.jpg',\n '/assets/products/9.jpg',\n '/assets/products/10.jpg',\n '/assets/products/11.jpg',\n '/assets/products/12.jpg',\n '/assets/products/13.jpg',\n '/assets/products/14.jpg',\n '/assets/products/15.jpg',\n '/assets/products/16.jpg',\n '/assets/products/17.jpg',\n '/assets/products/18.jpg',\n '/assets/products/19.jpg',\n '/assets/products/20.jpg',\n '/assets/products/21.jpg',\n '/assets/products/22.jpg',\n '/assets/products/23.jpg',\n '/assets/products/24.jpg',\n '/assets/products/25.jpg',\n '/assets/products/26.jpg',\n '/assets/products/27.jpg',\n '/assets/products/28.jpg',\n '/assets/products/29.jpg',\n '/assets/products/30.jpg',\n '/assets/products/31.jpg',\n '/assets/products/32.jpg',\n '/assets/products/33.jpg',\n '/assets/products/34.jpg',\n '/assets/products/35.jpg',\n '/assets/products/36.jpg',\n '/assets/products/37.jpg',\n '/assets/products/38.jpg',\n '/assets/products/39.jpg',\n '/assets/products/40.jpg',\n '/assets/products/41.jpg',\n '/assets/products/42.jpg',\n '/assets/products/43.jpg',\n '/assets/products/44.jpg',\n '/assets/products/45.jpg',\n '/assets/products/46.jpg',\n '/assets/products/47.jpg',\n '/assets/products/48.jpg',\n '/assets/products/49.jpg',\n '/assets/products/50.jpg',\n '/assets/products/51.jpg',\n '/assets/products/52.jpg',\n '/assets/products/53.jpg',\n '/assets/products/54.jpg',\n '/assets/products/55.jpg',\n '/assets/products/56.jpg',\n '/assets/products/57.jpg',\n '/assets/products/58.jpg',\n '/assets/products/59.jpg',\n '/assets/products/60.jpg',\n '/assets/products/61.jpg',\n '/assets/products/62.jpg',\n '/assets/products/63.jpg',\n '/assets/products/64.jpg',\n '/assets/products/65.jpg',\n '/assets/products/66.jpg',\n '/assets/products/67.jpg',\n '/assets/products/68.jpg',\n '/assets/products/69.jpg',\n '/assets/products/70.jpg',\n '/assets/products/71.jpg',\n '/assets/products/72.jpg',\n '/assets/products/73.jpg',\n '/assets/products/74.jpg',\n '/assets/products/75.jpg',\n '/assets/products/76.jpg',\n '/assets/products/77.jpg',\n '/assets/products/78.jpg',\n '/assets/products/79.jpg',\n '/assets/products/80.jpg',\n '/assets/products/81.jpg',\n '/assets/products/82.jpg',\n '/assets/products/83.jpg',\n '/assets/products/84.jpg',\n '/assets/products/85.jpg',\n '/assets/products/86.jpg',\n '/assets/products/87.jpg',\n '/assets/products/88.jpg',\n '/assets/products/89.jpg',\n '/assets/products/90.jpg',\n '/assets/products/91.jpg',\n '/assets/products/92.jpg',\n '/assets/products/93.jpg',\n '/assets/products/94.jpg',\n '/assets/products/95.jpg',\n '/assets/products/96.jpg',\n '/assets/products/97.jpg',\n '/assets/products/98.jpg',\n '/assets/products/99.jpg',\n '/assets/products/100.jpg',\n];\n\n/**\n * Mocked DaffProductImage object.\n */\nexport class MockProductImage implements DaffProductImage {\n id = faker.datatype.uuid();\n url = productImageUrlsList[faker.datatype.number(productImageUrlsList.length-1)];\n label = faker.lorem.sentence();\n}\n\n/**\n * A factory for creating DaffProductImage.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffProductImageFactory extends DaffModelFactory<DaffProductImage> {\n constructor(){\n super(MockProductImage);\n }\n}\n","import {\n InjectionToken,\n Provider,\n Type,\n} from '@angular/core';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffProduct } from '@daffodil/product';\n\n/**\n * A multi-provider injection token for providing extra product type factories.\n * These factories correspond to different product types that may be added by other packages.\n * This is useful for backend mocks (such as the in-memory driver) to generate an accurate representation\n * of the variety of products that an application can receive in production.\n */\nexport const DAFF_PRODUCT_TYPE_FACTORIES = new InjectionToken<DaffModelFactory<DaffProduct>[]>(\n 'DAFF_PRODUCT_TYPE_FACTORIES',\n { factory: () => [], providedIn: 'root' },\n);\n\n/**\n * Provides extra product factory types.\n *\n * See {@link DAFF_PRODUCT_TYPE_FACTORIES}.\n *\n * ```ts\n * providers: [\n * ...daffProvideProductExtraFactoryTypes(\n * MyProductFactory\n * )\n * ]\n * ```\n */\nexport function daffProvideProductExtraFactoryTypes<T extends DaffProduct = DaffProduct>(...factoryTypes: Type<DaffModelFactory<T>>[]): Provider[] {\n return factoryTypes.map(factoryType => ({\n provide: DAFF_PRODUCT_TYPE_FACTORIES,\n useExisting: factoryType,\n multi: true,\n }));\n}\n","import {\n InjectionToken,\n Provider,\n Type,\n} from '@angular/core';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffProduct } from '@daffodil/product';\n\n/**\n * A multi-provider injection token for providing extra product factories.\n * These extra factories represent the additional product fields that may be added by other packages.\n * This is useful for backend mocks (such as the in-memory driver) to generate an accurate representation\n * of the entire product data that an application can receive in production.\n *\n * These factories will be invoked ang the return included in {@link DaffProductFactory}.\n */\nexport const DAFF_PRODUCT_EXTRA_FACTORIES = new InjectionToken<DaffModelFactory<DaffProduct>[]>(\n 'DAFF_PRODUCT_EXTRA_FACTORIES',\n { factory: () => [], providedIn: 'root' },\n);\n\n/**\n * Provides extra product factories.\n *\n * See {@link DAFF_PRODUCT_EXTRA_FACTORIES}.\n *\n * ```ts\n * providers: [\n * ...daffProvideProductExtraProductFactories(\n * MyProductFactory\n * )\n * ]\n * ```\n */\nexport function daffProvideProductExtraProductFactories<T extends DaffProduct = DaffProduct>(...factoryTypes: Type<DaffModelFactory<T>>[]): Provider[] {\n return factoryTypes.map(factoryType => ({\n provide: DAFF_PRODUCT_EXTRA_FACTORIES,\n useExisting: factoryType,\n multi: true,\n }));\n}\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\n\nimport { sample } from '@daffodil/core';\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffProduct } from '@daffodil/product';\n\nimport { DAFF_PRODUCT_TYPE_FACTORIES } from '../injection-tokens/public_api';\nimport { MockProduct } from './default-product.factory';\n\n/**\n * Factory for creating DaffProducts.\n * This will create a random product kind,\n * including extra product kinds that may be provided by optional product packages.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffProductKindFactory extends DaffModelFactory<DaffProduct> {\n constructor(\n @Inject(DAFF_PRODUCT_TYPE_FACTORIES) private productTypeFactories: DaffModelFactory<DaffProduct>[],\n ) {\n super(MockProduct);\n }\n\n private get _randomFactory(): DaffModelFactory<DaffProduct> {\n return sample(this.productTypeFactories);\n }\n\n /**\n * Creates a mock product of random kind.\n * Includes extra product kinds that may be provided by optional product packages.\n */\n create(partial = {}): DaffProduct {\n return this._randomFactory.create(partial);\n }\n}\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffProduct } from '@daffodil/product';\n\nimport { DAFF_PRODUCT_EXTRA_FACTORIES } from '../injection-tokens/public_api';\nimport { MockProduct } from './default-product.factory';\nimport { DaffProductKindFactory } from './kind.factory';\n\n/**\n * Factory for creating `DaffProduct`s with extension fields.\n * This includes all the extra extension factories that may be provided by optional product packages.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffProductExtensionFactory extends DaffModelFactory<DaffProduct> {\n constructor(\n @Inject(DAFF_PRODUCT_EXTRA_FACTORIES) private extraFactories: DaffModelFactory<DaffProduct>[],\n private productKindFactory: DaffProductKindFactory,\n ) {\n super(MockProduct);\n }\n\n /**\n * Creates a mock product of random type.\n * Includes extra product types that may be provided by optional product packages.\n * This includes all the extra extension factories that may be provided by optional product packages.\n */\n create(partial = {}): DaffProduct {\n return Object.assign(\n {},\n ...this.extraFactories.map(factory => factory.create(partial)),\n // spread this in last to preserve type\n this.productKindFactory.create(partial),\n );\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffDefaultProductFactory } from './factories/public_api';\nimport { DAFF_PRODUCT_TYPE_FACTORIES } from './injection-tokens/public_api';\n\n/**\n * Provides the default product factory as a product type factory.\n */\n@NgModule({\n providers: [\n {\n provide: DAFF_PRODUCT_TYPE_FACTORIES,\n useExisting: DaffDefaultProductFactory,\n multi: true,\n },\n ],\n})\nexport class DaffProductTestingModule { }\n","import { DaffProduct } from '@daffodil/product';\n\n/**\n * A helper function to verify that a model is a Product.\n *\n * @param product\n */\nexport function isProduct(product: DaffProduct): boolean {\n return !!product.id\n && !!product.price\n && !!product.name\n && !!product.brand\n && !!product.description\n && !!product.images;\n}\n"]}
1
+ {"version":3,"sources":["../../../node_modules/tslib/tslib.es6.js","../../../libs/product/testing/src/factories/default-product.factory.ts","../../../libs/product/testing/src/factories/composite-product.factory.ts","../../../libs/product/testing/src/factories/configurable-product.factory.ts","../../../libs/product/testing/src/factories/product-image.factory.ts","../../../libs/product/testing/src/injection-tokens/factories/type.token.ts","../../../libs/product/testing/src/injection-tokens/factories/extra.token.ts","../../../libs/product/testing/src/factories/kind.factory.ts","../../../libs/product/testing/src/factories/extension.factory.ts","../../../libs/product/testing/src/testing.module.ts","../../../libs/product/testing/src/helpers.ts"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","__read","o","n","m","Symbol","iterator","r","e","i","ar","next","done","push","value","error","__spread","arguments","length","concat","stubPrice","faker.datatype","number","min","max","stubDiscount","type","DaffProductTypeEnum","Simple","id","uuid","url","faker.random","word","canonicalUrl","faker.internet","price","in_stock","discount","amount","percent","Math","floor","images","thumbnail","name","faker.commerce","productName","brand","faker.company","companyName","description","short_description","meta_title","meta_description","related","upsell","DaffDefaultProductFactory","_super","MockProduct","DaffModelFactory","Injectable","args","providedIn","MockCompositeProduct","_this","apply","Composite","items","required","boolean","title","input_type","DaffCompositeProductItemInputEnum","select","options","productMaterial","quantity","is_default","DaffCompositeProductFactory","MockConfigurableProduct","stubPriceVariant1","stubDiscountVariant1","stubPriceVariant2","stubDiscountVariant2","stubPriceVariant3","stubDiscountVariant3","Configurable","configurableAttributes","code","label","order","values","swatch","variants","appliedAttributes","color","size","material","DaffConfigurableProductFactory","productImageUrlsList","faker.lorem","sentence","DaffProductImageFactory","MockProductImage","DAFF_PRODUCT_TYPE_FACTORIES","InjectionToken","factory","DAFF_PRODUCT_EXTRA_FACTORIES","DaffProductKindFactory","productTypeFactories","defineProperty","sample","partial","_randomFactory","Inject","DaffProductExtensionFactory","extraFactories","productKindFactory","assign","map","NgModule","providers","provide","useExisting","multi","factoryTypes","_i","factoryType","product"],"mappings":";;;;;;;;;;;;;;oFAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOC,OAAOK,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,MAC3EN,EAAGC,aAGZS,EAAUV,EAAGC,GACzB,GAAiB,mBAANA,GAA0B,OAANA,EAC3B,MAAM,IAAIU,UAAU,uBAAyBC,OAAOX,GAAK,iCAE7D,SAASY,IAAOC,KAAKC,YAAcf,EADnCD,EAAcC,EAAGC,GAEjBD,EAAEO,UAAkB,OAANN,EAAaC,OAAOc,OAAOf,IAAMY,EAAGN,UAAYN,EAAEM,UAAW,IAAIM,GA+EtDX,OAAOc,gBAwBpBC,EAAOC,EAAGC,GACtB,IAAIC,EAAsB,mBAAXC,QAAyBH,EAAEG,OAAOC,UACjD,IAAKF,EAAG,OAAOF,EACf,IAAmBK,EAAYC,EAA3BC,EAAIL,EAAEX,KAAKS,GAAOQ,EAAK,GAC3B,IACI,WAAc,IAANP,GAAgBA,KAAM,MAAQI,EAAIE,EAAEE,QAAQC,MAAMF,EAAGG,KAAKN,EAAEO,OAExE,MAAOC,GAASP,EAAI,CAAEO,MAAO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,EAAQ7F,OACR6F,EAAQpF,MACRoF,EAAQjF,OACRiF,EAAQ9E,aACR8E,EAAQtF","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","import { Injectable } from '@angular/core';\nimport * as faker from 'faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n DaffProduct,\n DaffProductTypeEnum,\n} from '@daffodil/product';\n\n/**\n * Mocked DaffProduct object.\n */\nexport class MockProduct implements DaffProduct {\n\tprivate stubPrice = faker.datatype.number({ min: 1, max: 1500 });\n\tprivate stubDiscount = faker.datatype.number({ min: 0, max: this.stubPrice - 1 });\n\n\ttype = DaffProductTypeEnum.Simple;\n\tid = faker.datatype.uuid();\n\turl = `/${faker.random.word()}.html`;\n\tcanonicalUrl = faker.internet.url();\n\tprice = this.stubPrice;\n\tin_stock = true;\n\tdiscount = {\n\t amount: this.stubDiscount,\n\t percent: Math.floor((this.stubDiscount/this.stubPrice) * 100),\n\t};\n\timages = [];\n thumbnail = null;\n name = faker.commerce.productName();\n brand = faker.company.companyName();\n description = 'Lorem ipsum dolor sit amet, accumsan ullamcorper ei eam. Sint appetere ocurreret no per, et cum lorem disputationi. Sit ut magna delenit, assum vidisse vocibus sed ut. In aperiri malorum accusamus sea, novum mediocritatem ius at. Duo agam probo honestatis ut. Nec regione splendide cu, unum graeco vivendum in duo.';\n short_description = 'Lorem ipsum dolor sit amet, accumsan ullamcorper ei eam. Sint appetere ocurreret no per, et cum lorem disputationi. Sit ut magna delenit, assum vidisse vocibus sed ut. In aperiri malorum accusamus sea, novum mediocritatem ius at. Duo agam probo honestatis ut.';\n meta_title = faker.commerce.productName();\n meta_description = 'Lorem ipsum dolor sit amet, accumsan ullamcorper ei eam. Sint appetere ocurreret no per, et cum lorem disputationi. Sit ut magna delenit, assum vidisse vocibus sed ut. In aperiri malorum accusamus sea, novum mediocritatem ius at. Duo agam probo honestatis ut. Nec regione splendide cu, unum graeco vivendum in duo.';\n related = [];\n upsell = [];\n}\n\n/**\n * Factory for creating simple `DaffProduct`s of no special kind.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffDefaultProductFactory extends DaffModelFactory<DaffProduct> {\n constructor() {\n super(MockProduct);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from 'faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n DaffCompositeProduct,\n DaffProductTypeEnum,\n DaffCompositeProductItemInputEnum,\n} from '@daffodil/product';\n\nimport { MockProduct } from './default-product.factory';\n\n/**\n * Mocked DaffCompositeProduct object.\n *\n * @deprecated import from @daffodil/composite-product/testing instead.\n */\nexport class MockCompositeProduct extends MockProduct implements DaffCompositeProduct {\n\ttype = DaffProductTypeEnum.Composite;\n\titems = [\n\t {\n\t id: faker.datatype.uuid(),\n\t url: `/${faker.random.word()}.html`,\n\t required: faker.datatype.boolean(),\n\t title: faker.commerce.productName(),\n\t input_type: DaffCompositeProductItemInputEnum.select,\n\t options: [\n\t {\n\t id: faker.datatype.uuid(),\n\t type: DaffProductTypeEnum.Simple,\n\t url: `/${faker.random.word()}.html`,\n\t name: faker.commerce.productMaterial(),\n\t price: faker.datatype.number({ min: 1, max: 100 }),\n\t images: [],\n\t thumbnail: null,\n\t discount: {\n\t amount: 0,\n\t percent: 0,\n\t },\n\t quantity: faker.datatype.number({ min: 1, max: 9 }),\n\t is_default: true,\n\t in_stock: true,\n\t related: [],\n\t upsell: [],\n\t },\n\t {\n\t id: faker.datatype.uuid(),\n\t type: DaffProductTypeEnum.Simple,\n\t url: `/${faker.random.word()}.html`,\n\t name: faker.commerce.productMaterial(),\n\t price: faker.datatype.number({ min: 1, max: 100 }),\n\t images: [],\n\t thumbnail: null,\n\t discount: {\n\t amount: 0,\n\t percent: 0,\n\t },\n\t quantity: faker.datatype.number({ min: 1, max: 9 }),\n\t is_default: false,\n\t in_stock: true,\n\t related: [],\n\t upsell: [],\n\t },\n\t ],\n\t },\n\t {\n\t id: faker.datatype.uuid(),\n\t url: `/${faker.random.word()}.html`,\n\t required: faker.datatype.boolean(),\n\t title: faker.commerce.productName(),\n\t input_type: DaffCompositeProductItemInputEnum.select,\n\t options: [\n\t {\n\t id: faker.datatype.uuid(),\n\t type: DaffProductTypeEnum.Simple,\n\t url: `/${faker.random.word()}.html`,\n\t name: faker.commerce.productMaterial(),\n\t price: faker.datatype.number({ min: 1, max: 100 }),\n\t images: [],\n\t thumbnail: null,\n\t discount: {\n\t amount: 0,\n\t percent: 0,\n\t },\n\t quantity: faker.datatype.number({ min: 1, max: 9 }),\n\t is_default: true,\n\t in_stock: true,\n\t related: [],\n\t upsell: [],\n\t },\n\t {\n\t id: faker.datatype.uuid(),\n\t type: DaffProductTypeEnum.Simple,\n\t url: `/${faker.random.word()}.html`,\n\t name: faker.commerce.productMaterial(),\n\t price: faker.datatype.number({ min: 1, max: 100 }),\n\t images: [],\n\t thumbnail: null,\n\t discount: {\n\t amount: 0,\n\t percent: 0,\n\t },\n\t quantity: faker.datatype.number({ min: 1, max: 9 }),\n\t is_default: false,\n\t in_stock: true,\n\t related: [],\n\t upsell: [],\n\t },\n\t ],\n\t },\n\t];\n}\n\n/**\n * Factory for creating DaffCompositeProducts.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCompositeProductFactory extends DaffModelFactory<DaffCompositeProduct>{\n constructor(){\n super(MockCompositeProduct);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from 'faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n DaffConfigurableProduct,\n DaffProductTypeEnum,\n} from '@daffodil/product';\n\nimport { MockProduct } from './default-product.factory';\n\n/**\n * Mocked DaffConfigurableProduct object.\n */\nexport class MockConfigurableProduct extends MockProduct implements DaffConfigurableProduct {\n\tprivate stubPriceVariant1 = faker.datatype.number({ min: 1, max: 1500 });\n\tprivate stubDiscountVariant1 = faker.datatype.number({ min: 0, max: this.stubPriceVariant1 - 1 });\n\tprivate stubPriceVariant2 = faker.datatype.number({ min: 1, max: 1500 });\n\tprivate stubDiscountVariant2 = faker.datatype.number({ min: 0, max: this.stubPriceVariant2 - 1 });\n\tprivate stubPriceVariant3 = faker.datatype.number({ min: 1, max: 1500 });\n\tprivate stubDiscountVariant3 = faker.datatype.number({ min: 0, max: this.stubPriceVariant3 - 1 });\n\n\ttype = DaffProductTypeEnum.Configurable;\n\tconfigurableAttributes = [\n\t {\n\t code: 'color',\n\t label: 'Color',\n\t order: 0,\n\t values: [\n\t {\n\t value: '0',\n\t label: 'Blue',\n\t swatch: {\n\t value: '#0000FF',\n\t thumbnail: null,\n\t },\n\t },\n\t {\n\t value: '1',\n\t label: 'Yellow',\n\t swatch: {\n\t value: '#FFFF00',\n\t thumbnail: null,\n\t },\n\t },\n\t {\n\t value: '2',\n\t label: 'Red',\n\t swatch: {\n\t value: '#FF0000',\n\t thumbnail: null,\n\t },\n\t },\n\t ],\n\t },\n\t {\n\t code: 'size',\n\t label: 'Size',\n\t order: 1,\n\t values: [\n\t {\n\t value: '0',\n\t label: 'Small',\n\t swatch: null,\n\t },\n\t {\n\t value: '1',\n\t label: 'Medium',\n\t swatch: null,\n\t },\n\t {\n\t value: '2',\n\t label: 'Large',\n\t swatch: null,\n\t },\n\t ],\n\t },\n\t {\n\t code: 'material',\n\t label: 'Material',\n\t order: 2,\n\t values: [\n\t {\n\t value: '0',\n\t label: 'Cotton',\n\t swatch: null,\n\t },\n\t {\n\t value: '1',\n\t label: 'Polyester',\n\t swatch: null,\n\t },\n\t {\n\t value: '2',\n\t label: 'Spandex',\n\t swatch: null,\n\t },\n\t ],\n\t },\n\t];\n\tvariants = [\n\t {\n\t appliedAttributes: {\n\t color: '0',\n\t size: '0',\n\t material: '0',\n\t },\n\t price: this.stubPriceVariant1,\n\t discount: {\n\t amount: this.stubDiscountVariant1,\n\t percent: Math.floor((this.stubDiscountVariant1/this.stubPriceVariant1) * 100),\n\t },\n\t id: faker.datatype.uuid(),\n\t in_stock: true,\n\t },\n\t {\n\t appliedAttributes: {\n\t color: '0',\n\t size: '1',\n\t material: '0',\n\t },\n\t price: this.stubPriceVariant1,\n\t discount: {\n\t amount: this.stubDiscountVariant1,\n\t percent: Math.floor((this.stubDiscountVariant1/this.stubPriceVariant1) * 100),\n\t },\n\t id: faker.datatype.uuid(),\n\t in_stock: true,\n\t },\n\t {\n\t appliedAttributes: {\n\t color: '0',\n\t size: '1',\n\t material: '2',\n\t },\n\t price: this.stubPriceVariant3,\n\t discount: {\n\t amount: this.stubDiscountVariant3,\n\t percent: Math.floor((this.stubDiscountVariant3/this.stubPriceVariant3) * 100),\n\t },\n\t id: faker.datatype.uuid(),\n\t in_stock: true,\n\t },\n\t {\n\t appliedAttributes: {\n\t color: '0',\n\t size: '2',\n\t material: '0',\n\t },\n\t price: this.stubPriceVariant1,\n\t discount: {\n\t amount: this.stubDiscountVariant1,\n\t percent: Math.floor((this.stubDiscountVariant1/this.stubPriceVariant1) * 100),\n\t },\n\t id: faker.datatype.uuid(),\n\t in_stock: true,\n\t },\n\t {\n\t appliedAttributes: {\n\t color: '1',\n\t size: '0',\n\t material: '0',\n\t },\n\t price: this.stubPriceVariant1,\n\t discount: {\n\t amount: this.stubDiscountVariant1,\n\t percent: Math.floor((this.stubDiscountVariant1/this.stubPriceVariant1) * 100),\n\t },\n\t id: faker.datatype.uuid(),\n\t in_stock: true,\n\t },\n\t {\n\t appliedAttributes: {\n\t color: '1',\n\t size: '0',\n\t material: '2',\n\t },\n\t price: this.stubPriceVariant3,\n\t discount: {\n\t amount: this.stubDiscountVariant3,\n\t percent: Math.floor((this.stubDiscountVariant3/this.stubPriceVariant3) * 100),\n\t },\n\t id: faker.datatype.uuid(),\n\t in_stock: true,\n\t },\n\t {\n\t appliedAttributes: {\n\t color: '1',\n\t size: '2',\n\t material: '0',\n\t },\n\t price: this.stubPriceVariant1,\n\t discount: {\n\t amount: this.stubDiscountVariant1,\n\t percent: Math.floor((this.stubDiscountVariant1/this.stubPriceVariant1) * 100),\n\t },\n\t id: faker.datatype.uuid(),\n\t in_stock: true,\n\t },\n\t {\n\t appliedAttributes: {\n\t color: '1',\n\t size: '2',\n\t material: '1',\n\t },\n\t price: this.stubPriceVariant2,\n\t discount: {\n\t amount: this.stubDiscountVariant2,\n\t percent: Math.floor((this.stubDiscountVariant2/this.stubPriceVariant2) * 100),\n\t },\n\t id: faker.datatype.uuid(),\n\t in_stock: true,\n\t },\n\t {\n\t appliedAttributes: {\n\t color: '2',\n\t size: '0',\n\t material: '0',\n\t },\n\t price: this.stubPriceVariant3,\n\t discount: {\n\t amount: this.stubDiscountVariant3,\n\t percent: Math.floor((this.stubDiscountVariant3/this.stubPriceVariant3) * 100),\n\t },\n\t id: faker.datatype.uuid(),\n\t in_stock: true,\n\t },\n\t {\n\t appliedAttributes: {\n\t color: '2',\n\t size: '2',\n\t material: '0',\n\t },\n\t price: this.stubPriceVariant1,\n\t discount: {\n\t amount: this.stubDiscountVariant1,\n\t percent: Math.floor((this.stubDiscountVariant1/this.stubPriceVariant1) * 100),\n\t },\n\t id: faker.datatype.uuid(),\n\t in_stock: true,\n\t },\n\t];\n}\n\n/**\n * Factory for creating DaffConfigurableProducts.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffConfigurableProductFactory extends DaffModelFactory<DaffConfigurableProduct>{\n constructor(){\n super(MockConfigurableProduct);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from 'faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffProductImage } from '@daffodil/product';\n\nconst productImageUrlsList: string[] = [\n '/assets/products/0.jpg',\n '/assets/products/1.jpg',\n '/assets/products/2.jpg',\n '/assets/products/3.jpg',\n '/assets/products/4.jpg',\n '/assets/products/5.jpg',\n '/assets/products/6.jpg',\n '/assets/products/7.jpg',\n '/assets/products/8.jpg',\n '/assets/products/9.jpg',\n '/assets/products/10.jpg',\n '/assets/products/11.jpg',\n '/assets/products/12.jpg',\n '/assets/products/13.jpg',\n '/assets/products/14.jpg',\n '/assets/products/15.jpg',\n '/assets/products/16.jpg',\n '/assets/products/17.jpg',\n '/assets/products/18.jpg',\n '/assets/products/19.jpg',\n '/assets/products/20.jpg',\n '/assets/products/21.jpg',\n '/assets/products/22.jpg',\n '/assets/products/23.jpg',\n '/assets/products/24.jpg',\n '/assets/products/25.jpg',\n '/assets/products/26.jpg',\n '/assets/products/27.jpg',\n '/assets/products/28.jpg',\n '/assets/products/29.jpg',\n '/assets/products/30.jpg',\n '/assets/products/31.jpg',\n '/assets/products/32.jpg',\n '/assets/products/33.jpg',\n '/assets/products/34.jpg',\n '/assets/products/35.jpg',\n '/assets/products/36.jpg',\n '/assets/products/37.jpg',\n '/assets/products/38.jpg',\n '/assets/products/39.jpg',\n '/assets/products/40.jpg',\n '/assets/products/41.jpg',\n '/assets/products/42.jpg',\n '/assets/products/43.jpg',\n '/assets/products/44.jpg',\n '/assets/products/45.jpg',\n '/assets/products/46.jpg',\n '/assets/products/47.jpg',\n '/assets/products/48.jpg',\n '/assets/products/49.jpg',\n '/assets/products/50.jpg',\n '/assets/products/51.jpg',\n '/assets/products/52.jpg',\n '/assets/products/53.jpg',\n '/assets/products/54.jpg',\n '/assets/products/55.jpg',\n '/assets/products/56.jpg',\n '/assets/products/57.jpg',\n '/assets/products/58.jpg',\n '/assets/products/59.jpg',\n '/assets/products/60.jpg',\n '/assets/products/61.jpg',\n '/assets/products/62.jpg',\n '/assets/products/63.jpg',\n '/assets/products/64.jpg',\n '/assets/products/65.jpg',\n '/assets/products/66.jpg',\n '/assets/products/67.jpg',\n '/assets/products/68.jpg',\n '/assets/products/69.jpg',\n '/assets/products/70.jpg',\n '/assets/products/71.jpg',\n '/assets/products/72.jpg',\n '/assets/products/73.jpg',\n '/assets/products/74.jpg',\n '/assets/products/75.jpg',\n '/assets/products/76.jpg',\n '/assets/products/77.jpg',\n '/assets/products/78.jpg',\n '/assets/products/79.jpg',\n '/assets/products/80.jpg',\n '/assets/products/81.jpg',\n '/assets/products/82.jpg',\n '/assets/products/83.jpg',\n '/assets/products/84.jpg',\n '/assets/products/85.jpg',\n '/assets/products/86.jpg',\n '/assets/products/87.jpg',\n '/assets/products/88.jpg',\n '/assets/products/89.jpg',\n '/assets/products/90.jpg',\n '/assets/products/91.jpg',\n '/assets/products/92.jpg',\n '/assets/products/93.jpg',\n '/assets/products/94.jpg',\n '/assets/products/95.jpg',\n '/assets/products/96.jpg',\n '/assets/products/97.jpg',\n '/assets/products/98.jpg',\n '/assets/products/99.jpg',\n '/assets/products/100.jpg',\n];\n\n/**\n * Mocked DaffProductImage object.\n */\nexport class MockProductImage implements DaffProductImage {\n id = faker.datatype.uuid();\n url = productImageUrlsList[faker.datatype.number(productImageUrlsList.length-1)];\n label = faker.lorem.sentence();\n}\n\n/**\n * A factory for creating DaffProductImage.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffProductImageFactory extends DaffModelFactory<DaffProductImage> {\n constructor(){\n super(MockProductImage);\n }\n}\n","import {\n InjectionToken,\n Provider,\n Type,\n} from '@angular/core';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffProduct } from '@daffodil/product';\n\n/**\n * A multi-provider injection token for providing extra product type factories.\n * These factories correspond to different product types that may be added by other packages.\n * This is useful for backend mocks (such as the in-memory driver) to generate an accurate representation\n * of the variety of products that an application can receive in production.\n */\nexport const DAFF_PRODUCT_TYPE_FACTORIES = new InjectionToken<DaffModelFactory<DaffProduct>[]>(\n 'DAFF_PRODUCT_TYPE_FACTORIES',\n { factory: () => [], providedIn: 'root' },\n);\n\n/**\n * Provides extra product factory types.\n *\n * See {@link DAFF_PRODUCT_TYPE_FACTORIES}.\n *\n * ```ts\n * providers: [\n * ...daffProvideProductExtraFactoryTypes(\n * MyProductFactory\n * )\n * ]\n * ```\n */\nexport function daffProvideProductExtraFactoryTypes<T extends DaffProduct = DaffProduct>(...factoryTypes: Type<DaffModelFactory<T>>[]): Provider[] {\n return factoryTypes.map(factoryType => ({\n provide: DAFF_PRODUCT_TYPE_FACTORIES,\n useExisting: factoryType,\n multi: true,\n }));\n}\n","import {\n InjectionToken,\n Provider,\n Type,\n} from '@angular/core';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffProduct } from '@daffodil/product';\n\n/**\n * A multi-provider injection token for providing extra product factories.\n * These extra factories represent the additional product fields that may be added by other packages.\n * This is useful for backend mocks (such as the in-memory driver) to generate an accurate representation\n * of the entire product data that an application can receive in production.\n *\n * These factories will be invoked ang the return included in {@link DaffProductFactory}.\n */\nexport const DAFF_PRODUCT_EXTRA_FACTORIES = new InjectionToken<DaffModelFactory<DaffProduct>[]>(\n 'DAFF_PRODUCT_EXTRA_FACTORIES',\n { factory: () => [], providedIn: 'root' },\n);\n\n/**\n * Provides extra product factories.\n *\n * See {@link DAFF_PRODUCT_EXTRA_FACTORIES}.\n *\n * ```ts\n * providers: [\n * ...daffProvideProductExtraProductFactories(\n * MyProductFactory\n * )\n * ]\n * ```\n */\nexport function daffProvideProductExtraProductFactories<T extends DaffProduct = DaffProduct>(...factoryTypes: Type<DaffModelFactory<T>>[]): Provider[] {\n return factoryTypes.map(factoryType => ({\n provide: DAFF_PRODUCT_EXTRA_FACTORIES,\n useExisting: factoryType,\n multi: true,\n }));\n}\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\n\nimport { sample } from '@daffodil/core';\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffProduct } from '@daffodil/product';\n\nimport { DAFF_PRODUCT_TYPE_FACTORIES } from '../injection-tokens/public_api';\nimport { MockProduct } from './default-product.factory';\n\n/**\n * Factory for creating DaffProducts.\n * This will create a random product kind,\n * including extra product kinds that may be provided by optional product packages.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffProductKindFactory extends DaffModelFactory<DaffProduct> {\n constructor(\n @Inject(DAFF_PRODUCT_TYPE_FACTORIES) private productTypeFactories: DaffModelFactory<DaffProduct>[],\n ) {\n super(MockProduct);\n }\n\n private get _randomFactory(): DaffModelFactory<DaffProduct> {\n return sample(this.productTypeFactories);\n }\n\n /**\n * Creates a mock product of random kind.\n * Includes extra product kinds that may be provided by optional product packages.\n */\n create(partial = {}): DaffProduct {\n return this._randomFactory.create(partial);\n }\n}\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffProduct } from '@daffodil/product';\n\nimport { DAFF_PRODUCT_EXTRA_FACTORIES } from '../injection-tokens/public_api';\nimport { MockProduct } from './default-product.factory';\nimport { DaffProductKindFactory } from './kind.factory';\n\n/**\n * Factory for creating `DaffProduct`s with extension fields.\n * This includes all the extra extension factories that may be provided by optional product packages.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffProductExtensionFactory extends DaffModelFactory<DaffProduct> {\n constructor(\n @Inject(DAFF_PRODUCT_EXTRA_FACTORIES) private extraFactories: DaffModelFactory<DaffProduct>[],\n private productKindFactory: DaffProductKindFactory,\n ) {\n super(MockProduct);\n }\n\n /**\n * Creates a mock product of random type.\n * Includes extra product types that may be provided by optional product packages.\n * This includes all the extra extension factories that may be provided by optional product packages.\n */\n create(partial = {}): DaffProduct {\n return Object.assign(\n {},\n ...this.extraFactories.map(factory => factory.create(partial)),\n // spread this in last to preserve type\n this.productKindFactory.create(partial),\n );\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffDefaultProductFactory } from './factories/public_api';\nimport { DAFF_PRODUCT_TYPE_FACTORIES } from './injection-tokens/public_api';\n\n/**\n * Provides the default product factory as a product type factory.\n */\n@NgModule({\n providers: [\n {\n provide: DAFF_PRODUCT_TYPE_FACTORIES,\n useExisting: DaffDefaultProductFactory,\n multi: true,\n },\n ],\n})\nexport class DaffProductTestingModule { }\n","import { DaffProduct } from '@daffodil/product';\n\n/**\n * A helper function to verify that a model is a Product.\n *\n * @param product\n */\nexport function isProduct(product: DaffProduct): boolean {\n return !!product.id\n && !!product.price\n && !!product.name\n && !!product.brand\n && !!product.description\n && !!product.images;\n}\n"]}
@@ -5,238 +5,50 @@
5
5
  }(this, (function (exports, core, state) { 'use strict';
6
6
 
7
7
  /**
8
- * @fileoverview added by tsickle
9
- * Generated from: models/composite-product-item.ts
10
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
11
- */
12
- /** @enum {string} */
13
- var DaffCompositeProductItemInputEnum = {
14
- select: "select",
15
- radio: "radio",
16
- };
17
- /**
18
- * The composite product item describes one set of product options that the user can add to the composite product.
19
- * A composite product item can be required or optional. If it is required, an option _must_ be chosen in order to add the product to the cart.
20
- * If the item is optional, the product can be added to the cart without an option having been chosen.
21
- * For example, if a composite product is a toolbox bundle, a composite product item might be a screw driver, and the options contained in that
22
- * item might be a phillips head and a flathead. The customer could choose to add either a phillips head or a flathead to the
23
- * composite product, or neither if the item is optional.
24
- *
25
- * @deprecated import from \@daffodil/composite-product instead.
26
- * @record
27
- */
28
- function DaffCompositeProductItem() { }
29
- if (false) {
30
- /**
31
- * Whether the item is required or optional.
32
- * @type {?}
33
- */
34
- DaffCompositeProductItem.prototype.required;
35
- /**
36
- * The title label for the item.
37
- * @type {?}
38
- */
39
- DaffCompositeProductItem.prototype.title;
40
- /**
41
- * Describes how the item should be displayed.
42
- * @type {?}
43
- */
44
- DaffCompositeProductItem.prototype.input_type;
45
- /**
46
- * The options that may be chosen for the item.
47
- * @type {?}
48
- */
49
- DaffCompositeProductItem.prototype.options;
50
- }
51
- /**
52
- * The composite product item option is a DaffProduct that can be added to a composite product.
8
+ * An enum for whether a composite product item should be displayed as a radio or select input.
53
9
  *
54
- * @deprecated import from \@daffodil/composite-product instead.
55
- * @record
10
+ * @deprecated import from @daffodil/composite-product instead.
56
11
  */
57
- function DaffCompositeProductItemOption() { }
58
- if (false) {
59
- /**
60
- * Whether the option is the default option for its parent {\@link DaffCompositeProductItem}.
61
- * @type {?}
62
- */
63
- DaffCompositeProductItemOption.prototype.is_default;
64
- /**
65
- * The quantity chosen for the option.
66
- * @type {?}
67
- */
68
- DaffCompositeProductItemOption.prototype.quantity;
69
- }
12
+ (function (DaffCompositeProductItemInputEnum) {
13
+ DaffCompositeProductItemInputEnum["select"] = "select";
14
+ DaffCompositeProductItemInputEnum["radio"] = "radio";
15
+ })(exports.DaffCompositeProductItemInputEnum || (exports.DaffCompositeProductItemInputEnum = {}));
70
16
 
71
17
  /**
72
- * @fileoverview added by tsickle
73
- * Generated from: models/product.ts
74
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
18
+ * The possible product types.
75
19
  */
76
- /** @enum {string} */
77
- var DaffProductTypeEnum = {
78
- Simple: "simple",
79
- Composite: "composite",
80
- Configurable: "configurable",
81
- };
82
- /**
83
- * An interface for a product usable by the \@daffodil/product library.
84
- * @record
85
- */
86
- function DaffProduct() { }
87
- if (false) {
88
- /**
89
- * The type of product.
90
- * @type {?}
91
- */
92
- DaffProduct.prototype.type;
93
- /**
94
- * The product name.
95
- * @type {?}
96
- */
97
- DaffProduct.prototype.name;
98
- /**
99
- * A smaller image to concisely visualize the product.
100
- * @type {?}
101
- */
102
- DaffProduct.prototype.thumbnail;
103
- /**
104
- * An array of images for the product.
105
- * @type {?}
106
- */
107
- DaffProduct.prototype.images;
108
- /**
109
- * A list of related products.
110
- * @type {?|undefined}
111
- */
112
- DaffProduct.prototype.related;
113
- /**
114
- * A list of upsell productss.
115
- * @type {?|undefined}
116
- */
117
- DaffProduct.prototype.upsell;
118
- /**
119
- * The price of the product.
120
- * @type {?|undefined}
121
- */
122
- DaffProduct.prototype.price;
123
- /**
124
- * The total discounts associated with this product.
125
- * @type {?|undefined}
126
- */
127
- DaffProduct.prototype.discount;
128
- /**
129
- * Whether or not the product is in stock.
130
- * @type {?|undefined}
131
- */
132
- DaffProduct.prototype.in_stock;
133
- /**
134
- * The product brand.
135
- * @type {?|undefined}
136
- */
137
- DaffProduct.prototype.brand;
138
- /**
139
- * Describes the product.
140
- * @type {?|undefined}
141
- */
142
- DaffProduct.prototype.description;
143
- /**
144
- * A shorter description of the product.
145
- * @type {?|undefined}
146
- */
147
- DaffProduct.prototype.short_description;
148
- /**
149
- * A title for the product to display in the browser tab title.
150
- * @type {?|undefined}
151
- */
152
- DaffProduct.prototype.meta_title;
153
- /**
154
- * A description of the product for usage in search engine results.
155
- * @type {?|undefined}
156
- */
157
- DaffProduct.prototype.meta_description;
158
- }
159
- /**
160
- * The discount for a product.
161
- * @record
162
- */
163
- function DaffProductDiscount() { }
164
- if (false) {
165
- /**
166
- * The discount represented as some amount of currency.
167
- * @type {?}
168
- */
169
- DaffProductDiscount.prototype.amount;
170
- /**
171
- * The discount represented as a percent of the original product price.
172
- * @type {?}
173
- */
174
- DaffProductDiscount.prototype.percent;
175
- }
20
+ (function (DaffProductTypeEnum) {
21
+ DaffProductTypeEnum["Simple"] = "simple";
22
+ DaffProductTypeEnum["Composite"] = "composite";
23
+ DaffProductTypeEnum["Configurable"] = "configurable";
24
+ })(exports.DaffProductTypeEnum || (exports.DaffProductTypeEnum = {}));
176
25
 
177
- /**
178
- * @fileoverview added by tsickle
179
- * Generated from: helpers.ts
180
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
181
- */
182
26
  /**
183
27
  * Returns whether a DaffPriceRange has a discount.
184
28
  *
185
- * \@param priceRange a DaffPriceRange
186
- * @type {?}
29
+ * @param priceRange a DaffPriceRange
187
30
  */
188
- var productPriceRangeHasDiscount = ( /**
189
- * @param {?} priceRange
190
- * @return {?}
191
- */function (priceRange) { return priceRange.minPrice.originalPrice !== priceRange.minPrice.discountedPrice ||
192
- priceRange.maxPrice.originalPrice !== priceRange.maxPrice.discountedPrice; });
31
+ var productPriceRangeHasDiscount = function (priceRange) { return priceRange.minPrice.originalPrice !== priceRange.minPrice.discountedPrice ||
32
+ priceRange.maxPrice.originalPrice !== priceRange.maxPrice.discountedPrice; };
193
33
  /**
194
34
  * Returns whether the min and max prices of a DaffPriceRange are different.
195
35
  *
196
- * \@param priceRange a DaffPriceRange
197
- * @type {?}
36
+ * @param priceRange a DaffPriceRange
198
37
  */
199
- var productPriceRangeHasPriceRange = ( /**
200
- * @param {?} priceRange
201
- * @return {?}
202
- */function (priceRange) { return priceRange.minPrice.originalPrice !== priceRange.maxPrice.originalPrice ||
203
- priceRange.minPrice.discountedPrice !== priceRange.maxPrice.discountedPrice; });
38
+ var productPriceRangeHasPriceRange = function (priceRange) { return priceRange.minPrice.originalPrice !== priceRange.maxPrice.originalPrice ||
39
+ priceRange.minPrice.discountedPrice !== priceRange.maxPrice.discountedPrice; };
204
40
 
205
41
  /**
206
- * @fileoverview added by tsickle
207
- * Generated from: injection-tokens/error-matcher.token.ts
208
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
209
- */
210
- /**
211
- * Transforms {\@link DaffError}s into {\@link DaffStateError}s before they are serialized into state.
42
+ * Transforms {@link DaffError}s into {@link DaffStateError}s before they are serialized into state.
212
43
  * Can be used to further refine Daffodil errors into more specific app errors.
213
- * @type {?}
214
- */
215
- var DAFF_PRODUCT_ERROR_MATCHER = new core.InjectionToken('DAFF_PRODUCT_ERROR_MATCHER', { factory: ( /**
216
- * @return {?}
217
- */function () { return state.daffTransformErrorToStateError; }) });
218
-
219
- /**
220
- * @fileoverview added by tsickle
221
- * Generated from: injection-tokens/public_api.ts
222
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
223
- */
224
-
225
- /**
226
- * @fileoverview added by tsickle
227
- * Generated from: index.ts
228
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
229
44
  */
45
+ var DAFF_PRODUCT_ERROR_MATCHER = new core.InjectionToken('DAFF_PRODUCT_ERROR_MATCHER', { factory: function () { return state.daffTransformErrorToStateError; } });
230
46
 
231
47
  /**
232
- * @fileoverview added by tsickle
233
- * Generated from: daffodil-product.ts
234
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
48
+ * Generated bundle index. Do not edit.
235
49
  */
236
50
 
237
51
  exports.DAFF_PRODUCT_ERROR_MATCHER = DAFF_PRODUCT_ERROR_MATCHER;
238
- exports.DaffCompositeProductItemInputEnum = DaffCompositeProductItemInputEnum;
239
- exports.DaffProductTypeEnum = DaffProductTypeEnum;
240
52
  exports.productPriceRangeHasDiscount = productPriceRangeHasDiscount;
241
53
  exports.productPriceRangeHasPriceRange = productPriceRangeHasPriceRange;
242
54
 
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-product.umd.js","sources":["../../../libs/product/src/models/composite-product-item.ts","../../../libs/product/src/models/product.ts","../../../libs/product/src/helpers.ts","../../../libs/product/src/injection-tokens/error-matcher.token.ts"],"sourcesContent":["import { DaffIdentifiable } from '@daffodil/core';\n\nimport { DaffProduct } from './product';\n\n/**\n * An enum for whether a composite product item should be displayed as a radio or select input.\n *\n * @deprecated import from @daffodil/composite-product instead.\n */\nexport enum DaffCompositeProductItemInputEnum {\n\tselect = 'select',\n\tradio = 'radio'\n}\n\n/**\n * The composite product item describes one set of product options that the user can add to the composite product.\n * A composite product item can be required or optional. If it is required, an option _must_ be chosen in order to add the product to the cart.\n * If the item is optional, the product can be added to the cart without an option having been chosen.\n * For example, if a composite product is a toolbox bundle, a composite product item might be a screw driver, and the options contained in that\n * item might be a phillips head and a flathead. The customer could choose to add either a phillips head or a flathead to the\n * composite product, or neither if the item is optional.\n *\n * @deprecated import from @daffodil/composite-product instead.\n */\nexport interface DaffCompositeProductItem extends DaffIdentifiable {\n\t/**\n\t * Whether the item is required or optional.\n\t */\n\trequired: boolean;\n\t/**\n\t * The title label for the item.\n\t */\n\ttitle: string;\n\t/**\n\t * Describes how the item should be displayed.\n\t */\n\tinput_type: DaffCompositeProductItemInputEnum;\n\t/**\n\t * The options that may be chosen for the item.\n\t */\n\toptions: DaffCompositeProductItemOption[];\n}\n\n/**\n * The composite product item option is a DaffProduct that can be added to a composite product.\n *\n * @deprecated import from @daffodil/composite-product instead.\n */\nexport interface DaffCompositeProductItemOption extends DaffProduct {\n\t/**\n\t * Whether the option is the default option for its parent {@link DaffCompositeProductItem}.\n\t */\n\tis_default: boolean;\n\t/**\n\t * The quantity chosen for the option.\n\t */\n\tquantity: number;\n}\n","import {\n DaffIdentifiable,\n DaffLocatable,\n DaffCanonicallyLocatable,\n} from '@daffodil/core';\n\nimport { DaffProductImage } from './product-image';\n\n/**\n * The possible product types.\n */\nexport enum DaffProductTypeEnum {\n\tSimple = 'simple',\n\tComposite = 'composite',\n\tConfigurable = 'configurable'\n}\n\n/**\n * An interface for a product usable by the @daffodil/product library.\n */\nexport interface DaffProduct extends DaffLocatable, DaffIdentifiable, Partial<DaffCanonicallyLocatable> {\n\t/**\n\t * The type of product.\n\t */\n type: DaffProductTypeEnum;\n /**\n * The product name.\n */\n name: string;\n /**\n * A smaller image to concisely visualize the product.\n */\n thumbnail: DaffProductImage;\n /**\n * An array of images for the product.\n */\n images: DaffProductImage[];\n /**\n * A list of related products.\n */\n related?: DaffProduct[];\n /**\n * A list of upsell productss.\n */\n upsell?: DaffProduct[];\n\n // TODO: move to subtypes\n /**\n * The price of the product.\n */\n\tprice?: number;\n\t/**\n\t * The total discounts associated with this product.\n\t */\n discount?: DaffProductDiscount;\n /**\n * Whether or not the product is in stock.\n */\n in_stock?: boolean;\n\n // TODO: move to meta object\n\t/**\n\t * The product brand.\n\t */\n brand?: string;\n\t/**\n\t * Describes the product.\n\t */\n description?: string;\n\t/**\n\t * A shorter description of the product.\n\t */\n\tshort_description?: string;\n\t/**\n\t * A title for the product to display in the browser tab title.\n\t */\n\tmeta_title?: string;\n\t/**\n\t * A description of the product for usage in search engine results.\n\t */\n\tmeta_description?: string;\n}\n\n/**\n * The discount for a product.\n */\nexport interface DaffProductDiscount {\n\t/**\n\t * The discount represented as some amount of currency.\n\t */\n\tamount: number;\n\t/**\n\t * The discount represented as a percent of the original product price.\n\t */\n\tpercent: number;\n}\n","import { DaffPriceRange } from './models/prices';\n\n/**\n * Returns whether a DaffPriceRange has a discount.\n *\n * @param priceRange a DaffPriceRange\n */\nexport const productPriceRangeHasDiscount = (priceRange: DaffPriceRange): boolean => priceRange.minPrice.originalPrice !== priceRange.minPrice.discountedPrice ||\n\t\tpriceRange.maxPrice.originalPrice !== priceRange.maxPrice.discountedPrice;\n\n/**\n * Returns whether the min and max prices of a DaffPriceRange are different.\n *\n * @param priceRange a DaffPriceRange\n */\nexport const productPriceRangeHasPriceRange = (priceRange: DaffPriceRange): boolean => priceRange.minPrice.originalPrice !== priceRange.maxPrice.originalPrice ||\n\t\tpriceRange.minPrice.discountedPrice !== priceRange.maxPrice.discountedPrice;\n","import { InjectionToken } from '@angular/core';\n\nimport { daffTransformErrorToStateError } from '@daffodil/core/state';\n\n/**\n * Transforms {@link DaffError}s into {@link DaffStateError}s before they are serialized into state.\n * Can be used to further refine Daffodil errors into more specific app errors.\n */\nexport const DAFF_PRODUCT_ERROR_MATCHER = new InjectionToken<typeof daffTransformErrorToStateError>(\n 'DAFF_PRODUCT_ERROR_MATCHER',\n { factory: () => daffTransformErrorToStateError },\n);\n"],"names":["InjectionToken","daffTransformErrorToStateError"],"mappings":";;;;;;;;;;;;QASY,iCAAiC;QAC5C,MAAM,UAAW;QACjB,KAAK,SAAU;MACf;;;;;;;;;;;;2CA6BA;;;;;;QAbA,4CAAkB;;;;;QAIlB,yCAAc;;;;;QAId,8CAA8C;;;;;QAI9C,2CAA0C;;;;;;;;iDAiB1C;;;;;;QALA,oDAAoB;;;;;QAIpB,kDAAiB;;;;;;;;;QC7CN,mBAAmB;QAC9B,MAAM,UAAW;QACjB,SAAS,aAAc;QACvB,YAAY,gBAAiB;MAC7B;;;;;8BAkEA;;;;;;QAzDC,2BAA0B;;;;;QAI1B,2BAAa;;;;;QAIb,gCAA4B;;;;;QAI5B,6BAA2B;;;;;QAI3B,8BAAwB;;;;;QAIxB,6BAAuB;;;;;QAMxB,4BAAe;;;;;QAId,+BAA+B;;;;;QAI/B,+BAAmB;;;;;QAMnB,4BAAe;;;;;QAIf,kCAAqB;;;;;QAItB,wCAA2B;;;;;QAI3B,iCAAoB;;;;;QAIpB,uCAA0B;;;;;;sCAe1B;;;;;;QALA,qCAAe;;;;;QAIf,sCAAgB;;;;;;;;;;;;;;QCvFJ,4BAA4B;;;OAAG,UAAC,UAA0B,IAAc,OAAA,UAAU,CAAC,QAAQ,CAAC,aAAa,KAAK,UAAU,CAAC,QAAQ,CAAC,eAAe;QAC5J,UAAU,CAAC,QAAQ,CAAC,aAAa,KAAK,UAAU,CAAC,QAAQ,CAAC,eAAe,GAAA;;;;;;;QAO9D,8BAA8B;;;OAAG,UAAC,UAA0B,IAAc,OAAA,UAAU,CAAC,QAAQ,CAAC,aAAa,KAAK,UAAU,CAAC,QAAQ,CAAC,aAAa;QAC5J,UAAU,CAAC,QAAQ,CAAC,eAAe,KAAK,UAAU,CAAC,QAAQ,CAAC,eAAe,GAAA;;;;;;;;;;;;QCRhE,0BAA0B,GAAG,IAAIA,mBAAc,CAC1D,4BAA4B,EAC5B,EAAE,OAAO;;eAAE,cAAM,OAAAC,oCAA8B,GAAA,CAAA,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"daffodil-product.umd.js","sources":["../../../libs/product/src/models/composite-product-item.ts","../../../libs/product/src/models/product.ts","../../../libs/product/src/helpers.ts","../../../libs/product/src/injection-tokens/error-matcher.token.ts","../../../libs/product/src/daffodil-product.ts"],"sourcesContent":["import { DaffIdentifiable } from '@daffodil/core';\n\nimport { DaffProduct } from './product';\n\n/**\n * An enum for whether a composite product item should be displayed as a radio or select input.\n *\n * @deprecated import from @daffodil/composite-product instead.\n */\nexport enum DaffCompositeProductItemInputEnum {\n\tselect = 'select',\n\tradio = 'radio'\n}\n\n/**\n * The composite product item describes one set of product options that the user can add to the composite product.\n * A composite product item can be required or optional. If it is required, an option _must_ be chosen in order to add the product to the cart.\n * If the item is optional, the product can be added to the cart without an option having been chosen.\n * For example, if a composite product is a toolbox bundle, a composite product item might be a screw driver, and the options contained in that\n * item might be a phillips head and a flathead. The customer could choose to add either a phillips head or a flathead to the\n * composite product, or neither if the item is optional.\n *\n * @deprecated import from @daffodil/composite-product instead.\n */\nexport interface DaffCompositeProductItem extends DaffIdentifiable {\n\t/**\n\t * Whether the item is required or optional.\n\t */\n\trequired: boolean;\n\t/**\n\t * The title label for the item.\n\t */\n\ttitle: string;\n\t/**\n\t * Describes how the item should be displayed.\n\t */\n\tinput_type: DaffCompositeProductItemInputEnum;\n\t/**\n\t * The options that may be chosen for the item.\n\t */\n\toptions: DaffCompositeProductItemOption[];\n}\n\n/**\n * The composite product item option is a DaffProduct that can be added to a composite product.\n *\n * @deprecated import from @daffodil/composite-product instead.\n */\nexport interface DaffCompositeProductItemOption extends DaffProduct {\n\t/**\n\t * Whether the option is the default option for its parent {@link DaffCompositeProductItem}.\n\t */\n\tis_default: boolean;\n\t/**\n\t * The quantity chosen for the option.\n\t */\n\tquantity: number;\n}\n","import {\n DaffIdentifiable,\n DaffLocatable,\n DaffCanonicallyLocatable,\n} from '@daffodil/core';\n\nimport { DaffProductImage } from './product-image';\n\n/**\n * The possible product types.\n */\nexport enum DaffProductTypeEnum {\n\tSimple = 'simple',\n\tComposite = 'composite',\n\tConfigurable = 'configurable'\n}\n\n/**\n * An interface for a product usable by the @daffodil/product library.\n */\nexport interface DaffProduct extends DaffLocatable, DaffIdentifiable, Partial<DaffCanonicallyLocatable> {\n\t/**\n\t * The type of product.\n\t */\n type: DaffProductTypeEnum;\n /**\n * The product name.\n */\n name: string;\n /**\n * A smaller image to concisely visualize the product.\n */\n thumbnail: DaffProductImage;\n /**\n * An array of images for the product.\n */\n images: DaffProductImage[];\n /**\n * A list of related products.\n */\n related?: DaffProduct[];\n /**\n * A list of upsell productss.\n */\n upsell?: DaffProduct[];\n\n // TODO: move to subtypes\n /**\n * The price of the product.\n */\n\tprice?: number;\n\t/**\n\t * The total discounts associated with this product.\n\t */\n discount?: DaffProductDiscount;\n /**\n * Whether or not the product is in stock.\n */\n in_stock?: boolean;\n\n // TODO: move to meta object\n\t/**\n\t * The product brand.\n\t */\n brand?: string;\n\t/**\n\t * Describes the product.\n\t */\n description?: string;\n\t/**\n\t * A shorter description of the product.\n\t */\n\tshort_description?: string;\n\t/**\n\t * A title for the product to display in the browser tab title.\n\t */\n\tmeta_title?: string;\n\t/**\n\t * A description of the product for usage in search engine results.\n\t */\n\tmeta_description?: string;\n}\n\n/**\n * The discount for a product.\n */\nexport interface DaffProductDiscount {\n\t/**\n\t * The discount represented as some amount of currency.\n\t */\n\tamount: number;\n\t/**\n\t * The discount represented as a percent of the original product price.\n\t */\n\tpercent: number;\n}\n","import { DaffPriceRange } from './models/prices';\n\n/**\n * Returns whether a DaffPriceRange has a discount.\n *\n * @param priceRange a DaffPriceRange\n */\nexport const productPriceRangeHasDiscount = (priceRange: DaffPriceRange): boolean => priceRange.minPrice.originalPrice !== priceRange.minPrice.discountedPrice ||\n\t\tpriceRange.maxPrice.originalPrice !== priceRange.maxPrice.discountedPrice;\n\n/**\n * Returns whether the min and max prices of a DaffPriceRange are different.\n *\n * @param priceRange a DaffPriceRange\n */\nexport const productPriceRangeHasPriceRange = (priceRange: DaffPriceRange): boolean => priceRange.minPrice.originalPrice !== priceRange.maxPrice.originalPrice ||\n\t\tpriceRange.minPrice.discountedPrice !== priceRange.maxPrice.discountedPrice;\n","import { InjectionToken } from '@angular/core';\n\nimport { daffTransformErrorToStateError } from '@daffodil/core/state';\n\n/**\n * Transforms {@link DaffError}s into {@link DaffStateError}s before they are serialized into state.\n * Can be used to further refine Daffodil errors into more specific app errors.\n */\nexport const DAFF_PRODUCT_ERROR_MATCHER = new InjectionToken<typeof daffTransformErrorToStateError>(\n 'DAFF_PRODUCT_ERROR_MATCHER',\n { factory: () => daffTransformErrorToStateError },\n);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["DaffCompositeProductItemInputEnum","DaffProductTypeEnum","InjectionToken","daffTransformErrorToStateError"],"mappings":";;;;;;IAIA;;;;;IAKA,WAAY,iCAAiC;QAC5C,sDAAiB,CAAA;QACjB,oDAAe,CAAA;IAChB,CAAC,EAHWA,yCAAiC,KAAjCA,yCAAiC;;ICD7C;;;IAGA,WAAY,mBAAmB;QAC9B,wCAAiB,CAAA;QACjB,8CAAuB,CAAA;QACvB,oDAA6B,CAAA;IAC9B,CAAC,EAJWC,2BAAmB,KAAnBA,2BAAmB;;ICT/B;;;;;QAKa,4BAA4B,GAAG,UAAC,UAA0B,IAAc,OAAA,UAAU,CAAC,QAAQ,CAAC,aAAa,KAAK,UAAU,CAAC,QAAQ,CAAC,eAAe;QAC5J,UAAU,CAAC,QAAQ,CAAC,aAAa,KAAK,UAAU,CAAC,QAAQ,CAAC,eAAe,IAAC;IAE5E;;;;;QAKa,8BAA8B,GAAG,UAAC,UAA0B,IAAc,OAAA,UAAU,CAAC,QAAQ,CAAC,aAAa,KAAK,UAAU,CAAC,QAAQ,CAAC,aAAa;QAC5J,UAAU,CAAC,QAAQ,CAAC,eAAe,KAAK,UAAU,CAAC,QAAQ,CAAC,eAAe;;ICZ7E;;;;QAIa,0BAA0B,GAAG,IAAIC,mBAAc,CAC1D,4BAA4B,EAC5B,EAAE,OAAO,EAAE,cAAM,OAAAC,oCAA8B,GAAA,EAAE;;ICVnD;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- !function(e,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("@angular/core"),require("@daffodil/core/state")):"function"==typeof define&&define.amd?define("@daffodil/product",["exports","@angular/core","@daffodil/core/state"],i):i(((e="undefined"!=typeof globalThis?globalThis:e||self).daffodil=e.daffodil||{},e.daffodil.product={}),e.ng.core,e.state)}(this,(function(e,i,r){"use strict";var o=new i.InjectionToken("DAFF_PRODUCT_ERROR_MATCHER",{factory:function(){return r.daffTransformErrorToStateError}});e.DAFF_PRODUCT_ERROR_MATCHER=o,e.DaffCompositeProductItemInputEnum={select:"select",radio:"radio"},e.DaffProductTypeEnum={Simple:"simple",Composite:"composite",Configurable:"configurable"},e.productPriceRangeHasDiscount=function(e){return e.minPrice.originalPrice!==e.minPrice.discountedPrice||e.maxPrice.originalPrice!==e.maxPrice.discountedPrice},e.productPriceRangeHasPriceRange=function(e){return e.minPrice.originalPrice!==e.maxPrice.originalPrice||e.minPrice.discountedPrice!==e.maxPrice.discountedPrice},Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("@angular/core"),require("@daffodil/core/state")):"function"==typeof define&&define.amd?define("@daffodil/product",["exports","@angular/core","@daffodil/core/state"],i):i(((e="undefined"!=typeof globalThis?globalThis:e||self).daffodil=e.daffodil||{},e.daffodil.product={}),e.ng.core,e.state)}(this,(function(e,i,r){"use strict";var o,n;(o=e.DaffCompositeProductItemInputEnum||(e.DaffCompositeProductItemInputEnum={})).select="select",o.radio="radio",(n=e.DaffProductTypeEnum||(e.DaffProductTypeEnum={})).Simple="simple",n.Composite="composite",n.Configurable="configurable";var t=new i.InjectionToken("DAFF_PRODUCT_ERROR_MATCHER",{factory:function(){return r.daffTransformErrorToStateError}});e.DAFF_PRODUCT_ERROR_MATCHER=t,e.productPriceRangeHasDiscount=function(e){return e.minPrice.originalPrice!==e.minPrice.discountedPrice||e.maxPrice.originalPrice!==e.maxPrice.discountedPrice},e.productPriceRangeHasPriceRange=function(e){return e.minPrice.originalPrice!==e.maxPrice.originalPrice||e.minPrice.discountedPrice!==e.maxPrice.discountedPrice},Object.defineProperty(e,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=daffodil-product.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../libs/product/src/injection-tokens/error-matcher.token.ts","../../../libs/product/src/models/composite-product-item.ts","../../../libs/product/src/models/product.ts","../../../libs/product/src/helpers.ts"],"names":["DAFF_PRODUCT_ERROR_MATCHER","InjectionToken","factory","daffTransformErrorToStateError","select","radio","Simple","Composite","Configurable","priceRange","minPrice","originalPrice","discountedPrice","maxPrice"],"mappings":"kaAQaA,EAA6B,IAAIC,EAAAA,eAC5C,6BACA,CAAEC,QAAO,WAAQ,OAAAC,EAAAA,qGCD0B,CAC5CC,OAAM,SACNC,MAAK,+BCAyB,CAC9BC,OAAM,SACNC,UAAS,YACTC,aAAY,+CCP4B,SAAIC,GAAwC,OAAAA,EAAWC,SAASC,gBAAkBF,EAAWC,SAASE,iBAC7IH,EAAWI,SAASF,gBAAkBF,EAAWI,SAASD,kDAOjB,SAAIH,GAAwC,OAAAA,EAAWC,SAASC,gBAAkBF,EAAWI,SAASF,eAC/IF,EAAWC,SAASE,kBAAoBH,EAAWI,SAASD","sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { daffTransformErrorToStateError } from '@daffodil/core/state';\n\n/**\n * Transforms {@link DaffError}s into {@link DaffStateError}s before they are serialized into state.\n * Can be used to further refine Daffodil errors into more specific app errors.\n */\nexport const DAFF_PRODUCT_ERROR_MATCHER = new InjectionToken<typeof daffTransformErrorToStateError>(\n 'DAFF_PRODUCT_ERROR_MATCHER',\n { factory: () => daffTransformErrorToStateError },\n);\n","import { DaffIdentifiable } from '@daffodil/core';\n\nimport { DaffProduct } from './product';\n\n/**\n * An enum for whether a composite product item should be displayed as a radio or select input.\n *\n * @deprecated import from @daffodil/composite-product instead.\n */\nexport enum DaffCompositeProductItemInputEnum {\n\tselect = 'select',\n\tradio = 'radio'\n}\n\n/**\n * The composite product item describes one set of product options that the user can add to the composite product.\n * A composite product item can be required or optional. If it is required, an option _must_ be chosen in order to add the product to the cart.\n * If the item is optional, the product can be added to the cart without an option having been chosen.\n * For example, if a composite product is a toolbox bundle, a composite product item might be a screw driver, and the options contained in that\n * item might be a phillips head and a flathead. The customer could choose to add either a phillips head or a flathead to the\n * composite product, or neither if the item is optional.\n *\n * @deprecated import from @daffodil/composite-product instead.\n */\nexport interface DaffCompositeProductItem extends DaffIdentifiable {\n\t/**\n\t * Whether the item is required or optional.\n\t */\n\trequired: boolean;\n\t/**\n\t * The title label for the item.\n\t */\n\ttitle: string;\n\t/**\n\t * Describes how the item should be displayed.\n\t */\n\tinput_type: DaffCompositeProductItemInputEnum;\n\t/**\n\t * The options that may be chosen for the item.\n\t */\n\toptions: DaffCompositeProductItemOption[];\n}\n\n/**\n * The composite product item option is a DaffProduct that can be added to a composite product.\n *\n * @deprecated import from @daffodil/composite-product instead.\n */\nexport interface DaffCompositeProductItemOption extends DaffProduct {\n\t/**\n\t * Whether the option is the default option for its parent {@link DaffCompositeProductItem}.\n\t */\n\tis_default: boolean;\n\t/**\n\t * The quantity chosen for the option.\n\t */\n\tquantity: number;\n}\n","import {\n DaffIdentifiable,\n DaffLocatable,\n DaffCanonicallyLocatable,\n} from '@daffodil/core';\n\nimport { DaffProductImage } from './product-image';\n\n/**\n * The possible product types.\n */\nexport enum DaffProductTypeEnum {\n\tSimple = 'simple',\n\tComposite = 'composite',\n\tConfigurable = 'configurable'\n}\n\n/**\n * An interface for a product usable by the @daffodil/product library.\n */\nexport interface DaffProduct extends DaffLocatable, DaffIdentifiable, Partial<DaffCanonicallyLocatable> {\n\t/**\n\t * The type of product.\n\t */\n type: DaffProductTypeEnum;\n /**\n * The product name.\n */\n name: string;\n /**\n * A smaller image to concisely visualize the product.\n */\n thumbnail: DaffProductImage;\n /**\n * An array of images for the product.\n */\n images: DaffProductImage[];\n /**\n * A list of related products.\n */\n related?: DaffProduct[];\n /**\n * A list of upsell productss.\n */\n upsell?: DaffProduct[];\n\n // TODO: move to subtypes\n /**\n * The price of the product.\n */\n\tprice?: number;\n\t/**\n\t * The total discounts associated with this product.\n\t */\n discount?: DaffProductDiscount;\n /**\n * Whether or not the product is in stock.\n */\n in_stock?: boolean;\n\n // TODO: move to meta object\n\t/**\n\t * The product brand.\n\t */\n brand?: string;\n\t/**\n\t * Describes the product.\n\t */\n description?: string;\n\t/**\n\t * A shorter description of the product.\n\t */\n\tshort_description?: string;\n\t/**\n\t * A title for the product to display in the browser tab title.\n\t */\n\tmeta_title?: string;\n\t/**\n\t * A description of the product for usage in search engine results.\n\t */\n\tmeta_description?: string;\n}\n\n/**\n * The discount for a product.\n */\nexport interface DaffProductDiscount {\n\t/**\n\t * The discount represented as some amount of currency.\n\t */\n\tamount: number;\n\t/**\n\t * The discount represented as a percent of the original product price.\n\t */\n\tpercent: number;\n}\n","import { DaffPriceRange } from './models/prices';\n\n/**\n * Returns whether a DaffPriceRange has a discount.\n *\n * @param priceRange a DaffPriceRange\n */\nexport const productPriceRangeHasDiscount = (priceRange: DaffPriceRange): boolean => priceRange.minPrice.originalPrice !== priceRange.minPrice.discountedPrice ||\n\t\tpriceRange.maxPrice.originalPrice !== priceRange.maxPrice.discountedPrice;\n\n/**\n * Returns whether the min and max prices of a DaffPriceRange are different.\n *\n * @param priceRange a DaffPriceRange\n */\nexport const productPriceRangeHasPriceRange = (priceRange: DaffPriceRange): boolean => priceRange.minPrice.originalPrice !== priceRange.maxPrice.originalPrice ||\n\t\tpriceRange.minPrice.discountedPrice !== priceRange.maxPrice.discountedPrice;\n"]}
1
+ {"version":3,"sources":["../../../libs/product/src/models/composite-product-item.ts","../../../libs/product/src/models/product.ts","../../../libs/product/src/injection-tokens/error-matcher.token.ts","../../../libs/product/src/helpers.ts"],"names":["DaffCompositeProductItemInputEnum","DaffProductTypeEnum","DAFF_PRODUCT_ERROR_MATCHER","InjectionToken","factory","daffTransformErrorToStateError","priceRange","minPrice","originalPrice","discountedPrice","maxPrice"],"mappings":"8ZASA,IAAYA,ECEAC,GDFAD,EAAAA,EAAAA,oCAAAA,EAAAA,kCAAiC,KAC5C,OAAA,SACAA,EAAA,MAAA,SCAWC,EAAAA,EAAAA,sBAAAA,EAAAA,oBAAmB,KAC9B,OAAA,SACAA,EAAA,UAAA,YACAA,EAAA,aAAA,mBCNYC,EAA6B,IAAIC,EAAAA,eAC5C,6BACA,CAAEC,QAAS,WAAM,OAAAC,EAAAA,gGCHyB,SAACC,GAAwC,OAAAA,EAAWC,SAASC,gBAAkBF,EAAWC,SAASE,iBAC7IH,EAAWI,SAASF,gBAAkBF,EAAWI,SAASD,kDAOd,SAACH,GAAwC,OAAAA,EAAWC,SAASC,gBAAkBF,EAAWI,SAASF,eAC/IF,EAAWC,SAASE,kBAAoBH,EAAWI,SAASD","sourcesContent":["import { DaffIdentifiable } from '@daffodil/core';\n\nimport { DaffProduct } from './product';\n\n/**\n * An enum for whether a composite product item should be displayed as a radio or select input.\n *\n * @deprecated import from @daffodil/composite-product instead.\n */\nexport enum DaffCompositeProductItemInputEnum {\n\tselect = 'select',\n\tradio = 'radio'\n}\n\n/**\n * The composite product item describes one set of product options that the user can add to the composite product.\n * A composite product item can be required or optional. If it is required, an option _must_ be chosen in order to add the product to the cart.\n * If the item is optional, the product can be added to the cart without an option having been chosen.\n * For example, if a composite product is a toolbox bundle, a composite product item might be a screw driver, and the options contained in that\n * item might be a phillips head and a flathead. The customer could choose to add either a phillips head or a flathead to the\n * composite product, or neither if the item is optional.\n *\n * @deprecated import from @daffodil/composite-product instead.\n */\nexport interface DaffCompositeProductItem extends DaffIdentifiable {\n\t/**\n\t * Whether the item is required or optional.\n\t */\n\trequired: boolean;\n\t/**\n\t * The title label for the item.\n\t */\n\ttitle: string;\n\t/**\n\t * Describes how the item should be displayed.\n\t */\n\tinput_type: DaffCompositeProductItemInputEnum;\n\t/**\n\t * The options that may be chosen for the item.\n\t */\n\toptions: DaffCompositeProductItemOption[];\n}\n\n/**\n * The composite product item option is a DaffProduct that can be added to a composite product.\n *\n * @deprecated import from @daffodil/composite-product instead.\n */\nexport interface DaffCompositeProductItemOption extends DaffProduct {\n\t/**\n\t * Whether the option is the default option for its parent {@link DaffCompositeProductItem}.\n\t */\n\tis_default: boolean;\n\t/**\n\t * The quantity chosen for the option.\n\t */\n\tquantity: number;\n}\n","import {\n DaffIdentifiable,\n DaffLocatable,\n DaffCanonicallyLocatable,\n} from '@daffodil/core';\n\nimport { DaffProductImage } from './product-image';\n\n/**\n * The possible product types.\n */\nexport enum DaffProductTypeEnum {\n\tSimple = 'simple',\n\tComposite = 'composite',\n\tConfigurable = 'configurable'\n}\n\n/**\n * An interface for a product usable by the @daffodil/product library.\n */\nexport interface DaffProduct extends DaffLocatable, DaffIdentifiable, Partial<DaffCanonicallyLocatable> {\n\t/**\n\t * The type of product.\n\t */\n type: DaffProductTypeEnum;\n /**\n * The product name.\n */\n name: string;\n /**\n * A smaller image to concisely visualize the product.\n */\n thumbnail: DaffProductImage;\n /**\n * An array of images for the product.\n */\n images: DaffProductImage[];\n /**\n * A list of related products.\n */\n related?: DaffProduct[];\n /**\n * A list of upsell productss.\n */\n upsell?: DaffProduct[];\n\n // TODO: move to subtypes\n /**\n * The price of the product.\n */\n\tprice?: number;\n\t/**\n\t * The total discounts associated with this product.\n\t */\n discount?: DaffProductDiscount;\n /**\n * Whether or not the product is in stock.\n */\n in_stock?: boolean;\n\n // TODO: move to meta object\n\t/**\n\t * The product brand.\n\t */\n brand?: string;\n\t/**\n\t * Describes the product.\n\t */\n description?: string;\n\t/**\n\t * A shorter description of the product.\n\t */\n\tshort_description?: string;\n\t/**\n\t * A title for the product to display in the browser tab title.\n\t */\n\tmeta_title?: string;\n\t/**\n\t * A description of the product for usage in search engine results.\n\t */\n\tmeta_description?: string;\n}\n\n/**\n * The discount for a product.\n */\nexport interface DaffProductDiscount {\n\t/**\n\t * The discount represented as some amount of currency.\n\t */\n\tamount: number;\n\t/**\n\t * The discount represented as a percent of the original product price.\n\t */\n\tpercent: number;\n}\n","import { InjectionToken } from '@angular/core';\n\nimport { daffTransformErrorToStateError } from '@daffodil/core/state';\n\n/**\n * Transforms {@link DaffError}s into {@link DaffStateError}s before they are serialized into state.\n * Can be used to further refine Daffodil errors into more specific app errors.\n */\nexport const DAFF_PRODUCT_ERROR_MATCHER = new InjectionToken<typeof daffTransformErrorToStateError>(\n 'DAFF_PRODUCT_ERROR_MATCHER',\n { factory: () => daffTransformErrorToStateError },\n);\n","import { DaffPriceRange } from './models/prices';\n\n/**\n * Returns whether a DaffPriceRange has a discount.\n *\n * @param priceRange a DaffPriceRange\n */\nexport const productPriceRangeHasDiscount = (priceRange: DaffPriceRange): boolean => priceRange.minPrice.originalPrice !== priceRange.minPrice.discountedPrice ||\n\t\tpriceRange.maxPrice.originalPrice !== priceRange.maxPrice.discountedPrice;\n\n/**\n * Returns whether the min and max prices of a DaffPriceRange are different.\n *\n * @param priceRange a DaffPriceRange\n */\nexport const productPriceRangeHasPriceRange = (priceRange: DaffPriceRange): boolean => priceRange.minPrice.originalPrice !== priceRange.maxPrice.originalPrice ||\n\t\tpriceRange.minPrice.discountedPrice !== priceRange.maxPrice.discountedPrice;\n"]}
@@ -11,10 +11,11 @@ import { DaffProductImageFactory, DaffProductExtensionFactory } from '@daffodil/
11
11
  export declare class DaffInMemoryBackendProductService implements InMemoryDbService {
12
12
  private productFactory;
13
13
  private productImageFactory;
14
+ protected _products: DaffProduct[];
14
15
  /**
15
- * @docs-private
16
+ * The collection of products in the backend.
16
17
  */
17
- products: DaffProduct[];
18
+ get products(): DaffProduct[];
18
19
  constructor(productFactory: DaffProductExtensionFactory, productImageFactory: DaffProductImageFactory);
19
20
  /**
20
21
  * Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.