@gofynd/fdk-store-gql 3.0.39 → 3.0.41

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 (167) hide show
  1. package/azure-pipelines.yml +22 -2
  2. package/lib/graphql/mutations/UnFollowById.handler.js +1 -1
  3. package/lib/graphql/mutations/UnFollowById.handler.js.map +1 -1
  4. package/lib/graphql/mutations/addItemsToCart.handler.js +2 -2
  5. package/lib/graphql/mutations/addItemsToCart.handler.js.map +1 -1
  6. package/lib/graphql/mutations/applyCoupon.handler.js +1 -1
  7. package/lib/graphql/mutations/applyCoupon.handler.js.map +1 -1
  8. package/lib/graphql/mutations/applyRewardPoints.handler.js +1 -1
  9. package/lib/graphql/mutations/applyRewardPoints.handler.js.map +1 -1
  10. package/lib/graphql/mutations/followById.handler.js +1 -1
  11. package/lib/graphql/mutations/followById.handler.js.map +1 -1
  12. package/lib/graphql/mutations/getCartShareLink.handler.js.map +1 -1
  13. package/lib/graphql/mutations/index.js +2 -2
  14. package/lib/graphql/mutations/index.js.map +1 -1
  15. package/lib/graphql/mutations/loginWithAppleIOS.handler.js.map +1 -1
  16. package/lib/graphql/mutations/loginWithEmailAndPassword.handler.js.map +1 -1
  17. package/lib/graphql/mutations/loginWithFacebook.handler.js.map +1 -1
  18. package/lib/graphql/mutations/loginWithGoogle.handler.js.map +1 -1
  19. package/lib/graphql/mutations/loginWithOTP.handler.d.ts +3 -1
  20. package/lib/graphql/mutations/loginWithOTP.handler.js +1 -1
  21. package/lib/graphql/mutations/loginWithOTP.handler.js.map +1 -1
  22. package/lib/graphql/mutations/removeCoupon.handler.js +1 -1
  23. package/lib/graphql/mutations/removeCoupon.handler.js.map +1 -1
  24. package/lib/graphql/mutations/selectAddress.handler.js +1 -1
  25. package/lib/graphql/mutations/selectAddress.handler.js.map +1 -1
  26. package/lib/graphql/mutations/selectPaymentMode.handler.js +1 -1
  27. package/lib/graphql/mutations/selectPaymentMode.handler.js.map +1 -1
  28. package/lib/graphql/mutations/updateAddress.handler.js.map +1 -1
  29. package/lib/graphql/mutations/updateCart.handler.js +2 -2
  30. package/lib/graphql/mutations/updateCart.handler.js.map +1 -1
  31. package/lib/graphql/mutations/updateCartMeta.handler.js.map +1 -1
  32. package/lib/graphql/mutations/updateProfile.handler.js +1 -1
  33. package/lib/graphql/mutations/updateProfile.handler.js.map +1 -1
  34. package/lib/graphql/mutations/verifyEmailOtp.handler.js.map +1 -1
  35. package/lib/graphql/mutations/verifyMobileOTP.handler.js.map +1 -1
  36. package/lib/graphql/query/address.handler.js.map +1 -1
  37. package/lib/graphql/query/addresses.handler.js.map +1 -1
  38. package/lib/graphql/query/aggregatorsConfig.handler.js.map +1 -1
  39. package/lib/graphql/query/allCountries.handler.js.map +1 -1
  40. package/lib/graphql/query/applicationConfiguration.handler.js +1 -1
  41. package/lib/graphql/query/applicationConfiguration.handler.js.map +1 -1
  42. package/lib/graphql/query/applicationContent.handler.js +2 -2
  43. package/lib/graphql/query/applicationContent.handler.js.map +1 -1
  44. package/lib/graphql/query/applicationStaff.handler.js +1 -1
  45. package/lib/graphql/query/applicationStaff.handler.js.map +1 -1
  46. package/lib/graphql/query/blog.handler.js +1 -1
  47. package/lib/graphql/query/blog.handler.js.map +1 -1
  48. package/lib/graphql/query/brands.handler.js.map +1 -1
  49. package/lib/graphql/query/bulkDiscountOffers.handler.js.map +1 -1
  50. package/lib/graphql/query/cartHandler.js +1 -1
  51. package/lib/graphql/query/cartHandler.js.map +1 -1
  52. package/lib/graphql/query/cartShipmentDetails.handler.js.map +1 -1
  53. package/lib/graphql/query/categories.handler.js.map +1 -1
  54. package/lib/graphql/query/collection.handler.js +1 -1
  55. package/lib/graphql/query/collection.handler.js.map +1 -1
  56. package/lib/graphql/query/collectionItems.handler.js.map +1 -1
  57. package/lib/graphql/query/coupons.handler.js.map +1 -1
  58. package/lib/graphql/query/customPage.hadler.js.map +1 -1
  59. package/lib/graphql/query/faqsByCategory.handler.js.map +1 -1
  60. package/lib/graphql/query/followedListing.handler.js.map +1 -1
  61. package/lib/graphql/query/followerCount.handler.js.map +1 -1
  62. package/lib/graphql/query/index.js +2 -2
  63. package/lib/graphql/query/index.js.map +1 -1
  64. package/lib/graphql/query/localityHandler.js.map +1 -1
  65. package/lib/graphql/query/order.handler.js +1 -1
  66. package/lib/graphql/query/order.handler.js.map +1 -1
  67. package/lib/graphql/query/page.handler.js +1 -2
  68. package/lib/graphql/query/page.handler.js.map +1 -1
  69. package/lib/graphql/query/paymentModeRoutes.handler.js.map +1 -1
  70. package/lib/graphql/query/pincodeDetails.handler.js.map +1 -1
  71. package/lib/graphql/query/platformConfig.handler.js.map +1 -1
  72. package/lib/graphql/query/product.handler.js +1 -1
  73. package/lib/graphql/query/product.handler.js.map +1 -1
  74. package/lib/graphql/query/productPrice.handler.js.map +1 -1
  75. package/lib/graphql/query/products.handler.js +1 -1
  76. package/lib/graphql/query/products.handler.js.map +1 -1
  77. package/lib/graphql/query/store.handler.js.map +1 -1
  78. package/lib/graphql/query/theme.handler.js +1 -1
  79. package/lib/graphql/query/theme.handler.js.map +1 -1
  80. package/lib/graphql/query/user.handler.js +2 -2
  81. package/lib/graphql/query/user.handler.js.map +1 -1
  82. package/lib/helpers/FPI-events.d.ts +1 -1
  83. package/lib/helpers/FPI-events.js +109 -88
  84. package/lib/helpers/FPI-events.js.map +1 -1
  85. package/lib/helpers/utils.js +20 -21
  86. package/lib/helpers/utils.js.map +1 -1
  87. package/lib/index.d.ts +2 -2
  88. package/lib/index.js +7 -2
  89. package/lib/index.js.map +1 -1
  90. package/lib/store/enums/keys.js.map +1 -1
  91. package/lib/store/index.d.ts +3 -0
  92. package/lib/store/index.js +27 -9
  93. package/lib/store/index.js.map +1 -1
  94. package/lib/store/modules/custom.js.map +1 -1
  95. package/lib/store/modules/payment.d.ts +1 -0
  96. package/lib/store/modules/payment.js +4 -1
  97. package/lib/store/modules/payment.js.map +1 -1
  98. package/lib/store/modules/theme.js +1 -2
  99. package/lib/store/modules/theme.js.map +1 -1
  100. package/lib/store/slices/address.js.map +1 -1
  101. package/lib/store/slices/auth.js +17 -5
  102. package/lib/store/slices/auth.js.map +1 -1
  103. package/lib/store/slices/brands.js +2 -2
  104. package/lib/store/slices/brands.js.map +1 -1
  105. package/lib/store/slices/cart.js +4 -4
  106. package/lib/store/slices/cart.js.map +1 -1
  107. package/lib/store/slices/categories.js +1 -1
  108. package/lib/store/slices/categories.js.map +1 -1
  109. package/lib/store/slices/collection.js +1 -1
  110. package/lib/store/slices/configuration.js +2 -2
  111. package/lib/store/slices/configuration.js.map +1 -1
  112. package/lib/store/slices/content.js +3 -3
  113. package/lib/store/slices/content.js.map +1 -1
  114. package/lib/store/slices/logistic.js +1 -1
  115. package/lib/store/slices/logistic.js.map +1 -1
  116. package/lib/store/slices/order.js +2 -2
  117. package/lib/store/slices/order.js.map +1 -1
  118. package/lib/store/slices/payment.d.ts +11 -0
  119. package/lib/store/slices/payment.js +22 -3
  120. package/lib/store/slices/payment.js.map +1 -1
  121. package/lib/store/slices/product.js +2 -2
  122. package/lib/store/slices/product.js.map +1 -1
  123. package/lib/store/slices/products.js +2 -2
  124. package/lib/store/slices/products.js.map +1 -1
  125. package/lib/store/slices/share.js +2 -2
  126. package/lib/store/slices/share.js.map +1 -1
  127. package/lib/store/slices/theme.js +3 -3
  128. package/lib/store/slices/theme.js.map +1 -1
  129. package/lib/store/store.js.map +1 -1
  130. package/lib/store/utils/gateways/ajiodhan.js +2 -2
  131. package/lib/store/utils/gateways/ajiodhan.js.map +1 -1
  132. package/lib/store/utils/gateways/ccavenue.js +1 -1
  133. package/lib/store/utils/gateways/ccavenue.js.map +1 -1
  134. package/lib/store/utils/gateways/epaylater.js +2 -2
  135. package/lib/store/utils/gateways/epaylater.js.map +1 -1
  136. package/lib/store/utils/gateways/helper.js +4 -4
  137. package/lib/store/utils/gateways/helper.js.map +1 -1
  138. package/lib/store/utils/gateways/index.js +12 -12
  139. package/lib/store/utils/gateways/index.js.map +1 -1
  140. package/lib/store/utils/gateways/jio.js +2 -2
  141. package/lib/store/utils/gateways/jio.js.map +1 -1
  142. package/lib/store/utils/gateways/jiopay.js +2 -2
  143. package/lib/store/utils/gateways/jiopay.js.map +1 -1
  144. package/lib/store/utils/gateways/juspay.js +7 -8
  145. package/lib/store/utils/gateways/juspay.js.map +1 -1
  146. package/lib/store/utils/gateways/payumoney.js.map +1 -1
  147. package/lib/store/utils/gateways/potlee.js +4 -2
  148. package/lib/store/utils/gateways/potlee.js.map +1 -1
  149. package/lib/store/utils/gateways/razorpay.d.ts +11 -10
  150. package/lib/store/utils/gateways/razorpay.js +46 -8
  151. package/lib/store/utils/gateways/razorpay.js.map +1 -1
  152. package/lib/store/utils/gateways/rupifi.js +2 -1
  153. package/lib/store/utils/gateways/rupifi.js.map +1 -1
  154. package/lib/store/utils/gateways/simply.js.map +1 -1
  155. package/lib/store/utils/gateways/standard_extension.js +3 -3
  156. package/lib/store/utils/gateways/standard_extension.js.map +1 -1
  157. package/lib/store/utils/helper.js +4 -4
  158. package/lib/store/utils/helper.js.map +1 -1
  159. package/lib/store/utils/payment.d.ts +2 -0
  160. package/lib/store/utils/payment.js +53 -19
  161. package/lib/store/utils/payment.js.map +1 -1
  162. package/lib/store/utils/util.js +3 -3
  163. package/lib/store/utils/util.js.map +1 -1
  164. package/lib/types/auth.d.ts +2 -2
  165. package/lib/types/graphql.d.ts +1 -0
  166. package/lib/types/graphql.js.map +1 -1
  167. package/package.json +5 -3
@@ -1 +1 @@
1
- {"version":3,"file":"pincodeDetails.handler.js","sourceRoot":"","sources":["../../../src/graphql/query/pincodeDetails.handler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,MAAM,UAAU,qBAAqB,CAAC,cAAmB,EAAE,QAAkC,EAAC,MAAa;IACvG,IAAI,cAAc,EAAE;QAChB,QAAQ,CAAC,iBAAiB,iCAAK,cAAc,GAAI,MAAM,EAAE,CAAC,CAAA;KAC7D;AACL,CAAC"}
1
+ {"version":3,"file":"pincodeDetails.handler.js","sourceRoot":"","sources":["../../../src/graphql/query/pincodeDetails.handler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,MAAM,UAAU,qBAAqB,CACnC,cAAmB,EACnB,QAAkC,EAClC,MAAc;IAEd,IAAI,cAAc,EAAE;QAClB,QAAQ,CAAC,iBAAiB,iCAAM,cAAc,GAAK,MAAM,EAAG,CAAC,CAAC;KAC/D;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"platformConfig.handler.js","sourceRoot":"","sources":["../../../src/graphql/query/platformConfig.handler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,UAAU,qBAAqB,CAAC,cAA8B,EAAE,QAAkC;IACpG,IAAI,cAAc,EAAE;QAChB,QAAQ,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC,CAAA;KAC9C;AACL,CAAC"}
1
+ {"version":3,"file":"platformConfig.handler.js","sourceRoot":"","sources":["../../../src/graphql/query/platformConfig.handler.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,UAAU,qBAAqB,CACnC,cAA8B,EAC9B,QAAkC;IAElC,IAAI,cAAc,EAAE;QAClB,QAAQ,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC,CAAC;KAC7C;AACH,CAAC"}
@@ -3,7 +3,7 @@ import { emitFPIEvent, FPI_EVENTS } from "../../helpers/FPI-events";
3
3
  export function productHandler(product, dispatch, params, oldStore) {
4
4
  if (product) {
5
5
  dispatch(setProduct(product));
6
- emitFPIEvent(FPI_EVENTS.PRODUCT_DETAIL_PAGE_VIEW, params, product, oldStore);
6
+ emitFPIEvent(FPI_EVENTS.PRODUCT_DETAIL_PAGE_VIEW, params, product, oldStore, dispatch);
7
7
  }
8
8
  if (product.variants) {
9
9
  dispatch(setProductVariants(product.variants));
@@ -1 +1 @@
1
- {"version":3,"file":"product.handler.js","sourceRoot":"","sources":["../../../src/graphql/query/product.handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEpE,MAAM,UAAU,cAAc,CAC5B,OAAgB,EAChB,QAAkC,EAClC,MAAe,EACf,QAAiB;IAEjB,IAAI,OAAO,EAAE;QACX,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;QAC9B,YAAY,CACV,UAAU,CAAC,wBAAwB,EACnC,MAAM,EACN,OAAO,EACP,QAAQ,CACT,CAAA;KACF;IACD,IAAI,OAAO,CAAC,QAAQ,EAAE;QACpB,QAAQ,CAAC,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;KAChD;AACH,CAAC"}
1
+ {"version":3,"file":"product.handler.js","sourceRoot":"","sources":["../../../src/graphql/query/product.handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEpE,MAAM,UAAU,cAAc,CAC5B,OAAgB,EAChB,QAAkC,EAClC,MAAe,EACf,QAAiB;IAEjB,IAAI,OAAO,EAAE;QACX,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;QAC9B,YAAY,CACV,UAAU,CAAC,wBAAwB,EACnC,MAAM,EACN,OAAO,EACP,QAAQ,EACR,QAAQ,CACT,CAAC;KACH;IACD,IAAI,OAAO,CAAC,QAAQ,EAAE;QACpB,QAAQ,CAAC,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;KAChD;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"productPrice.handler.js","sourceRoot":"","sources":["../../../src/graphql/query/productPrice.handler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,MAAM,UAAU,mBAAmB,CACjC,YAA8B,EAC9B,QAAkC,EAClC,MAAW;IAET,QAAQ,CAAC,eAAe,iCAAK,YAAY,GAAK,MAAM,EAAE,CAAC,CAAC;AAC5D,CAAC"}
1
+ {"version":3,"file":"productPrice.handler.js","sourceRoot":"","sources":["../../../src/graphql/query/productPrice.handler.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,MAAM,UAAU,mBAAmB,CACjC,YAA8B,EAC9B,QAAkC,EAClC,MAAW;IAEX,QAAQ,CAAC,eAAe,iCAAM,YAAY,GAAK,MAAM,EAAG,CAAC,CAAC;AAC5D,CAAC"}
@@ -3,7 +3,7 @@ import { emitFPIEvent, FPI_EVENTS } from "../../helpers/FPI-events";
3
3
  export function productsHandler(products, dispatch, params, oldStore) {
4
4
  if (products) {
5
5
  dispatch(setProducts(products));
6
- emitFPIEvent(FPI_EVENTS.PRODUCT_LIST_VIEW, params, products, oldStore);
6
+ emitFPIEvent(FPI_EVENTS.PRODUCT_LIST_VIEW, params, products, oldStore, dispatch);
7
7
  }
8
8
  }
9
9
  //# sourceMappingURL=products.handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"products.handler.js","sourceRoot":"","sources":["../../../src/graphql/query/products.handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEpE,MAAM,UAAU,eAAe,CAC7B,QAA2B,EAC3B,QAAkC,EAClC,MAAe,EACf,QAAiB;IAEjB,IAAI,QAAQ,EAAE;QACZ,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;QAChC,YAAY,CACV,UAAU,CAAC,iBAAiB,EAC5B,MAAM,EACN,QAAQ,EACR,QAAQ,CACT,CAAA;KACF;AACH,CAAC"}
1
+ {"version":3,"file":"products.handler.js","sourceRoot":"","sources":["../../../src/graphql/query/products.handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEpE,MAAM,UAAU,eAAe,CAC7B,QAA2B,EAC3B,QAAkC,EAClC,MAAe,EACf,QAAiB;IAEjB,IAAI,QAAQ,EAAE;QACZ,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;QAChC,YAAY,CACV,UAAU,CAAC,iBAAiB,EAC5B,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,CACT,CAAC;KACH;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"store.handler.js","sourceRoot":"","sources":["../../../src/graphql/query/store.handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAE5D,MAAM,UAAU,YAAY,CAC1B,KAAY,EACZ,QAAkC;IAElC,IAAI,KAAK,EAAE;QACT,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;KAC3B;AACH,CAAC"}
1
+ {"version":3,"file":"store.handler.js","sourceRoot":"","sources":["../../../src/graphql/query/store.handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAE5D,MAAM,UAAU,YAAY,CAAC,KAAY,EAAE,QAAkC;IAC3E,IAAI,KAAK,EAAE;QACT,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;KAC3B;AACH,CAAC"}
@@ -1,4 +1,4 @@
1
- import { setPreviewTheme, setthemePageDetail, setthemePages } from "../../store/slices/theme";
1
+ import { setPreviewTheme, setthemePageDetail, setthemePages, } from "../../store/slices/theme";
2
2
  export function themeHandler(theme, dispatch) {
3
3
  if (theme === null || theme === void 0 ? void 0 : theme.preview_theme) {
4
4
  dispatch(setPreviewTheme(theme.preview_theme));
@@ -1 +1 @@
1
- {"version":3,"file":"theme.handler.js","sourceRoot":"","sources":["../../../src/graphql/query/theme.handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,eAAe,EAAE,kBAAkB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAI9G,MAAM,UAAU,YAAY,CAAC,KAAY,EAAE,QAAkC;IAEzE,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,EAAE;QACtB,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAA;KACjD;IACD,IAAI,KAAK,CAAC,iBAAiB,EAAE;QACzB,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAA;KACxD;IACD,IAAI,KAAK,CAAC,WAAW,EAAE;QACnB,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAA;KAC7C;AACL,CAAC"}
1
+ {"version":3,"file":"theme.handler.js","sourceRoot":"","sources":["../../../src/graphql/query/theme.handler.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,eAAe,EACf,kBAAkB,EAClB,aAAa,GACd,MAAM,0BAA0B,CAAC;AAGlC,MAAM,UAAU,YAAY,CAAC,KAAY,EAAE,QAAkC;IAC3E,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,EAAE;QACxB,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;KAChD;IACD,IAAI,KAAK,CAAC,iBAAiB,EAAE;QAC3B,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;KACvD;IACD,IAAI,KAAK,CAAC,WAAW,EAAE;QACrB,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;KAC5C;AACH,CAAC"}
@@ -3,10 +3,10 @@ import { emitFPIEvent, FPI_EVENTS } from "../../helpers/FPI-events";
3
3
  export function userHandler(user, dispatch, params, oldStore) {
4
4
  if (user === null || user === void 0 ? void 0 : user.logged_in_user) {
5
5
  dispatch(setUserData(user.logged_in_user));
6
- emitFPIEvent(FPI_EVENTS.LOG_IN, params, user.logged_in_user, oldStore);
6
+ emitFPIEvent(FPI_EVENTS.LOG_IN, params, user.logged_in_user, oldStore, dispatch);
7
7
  }
8
8
  if (user.logout) {
9
- emitFPIEvent(FPI_EVENTS.LOG_OUT, params, user.logout, oldStore);
9
+ emitFPIEvent(FPI_EVENTS.LOG_OUT, params, user.logout, oldStore, dispatch);
10
10
  }
11
11
  }
12
12
  //# sourceMappingURL=user.handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"user.handler.js","sourceRoot":"","sources":["../../../src/graphql/query/user.handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEpE,MAAM,UAAU,WAAW,CACzB,IAAU,EACV,QAAkC,EAClC,MAAe,EACf,QAAiB;IAEjB,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,cAAc,EAAE;QACxB,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;QAC3C,YAAY,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;KACxE;IACD,IAAI,IAAI,CAAC,MAAM,EAAE;QACf,YAAY,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;KACjE;AACH,CAAC"}
1
+ {"version":3,"file":"user.handler.js","sourceRoot":"","sources":["../../../src/graphql/query/user.handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEpE,MAAM,UAAU,WAAW,CACzB,IAAU,EACV,QAAkC,EAClC,MAAe,EACf,QAAiB;IAEjB,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,cAAc,EAAE;QACxB,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;QAC3C,YAAY,CACV,UAAU,CAAC,MAAM,EACjB,MAAM,EACN,IAAI,CAAC,cAAc,EACnB,QAAQ,EACR,QAAQ,CACT,CAAC;KACH;IACD,IAAI,IAAI,CAAC,MAAM,EAAE;QACf,YAAY,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;KAC3E;AACH,CAAC"}
@@ -21,7 +21,7 @@ export type EventMap = {
21
21
  payloadCreator: PayloadCreator;
22
22
  };
23
23
  export declare const FPI_EVENTS: FPI_EVENTS;
24
- export declare function emitFPIEvent(event: EventMap | undefined, params: any, result: any, oldStore: any, eventEmitter?: EventEmitterFunction): boolean;
24
+ export declare function emitFPIEvent(event: EventMap | undefined, params: any, result: any, oldStore: any, dispatch?: any, eventEmitter?: EventEmitterFunction): true | undefined;
25
25
  export declare function defaultFPIEmit(eventName: string, payload: any): void;
26
26
  export declare function collectUnemittedEvents(customData: {
27
27
  [x: string]: any;
@@ -1,19 +1,20 @@
1
+ import { setValue } from "../store/slices/custom";
1
2
  import { isRunningOnClient } from "./utils";
2
3
  export const FPI_EVENTS = {
3
4
  LOG_IN: {
4
- eventName: 'user.login',
5
+ eventName: "user.login",
5
6
  payloadCreator: (result, param, store) => {
6
7
  let user = result;
7
8
  return {
8
9
  user_id: (user === null || user === void 0 ? void 0 : user.user_id) || (user === null || user === void 0 ? void 0 : user._id),
9
10
  gender: user === null || user === void 0 ? void 0 : user.gender,
10
11
  email: user === null || user === void 0 ? void 0 : user.emails,
11
- phone_number: user === null || user === void 0 ? void 0 : user.phone_numbers
12
+ phone_number: user === null || user === void 0 ? void 0 : user.phone_numbers,
12
13
  };
13
- }
14
+ },
14
15
  },
15
16
  LOG_OUT: {
16
- eventName: 'user.logout',
17
+ eventName: "user.logout",
17
18
  payloadCreator: (result, param, store) => {
18
19
  let user = store.auth.user_data;
19
20
  return {
@@ -21,57 +22,57 @@ export const FPI_EVENTS = {
21
22
  phone: user === null || user === void 0 ? void 0 : user.phone_numbers,
22
23
  email: user === null || user === void 0 ? void 0 : user.emails,
23
24
  };
24
- }
25
+ },
25
26
  },
26
27
  PROFILE_UPDATE: {
27
- eventName: 'user.update',
28
+ eventName: "user.update",
28
29
  payloadCreator: (result, param, store, oldStore) => {
29
30
  var _a, _b, _c;
30
31
  return {
31
32
  gender: (_a = result === null || result === void 0 ? void 0 : result.user) === null || _a === void 0 ? void 0 : _a.gender,
32
33
  email: result === null || result === void 0 ? void 0 : result.email,
33
34
  phone_number: (result === null || result === void 0 ? void 0 : result.mobile) || ((_b = result === null || result === void 0 ? void 0 : result.user) === null || _b === void 0 ? void 0 : _b.phone_numbers),
34
- user_id: (_c = result === null || result === void 0 ? void 0 : result.user) === null || _c === void 0 ? void 0 : _c._id
35
+ user_id: (_c = result === null || result === void 0 ? void 0 : result.user) === null || _c === void 0 ? void 0 : _c._id,
35
36
  };
36
- }
37
+ },
37
38
  },
38
39
  PRODUCT_LIST_VIEW: {
39
- eventName: 'product_list.view',
40
+ eventName: "product_list.view",
40
41
  payloadCreator: (result, param, store) => {
41
42
  return { items: result === null || result === void 0 ? void 0 : result.items };
42
- }
43
+ },
43
44
  },
44
45
  COLLECTION_LIST_VIEW: {
45
- eventName: 'collection_list.view',
46
+ eventName: "collection_list.view",
46
47
  payloadCreator: (result, param, store, oldStore) => {
47
48
  return {
48
49
  name: result === null || result === void 0 ? void 0 : result.name,
49
- slug: result === null || result === void 0 ? void 0 : result.slug
50
+ slug: result === null || result === void 0 ? void 0 : result.slug,
50
51
  };
51
- }
52
+ },
52
53
  },
53
54
  PRODUCT_LIST_CLICK: {
54
- eventName: 'product_list.click',
55
+ eventName: "product_list.click",
55
56
  payloadCreator: (store) => {
56
57
  return store;
57
- }
58
+ },
58
59
  },
59
60
  PRODUCT_FILTER: {
60
- eventName: 'product_list.filter',
61
+ eventName: "product_list.filter",
61
62
  payloadCreator: (store) => {
62
63
  return store;
63
- }
64
+ },
64
65
  },
65
66
  PRODUCT_SORT: {
66
- eventName: 'product_list.sort',
67
+ eventName: "product_list.sort",
67
68
  payloadCreator: (store) => {
68
69
  return store;
69
- }
70
+ },
70
71
  },
71
72
  PRODUCT_DETAIL_PAGE_VIEW: {
72
- eventName: 'product.view',
73
+ eventName: "product.view",
73
74
  payloadCreator: (result, param, store) => {
74
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
75
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
75
76
  return {
76
77
  product: {
77
78
  uid: result === null || result === void 0 ? void 0 : result.uid,
@@ -86,34 +87,36 @@ export const FPI_EVENTS = {
86
87
  name: (_f = (_e = result === null || result === void 0 ? void 0 : result.categories) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.name,
87
88
  },
88
89
  price: (_j = (_h = (_g = store.product) === null || _g === void 0 ? void 0 : _g.product_meta) === null || _h === void 0 ? void 0 : _h.sizes) === null || _j === void 0 ? void 0 : _j.price.effective,
89
- sizes: (_l = (_k = store.product.product_meta) === null || _k === void 0 ? void 0 : _k.sizes) === null || _l === void 0 ? void 0 : _l.sizes.map((s) => ({
90
+ sizes: (((_l = (_k = store.product.product_meta) === null || _k === void 0 ? void 0 : _k.sizes) === null || _l === void 0 ? void 0 : _l.sizes) ||
91
+ ((_o = (_m = store.product.product_meta) === null || _m === void 0 ? void 0 : _m.sizes) === null || _o === void 0 ? void 0 : _o.size_details) ||
92
+ []).map((s) => ({
90
93
  value: s === null || s === void 0 ? void 0 : s.value,
91
94
  is_available: s === null || s === void 0 ? void 0 : s.is_available,
92
95
  quantity: s === null || s === void 0 ? void 0 : s.quantity,
93
96
  })),
94
- l1_category: (_o = (_m = result === null || result === void 0 ? void 0 : result.category_map) === null || _m === void 0 ? void 0 : _m.l1) === null || _o === void 0 ? void 0 : _o.name,
95
- l3_category: (_q = (_p = result === null || result === void 0 ? void 0 : result.category_map) === null || _p === void 0 ? void 0 : _p.l3) === null || _q === void 0 ? void 0 : _q.name,
96
- }
97
+ l1_category: (_q = (_p = result === null || result === void 0 ? void 0 : result.category_map) === null || _p === void 0 ? void 0 : _p.l1) === null || _q === void 0 ? void 0 : _q.name,
98
+ l3_category: (_s = (_r = result === null || result === void 0 ? void 0 : result.category_map) === null || _r === void 0 ? void 0 : _r.l3) === null || _s === void 0 ? void 0 : _s.name,
99
+ },
97
100
  };
98
- }
101
+ },
99
102
  },
100
103
  NOTIFY_PRODUCT: {
101
- eventName: 'notify.product',
104
+ eventName: "notify.product",
102
105
  payloadCreator: (store) => {
103
106
  return store;
104
- }
107
+ },
105
108
  },
106
109
  ADD_TO_COMPARE: {
107
- eventName: 'compare.add',
110
+ eventName: "compare.add",
108
111
  payloadCreator: (store) => {
109
112
  return store;
110
- }
113
+ },
111
114
  },
112
115
  REMOVE_FROM_COMPARE: {
113
- eventName: 'compare.remove',
116
+ eventName: "compare.remove",
114
117
  payloadCreator: (store) => {
115
118
  return store;
116
- }
119
+ },
117
120
  },
118
121
  ADD_TO_WISHLIST: {
119
122
  eventName: "wishlist.add",
@@ -134,8 +137,8 @@ export const FPI_EVENTS = {
134
137
  return {
135
138
  item: Object.assign(Object.assign(Object.assign({}, item), item.product), { price: {
136
139
  effective: {
137
- max: (_q = (_p = item === null || item === void 0 ? void 0 : item.price) === null || _p === void 0 ? void 0 : _p.converted) === null || _q === void 0 ? void 0 : _q.effective
138
- }
140
+ max: (_q = (_p = item === null || item === void 0 ? void 0 : item.price) === null || _p === void 0 ? void 0 : _p.converted) === null || _q === void 0 ? void 0 : _q.effective,
141
+ },
139
142
  } }),
140
143
  };
141
144
  }
@@ -161,8 +164,8 @@ export const FPI_EVENTS = {
161
164
  return {
162
165
  item: Object.assign(Object.assign(Object.assign({}, item), item.product), { price: {
163
166
  effective: {
164
- max: (_q = (_p = item === null || item === void 0 ? void 0 : item.price) === null || _p === void 0 ? void 0 : _p.converted) === null || _q === void 0 ? void 0 : _q.effective
165
- }
167
+ max: (_q = (_p = item === null || item === void 0 ? void 0 : item.price) === null || _p === void 0 ? void 0 : _p.converted) === null || _q === void 0 ? void 0 : _q.effective,
168
+ },
166
169
  } }),
167
170
  };
168
171
  }
@@ -170,7 +173,7 @@ export const FPI_EVENTS = {
170
173
  },
171
174
  },
172
175
  VIEW_CART: {
173
- eventName: 'cart.view',
176
+ eventName: "cart.view",
174
177
  payloadCreator: (result, param, store, oldStore) => {
175
178
  const items = result === null || result === void 0 ? void 0 : result.items;
176
179
  let allProducts = items === null || items === void 0 ? void 0 : items.map((item) => {
@@ -186,8 +189,7 @@ export const FPI_EVENTS = {
186
189
  },
187
190
  brand: {
188
191
  uid: (_e = product === null || product === void 0 ? void 0 : product.brand) === null || _e === void 0 ? void 0 : _e.uid,
189
- name: ((_f = product === null || product === void 0 ? void 0 : product.brand) === null || _f === void 0 ? void 0 : _f.name) ||
190
- ((_g = product === null || product === void 0 ? void 0 : product.attributes) === null || _g === void 0 ? void 0 : _g.brand_name),
192
+ name: ((_f = product === null || product === void 0 ? void 0 : product.brand) === null || _f === void 0 ? void 0 : _f.name) || ((_g = product === null || product === void 0 ? void 0 : product.attributes) === null || _g === void 0 ? void 0 : _g.brand_name),
191
193
  },
192
194
  name: product === null || product === void 0 ? void 0 : product.name,
193
195
  item_code: product === null || product === void 0 ? void 0 : product.item_code,
@@ -211,19 +213,19 @@ export const FPI_EVENTS = {
211
213
  return {
212
214
  cart_id: result === null || result === void 0 ? void 0 : result.id,
213
215
  products: allProducts,
214
- breakup_values_raw: result === null || result === void 0 ? void 0 : result.breakup_values
216
+ breakup_values_raw: result === null || result === void 0 ? void 0 : result.breakup_values,
215
217
  };
216
- }
218
+ },
217
219
  },
218
220
  ADD_TO_CART: {
219
- eventName: 'cart.newProduct',
221
+ eventName: "cart.newProduct",
220
222
  payloadCreator: (result, param, store, oldStore) => {
221
223
  var _a, _b, _c, _d;
222
224
  const allProducts = (_a = result === null || result === void 0 ? void 0 : result.cart) === null || _a === void 0 ? void 0 : _a.items;
223
225
  let productdata = (_c = param === null || param === void 0 ? void 0 : (_b = param.addCartRequestInput.items).map) === null || _c === void 0 ? void 0 : _c.call(_b, (pro) => {
224
226
  var _a, _b, _c, _d, _e, _f, _g;
225
227
  const item = (allProducts === null || allProducts === void 0 ? void 0 : allProducts.find((i) => { var _a; return ((_a = i === null || i === void 0 ? void 0 : i.product) === null || _a === void 0 ? void 0 : _a.uid) == pro.item_id; })) || {};
226
- const { article, availability, product, price, discount, quantity, } = item;
228
+ const { article, availability, product, price, discount, quantity } = item;
227
229
  return {
228
230
  article: {
229
231
  uid: article === null || article === void 0 ? void 0 : article.uid,
@@ -234,8 +236,7 @@ export const FPI_EVENTS = {
234
236
  },
235
237
  brand: {
236
238
  uid: (_e = product === null || product === void 0 ? void 0 : product.brand) === null || _e === void 0 ? void 0 : _e.uid,
237
- name: ((_f = product === null || product === void 0 ? void 0 : product.brand) === null || _f === void 0 ? void 0 : _f.name) ||
238
- ((_g = product === null || product === void 0 ? void 0 : product.attributes) === null || _g === void 0 ? void 0 : _g.brand_name),
239
+ name: ((_f = product === null || product === void 0 ? void 0 : product.brand) === null || _f === void 0 ? void 0 : _f.name) || ((_g = product === null || product === void 0 ? void 0 : product.attributes) === null || _g === void 0 ? void 0 : _g.brand_name),
239
240
  },
240
241
  name: product === null || product === void 0 ? void 0 : product.name,
241
242
  item_code: product === null || product === void 0 ? void 0 : product.item_code,
@@ -258,12 +259,12 @@ export const FPI_EVENTS = {
258
259
  });
259
260
  return {
260
261
  cart_id: (_d = result === null || result === void 0 ? void 0 : result.cart) === null || _d === void 0 ? void 0 : _d.id,
261
- products: productdata
262
+ products: productdata,
262
263
  };
263
- }
264
+ },
264
265
  },
265
266
  REMOVE_FROM_CART: {
266
- eventName: 'cart.remove',
267
+ eventName: "cart.remove",
267
268
  payloadCreator: (result, param, store, oldStore) => {
268
269
  var _a, _b, _c, _d, _e;
269
270
  const allItems = (_b = (_a = store === null || store === void 0 ? void 0 : store.cart) === null || _a === void 0 ? void 0 : _a.cart_items) === null || _b === void 0 ? void 0 : _b.items;
@@ -308,9 +309,9 @@ export const FPI_EVENTS = {
308
309
  })) === null || _d === void 0 ? void 0 : _d.filter(Boolean);
309
310
  return {
310
311
  cart_id: (_e = result === null || result === void 0 ? void 0 : result.cart) === null || _e === void 0 ? void 0 : _e.id,
311
- products: data
312
+ products: data,
312
313
  };
313
- }
314
+ },
314
315
  },
315
316
  UPDATE_CART: {
316
317
  eventName: "cart.update",
@@ -361,12 +362,17 @@ export const FPI_EVENTS = {
361
362
  return {
362
363
  cart_id: (_e = result === null || result === void 0 ? void 0 : result.cart) === null || _e === void 0 ? void 0 : _e.id,
363
364
  products: data,
364
- operation: (data === null || data === void 0 ? void 0 : data.length) ? data[0].quantity.current > ((_f = storeItems === null || storeItems === void 0 ? void 0 : storeItems.find((i) => { var _a; return ((_a = i === null || i === void 0 ? void 0 : i.product) === null || _a === void 0 ? void 0 : _a.uid) === data[0].uid; })) === null || _f === void 0 ? void 0 : _f.quantity) ? "increment_quantity" : "decrement_quantity" : undefined,
365
+ operation: (data === null || data === void 0 ? void 0 : data.length)
366
+ ? data[0].quantity.current >
367
+ ((_f = storeItems === null || storeItems === void 0 ? void 0 : storeItems.find((i) => { var _a; return ((_a = i === null || i === void 0 ? void 0 : i.product) === null || _a === void 0 ? void 0 : _a.uid) === data[0].uid; })) === null || _f === void 0 ? void 0 : _f.quantity)
368
+ ? "increment_quantity"
369
+ : "decrement_quantity"
370
+ : undefined,
365
371
  };
366
- }
372
+ },
367
373
  },
368
374
  ORDER_CHECKOUT: {
369
- eventName: 'order.checkout',
375
+ eventName: "order.checkout",
370
376
  payloadCreator: (result, param, store, oldStore) => {
371
377
  var _a, _b, _c, _d, _e, _f;
372
378
  const allProducts = (_b = (_a = store.cart) === null || _a === void 0 ? void 0 : _a.cart_items) === null || _b === void 0 ? void 0 : _b.items;
@@ -401,24 +407,26 @@ export const FPI_EVENTS = {
401
407
  return {
402
408
  cart_id: (_d = (_c = store.cart) === null || _c === void 0 ? void 0 : _c.cart_items) === null || _d === void 0 ? void 0 : _d.cart_id,
403
409
  products: data,
404
- breakup_values: (_f = (_e = store.cart) === null || _e === void 0 ? void 0 : _e.cart_items) === null || _f === void 0 ? void 0 : _f.breakup_values
410
+ breakup_values: (_f = (_e = store.cart) === null || _e === void 0 ? void 0 : _e.cart_items) === null || _f === void 0 ? void 0 : _f.breakup_values,
405
411
  };
406
- }
412
+ },
407
413
  },
408
414
  ADD_PAYMENT_INFORMATION: {
409
- eventName: 'order.payment_information',
415
+ eventName: "order.payment_information",
410
416
  payloadCreator: (result, param, store) => {
411
417
  var _a, _b, _c, _d;
412
418
  return {
413
- value: (_a = result === null || result === void 0 ? void 0 : result.breakup_values) === null || _a === void 0 ? void 0 : _a.display.filter((value) => value.display === 'Total')[0].value,
419
+ value: (_a = result === null || result === void 0 ? void 0 : result.breakup_values) === null || _a === void 0 ? void 0 : _a.display.filter((value) => value.display === "Total")[0].value,
414
420
  coupon: {
415
421
  coupon_code: (_c = (_b = result === null || result === void 0 ? void 0 : result.breakup_values) === null || _b === void 0 ? void 0 : _b.coupon) === null || _c === void 0 ? void 0 : _c.code,
416
422
  },
417
- payment: { payment_type: (_d = param === null || param === void 0 ? void 0 : param.updateCartPaymentRequestInput) === null || _d === void 0 ? void 0 : _d.payment_mode },
423
+ payment: {
424
+ payment_type: (_d = param === null || param === void 0 ? void 0 : param.updateCartPaymentRequestInput) === null || _d === void 0 ? void 0 : _d.payment_mode,
425
+ },
418
426
  delivery_charges: result === null || result === void 0 ? void 0 : result.delivery_charge_info,
419
427
  cart: { cart_id: result === null || result === void 0 ? void 0 : result.id },
420
428
  };
421
- }
429
+ },
422
430
  },
423
431
  // {
424
432
  // value: res?.breakup_values?.raw?.total,
@@ -430,7 +438,7 @@ export const FPI_EVENTS = {
430
438
  // address_id: address_id,
431
439
  // }
432
440
  ADD_ADDRESS_INFORMATION: {
433
- eventName: 'order.address_information',
441
+ eventName: "order.address_information",
434
442
  payloadCreator: (result, param, store) => {
435
443
  var _a, _b, _c, _d, _e, _f, _g, _h;
436
444
  let selectAddress = store.address.address.address.find((item) => item.id == param.selectCartAddressRequestInput.billing_address_id);
@@ -440,13 +448,15 @@ export const FPI_EVENTS = {
440
448
  coupon_code: (_h = (_g = (_f = (_e = store === null || store === void 0 ? void 0 : store.cart) === null || _e === void 0 ? void 0 : _e.cart_items) === null || _f === void 0 ? void 0 : _f.breakup_values) === null || _g === void 0 ? void 0 : _g.coupon) === null || _h === void 0 ? void 0 : _h.code,
441
449
  },
442
450
  address_id: param.selectCartAddressRequestInput.billing_address_id,
443
- cart: { cart_id: param.selectCartAddressRequestInput.billing_address_id },
444
- pincode: selectAddress.area_code
451
+ cart: {
452
+ cart_id: param.selectCartAddressRequestInput.billing_address_id,
453
+ },
454
+ pincode: selectAddress.area_code,
445
455
  };
446
- }
456
+ },
447
457
  },
448
458
  ORDER_PROCESSED: {
449
- eventName: 'order.processed',
459
+ eventName: "order.processed",
450
460
  payloadCreator: (result, param, store, oldStore) => {
451
461
  let orderData = result;
452
462
  const breakup = {};
@@ -460,7 +470,7 @@ export const FPI_EVENTS = {
460
470
  const extractItems = (data) => {
461
471
  const allItems = [];
462
472
  data.forEach((order) => {
463
- order.bags.forEach(bag => {
473
+ order.bags.forEach((bag) => {
464
474
  const itemWithDetails = Object.assign(Object.assign({}, bag.item), { quantity: bag === null || bag === void 0 ? void 0 : bag.quantity, price: bag === null || bag === void 0 ? void 0 : bag.prices });
465
475
  allItems.push(itemWithDetails);
466
476
  });
@@ -470,50 +480,51 @@ export const FPI_EVENTS = {
470
480
  const items = extractItems(orderData.shipments);
471
481
  orderData.items = items;
472
482
  return orderData;
473
- }
483
+ },
474
484
  },
475
485
  ORDER_TRACKING_VIEW: {
476
- eventName: 'order_tracking.view',
486
+ eventName: "order_tracking.view",
477
487
  payloadCreator: (store) => {
478
488
  return store;
479
- }
489
+ },
480
490
  },
481
491
  ORDER_INITIALCHECKOUT: {
482
- eventName: 'order.initialCheckout',
492
+ eventName: "order.initialCheckout",
483
493
  payloadCreator: (store) => {
484
494
  return store;
485
- }
495
+ },
486
496
  },
487
497
  REFUND_SUCCESS: {
488
- eventName: 'refund.success',
498
+ eventName: "refund.success",
489
499
  payloadCreator: (store) => {
490
500
  return store;
491
- }
501
+ },
492
502
  },
493
503
  SEARCH_PRODUCTS: {
494
- eventName: 'search.products',
504
+ eventName: "search.products",
495
505
  payloadCreator: (store) => {
496
506
  return store;
497
- }
507
+ },
498
508
  },
499
509
  PINCODE_SERVICEABILITY: {
500
- eventName: 'pincode.serviceablility',
510
+ eventName: "pincode.serviceablility",
501
511
  payloadCreator: (store) => {
502
512
  return store;
503
- }
513
+ },
504
514
  },
505
515
  NAVIGATION: {
506
- eventName: 'root.navigation',
516
+ eventName: "root.navigation",
507
517
  payloadCreator: (store) => {
508
518
  return store;
509
- }
510
- }
519
+ },
520
+ },
511
521
  };
512
522
  function handleDynamicEventName(event, eventPayload, params) {
523
+ var _a, _b, _c;
513
524
  if (event.eventName !== FPI_EVENTS.UPDATE_CART.eventName) {
514
525
  return event.eventName;
515
526
  }
516
- const operation = params[0].body.operation;
527
+ const operation = ((_b = (_a = params === null || params === void 0 ? void 0 : params[0]) === null || _a === void 0 ? void 0 : _a.body) === null || _b === void 0 ? void 0 : _b.operation) || ((_c = params === null || params === void 0 ? void 0 : params.updateCartRequestInput) === null || _c === void 0 ? void 0 : _c.operation);
517
528
  if (!operation) {
518
529
  return event.eventName;
519
530
  }
@@ -523,7 +534,7 @@ function handleDynamicEventName(event, eventPayload, params) {
523
534
  }
524
535
  return FPI_EVENTS.REMOVE_FROM_CART.eventName;
525
536
  }
526
- export function emitFPIEvent(event, params, result, oldStore, eventEmitter) {
537
+ export function emitFPIEvent(event, params, result, oldStore, dispatch, eventEmitter) {
527
538
  var _a, _b, _c, _d;
528
539
  if (!(event === null || event === void 0 ? void 0 : event.eventName) || !(event === null || event === void 0 ? void 0 : event.payloadCreator)) {
529
540
  return true;
@@ -531,23 +542,32 @@ export function emitFPIEvent(event, params, result, oldStore, eventEmitter) {
531
542
  if (isRunningOnClient()) {
532
543
  let { eventName, payloadCreator } = event;
533
544
  const storeSnapshot = (_d = (_c = (_b = (_a = window.fpi) === null || _a === void 0 ? void 0 : _a.store) === null || _b === void 0 ? void 0 : _b.getState) === null || _c === void 0 ? void 0 : _c.call(_b)) !== null && _d !== void 0 ? _d : {};
534
- const eventPayload = typeof payloadCreator === 'function' ? payloadCreator(result, params, storeSnapshot, oldStore) : payloadCreator;
545
+ const eventPayload = typeof payloadCreator === "function"
546
+ ? payloadCreator(result, params, storeSnapshot, oldStore)
547
+ : payloadCreator;
535
548
  eventName = handleDynamicEventName(event, eventPayload, params);
536
549
  try {
537
- if (typeof eventEmitter === 'function') {
550
+ if (typeof eventEmitter === "function") {
538
551
  eventEmitter(eventName, eventPayload);
539
552
  }
540
553
  defaultFPIEmit(eventName, eventPayload);
541
554
  }
542
555
  catch (error) {
543
- console.error('Error Occured in Event : ', error);
556
+ console.error("Error Occured in Event : ", error);
544
557
  }
545
558
  finally {
546
559
  return true;
547
560
  }
548
561
  }
549
562
  else {
550
- return false;
563
+ dispatch(setValue({
564
+ key: `fpiEvent${event.eventName}`,
565
+ value: {
566
+ key: event.eventName,
567
+ params,
568
+ result,
569
+ },
570
+ }));
551
571
  }
552
572
  }
553
573
  export function defaultFPIEmit(eventName, payload) {
@@ -557,14 +577,14 @@ export function defaultFPIEmit(eventName, payload) {
557
577
  (_b = (_a = window.FPI.event) === null || _a === void 0 ? void 0 : _a.emit) === null || _b === void 0 ? void 0 : _b.call(_a, eventName, payload);
558
578
  }
559
579
  catch (error) {
560
- console.error('Error Occured in Event : ', error);
580
+ console.error("Error Occured in Event : ", error);
561
581
  }
562
582
  }
563
583
  }
564
584
  export function collectUnemittedEvents(customData) {
565
585
  const events = [];
566
586
  for (let key in customData) {
567
- if (customData.hasOwnProperty(key) && key.startsWith('fpiEvent')) {
587
+ if (customData.hasOwnProperty(key) && key.startsWith("fpiEvent")) {
568
588
  events.push(customData[key]);
569
589
  }
570
590
  }
@@ -575,7 +595,8 @@ export function emitAllEvents(events, FPI_EVENTS, storeInitialData) {
575
595
  const { key, params, result } = event;
576
596
  let matchingEvent;
577
597
  for (let lkey in FPI_EVENTS) {
578
- if (FPI_EVENTS.hasOwnProperty(lkey) && FPI_EVENTS[lkey].eventName === key) {
598
+ if (FPI_EVENTS.hasOwnProperty(lkey) &&
599
+ FPI_EVENTS[lkey].eventName === key) {
579
600
  matchingEvent = FPI_EVENTS[lkey];
580
601
  break;
581
602
  }