@bikdotai/bik-component-library 0.0.780-beta.3 → 0.0.780-beta.5

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 (435) hide show
  1. package/dist/cjs/assets/icons/Ai_event_generating.svg.js +1 -1
  2. package/dist/cjs/components/ProgressChecklist/MultiChecklistItem.d.ts +29 -1
  3. package/dist/cjs/components/ProgressChecklist/ProgressChecklist.d.ts +1 -27
  4. package/dist/cjs/components/QueryBuilder/Filters/CustomField/components/CustomField.js +1 -1
  5. package/dist/cjs/components/QueryBuilder/Filters/Event/components/EventFilter.js +1 -1
  6. package/dist/cjs/components/QueryBuilder/Filters/Segment/components/SegmentFilter.js +1 -1
  7. package/dist/cjs/components/QueryBuilder/Filters/UserProperty/components/UserPropertyFilter.js +1 -1
  8. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.js +1 -1
  9. package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.js +1 -1
  10. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/EmojiPicker.d.ts +1 -2
  11. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/EmojiPicker.js +1 -1
  12. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/InTheLast.js +1 -1
  13. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/InTwoLast.js +1 -1
  14. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/MultiselectDropdownFreeText.js +1 -1
  15. package/dist/cjs/components/QueryBuilder/components/Connectors/Components/SingleselectDropdownFreeText.js +1 -1
  16. package/dist/cjs/components/QueryBuilder/components/Connectors/Connector.js +1 -1
  17. package/dist/cjs/components/QueryBuilder/components/DropdownWrapper.d.ts +1 -3
  18. package/dist/cjs/components/QueryBuilder/components/DropdownWrapper.js +1 -1
  19. package/dist/cjs/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js +1 -1
  20. package/dist/cjs/components/QueryBuilder/constants/connector.d.ts +1 -1
  21. package/dist/cjs/components/QueryBuilder/constants/connector.js +1 -1
  22. package/dist/cjs/components/QueryBuilder/constants/connectorPosition.js +1 -1
  23. package/dist/cjs/components/QueryBuilder/helpers/Connector.helper.d.ts +1 -1
  24. package/dist/cjs/components/QueryBuilder/helpers/Connector.helper.js +1 -1
  25. package/dist/cjs/components/QueryBuilder/helpers/PropertyCustomProcessor.d.ts +1 -1
  26. package/dist/cjs/components/QueryBuilder/helpers/SegmentValidator.d.ts +3 -15
  27. package/dist/cjs/components/QueryBuilder/types/QueryBuilder.type.d.ts +2 -22
  28. package/dist/cjs/components/QueryBuilder/types/QueryBuilder.type.js +1 -1
  29. package/dist/cjs/components/QueryBuilder/types/QueryBuilderAPI.type.d.ts +1 -1
  30. package/dist/cjs/components/QueryBuilder/types/QueryBuilderConnector.type.d.ts +1 -6
  31. package/dist/cjs/components/QueryBuilder/types/QueryBuilderEnum.type.d.ts +21 -0
  32. package/dist/cjs/components/QueryBuilder/types/QueryBuilderEnum.type.js +1 -0
  33. package/dist/cjs/components/QueryBuilder/types/index.d.ts +2 -1
  34. package/dist/cjs/components/SearchFilter/components/DatePickerButton.d.ts +1 -1
  35. package/dist/cjs/components/SearchFilter/components/DateRangeOnlyButton.d.ts +1 -1
  36. package/dist/cjs/components/SearchFilter/components/SearchFilterItem.d.ts +1 -1
  37. package/dist/cjs/components/SearchFilter/components/SearchFilterItem.js +1 -1
  38. package/dist/cjs/components/SearchFilter/types/SearchFilter.type.d.ts +1 -1
  39. package/dist/cjs/components/TablePagination/TablePagination.js +1 -1
  40. package/dist/cjs/components/WhatsAppTextEditor/AIRephraseButton.d.ts +4 -1
  41. package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditor.d.ts +4 -1
  42. package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.d.ts +1 -4
  43. package/dist/cjs/components/WhatsAppTextEditor/ai/actionRegistry.d.ts +2 -1
  44. package/dist/cjs/components/accordion/Accordion.d.ts +2 -35
  45. package/dist/cjs/components/accordion/Accordion.model.d.ts +35 -0
  46. package/dist/cjs/components/accordion/Accordion.style.d.ts +1 -1
  47. package/dist/cjs/components/analytics-card/AnalyticsCard.d.ts +1 -1
  48. package/dist/cjs/components/analytics-card/AnalyticsCard.model.d.ts +1 -0
  49. package/dist/cjs/components/analytics-card/AnalyticsCard.styled.d.ts +1 -1
  50. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsChip.d.ts +1 -17
  51. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsChip.model.d.ts +18 -0
  52. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsChipChannelFooter.d.ts +1 -1
  53. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
  54. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsMultiChip.d.ts +1 -1
  55. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LazyCharts.d.ts +2 -0
  56. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LazyCharts.js +1 -0
  57. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
  58. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js +1 -1
  59. package/dist/cjs/components/avatar/Avatar.js +1 -1
  60. package/dist/cjs/components/bik-layout/BikSidebar.d.ts +1 -1
  61. package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
  62. package/dist/cjs/components/bik-layout/Sidebar.model.d.ts +27 -0
  63. package/dist/cjs/components/bik-layout/SidebarPopup.d.ts +1 -1
  64. package/dist/cjs/components/bik-layout/SidebarSkeleton.d.ts +1 -1
  65. package/dist/cjs/components/bik-layout/SidebarStyles.d.ts +1 -1
  66. package/dist/cjs/components/bik-layout/SimpleSidebar.d.ts +1 -27
  67. package/dist/cjs/components/country-code-picker/CountryCodePicker.js +1 -1
  68. package/dist/cjs/components/country-code-picker/CountryPicker.js +1 -1
  69. package/dist/cjs/components/custom-date-time/CustomDateTime.js +1 -1
  70. package/dist/cjs/components/custom-date-time/DateSelector/DateSelector.js +1 -1
  71. package/dist/cjs/components/datePicker/TimePicker.js +1 -1
  72. package/dist/cjs/components/discount-modal/CouponExpiration/CouponExpiration.js +1 -1
  73. package/dist/cjs/components/discount-modal/DiscountModal.js +1 -1
  74. package/dist/cjs/components/discount-modal/DynamicCoupon/DynamicCoupon.js +1 -1
  75. package/dist/cjs/components/discount-modal/DynamicCoupon/MinimumRequirementComponent.js +1 -1
  76. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
  77. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.d.ts +0 -2
  78. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js +1 -1
  79. package/dist/cjs/components/dropdown/hooks/useDropdown.d.ts +0 -2
  80. package/dist/cjs/components/dropdown/hooks/useDropdown.js +1 -1
  81. package/dist/cjs/components/dropdown/type.d.ts +0 -9
  82. package/dist/cjs/components/dropdown-button/DropdownButton.js +1 -1
  83. package/dist/cjs/components/floating-input-dropdown/FloatingInputDropdown.d.ts +1 -1
  84. package/dist/cjs/components/image-cropper/BikImageCropper.d.ts +1 -6
  85. package/dist/cjs/components/image-cropper/BikImageCropper.model.d.ts +6 -0
  86. package/dist/cjs/components/image-cropper/BikImagePipeline/BikImagePipeline.d.ts +1 -1
  87. package/dist/cjs/components/input/ChipInput.js +1 -1
  88. package/dist/cjs/components/input/ChipInput.styled.d.ts +6 -66
  89. package/dist/cjs/components/input/ChipInput.styled.js +1 -1
  90. package/dist/cjs/components/input/Input-helper.d.ts +1 -1
  91. package/dist/cjs/components/input/Input.d.ts +1 -71
  92. package/dist/cjs/components/input/Input.model.d.ts +72 -0
  93. package/dist/cjs/components/input/Input.styled.d.ts +1 -1
  94. package/dist/cjs/components/input-with-vars/InputWithVariables.d.ts +1 -1
  95. package/dist/cjs/components/list-item/List.model.d.ts +18 -0
  96. package/dist/cjs/components/list-item/ListItem.d.ts +1 -17
  97. package/dist/cjs/components/list-item/ListItem.styled.d.ts +1 -1
  98. package/dist/cjs/components/list-item/themes.d.ts +1 -1
  99. package/dist/cjs/components/multi-level-dropdown/GroupedMenuList.d.ts +2 -1
  100. package/dist/cjs/components/multi-level-dropdown/GroupedMenuList.js +1 -1
  101. package/dist/cjs/components/multi-level-dropdown/MenuItem.d.ts +2 -1
  102. package/dist/cjs/components/multi-level-dropdown/MenuItem.js +1 -1
  103. package/dist/cjs/components/multi-level-dropdown/MenuList.js +1 -1
  104. package/dist/cjs/components/multi-level-dropdown/type.d.ts +2 -1
  105. package/dist/cjs/components/product-picker-v2/ProductPickerTag.d.ts +2 -2
  106. package/dist/cjs/components/product-picker-v2/collectionScreen.d.ts +3 -3
  107. package/dist/cjs/components/product-picker-v2/helpers/ProductHelper.d.ts +3 -4
  108. package/dist/cjs/components/product-picker-v2/index.d.ts +1 -1
  109. package/dist/cjs/components/product-picker-v2/modal.d.ts +2 -58
  110. package/dist/cjs/components/product-picker-v2/product.d.ts +2 -3
  111. package/dist/cjs/components/product-picker-v2/productInfoOverlay.d.ts +1 -2
  112. package/dist/cjs/components/product-picker-v2/productScreen.d.ts +3 -3
  113. package/dist/cjs/components/product-picker-v2/productScreen.js +1 -1
  114. package/dist/cjs/components/product-picker-v2/rearrangeScreen.d.ts +3 -4
  115. package/dist/cjs/components/product-picker-v2/reducers.d.ts +1 -1
  116. package/dist/cjs/components/product-picker-v2/reducers.js +1 -1
  117. package/dist/cjs/components/product-picker-v2/searchScreen.d.ts +3 -4
  118. package/dist/cjs/components/product-picker-v2/selectedScreen.d.ts +3 -4
  119. package/dist/cjs/components/product-picker-v2/type.d.ts +65 -0
  120. package/dist/cjs/components/product-picker-v2/utility.d.ts +3 -3
  121. package/dist/cjs/components/product-picker-v2/utility.js +1 -1
  122. package/dist/cjs/components/product-picker-v2/variant.d.ts +2 -12
  123. package/dist/cjs/components/product-picker-v2/variantComponents.d.ts +2 -3
  124. package/dist/cjs/components/sample-button/SampleButton.d.ts +1 -16
  125. package/dist/cjs/components/sample-button/SampleButton.model.d.ts +17 -0
  126. package/dist/cjs/components/sample-button/SampleButton.styled.d.ts +1 -1
  127. package/dist/cjs/components/sample-button/themes.d.ts +1 -1
  128. package/dist/cjs/components/searchBar/searchBar.d.ts +1 -1
  129. package/dist/cjs/components/slider/slider.js +1 -1
  130. package/dist/cjs/components/stepper/Stepper.d.ts +1 -17
  131. package/dist/cjs/components/stepper/Stepper.model.d.ts +17 -0
  132. package/dist/cjs/components/stepper/Stepper.styled.d.ts +1 -1
  133. package/dist/cjs/components/stepper/StepperService.d.ts +1 -1
  134. package/dist/cjs/components/stepper/themes.d.ts +1 -1
  135. package/dist/cjs/components/template-context-mapper/TemplateContextMapper.d.ts +9 -9
  136. package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
  137. package/dist/cjs/components/template-context-mapper/context/templateModalContext.d.ts +7 -7
  138. package/dist/cjs/components/template-context-mapper/custom-hooks/useAdditionalVariables.d.ts +1 -1
  139. package/dist/cjs/components/template-context-mapper/helpers/WebpushTemplateHelper.d.ts +6 -4
  140. package/dist/cjs/components/template-context-mapper/helpers/WebpushTemplateHelper.js +1 -1
  141. package/dist/cjs/components/template-context-mapper/modalElements/Body.d.ts +2 -2
  142. package/dist/cjs/components/template-context-mapper/modalElements/Body.js +10 -10
  143. package/dist/cjs/components/template-context-mapper/modalElements/DesktopPreview.js +7 -7
  144. package/dist/cjs/components/template-context-mapper/modalElements/EditMediaModal.d.ts +3 -3
  145. package/dist/cjs/components/template-context-mapper/modalElements/EditMediaModal.js +1 -1
  146. package/dist/cjs/components/template-context-mapper/modalElements/EditWebpushTemplate.d.ts +2 -2
  147. package/dist/cjs/components/template-context-mapper/modalElements/EditWebpushTemplate.js +1 -1
  148. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.d.ts +3 -14
  149. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
  150. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.d.ts +5 -5
  151. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +2 -2
  152. package/dist/cjs/components/template-context-mapper/modalElements/Footer.js +4 -4
  153. package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.d.ts +1 -1
  154. package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.js +3 -3
  155. package/dist/cjs/components/template-context-mapper/modalElements/QualityWarningModal.d.ts +1 -1
  156. package/dist/cjs/components/template-context-mapper/modalElements/TemplateAnalyticsComponent.d.ts +1 -1
  157. package/dist/cjs/components/template-context-mapper/modalElements/TemplateSelectModalContent.d.ts +2 -2
  158. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.d.ts +1 -1
  159. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.js +4 -4
  160. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.d.ts +5 -4
  161. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
  162. package/dist/cjs/components/template-context-mapper/modalElements/VariableEditorHeader.d.ts +1 -1
  163. package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.d.ts +2 -2
  164. package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
  165. package/dist/cjs/components/template-context-mapper/modalElements/modal.d.ts +13 -0
  166. package/dist/cjs/components/template-context-mapper/modalElements/useEditWhtasappTemplateMedia.d.ts +1 -1
  167. package/dist/cjs/components/template-context-mapper/modalElements/useEditWhtasappTemplateMedia.js +1 -1
  168. package/dist/cjs/components/template-context-mapper/utils/convertPlaceholdersToBikDropdown.d.ts +2 -2
  169. package/dist/cjs/components/template-context-mapper/utils/getDataFromTemplateComponent.d.ts +2 -2
  170. package/dist/cjs/components/template-context-mapper/utils/highlightFor.d.ts +1 -1
  171. package/dist/cjs/components/template-preview/models/TemplateMeta.d.ts +1 -1
  172. package/dist/cjs/components/template-preview/models/WhatsappCarouselTemplate.d.ts +2 -2
  173. package/dist/cjs/components/toaster/Toaster.styled.js +1 -1
  174. package/dist/cjs/components/variable-picker-v3/SubHeaderItems.js +1 -1
  175. package/dist/cjs/components/zeroState/ZeroState.js +1 -2
  176. package/dist/cjs/firebase/environment.d.ts +58 -0
  177. package/dist/cjs/firebase/environment.js +1 -0
  178. package/dist/cjs/firebase/firebaseUserFetcher.d.ts +34 -0
  179. package/dist/cjs/firebase/firebaseUserFetcher.js +1 -0
  180. package/dist/cjs/firebase/index.d.ts +7 -0
  181. package/dist/cjs/firebase/lazyFirebaseApp.d.ts +22 -0
  182. package/dist/cjs/firebase/lazyFirebaseApp.js +1 -0
  183. package/dist/cjs/firebase/lazyFirebaseMethods.d.ts +589 -0
  184. package/dist/cjs/firebase/lazyFirebaseMethods.js +1 -0
  185. package/dist/cjs/firebase/lazyFirestore.d.ts +6 -0
  186. package/dist/cjs/firebase/lazyFirestore.js +1 -0
  187. package/dist/cjs/firebase/lazyFirestoreLite.d.ts +6 -0
  188. package/dist/cjs/firebase/lazyFirestoreLite.js +1 -0
  189. package/dist/cjs/firebase/lazyStorage.d.ts +5 -0
  190. package/dist/cjs/firebase/lazyStorage.js +1 -0
  191. package/dist/cjs/index.d.ts +3 -0
  192. package/dist/cjs/index.js +1 -1
  193. package/dist/cjs/request-executor/executor.d.ts +99 -0
  194. package/dist/cjs/request-executor/executor.js +1 -0
  195. package/dist/cjs/request-executor/index.d.ts +2 -0
  196. package/dist/cjs/request-executor/model.d.ts +14 -0
  197. package/dist/cjs/utils/logging/ErrorConstructor/ApiError.d.ts +3 -0
  198. package/dist/cjs/utils/logging/ErrorConstructor/ApiError.js +1 -0
  199. package/dist/cjs/utils/logging/ErrorConstructor/BroadcastFlowError.d.ts +4 -0
  200. package/dist/cjs/utils/logging/ErrorConstructor/BroadcastFlowError.js +1 -0
  201. package/dist/cjs/utils/logging/ErrorConstructor/CohortError.d.ts +4 -0
  202. package/dist/cjs/utils/logging/ErrorConstructor/CohortError.js +1 -0
  203. package/dist/cjs/utils/logging/ErrorConstructor/CustomError.d.ts +3 -0
  204. package/dist/cjs/utils/logging/ErrorConstructor/CustomError.js +1 -0
  205. package/dist/cjs/utils/logging/ErrorConstructor/ExcelUploadError.d.ts +3 -0
  206. package/dist/cjs/utils/logging/ErrorConstructor/ExcelUploadError.js +1 -0
  207. package/dist/cjs/utils/logging/ErrorConstructor/FirebaseCallError.d.ts +3 -0
  208. package/dist/cjs/utils/logging/ErrorConstructor/FirebaseCallError.js +1 -0
  209. package/dist/cjs/utils/logging/ErrorConstructor/FirebaseSubscriptionError.d.ts +3 -0
  210. package/dist/cjs/utils/logging/ErrorConstructor/FirebaseSubscriptionError.js +1 -0
  211. package/dist/cjs/utils/logging/ErrorConstructor/RechargeFailure.d.ts +3 -0
  212. package/dist/cjs/utils/logging/ErrorConstructor/RechargeFailure.js +1 -0
  213. package/dist/cjs/utils/logging/ErrorConstructor/WhatsappIntegrationError.d.ts +3 -0
  214. package/dist/cjs/utils/logging/ErrorConstructor/WhatsappIntegrationError.js +1 -0
  215. package/dist/cjs/utils/logging/Logger.d.ts +24 -0
  216. package/dist/cjs/utils/logging/Logger.js +1 -0
  217. package/dist/cjs/utils/logging/index.d.ts +10 -0
  218. package/dist/esm/assets/icons/Ai_event_generating.svg.js +1 -1
  219. package/dist/esm/components/ProgressChecklist/MultiChecklistItem.d.ts +29 -1
  220. package/dist/esm/components/ProgressChecklist/ProgressChecklist.d.ts +1 -27
  221. package/dist/esm/components/QueryBuilder/Filters/CustomField/components/CustomField.js +1 -1
  222. package/dist/esm/components/QueryBuilder/Filters/Event/components/EventFilter.js +1 -1
  223. package/dist/esm/components/QueryBuilder/Filters/Segment/components/SegmentFilter.js +1 -1
  224. package/dist/esm/components/QueryBuilder/Filters/UserProperty/components/UserPropertyFilter.js +1 -1
  225. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.js +1 -1
  226. package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.js +1 -1
  227. package/dist/esm/components/QueryBuilder/components/Connectors/Components/EmojiPicker.d.ts +1 -2
  228. package/dist/esm/components/QueryBuilder/components/Connectors/Components/EmojiPicker.js +1 -1
  229. package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTheLast.js +1 -1
  230. package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTwoLast.js +1 -1
  231. package/dist/esm/components/QueryBuilder/components/Connectors/Components/MultiselectDropdownFreeText.js +1 -1
  232. package/dist/esm/components/QueryBuilder/components/Connectors/Components/SingleselectDropdownFreeText.js +1 -1
  233. package/dist/esm/components/QueryBuilder/components/Connectors/Connector.js +1 -1
  234. package/dist/esm/components/QueryBuilder/components/DropdownWrapper.d.ts +1 -3
  235. package/dist/esm/components/QueryBuilder/components/DropdownWrapper.js +1 -1
  236. package/dist/esm/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js +1 -1
  237. package/dist/esm/components/QueryBuilder/constants/connector.d.ts +1 -1
  238. package/dist/esm/components/QueryBuilder/constants/connector.js +1 -1
  239. package/dist/esm/components/QueryBuilder/constants/connectorPosition.js +1 -1
  240. package/dist/esm/components/QueryBuilder/helpers/Connector.helper.d.ts +1 -1
  241. package/dist/esm/components/QueryBuilder/helpers/Connector.helper.js +1 -1
  242. package/dist/esm/components/QueryBuilder/helpers/PropertyCustomProcessor.d.ts +1 -1
  243. package/dist/esm/components/QueryBuilder/helpers/SegmentValidator.d.ts +3 -15
  244. package/dist/esm/components/QueryBuilder/types/QueryBuilder.type.d.ts +2 -22
  245. package/dist/esm/components/QueryBuilder/types/QueryBuilder.type.js +1 -1
  246. package/dist/esm/components/QueryBuilder/types/QueryBuilderAPI.type.d.ts +1 -1
  247. package/dist/esm/components/QueryBuilder/types/QueryBuilderConnector.type.d.ts +1 -6
  248. package/dist/esm/components/QueryBuilder/types/QueryBuilderEnum.type.d.ts +21 -0
  249. package/dist/esm/components/QueryBuilder/types/QueryBuilderEnum.type.js +1 -0
  250. package/dist/esm/components/QueryBuilder/types/index.d.ts +2 -1
  251. package/dist/esm/components/SearchFilter/components/DatePickerButton.d.ts +1 -1
  252. package/dist/esm/components/SearchFilter/components/DateRangeOnlyButton.d.ts +1 -1
  253. package/dist/esm/components/SearchFilter/components/SearchFilterItem.d.ts +1 -1
  254. package/dist/esm/components/SearchFilter/components/SearchFilterItem.js +1 -1
  255. package/dist/esm/components/SearchFilter/types/SearchFilter.type.d.ts +1 -1
  256. package/dist/esm/components/TablePagination/TablePagination.js +1 -1
  257. package/dist/esm/components/WhatsAppTextEditor/AIRephraseButton.d.ts +4 -1
  258. package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditor.d.ts +4 -1
  259. package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.d.ts +1 -4
  260. package/dist/esm/components/WhatsAppTextEditor/ai/actionRegistry.d.ts +2 -1
  261. package/dist/esm/components/accordion/Accordion.d.ts +2 -35
  262. package/dist/esm/components/accordion/Accordion.model.d.ts +35 -0
  263. package/dist/esm/components/accordion/Accordion.style.d.ts +1 -1
  264. package/dist/esm/components/analytics-card/AnalyticsCard.d.ts +1 -1
  265. package/dist/esm/components/analytics-card/AnalyticsCard.model.d.ts +1 -0
  266. package/dist/esm/components/analytics-card/AnalyticsCard.styled.d.ts +1 -1
  267. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsChip.d.ts +1 -17
  268. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsChip.model.d.ts +18 -0
  269. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsChipChannelFooter.d.ts +1 -1
  270. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
  271. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsMultiChip.d.ts +1 -1
  272. package/dist/esm/components/analytics-chips-and-dropdowns/chart/LazyCharts.d.ts +2 -0
  273. package/dist/esm/components/analytics-chips-and-dropdowns/chart/LazyCharts.js +1 -0
  274. package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
  275. package/dist/esm/components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js +1 -1
  276. package/dist/esm/components/avatar/Avatar.js +1 -1
  277. package/dist/esm/components/bik-layout/BikSidebar.d.ts +1 -1
  278. package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
  279. package/dist/esm/components/bik-layout/Sidebar.model.d.ts +27 -0
  280. package/dist/esm/components/bik-layout/SidebarPopup.d.ts +1 -1
  281. package/dist/esm/components/bik-layout/SidebarSkeleton.d.ts +1 -1
  282. package/dist/esm/components/bik-layout/SidebarStyles.d.ts +1 -1
  283. package/dist/esm/components/bik-layout/SimpleSidebar.d.ts +1 -27
  284. package/dist/esm/components/country-code-picker/CountryCodePicker.js +1 -1
  285. package/dist/esm/components/country-code-picker/CountryPicker.js +1 -1
  286. package/dist/esm/components/custom-date-time/CustomDateTime.js +1 -1
  287. package/dist/esm/components/custom-date-time/DateSelector/DateSelector.js +1 -1
  288. package/dist/esm/components/datePicker/TimePicker.js +1 -1
  289. package/dist/esm/components/discount-modal/CouponExpiration/CouponExpiration.js +1 -1
  290. package/dist/esm/components/discount-modal/DiscountModal.js +1 -1
  291. package/dist/esm/components/discount-modal/DynamicCoupon/DynamicCoupon.js +1 -1
  292. package/dist/esm/components/discount-modal/DynamicCoupon/MinimumRequirementComponent.js +1 -1
  293. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
  294. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.d.ts +0 -2
  295. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js +1 -1
  296. package/dist/esm/components/dropdown/hooks/useDropdown.d.ts +0 -2
  297. package/dist/esm/components/dropdown/hooks/useDropdown.js +1 -1
  298. package/dist/esm/components/dropdown/type.d.ts +0 -9
  299. package/dist/esm/components/dropdown-button/DropdownButton.js +1 -1
  300. package/dist/esm/components/floating-input-dropdown/FloatingInputDropdown.d.ts +1 -1
  301. package/dist/esm/components/image-cropper/BikImageCropper.d.ts +1 -6
  302. package/dist/esm/components/image-cropper/BikImageCropper.model.d.ts +6 -0
  303. package/dist/esm/components/image-cropper/BikImagePipeline/BikImagePipeline.d.ts +1 -1
  304. package/dist/esm/components/input/ChipInput.js +1 -1
  305. package/dist/esm/components/input/ChipInput.styled.d.ts +6 -66
  306. package/dist/esm/components/input/ChipInput.styled.js +1 -1
  307. package/dist/esm/components/input/Input-helper.d.ts +1 -1
  308. package/dist/esm/components/input/Input.d.ts +1 -71
  309. package/dist/esm/components/input/Input.model.d.ts +72 -0
  310. package/dist/esm/components/input/Input.styled.d.ts +1 -1
  311. package/dist/esm/components/input-with-vars/InputWithVariables.d.ts +1 -1
  312. package/dist/esm/components/list-item/List.model.d.ts +18 -0
  313. package/dist/esm/components/list-item/ListItem.d.ts +1 -17
  314. package/dist/esm/components/list-item/ListItem.styled.d.ts +1 -1
  315. package/dist/esm/components/list-item/themes.d.ts +1 -1
  316. package/dist/esm/components/multi-level-dropdown/GroupedMenuList.d.ts +2 -1
  317. package/dist/esm/components/multi-level-dropdown/GroupedMenuList.js +1 -1
  318. package/dist/esm/components/multi-level-dropdown/MenuItem.d.ts +2 -1
  319. package/dist/esm/components/multi-level-dropdown/MenuItem.js +1 -1
  320. package/dist/esm/components/multi-level-dropdown/MenuList.js +1 -1
  321. package/dist/esm/components/multi-level-dropdown/type.d.ts +2 -1
  322. package/dist/esm/components/product-picker-v2/ProductPickerTag.d.ts +2 -2
  323. package/dist/esm/components/product-picker-v2/collectionScreen.d.ts +3 -3
  324. package/dist/esm/components/product-picker-v2/helpers/ProductHelper.d.ts +3 -4
  325. package/dist/esm/components/product-picker-v2/index.d.ts +1 -1
  326. package/dist/esm/components/product-picker-v2/modal.d.ts +2 -58
  327. package/dist/esm/components/product-picker-v2/product.d.ts +2 -3
  328. package/dist/esm/components/product-picker-v2/productInfoOverlay.d.ts +1 -2
  329. package/dist/esm/components/product-picker-v2/productScreen.d.ts +3 -3
  330. package/dist/esm/components/product-picker-v2/productScreen.js +1 -1
  331. package/dist/esm/components/product-picker-v2/rearrangeScreen.d.ts +3 -4
  332. package/dist/esm/components/product-picker-v2/reducers.d.ts +1 -1
  333. package/dist/esm/components/product-picker-v2/reducers.js +1 -1
  334. package/dist/esm/components/product-picker-v2/searchScreen.d.ts +3 -4
  335. package/dist/esm/components/product-picker-v2/selectedScreen.d.ts +3 -4
  336. package/dist/esm/components/product-picker-v2/type.d.ts +65 -0
  337. package/dist/esm/components/product-picker-v2/utility.d.ts +3 -3
  338. package/dist/esm/components/product-picker-v2/utility.js +1 -1
  339. package/dist/esm/components/product-picker-v2/variant.d.ts +2 -12
  340. package/dist/esm/components/product-picker-v2/variantComponents.d.ts +2 -3
  341. package/dist/esm/components/sample-button/SampleButton.d.ts +1 -16
  342. package/dist/esm/components/sample-button/SampleButton.model.d.ts +17 -0
  343. package/dist/esm/components/sample-button/SampleButton.styled.d.ts +1 -1
  344. package/dist/esm/components/sample-button/themes.d.ts +1 -1
  345. package/dist/esm/components/searchBar/searchBar.d.ts +1 -1
  346. package/dist/esm/components/slider/slider.js +1 -1
  347. package/dist/esm/components/stepper/Stepper.d.ts +1 -17
  348. package/dist/esm/components/stepper/Stepper.model.d.ts +17 -0
  349. package/dist/esm/components/stepper/Stepper.styled.d.ts +1 -1
  350. package/dist/esm/components/stepper/StepperService.d.ts +1 -1
  351. package/dist/esm/components/stepper/themes.d.ts +1 -1
  352. package/dist/esm/components/template-context-mapper/TemplateContextMapper.d.ts +9 -9
  353. package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
  354. package/dist/esm/components/template-context-mapper/context/templateModalContext.d.ts +7 -7
  355. package/dist/esm/components/template-context-mapper/custom-hooks/useAdditionalVariables.d.ts +1 -1
  356. package/dist/esm/components/template-context-mapper/helpers/WebpushTemplateHelper.d.ts +6 -4
  357. package/dist/esm/components/template-context-mapper/helpers/WebpushTemplateHelper.js +1 -1
  358. package/dist/esm/components/template-context-mapper/modalElements/Body.d.ts +2 -2
  359. package/dist/esm/components/template-context-mapper/modalElements/Body.js +10 -10
  360. package/dist/esm/components/template-context-mapper/modalElements/DesktopPreview.js +6 -6
  361. package/dist/esm/components/template-context-mapper/modalElements/EditMediaModal.d.ts +3 -3
  362. package/dist/esm/components/template-context-mapper/modalElements/EditMediaModal.js +1 -1
  363. package/dist/esm/components/template-context-mapper/modalElements/EditWebpushTemplate.d.ts +2 -2
  364. package/dist/esm/components/template-context-mapper/modalElements/EditWebpushTemplate.js +1 -1
  365. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.d.ts +3 -14
  366. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
  367. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.d.ts +5 -5
  368. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +1 -1
  369. package/dist/esm/components/template-context-mapper/modalElements/Footer.js +4 -4
  370. package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.d.ts +1 -1
  371. package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.js +5 -5
  372. package/dist/esm/components/template-context-mapper/modalElements/QualityWarningModal.d.ts +1 -1
  373. package/dist/esm/components/template-context-mapper/modalElements/TemplateAnalyticsComponent.d.ts +1 -1
  374. package/dist/esm/components/template-context-mapper/modalElements/TemplateSelectModalContent.d.ts +2 -2
  375. package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.d.ts +1 -1
  376. package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.js +1 -1
  377. package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.d.ts +5 -4
  378. package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
  379. package/dist/esm/components/template-context-mapper/modalElements/VariableEditorHeader.d.ts +1 -1
  380. package/dist/esm/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.d.ts +2 -2
  381. package/dist/esm/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
  382. package/dist/esm/components/template-context-mapper/modalElements/modal.d.ts +13 -0
  383. package/dist/esm/components/template-context-mapper/modalElements/useEditWhtasappTemplateMedia.d.ts +1 -1
  384. package/dist/esm/components/template-context-mapper/modalElements/useEditWhtasappTemplateMedia.js +1 -1
  385. package/dist/esm/components/template-context-mapper/utils/convertPlaceholdersToBikDropdown.d.ts +2 -2
  386. package/dist/esm/components/template-context-mapper/utils/getDataFromTemplateComponent.d.ts +2 -2
  387. package/dist/esm/components/template-context-mapper/utils/highlightFor.d.ts +1 -1
  388. package/dist/esm/components/template-preview/models/TemplateMeta.d.ts +1 -1
  389. package/dist/esm/components/template-preview/models/WhatsappCarouselTemplate.d.ts +2 -2
  390. package/dist/esm/components/toaster/Toaster.styled.js +1 -1
  391. package/dist/esm/components/variable-picker-v3/SubHeaderItems.js +1 -1
  392. package/dist/esm/components/zeroState/ZeroState.js +1 -2
  393. package/dist/esm/firebase/environment.d.ts +58 -0
  394. package/dist/esm/firebase/environment.js +1 -0
  395. package/dist/esm/firebase/firebaseUserFetcher.d.ts +34 -0
  396. package/dist/esm/firebase/firebaseUserFetcher.js +1 -0
  397. package/dist/esm/firebase/index.d.ts +7 -0
  398. package/dist/esm/firebase/lazyFirebaseApp.d.ts +22 -0
  399. package/dist/esm/firebase/lazyFirebaseApp.js +1 -0
  400. package/dist/esm/firebase/lazyFirebaseMethods.d.ts +589 -0
  401. package/dist/esm/firebase/lazyFirebaseMethods.js +1 -0
  402. package/dist/esm/firebase/lazyFirestore.d.ts +6 -0
  403. package/dist/esm/firebase/lazyFirestore.js +1 -0
  404. package/dist/esm/firebase/lazyFirestoreLite.d.ts +6 -0
  405. package/dist/esm/firebase/lazyFirestoreLite.js +1 -0
  406. package/dist/esm/firebase/lazyStorage.d.ts +5 -0
  407. package/dist/esm/firebase/lazyStorage.js +1 -0
  408. package/dist/esm/index.d.ts +3 -0
  409. package/dist/esm/index.js +1 -1
  410. package/dist/esm/request-executor/executor.d.ts +99 -0
  411. package/dist/esm/request-executor/executor.js +1 -0
  412. package/dist/esm/request-executor/index.d.ts +2 -0
  413. package/dist/esm/request-executor/model.d.ts +14 -0
  414. package/dist/esm/utils/logging/ErrorConstructor/ApiError.d.ts +3 -0
  415. package/dist/esm/utils/logging/ErrorConstructor/ApiError.js +1 -0
  416. package/dist/esm/utils/logging/ErrorConstructor/BroadcastFlowError.d.ts +4 -0
  417. package/dist/esm/utils/logging/ErrorConstructor/BroadcastFlowError.js +1 -0
  418. package/dist/esm/utils/logging/ErrorConstructor/CohortError.d.ts +4 -0
  419. package/dist/esm/utils/logging/ErrorConstructor/CohortError.js +1 -0
  420. package/dist/esm/utils/logging/ErrorConstructor/CustomError.d.ts +3 -0
  421. package/dist/esm/utils/logging/ErrorConstructor/CustomError.js +1 -0
  422. package/dist/esm/utils/logging/ErrorConstructor/ExcelUploadError.d.ts +3 -0
  423. package/dist/esm/utils/logging/ErrorConstructor/ExcelUploadError.js +1 -0
  424. package/dist/esm/utils/logging/ErrorConstructor/FirebaseCallError.d.ts +3 -0
  425. package/dist/esm/utils/logging/ErrorConstructor/FirebaseCallError.js +1 -0
  426. package/dist/esm/utils/logging/ErrorConstructor/FirebaseSubscriptionError.d.ts +3 -0
  427. package/dist/esm/utils/logging/ErrorConstructor/FirebaseSubscriptionError.js +1 -0
  428. package/dist/esm/utils/logging/ErrorConstructor/RechargeFailure.d.ts +3 -0
  429. package/dist/esm/utils/logging/ErrorConstructor/RechargeFailure.js +1 -0
  430. package/dist/esm/utils/logging/ErrorConstructor/WhatsappIntegrationError.d.ts +3 -0
  431. package/dist/esm/utils/logging/ErrorConstructor/WhatsappIntegrationError.js +1 -0
  432. package/dist/esm/utils/logging/Logger.d.ts +24 -0
  433. package/dist/esm/utils/logging/Logger.js +1 -0
  434. package/dist/esm/utils/logging/index.d.ts +10 -0
  435. package/package.json +8 -8
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),r=require("../../assets/icons/box.svg.js"),c=require("../../assets/icons/search.svg.js"),o=require("lodash"),s=require("react"),n=require("../../constants/Theme.js"),i=require("../checkBox/CheckBox.js"),l=require("../icon-button/IconButton.js"),d=require("../InfiniteScroll/InfiniteScroll.js"),u=require("../input/Input.js"),a=require("../spinner/Spinner.js"),h=require("../TypographyStyle.js"),p=require("./emptyState.js"),j=require("./product.js"),v=require("./ProductPickerShimmer.js"),g=require("./reducers.js"),y=require("./style.js"),O=require("./type.js"),b=require("./utility.js");exports.ProductsScreen=f=>{var k,C;const{data:P,collectionsDispatch:x,selectedData:S,selectedCollectionsDispatch:I,productFetcher:m,storeId:q,setScreen:A,setSaveDisabled:D,hideInCollectionSearch:T,customCollectionRestriction:E,hideProductCheckbox:R,outOfStockAction:V=O.OUT_OF_STOCK_ACTION.BLUR,hideVariantCheckbox:L=!1,selectProductsFromCustomCollection:F=!1,pickerType:w,hideProductVariants:B,fbStatusFetcher:_,onProductDetailClick:U,showProductDetailInfoIcon:K,scrollContainerRef:M,appType:N}=f,H=s.useContext(g.CollectionIdContext),J=s.useRef(0),W=s.useRef(!1),[z,G]=s.useState(""),[Q,X]=s.useState(!1),[Y,Z]=s.useState(P),$=s.useRef(!0),ee=s.useRef(!1);s.useEffect((()=>{if($.current)return void($.current=!1);const e=setTimeout((()=>{z.length?(X(!0),f.searchInCollectionFetcher(q,H,z,N).then((e=>{const t=o.cloneDeep(P);t.products=e,Z(t);const r=b.getVariantIdsToFetchAtProductLevel(null!=e?e:{});re(r,null!=e?e:{},!0),D(!1),X(!1)}))):Z(P)}),800);return()=>clearTimeout(e)}),[z]);s.useEffect((()=>{var e,t,r,c;ee.current=!1,J.current=Math.floor((null===(t=Object.keys(null!==(e=P.products)&&void 0!==e?e:{}))||void 0===t?void 0:t.length)/10);const o=b.getVariantIdsToFetchAtProductLevel(null!==(r=P.products)&&void 0!==r?r:{});re(o,null!==(c=P.products)&&void 0!==c?c:{})}),[H]);const te=!!E&&P.isSmartCollection;s.useEffect((()=>{(null==P?void 0:P.products)||ce(10)}),[]);const re=(e,t,r)=>{_||(r?b.markVariantsAsApprovedProductsLevel(t,x,H,Y,Z):b.markVariantsAsApprovedProductsLevel(t,x,H)),e.length>0&&_&&_(q,e,N).then((e=>{const c=Object.assign({},t);Object.keys(t).forEach((r=>{var o,s;Object.keys(null!==(s=null===(o=null==t?void 0:t[r])||void 0===o?void 0:o.variants)&&void 0!==s?s:{}).forEach((o=>{var s,n;const i=null===(s=null==t?void 0:t[r].variants)||void 0===s?void 0:s[o];i&&"REJECTED"===e[o]?i.fbStatus="REJECTED":i&&"APPROVED"===e[o]&&(i.fbStatus="APPROVED");const l=null===(n=null==c?void 0:c[r])||void 0===n?void 0:n.variants;l&&l[o]&&(l[o]=i)}))})),r?(Z((e=>{const t=Object.assign({},e);return t.products=c,t})),x({type:"productsPaged",data:{collectionId:H,products:c}})):x({type:"productsPaged",data:{collectionId:H,products:c}})})).catch((e=>{r?b.markVariantsAsApprovedProductsLevel(t,x,H,Y,Z):b.markVariantsAsApprovedProductsLevel(t,x,H)}))},ce=e=>{D(!0),X(!0),m(H,q,N,e,0).then((t=>{if(Object.keys(t).length||(ee.current=!0),Object.keys(t).length){Z(Object.assign(Object.assign({},Y),{products:t}));const e=b.getVariantIdsToFetchAtProductLevel(t);re(e,t),J.current=1}e||I({type:"selected",data:{id:H,val:Object.assign(Object.assign({},P),{products:t})}}),D(!1),X(!1)})).catch()},oe=(e,t)=>{const r=b.liftTheStateUp(t,P);I({type:e,data:Object.assign(Object.assign({},r),{isRestricted:E})})},se=!!(null==S?void 0:S[H])&&!!Object.keys(null!==(C=null===(k=null==S?void 0:S[H])||void 0===k?void 0:k.products)&&void 0!==C?C:{}).length;return e.jsxs("div",{children:[e.jsxs(y.ProductScreenHeader,{children:[e.jsx(l.IconButton,{Icon:t.default,height:16,onClick:()=>{A("collections")}}),e.jsx(h.BodyCaption,Object.assign({style:{color:n.COLORS.content.secondary}},{children:P.name}))]}),!T&&e.jsx("div",Object.assign({style:{padding:16,height:"76px",borderBottom:"1px solid #E0E0E0"}},{children:e.jsx(u.Input,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>Q&&z.length?e.jsx(a.Spinner,{size:"small",color:n.COLORS.content.primary}):e.jsx(c.default,{})},id:"listInput",height:"24px",type:"text",value:z,onChangeText:e=>{e.length&&e.trim().length?G(e):G("")},placeholder:"Search using ID, Name or SKU ID"})})),Object.keys((null==Y?void 0:Y.products)||[]).length>0&&!te&&!z.length&&!R&&"-1"!==H&&e.jsxs(y.ProductScreenCollectionCardStyle,{children:[e.jsx(i.CheckBox,{isChecked:se,isPartiallyChecked:b.isCollectionPartiallyChecked(H,Y,S,B),onValueChange:function(e){e?ce():I({type:"unselected",data:{id:H}})}}),e.jsx("div",Object.assign({style:{width:40,height:40}},{children:e.jsx(r.default,{})})),e.jsx(h.TitleRegular,{children:"All Products"})]}),e.jsx(d.InfiniteScroll,Object.assign({hasData:!(Object.keys((null==Y?void 0:Y.products)||[]).length<10)&&!!Object.keys((null==Y?void 0:Y.products)||[]).length,fetchMore:()=>(W.current=!0,m(H,q,N,10,J.current).then((e=>{let t=!1;if(Object.keys(e).length||(t=!0),Object.keys(e).length){const t=Y;t.products=Object.assign(Object.assign({},Y.products),e),Z(Object.assign({},t));const r=b.getVariantIdsToFetchAtProductLevel(e);re(r,e)}return D(!1),W.current=!1,J.current+=1,t}))),containerRef:M},{children:Object.keys((null==Y?void 0:Y.products)||[]).length?Object.keys(Y.products||[]).map((t=>e.jsx(j.ProductGroup,{outOfStockAction:V,collectionId:H,isProductPartiallyChecked:b.isProductPartiallyChecked(H,t,S,Y,B),productId:t,data:Y.products[t],selectedData:S,selectedCollectionsDispatch:I,viewOnly:!F&&!!te,upliftAdditions:oe,hideProductCheckbox:R,hideVariantCheckbox:L,hideProductVariants:B,pickerType:w,onProductDetailClick:U,showProductDetailInfoIcon:K},t))):Q?e.jsx(v.ProductPickerShimmer,{limit:10}):e.jsx(p.EmptyState,{title:"No products to show",subtitle:z.length?"We couldn't find the product you were looking for":"We couldn’t find any product in this collection."})}))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),r=require("../../assets/icons/box.svg.js"),o=require("../../assets/icons/search.svg.js"),c=require("lodash/cloneDeep"),s=require("react"),n=require("../../constants/Theme.js"),i=require("../checkBox/CheckBox.js"),l=require("../icon-button/IconButton.js"),u=require("../InfiniteScroll/InfiniteScroll.js"),d=require("../input/Input.js"),a=require("../spinner/Spinner.js"),h=require("../TypographyStyle.js"),p=require("./emptyState.js"),j=require("./product.js"),v=require("./ProductPickerShimmer.js"),g=require("./reducers.js"),y=require("./style.js"),f=require("./type.js"),b=require("./utility.js");function O(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var k=O(c);exports.ProductsScreen=c=>{var O,C;const{data:P,collectionsDispatch:x,selectedData:S,selectedCollectionsDispatch:I,productFetcher:m,storeId:q,setScreen:A,setSaveDisabled:D,hideInCollectionSearch:T,customCollectionRestriction:E,hideProductCheckbox:R,outOfStockAction:V=f.OUT_OF_STOCK_ACTION.BLUR,hideVariantCheckbox:L=!1,selectProductsFromCustomCollection:F=!1,pickerType:w,hideProductVariants:B,fbStatusFetcher:_,onProductDetailClick:U,showProductDetailInfoIcon:K,scrollContainerRef:M,appType:N}=c,H=s.useContext(g.CollectionIdContext),J=s.useRef(0),W=s.useRef(!1),[z,G]=s.useState(""),[Q,X]=s.useState(!1),[Y,Z]=s.useState(P),$=s.useRef(!0),ee=s.useRef(!1);s.useEffect((()=>{if($.current)return void($.current=!1);const e=setTimeout((()=>{z.length?(X(!0),c.searchInCollectionFetcher(q,H,z,N).then((e=>{const t=k.default(P);t.products=e,Z(t);const r=b.getVariantIdsToFetchAtProductLevel(null!=e?e:{});re(r,null!=e?e:{},!0),D(!1),X(!1)}))):Z(P)}),800);return()=>clearTimeout(e)}),[z]);s.useEffect((()=>{var e,t,r,o;ee.current=!1,J.current=Math.floor((null===(t=Object.keys(null!==(e=P.products)&&void 0!==e?e:{}))||void 0===t?void 0:t.length)/10);const c=b.getVariantIdsToFetchAtProductLevel(null!==(r=P.products)&&void 0!==r?r:{});re(c,null!==(o=P.products)&&void 0!==o?o:{})}),[H]);const te=!!E&&P.isSmartCollection;s.useEffect((()=>{(null==P?void 0:P.products)||oe(10)}),[]);const re=(e,t,r)=>{_||(r?b.markVariantsAsApprovedProductsLevel(t,x,H,Y,Z):b.markVariantsAsApprovedProductsLevel(t,x,H)),e.length>0&&_&&_(q,e,N).then((e=>{const o=Object.assign({},t);Object.keys(t).forEach((r=>{var c,s;Object.keys(null!==(s=null===(c=null==t?void 0:t[r])||void 0===c?void 0:c.variants)&&void 0!==s?s:{}).forEach((c=>{var s,n;const i=null===(s=null==t?void 0:t[r].variants)||void 0===s?void 0:s[c];i&&"REJECTED"===e[c]?i.fbStatus="REJECTED":i&&"APPROVED"===e[c]&&(i.fbStatus="APPROVED");const l=null===(n=null==o?void 0:o[r])||void 0===n?void 0:n.variants;l&&l[c]&&(l[c]=i)}))})),r?(Z((e=>{const t=Object.assign({},e);return t.products=o,t})),x({type:"productsPaged",data:{collectionId:H,products:o}})):x({type:"productsPaged",data:{collectionId:H,products:o}})})).catch((e=>{r?b.markVariantsAsApprovedProductsLevel(t,x,H,Y,Z):b.markVariantsAsApprovedProductsLevel(t,x,H)}))},oe=e=>{D(!0),X(!0),m(H,q,N,e,0).then((t=>{if(Object.keys(t).length||(ee.current=!0),Object.keys(t).length){Z(Object.assign(Object.assign({},Y),{products:t}));const e=b.getVariantIdsToFetchAtProductLevel(t);re(e,t),J.current=1}e||I({type:"selected",data:{id:H,val:Object.assign(Object.assign({},P),{products:t})}}),D(!1),X(!1)})).catch()},ce=(e,t)=>{const r=b.liftTheStateUp(t,P);I({type:e,data:Object.assign(Object.assign({},r),{isRestricted:E})})},se=!!(null==S?void 0:S[H])&&!!Object.keys(null!==(C=null===(O=null==S?void 0:S[H])||void 0===O?void 0:O.products)&&void 0!==C?C:{}).length;return e.jsxs("div",{children:[e.jsxs(y.ProductScreenHeader,{children:[e.jsx(l.IconButton,{Icon:t.default,height:16,onClick:()=>{A("collections")}}),e.jsx(h.BodyCaption,Object.assign({style:{color:n.COLORS.content.secondary}},{children:P.name}))]}),!T&&e.jsx("div",Object.assign({style:{padding:16,height:"76px",borderBottom:"1px solid #E0E0E0"}},{children:e.jsx(d.Input,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>Q&&z.length?e.jsx(a.Spinner,{size:"small",color:n.COLORS.content.primary}):e.jsx(o.default,{})},id:"listInput",height:"24px",type:"text",value:z,onChangeText:e=>{e.length&&e.trim().length?G(e):G("")},placeholder:"Search using ID, Name or SKU ID"})})),Object.keys((null==Y?void 0:Y.products)||[]).length>0&&!te&&!z.length&&!R&&"-1"!==H&&e.jsxs(y.ProductScreenCollectionCardStyle,{children:[e.jsx(i.CheckBox,{isChecked:se,isPartiallyChecked:b.isCollectionPartiallyChecked(H,Y,S,B),onValueChange:function(e){e?oe():I({type:"unselected",data:{id:H}})}}),e.jsx("div",Object.assign({style:{width:40,height:40}},{children:e.jsx(r.default,{})})),e.jsx(h.TitleRegular,{children:"All Products"})]}),e.jsx(u.InfiniteScroll,Object.assign({hasData:!(Object.keys((null==Y?void 0:Y.products)||[]).length<10)&&!!Object.keys((null==Y?void 0:Y.products)||[]).length,fetchMore:()=>(W.current=!0,m(H,q,N,10,J.current).then((e=>{let t=!1;if(Object.keys(e).length||(t=!0),Object.keys(e).length){const t=Y;t.products=Object.assign(Object.assign({},Y.products),e),Z(Object.assign({},t));const r=b.getVariantIdsToFetchAtProductLevel(e);re(r,e)}return D(!1),W.current=!1,J.current+=1,t}))),containerRef:M},{children:Object.keys((null==Y?void 0:Y.products)||[]).length?Object.keys(Y.products||[]).map((t=>e.jsx(j.ProductGroup,{outOfStockAction:V,collectionId:H,isProductPartiallyChecked:b.isProductPartiallyChecked(H,t,S,Y,B),productId:t,data:Y.products[t],selectedData:S,selectedCollectionsDispatch:I,viewOnly:!F&&!!te,upliftAdditions:ce,hideProductCheckbox:R,hideVariantCheckbox:L,hideProductVariants:B,pickerType:w,onProductDetailClick:U,showProductDetailInfoIcon:K},t))):Q?e.jsx(v.ProductPickerShimmer,{limit:10}):e.jsx(p.EmptyState,{title:"No products to show",subtitle:z.length?"We couldn't find the product you were looking for":"We couldn’t find any product in this collection."})}))]})};
@@ -1,8 +1,7 @@
1
- import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
1
+ import type { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
2
2
  import React from 'react';
3
- import { FbStatusFetcherReturn, SelectedItems } from '.';
4
- import { SelectedCollectionsActions } from './reducers';
5
- import { OUT_OF_STOCK_ACTION } from './type';
3
+ import type { SelectedCollectionsActions } from './reducers';
4
+ import { type FbStatusFetcherReturn, OUT_OF_STOCK_ACTION, type SelectedItems } from './type';
6
5
  interface RearrangeScreenInterface {
7
6
  selectedCollections: SelectedItems;
8
7
  selectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { Collection, SearchedItems, SelectedItems } from '.';
2
+ import type { Collection, SearchedItems, SelectedItems } from './type';
3
3
  export interface SelectedCollectionsActions {
4
4
  type: string;
5
5
  data: {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("lodash");const e=require("react").createContext("");exports.CollectionIdContext=e,exports.collectionsReducer=function(t,e){let a={};switch(e.type){case"fetched":return a=Object.assign({},e.data),a;case"productsFetched":return a=Object.assign({},t),a[e.data.collectionId].products=e.data.products,a;case"paged":return a=Object.assign(Object.assign({},t),e.data),a;case"productsPaged":return a=Object.assign({},t),a[e.data.collectionId].products=Object.assign(Object.assign({},a[e.data.collectionId].products),e.data.products),a;case"searched":a=Object.assign({},t);for(const t in e.data)t in a||(a[t]=e.data[t]);return a;default:return{}}},exports.paginationReducer=function(t,e){let a={};switch(e.type){case"paginate":a=Object.assign({},t);for(const t in e.data)if(Object.prototype.hasOwnProperty.call(e.data,t)){const s=e.data[t];if(Object.prototype.hasOwnProperty.call(a,t)){const e=a[t];a[t]=Object.assign(Object.assign({},e),{products:Object.assign(Object.assign({},e.products),s.products)})}else a[t]=s}return a;case"update":return a=Object.assign({},t),a;case"set":return a=Object.assign(Object.assign({},t),e.data),a;case"filter":a={};for(const s in t)if(s in e.data){const c=Object.assign({},t[s]),d=e.data[s],o={};for(const t in c.products)if(t in d.products){const e=Object.assign({},c.products[t]),a=d.products[t],s={};for(const t in e.variants)t in a.variants&&(s[t]=Object.assign({},e.variants[t]));Object.keys(s).length>0&&(e.variants=s,o[t]=e)}Object.keys(o).length>0&&(c.products=o,a[s]=c)}return a;default:return t}},exports.searchReducer=function(t,e){let a={collections:{},products:{}};switch(e.type){case"set":return e.data;case"setProducts":return a=Object.assign({},t),a.products=e.data,a;default:return t}},exports.selectedColectionsReducer=function(e,a){var s,c,d,o,r,n,i,l,u,p,v;let O={},g="",b="",j="";switch(a.type){case"selected":return O=t.cloneDeep(e),a.data.val.isSmartCollection&&(a.data.isRestricted&&(O={}),O.isCustom=!0),O[a.data.id]=a.data.val,O;case"unselected":return O=t.cloneDeep(e),(null==O?void 0:O.isCustom)&&(O.isCustom=!1),delete O[a.data.id],O;case"productUnselected":return O=t.cloneDeep(e),g=a.data.productId,b=a.data.collectionId,delete O[b].products[g],Object.keys(O[b].products).length||((null==O?void 0:O.isCustom)&&(O.isCustom=!1),delete O[b]),O;case"productSelected":return O=t.cloneDeep(e),g=a.data.productId,b=a.data.collectionId,(null===(s=a.data.catalogOnlyData)||void 0===s?void 0:s.isSmartCollection)&&(a.data.isRestricted&&(O={}),O.isCustom=!0),(null==O?void 0:O[b])||(O[b]=a.data.catalogOnlyData,O[b].products={}),O[b].products[g]=a.data.product,O;case"variantSelected":return O=t.cloneDeep(e),g=a.data.productId,b=a.data.collectionId,j=a.data.variantId,(null===(c=a.data.catalogOnlyData)||void 0===c?void 0:c.isSmartCollection)&&(a.data.isRestricted&&(O={}),O.isCustom=!0),(null==O?void 0:O[b])||(O[b]=a.data.catalogOnlyData,O[b].products={},O[b].products[g]=a.data.productOnlyData,O[b].products[g].variants={}),(null===(d=null==O?void 0:O[b])||void 0===d?void 0:d.products)||(O[b].products={}),(null===(r=null===(o=null==O?void 0:O[b])||void 0===o?void 0:o.products)||void 0===r?void 0:r[g])||(O[b].products[g]=a.data.productOnlyData,O[b].products[g].variants={}),O[b].products[g].variants||(O[b].products[g].variants={}),O[b].products[g].variants[j]=a.data.variant,O;case"variantUnselected":return O=t.cloneDeep(e),g=a.data.productId,b=a.data.collectionId,j=a.data.variantId,(null===(i=null===(n=O[b].products[g])||void 0===n?void 0:n.variants)||void 0===i?void 0:i[j])&&delete O[b].products[g].variants[j],Object.keys(null!==(p=null===(u=null===(l=O[b].products)||void 0===l?void 0:l[g])||void 0===u?void 0:u.variants)&&void 0!==p?p:{}).length||(delete O[b].products[g],Object.keys(O[b].products).length||((null===(v=O[b])||void 0===v?void 0:v.isSmartCollection)&&(O.isCustom=!1),delete O[b])),O;case"update":return O=Object.assign({},e),O;case"reset":return{};default:return e}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("lodash/cloneDeep"),e=require("react");function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=a(t);const d=e.createContext("");exports.CollectionIdContext=d,exports.collectionsReducer=function(t,e){let a={};switch(e.type){case"fetched":return a=Object.assign({},e.data),a;case"productsFetched":return a=Object.assign({},t),a[e.data.collectionId].products=e.data.products,a;case"paged":return a=Object.assign(Object.assign({},t),e.data),a;case"productsPaged":return a=Object.assign({},t),a[e.data.collectionId].products=Object.assign(Object.assign({},a[e.data.collectionId].products),e.data.products),a;case"searched":a=Object.assign({},t);for(const t in e.data)t in a||(a[t]=e.data[t]);return a;default:return{}}},exports.paginationReducer=function(t,e){let a={};switch(e.type){case"paginate":a=Object.assign({},t);for(const t in e.data)if(Object.prototype.hasOwnProperty.call(e.data,t)){const s=e.data[t];if(Object.prototype.hasOwnProperty.call(a,t)){const e=a[t];a[t]=Object.assign(Object.assign({},e),{products:Object.assign(Object.assign({},e.products),s.products)})}else a[t]=s}return a;case"update":return a=Object.assign({},t),a;case"set":return a=Object.assign(Object.assign({},t),e.data),a;case"filter":a={};for(const s in t)if(s in e.data){const d=Object.assign({},t[s]),c=e.data[s],o={};for(const t in d.products)if(t in c.products){const e=Object.assign({},d.products[t]),a=c.products[t],s={};for(const t in e.variants)t in a.variants&&(s[t]=Object.assign({},e.variants[t]));Object.keys(s).length>0&&(e.variants=s,o[t]=e)}Object.keys(o).length>0&&(d.products=o,a[s]=d)}return a;default:return t}},exports.searchReducer=function(t,e){let a={collections:{},products:{}};switch(e.type){case"set":return e.data;case"setProducts":return a=Object.assign({},t),a.products=e.data,a;default:return t}},exports.selectedColectionsReducer=function(t,e){var a,d,c,o,r,n,i,u,l,p,v;let O={},g="",b="",f="";switch(e.type){case"selected":return O=s.default(t),e.data.val.isSmartCollection&&(e.data.isRestricted&&(O={}),O.isCustom=!0),O[e.data.id]=e.data.val,O;case"unselected":return O=s.default(t),(null==O?void 0:O.isCustom)&&(O.isCustom=!1),delete O[e.data.id],O;case"productUnselected":return O=s.default(t),g=e.data.productId,b=e.data.collectionId,delete O[b].products[g],Object.keys(O[b].products).length||((null==O?void 0:O.isCustom)&&(O.isCustom=!1),delete O[b]),O;case"productSelected":return O=s.default(t),g=e.data.productId,b=e.data.collectionId,(null===(a=e.data.catalogOnlyData)||void 0===a?void 0:a.isSmartCollection)&&(e.data.isRestricted&&(O={}),O.isCustom=!0),(null==O?void 0:O[b])||(O[b]=e.data.catalogOnlyData,O[b].products={}),O[b].products[g]=e.data.product,O;case"variantSelected":return O=s.default(t),g=e.data.productId,b=e.data.collectionId,f=e.data.variantId,(null===(d=e.data.catalogOnlyData)||void 0===d?void 0:d.isSmartCollection)&&(e.data.isRestricted&&(O={}),O.isCustom=!0),(null==O?void 0:O[b])||(O[b]=e.data.catalogOnlyData,O[b].products={},O[b].products[g]=e.data.productOnlyData,O[b].products[g].variants={}),(null===(c=null==O?void 0:O[b])||void 0===c?void 0:c.products)||(O[b].products={}),(null===(r=null===(o=null==O?void 0:O[b])||void 0===o?void 0:o.products)||void 0===r?void 0:r[g])||(O[b].products[g]=e.data.productOnlyData,O[b].products[g].variants={}),O[b].products[g].variants||(O[b].products[g].variants={}),O[b].products[g].variants[f]=e.data.variant,O;case"variantUnselected":return O=s.default(t),g=e.data.productId,b=e.data.collectionId,f=e.data.variantId,(null===(i=null===(n=O[b].products[g])||void 0===n?void 0:n.variants)||void 0===i?void 0:i[f])&&delete O[b].products[g].variants[f],Object.keys(null!==(p=null===(l=null===(u=O[b].products)||void 0===u?void 0:u[g])||void 0===l?void 0:l.variants)&&void 0!==p?p:{}).length||(delete O[b].products[g],Object.keys(O[b].products).length||((null===(v=O[b])||void 0===v?void 0:v.isSmartCollection)&&(O.isCustom=!1),delete O[b])),O;case"update":return O=Object.assign({},t),O;case"reset":return{};default:return t}};
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
3
- import { Collection, FbStatusFetcherReturn, SearchedItems, SelectedItems } from '.';
4
- import { SearchReducerActions, SelectedCollectionsActions } from './reducers';
5
- import { OUT_OF_STOCK_ACTION } from './type';
2
+ import type { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
3
+ import type { SearchReducerActions, SelectedCollectionsActions } from './reducers';
4
+ import { type Collection, type FbStatusFetcherReturn, OUT_OF_STOCK_ACTION, type SearchedItems, type SelectedItems } from './type';
6
5
  interface SearchScreenInterface {
7
6
  customCollectionRestriction?: boolean;
8
7
  selectedCollections: SelectedItems;
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
3
- import { Collection, FbStatusFetcherReturn, SelectedItems } from '.';
4
- import { SelectedCollectionsActions } from './reducers';
5
- import { OUT_OF_STOCK_ACTION } from './type';
2
+ import type { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
3
+ import { type SelectedCollectionsActions } from './reducers';
4
+ import { type Collection, type FbStatusFetcherReturn, OUT_OF_STOCK_ACTION, type SelectedItems } from './type';
6
5
  interface SelectedScreenInterface {
7
6
  selectedCollections: SelectedItems;
8
7
  selectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>;
@@ -17,3 +17,68 @@ export declare enum ScreenName {
17
17
  SearchProducts = "searchProducts",
18
18
  Products = "products"
19
19
  }
20
+ export type FbProductStatus = 'APPROVED' | 'REJECTED';
21
+ export interface ProductVariant {
22
+ name: string;
23
+ price: string;
24
+ image: string;
25
+ quantity: number;
26
+ skipSync?: boolean;
27
+ displayOrder?: number | null;
28
+ fbStatus?: FbProductStatus;
29
+ description?: string;
30
+ id?: string;
31
+ actualPrice?: string;
32
+ currency?: string;
33
+ skuId?: string;
34
+ }
35
+ export interface Product {
36
+ name: string;
37
+ image: string;
38
+ description?: string;
39
+ variants?: {
40
+ [key: string]: ProductVariant;
41
+ };
42
+ id?: string;
43
+ handle?: string;
44
+ currency?: string;
45
+ }
46
+ export interface Collection {
47
+ name: string;
48
+ image: string;
49
+ isSmartCollection: boolean;
50
+ products?: {
51
+ [key: string]: Product;
52
+ };
53
+ }
54
+ export type SelectedItems = {
55
+ [key: string]: Collection;
56
+ };
57
+ export type SearchedItems = {
58
+ collections: SelectedItems;
59
+ products: SelectedItems;
60
+ };
61
+ export type CollectionFetcherReturn = Promise<{
62
+ collections: {
63
+ [key: string]: {
64
+ image: string;
65
+ name: string;
66
+ isSmartCollection: string;
67
+ };
68
+ };
69
+ }>;
70
+ export type ProductFetcherReturn = Promise<{
71
+ [key: string]: Product;
72
+ }>;
73
+ export type FbStatusFetcherReturn = Promise<{
74
+ [key: string]: FbProductStatus;
75
+ }>;
76
+ /**
77
+ * Extended type from Product Variant, which contains ids and name.
78
+ */
79
+ export type ProductVariantForRearrange = ProductVariant & {
80
+ variantId: string;
81
+ productId: string;
82
+ collectionId: string;
83
+ productName: string;
84
+ };
@@ -1,6 +1,6 @@
1
- import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
2
- import { Collection, FbStatusFetcherReturn, Product, ProductVariant, SearchedItems, SelectedItems } from './modal';
3
- import { CollectionsActions } from './reducers';
1
+ import type { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
2
+ import type { CollectionsActions } from './reducers';
3
+ import type { Collection, FbStatusFetcherReturn, Product, ProductVariant, SearchedItems, SelectedItems } from './type';
4
4
  export declare const liftTheStateUp: (payload: any, data: any) => any;
5
5
  export declare function paginateSelectedItems(selectedItems: SelectedItems, limit: number, offset: number): {
6
6
  [key: string]: Collection;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("lodash");function l(o,l,t){if(!o)return{};const i=Object.keys(o).slice(t,t+l),n={};return i.forEach((l=>{n[l]=o[l]})),n}const t=(o,l,t)=>{Object.keys(o).forEach((l=>{var t,i;const n=null!==(i=null===(t=o[l])||void 0===t?void 0:t.products)&&void 0!==i?i:{};Object.keys(n).forEach((t=>{var i,n,d,v;const s=null!==(v=null===(d=null===(n=null===(i=o[l])||void 0===i?void 0:i.products)||void 0===n?void 0:n[t])||void 0===d?void 0:d.variants)&&void 0!==v?v:{};Object.keys(s).forEach((i=>{var n,d,v,s;const e=null===(s=null===(v=null===(d=null===(n=o[l])||void 0===n?void 0:n.products)||void 0===d?void 0:d[t])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[i];e&&!e.fbStatus&&(e.fbStatus="APPROVED")}))}))})),l({type:t,data:o})};exports.fetchFbStatusCollection=function(o,l,i,n,d){let v=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"paged";d||t(o,n,v);const s=(o=>{const l=[];return Object.keys(o).forEach((t=>{var i,n;const d=null!==(n=null===(i=o[t])||void 0===i?void 0:i.products)&&void 0!==n?n:{};Object.keys(d).forEach((i=>{var n,d,v,s;const e=null!==(s=null===(v=null===(d=null===(n=o[t])||void 0===n?void 0:n.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(e).forEach((n=>{var d,v,s,e;const u=null===(e=null===(s=null===(v=null===(d=o[t])||void 0===d?void 0:d.products)||void 0===v?void 0:v[i])||void 0===s?void 0:s.variants)||void 0===e?void 0:e[n];(null==u?void 0:u.fbStatus)||l.push(n)}))}))})),l})(o);s.length>0&&d&&d(l,s,i).then((l=>{const t=Object.assign({},o);Object.keys(t).forEach((o=>{var i,n;const d=null!==(n=null===(i=t[o])||void 0===i?void 0:i.products)&&void 0!==n?n:{};Object.keys(d).forEach((i=>{var n,d,v,s;const e=null!==(s=null===(v=null===(d=null===(n=t[o])||void 0===n?void 0:n.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(e).forEach((n=>{var d,v,s,e;const u=null===(e=null===(s=null===(v=null===(d=t[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[i])||void 0===s?void 0:s.variants)||void 0===e?void 0:e[n];u&&"REJECTED"===l[n]?u.fbStatus="REJECTED":u&&"APPROVED"===l[n]&&(u.fbStatus="APPROVED")}))}))})),n({type:v,data:t})})).catch((l=>{console.error("Error in fbStatusFetcher",l),t(o,n,v)}))},exports.getSkuId=(o,l)=>{var t;if(l)return o.skuId;const i=Object.values(null!==(t=null==o?void 0:o.variants)&&void 0!==t?t:{});return 1===i.length&&i[0].name.includes(o.name)?i[0].skuId:""},exports.getVariantIdsToFetchAtProductLevel=(o,l)=>{const t=[];return Object.keys(null!=o?o:{}).forEach((i=>{var n,d;const v=null!==(d=null===(n=null==o?void 0:o[i])||void 0===n?void 0:n.variants)&&void 0!==d?d:{};Object.keys(v).forEach((n=>{var d,v,s,e,u;let r;r=l?null===(s=null===(v=null===(d=null==l?void 0:l.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[n]:null===(u=null===(e=null==o?void 0:o[i])||void 0===e?void 0:e.variants)||void 0===u?void 0:u[n],(null==r?void 0:r.fbStatus)||t.push(n)}))})),t},exports.isCollectionPartiallyChecked=function(o,l,t){var i,n,d,v;let s=0,e=0;if(arguments.length>3&&void 0!==arguments[3]&&arguments[3]){const v=null!==(i=null==l?void 0:l.products)&&void 0!==i?i:{};s=Object.keys(v).length;const u=null!==(d=null===(n=t[o])||void 0===n?void 0:n.products)&&void 0!==d?d:{};e=Object.keys(u).length}else if(t[o]){const i=null==l?void 0:l.products;i&&Object.keys(i).forEach((o=>{var l;const t=null===(l=i[o])||void 0===l?void 0:l.variants;t&&Object.keys(t).forEach((o=>s+=1))}));const n=null===(v=t[o])||void 0===v?void 0:v.products;if(n&&Object.keys(n).forEach((o=>{var l;const t=null===(l=n[o])||void 0===l?void 0:l.variants;t&&Object.keys(t).forEach((o=>e+=1))})),s<=0&&e>0)return!1}return e>0&&s!==e},exports.isProductPartiallyChecked=(o,l,t,i,n)=>{var d,v,s,e,u,r,c,a,p,b,O,f,j,h,y,g,k,E,P;let D=0,S=0;if(null===(v=null===(d=null==t?void 0:t[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[l]){if(n)return!1;const d=(null===(u=null===(e=null===(s=null==t?void 0:t[o])||void 0===s?void 0:s.products)||void 0===e?void 0:e[l])||void 0===u?void 0:u.variants)||[];if(1===Object.keys(d).length)for(const i in d){const n=null===(c=null===(r=null==t?void 0:t[o])||void 0===r?void 0:r.products)||void 0===c?void 0:c[l],d=null===(O=null===(b=null===(p=null===(a=null==t?void 0:t[o])||void 0===a?void 0:a.products)||void 0===p?void 0:p[l])||void 0===b?void 0:b.variants)||void 0===O?void 0:O[i];if(null===(f=null==d?void 0:d.name)||void 0===f?void 0:f.includes(null!==(j=null==n?void 0:n.name)&&void 0!==j?j:""))return!1}if(null===(g=Object.keys((null===(y=null===(h=null==i?void 0:i.products)||void 0===h?void 0:h[l])||void 0===y?void 0:y.variants)||[]))||void 0===g||g.forEach((()=>S++)),Object.keys((null===(P=null===(E=null===(k=null==t?void 0:t[o])||void 0===k?void 0:k.products)||void 0===E?void 0:E[l])||void 0===P?void 0:P.variants)||[]).forEach((()=>D++)),D>0&&S!==D)return!0}return!1},exports.liftTheStateUp=(l,t)=>{const i=o.cloneDeep(t);if(delete i.products,(l=Object.assign(Object.assign({},l),{catalogOnlyData:i})).productId&&t.products){const n=o.cloneDeep(t.products[l.productId]);(null==n?void 0:n.variants)&&delete n.variants,l=Object.assign(Object.assign({},l),{catalogOnlyData:i,productOnlyData:n})}return l},exports.markVariantsAsApprovedProductsLevel=(o,l,t,i,n)=>{const d=Object.assign({},o);if(Object.keys(o).forEach((l=>{var t,i;Object.keys(null!==(i=null===(t=null==o?void 0:o[l])||void 0===t?void 0:t.variants)&&void 0!==i?i:{}).forEach((t=>{var i,n;const v=null===(i=null==o?void 0:o[l].variants)||void 0===i?void 0:i[t];v&&(v.fbStatus="APPROVED");const s=null===(n=null==d?void 0:d[l])||void 0===n?void 0:n.variants;s&&s[t]&&(s[t]=v)}))})),i&&n){const o=Object.assign({},i);o.products=d,n(o),l({type:"productsPaged",data:{collectionId:t,products:d}})}else l({type:"productsPaged",data:{collectionId:t,products:d}})},exports.paginateSelectedItems=function(o,t,i){var n;const d={};let v=0;for(const s in o)if(Object.prototype.hasOwnProperty.call(o,s)){const e=o[s],u=l(e.products,t,i-v);u&&Object.keys(u).length>0&&(d[s]=Object.assign(Object.assign({},e),{products:u})),v+=Object.keys(null!==(n=e.products)&&void 0!==n?n:{}).length}return d},exports.shouldShowVariant=o=>{const l=Object.keys(o.variants||[]);let t=!1;return!(l.length<=1)||(l.forEach((l=>{var i,n;t=null!==(n=null===(i=o.variants)||void 0===i?void 0:i[l].name.includes(o.name))&&void 0!==n&&n})),!t)},exports.updateAllVariantsForSelectedProducts=(l,t,i)=>Object.keys(l).reduce(((n,d)=>{var v;return d in t?(n[d]=Object.assign(Object.assign({},l[d]),{products:Object.keys(null!==(v=l[d].products)&&void 0!==v?v:{}).reduce(((n,v)=>{var s,e,u,r,c,a,p,b,O,f;const j=null===(s=t[d].products)||void 0===s?void 0:s[v],h=null===(r=null===(u=null===(e=null==i?void 0:i.products)||void 0===e?void 0:e[d])||void 0===u?void 0:u.products)||void 0===r?void 0:r[v];return j?n[v]=Object.assign(Object.assign({},(null===(c=l[d].products)||void 0===c?void 0:c[v])||{}),{allVariants:o.cloneDeep(j.variants)}):h?n[v]=Object.assign(Object.assign({},(null===(a=l[d].products)||void 0===a?void 0:a[v])||{}),{allVariants:o.cloneDeep(h.variants)}):(null===(b=null===(p=l[d].products)||void 0===p?void 0:p[v])||void 0===b?void 0:b.allVariants)&&(n[v]=Object.assign(Object.assign({},(null===(O=l[d].products)||void 0===O?void 0:O[v])||{}),{allVariants:o.cloneDeep(null===(f=l[d].products)||void 0===f?void 0:f[v].allVariants)})),n}),{})}),n):n}),{});
1
+ "use strict";function o(o){return o&&"object"==typeof o&&"default"in o?o:{default:o}}Object.defineProperty(exports,"__esModule",{value:!0});var t=o(require("lodash/cloneDeep"));function l(o,t,l){if(!o)return{};const i=Object.keys(o).slice(l,l+t),d={};return i.forEach((t=>{d[t]=o[t]})),d}const i=(o,t,l)=>{Object.keys(o).forEach((t=>{var l,i;const d=null!==(i=null===(l=o[t])||void 0===l?void 0:l.products)&&void 0!==i?i:{};Object.keys(d).forEach((l=>{var i,d,n,v;const s=null!==(v=null===(n=null===(d=null===(i=o[t])||void 0===i?void 0:i.products)||void 0===d?void 0:d[l])||void 0===n?void 0:n.variants)&&void 0!==v?v:{};Object.keys(s).forEach((i=>{var d,n,v,s;const e=null===(s=null===(v=null===(n=null===(d=o[t])||void 0===d?void 0:d.products)||void 0===n?void 0:n[l])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[i];e&&!e.fbStatus&&(e.fbStatus="APPROVED")}))}))})),t({type:l,data:o})};exports.fetchFbStatusCollection=function(o,t,l,d,n){let v=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"paged";n||i(o,d,v);const s=(o=>{const t=[];return Object.keys(o).forEach((l=>{var i,d;const n=null!==(d=null===(i=o[l])||void 0===i?void 0:i.products)&&void 0!==d?d:{};Object.keys(n).forEach((i=>{var d,n,v,s;const e=null!==(s=null===(v=null===(n=null===(d=o[l])||void 0===d?void 0:d.products)||void 0===n?void 0:n[i])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(e).forEach((d=>{var n,v,s,e;const u=null===(e=null===(s=null===(v=null===(n=o[l])||void 0===n?void 0:n.products)||void 0===v?void 0:v[i])||void 0===s?void 0:s.variants)||void 0===e?void 0:e[d];(null==u?void 0:u.fbStatus)||t.push(d)}))}))})),t})(o);s.length>0&&n&&n(t,s,l).then((t=>{const l=Object.assign({},o);Object.keys(l).forEach((o=>{var i,d;const n=null!==(d=null===(i=l[o])||void 0===i?void 0:i.products)&&void 0!==d?d:{};Object.keys(n).forEach((i=>{var d,n,v,s;const e=null!==(s=null===(v=null===(n=null===(d=l[o])||void 0===d?void 0:d.products)||void 0===n?void 0:n[i])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(e).forEach((d=>{var n,v,s,e;const u=null===(e=null===(s=null===(v=null===(n=l[o])||void 0===n?void 0:n.products)||void 0===v?void 0:v[i])||void 0===s?void 0:s.variants)||void 0===e?void 0:e[d];u&&"REJECTED"===t[d]?u.fbStatus="REJECTED":u&&"APPROVED"===t[d]&&(u.fbStatus="APPROVED")}))}))})),d({type:v,data:l})})).catch((t=>{console.error("Error in fbStatusFetcher",t),i(o,d,v)}))},exports.getSkuId=(o,t)=>{var l;if(t)return o.skuId;const i=Object.values(null!==(l=null==o?void 0:o.variants)&&void 0!==l?l:{});return 1===i.length&&i[0].name.includes(o.name)?i[0].skuId:""},exports.getVariantIdsToFetchAtProductLevel=(o,t)=>{const l=[];return Object.keys(null!=o?o:{}).forEach((i=>{var d,n;const v=null!==(n=null===(d=null==o?void 0:o[i])||void 0===d?void 0:d.variants)&&void 0!==n?n:{};Object.keys(v).forEach((d=>{var n,v,s,e,u;let r;r=t?null===(s=null===(v=null===(n=null==t?void 0:t.products)||void 0===n?void 0:n[i])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[d]:null===(u=null===(e=null==o?void 0:o[i])||void 0===e?void 0:e.variants)||void 0===u?void 0:u[d],(null==r?void 0:r.fbStatus)||l.push(d)}))})),l},exports.isCollectionPartiallyChecked=function(o,t,l){var i,d,n,v;let s=0,e=0;if(arguments.length>3&&void 0!==arguments[3]&&arguments[3]){const v=null!==(i=null==t?void 0:t.products)&&void 0!==i?i:{};s=Object.keys(v).length;const u=null!==(n=null===(d=l[o])||void 0===d?void 0:d.products)&&void 0!==n?n:{};e=Object.keys(u).length}else if(l[o]){const i=null==t?void 0:t.products;i&&Object.keys(i).forEach((o=>{var t;const l=null===(t=i[o])||void 0===t?void 0:t.variants;l&&Object.keys(l).forEach((o=>s+=1))}));const d=null===(v=l[o])||void 0===v?void 0:v.products;if(d&&Object.keys(d).forEach((o=>{var t;const l=null===(t=d[o])||void 0===t?void 0:t.variants;l&&Object.keys(l).forEach((o=>e+=1))})),s<=0&&e>0)return!1}return e>0&&s!==e},exports.isProductPartiallyChecked=(o,t,l,i,d)=>{var n,v,s,e,u,r,a,c,p,f,b,O,j,h,y,g,k,E,P;let S=0,V=0;if(null===(v=null===(n=null==l?void 0:l[o])||void 0===n?void 0:n.products)||void 0===v?void 0:v[t]){if(d)return!1;const n=(null===(u=null===(e=null===(s=null==l?void 0:l[o])||void 0===s?void 0:s.products)||void 0===e?void 0:e[t])||void 0===u?void 0:u.variants)||[];if(1===Object.keys(n).length)for(const i in n){const d=null===(a=null===(r=null==l?void 0:l[o])||void 0===r?void 0:r.products)||void 0===a?void 0:a[t],n=null===(b=null===(f=null===(p=null===(c=null==l?void 0:l[o])||void 0===c?void 0:c.products)||void 0===p?void 0:p[t])||void 0===f?void 0:f.variants)||void 0===b?void 0:b[i];if(null===(O=null==n?void 0:n.name)||void 0===O?void 0:O.includes(null!==(j=null==d?void 0:d.name)&&void 0!==j?j:""))return!1}if(null===(g=Object.keys((null===(y=null===(h=null==i?void 0:i.products)||void 0===h?void 0:h[t])||void 0===y?void 0:y.variants)||[]))||void 0===g||g.forEach((()=>V++)),Object.keys((null===(P=null===(E=null===(k=null==l?void 0:l[o])||void 0===k?void 0:k.products)||void 0===E?void 0:E[t])||void 0===P?void 0:P.variants)||[]).forEach((()=>S++)),S>0&&V!==S)return!0}return!1},exports.liftTheStateUp=(o,l)=>{const i=t.default(l);if(delete i.products,(o=Object.assign(Object.assign({},o),{catalogOnlyData:i})).productId&&l.products){const d=t.default(l.products[o.productId]);(null==d?void 0:d.variants)&&delete d.variants,o=Object.assign(Object.assign({},o),{catalogOnlyData:i,productOnlyData:d})}return o},exports.markVariantsAsApprovedProductsLevel=(o,t,l,i,d)=>{const n=Object.assign({},o);if(Object.keys(o).forEach((t=>{var l,i;Object.keys(null!==(i=null===(l=null==o?void 0:o[t])||void 0===l?void 0:l.variants)&&void 0!==i?i:{}).forEach((l=>{var i,d;const v=null===(i=null==o?void 0:o[t].variants)||void 0===i?void 0:i[l];v&&(v.fbStatus="APPROVED");const s=null===(d=null==n?void 0:n[t])||void 0===d?void 0:d.variants;s&&s[l]&&(s[l]=v)}))})),i&&d){const o=Object.assign({},i);o.products=n,d(o),t({type:"productsPaged",data:{collectionId:l,products:n}})}else t({type:"productsPaged",data:{collectionId:l,products:n}})},exports.paginateSelectedItems=function(o,t,i){var d;const n={};let v=0;for(const s in o)if(Object.prototype.hasOwnProperty.call(o,s)){const e=o[s],u=l(e.products,t,i-v);u&&Object.keys(u).length>0&&(n[s]=Object.assign(Object.assign({},e),{products:u})),v+=Object.keys(null!==(d=e.products)&&void 0!==d?d:{}).length}return n},exports.shouldShowVariant=o=>{const t=Object.keys(o.variants||[]);let l=!1;return!(t.length<=1)||(t.forEach((t=>{var i,d;l=null!==(d=null===(i=o.variants)||void 0===i?void 0:i[t].name.includes(o.name))&&void 0!==d&&d})),!l)},exports.updateAllVariantsForSelectedProducts=(o,l,i)=>Object.keys(o).reduce(((d,n)=>{var v;return n in l?(d[n]=Object.assign(Object.assign({},o[n]),{products:Object.keys(null!==(v=o[n].products)&&void 0!==v?v:{}).reduce(((d,v)=>{var s,e,u,r,a,c,p,f,b,O;const j=null===(s=l[n].products)||void 0===s?void 0:s[v],h=null===(r=null===(u=null===(e=null==i?void 0:i.products)||void 0===e?void 0:e[n])||void 0===u?void 0:u.products)||void 0===r?void 0:r[v];return j?d[v]=Object.assign(Object.assign({},(null===(a=o[n].products)||void 0===a?void 0:a[v])||{}),{allVariants:t.default(j.variants)}):h?d[v]=Object.assign(Object.assign({},(null===(c=o[n].products)||void 0===c?void 0:c[v])||{}),{allVariants:t.default(h.variants)}):(null===(f=null===(p=o[n].products)||void 0===p?void 0:p[v])||void 0===f?void 0:f.allVariants)&&(d[v]=Object.assign(Object.assign({},(null===(b=o[n].products)||void 0===b?void 0:b[v])||{}),{allVariants:t.default(null===(O=o[n].products)||void 0===O?void 0:O[v].allVariants)})),d}),{})}),d):d}),{});
@@ -1,16 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { ProductVariant } from './modal';
3
- import { SelectedCollectionsActions } from './reducers';
4
- import { OUT_OF_STOCK_ACTION } from './type';
5
- /**
6
- * Extended type from Product Variant, which contains ids and name.
7
- */
8
- export type ProductVariantForRearrange = ProductVariant & {
9
- variantId: string;
10
- productId: string;
11
- collectionId: string;
12
- productName: string;
13
- };
2
+ import type { SelectedCollectionsActions } from './reducers';
3
+ import { OUT_OF_STOCK_ACTION, type ProductVariantForRearrange } from './type';
14
4
  /**
15
5
  * Props type for variant card in rearrange screen
16
6
  */
@@ -1,7 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { SelectedCollectionsActions } from './reducers';
3
- import { OUT_OF_STOCK_ACTION } from './type';
4
- import { ProductVariantForRearrange } from './variant';
2
+ import type { SelectedCollectionsActions } from './reducers';
3
+ import { OUT_OF_STOCK_ACTION, type ProductVariantForRearrange } from './type';
5
4
  /**
6
5
  * Props for list of variants - applicable both in list and grid view
7
6
  */
@@ -1,18 +1,3 @@
1
1
  /// <reference types="react" />
2
- export type Color = 'primary' | 'secondary' | 'success' | 'error' | 'warn';
3
- export type Variant = 'solid' | 'outline' | 'text';
4
- export interface SampleButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
5
- /**
6
- * The color of the Button.
7
- *
8
- * @default 'primary'
9
- */
10
- color?: Color;
11
- /**
12
- * The visual style of the Button.
13
- *
14
- * @default 'solid'
15
- */
16
- variant?: Variant;
17
- }
2
+ import { SampleButtonProps } from './SampleButton.model';
18
3
  export declare const SampleButton: import("react").ForwardRefExoticComponent<SampleButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ export type Color = 'primary' | 'secondary' | 'success' | 'error' | 'warn';
3
+ export type Variant = 'solid' | 'outline' | 'text';
4
+ export interface SampleButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
5
+ /**
6
+ * The color of the Button.
7
+ *
8
+ * @default 'primary'
9
+ */
10
+ color?: Color;
11
+ /**
12
+ * The visual style of the Button.
13
+ *
14
+ * @default 'solid'
15
+ */
16
+ variant?: Variant;
17
+ }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { Color, Variant } from './SampleButton';
2
+ import type { Color, Variant } from './SampleButton.model';
3
3
  export declare const SampleButton: import("@emotion/styled").StyledComponent<{
4
4
  theme?: import("@emotion/react").Theme | undefined;
5
5
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
@@ -1,2 +1,2 @@
1
- import type { Color, Variant } from './SampleButton';
1
+ import type { Color, Variant } from './SampleButton.model';
2
2
  export declare function getTheme(color: Color, variant: Variant): import("@emotion/utils").SerializedStyles;
@@ -1,5 +1,5 @@
1
1
  import { ButtonProps } from '../button/model';
2
- import { InputVariant } from '../input/Input';
2
+ import { InputVariant } from '../input/Input.model';
3
3
  export interface SearchBarProps {
4
4
  width: string;
5
5
  isEnabled: boolean;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),a=require("../../constants/Theme.js");exports.BikSlider=n=>{let{min:r=0,max:s=100,defaultValue:o,onChange:i,step:l=1,disabled:u=!1}=n;const c=void 0!==o?o:r,[b,d]=t.useState(c),[g,h]=t.useState(!1),[p,x]=t.useState(!1),[m,f]=t.useState(!1),v=t.useRef(null),w=t.useRef(null),k=(e=>({container:{position:"relative",marginTop:"30px",height:"8px",width:"100%",cursor:e?"not-allowed":"pointer",opacity:e?.5:1},track:{position:"absolute",top:0,left:0,right:0,height:"8px",backgroundColor:"#E0E0E0",borderRadius:"4px"},filledTrack:{position:"absolute",top:0,left:0,height:"8px",backgroundColor:a.COLORS.background.brand,borderRadius:"4px",transition:"width 0.1s ease"},thumb:{position:"absolute",top:"50%",width:"24px",height:"24px",backgroundColor:a.COLORS.background.brand,border:`2px solid ${a.COLORS.background.brand}`,borderRadius:"50%",transform:"translate(-50%, -50%)",cursor:e?"not-allowed":"grab",transition:"box-shadow 0.2s ease",outline:"none",zIndex:1},thumbDisabled:{cursor:"not-allowed"},valueLabel:{position:"absolute",bottom:"100%",left:"50%",marginBottom:"16px",width:"32px",height:"32px",backgroundColor:a.COLORS.background.brand,borderRadius:"50% 50% 50% 0",transform:"translate(0, 0) rotate(-45deg) scale(0)",transformOrigin:"bottom left",transition:"transform 0.2s ease",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},valueLabelVisible:{transform:"translate(0, 0) rotate(-45deg) scale(1)"},valueLabelText:{transform:"rotate(45deg)",color:"white",fontSize:"12px",lineHeight:1.2,fontWeight:500}}))(u);t.useEffect((()=>{d(void 0!==o?o:r)}),[o,r]);const j=t.useCallback((e=>{if(!v.current)return r;const t=v.current.getBoundingClientRect(),a=Math.max(0,Math.min(1,(e-t.left)/t.width)),n=r+a*(s-r),o=Math.round(n/l)*l;return Math.max(r,Math.min(s,o))}),[r,s,l]),O=t.useCallback((e=>{if(u)return;e.preventDefault(),h(!0),f(!0);const t=j(e.clientX);d(t);const a=new Event("change",{bubbles:!0});i(a,t)}),[u,j,i]),C=t.useCallback((e=>{if(!g||u)return;const t=j(e.clientX);d(t);const a=new Event("change",{bubbles:!0});i(a,t)}),[g,u,j,i]),L=t.useCallback((()=>{h(!1),f(!1)}),[]),E=t.useCallback((e=>{if(u)return;let t=b;switch(e.key){case"ArrowLeft":case"ArrowDown":t=Math.max(r,b-l);break;case"ArrowRight":case"ArrowUp":t=Math.min(s,b+l);break;case"Home":t=r;break;case"End":t=s;break;default:return}e.preventDefault(),d(t);const a=new Event("change",{bubbles:!0});i(a,t)}),[u,b,r,s,l,i]);t.useEffect((()=>{if(g)return document.addEventListener("mousemove",C),document.addEventListener("mouseup",L),()=>{document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",L)}}),[g,C,L]);const M=(b-r)/(s-r)*100,y=isNaN(M)?0:Math.max(0,Math.min(100,M));return e.jsxs("div",Object.assign({ref:v,style:k.container,onMouseDown:O,role:"slider","aria-label":"bik slider","aria-valuemin":r,"aria-valuemax":s,"aria-valuenow":b,tabIndex:u?-1:0,onKeyDown:E},{children:[e.jsx("div",{style:k.track}),e.jsx("div",{style:Object.assign(Object.assign({},k.filledTrack),{width:`${y}%`})}),e.jsx("div",Object.assign({ref:w,style:(()=>{const e=Object.assign({},k.thumb);return u?Object.assign(Object.assign({},e),k.thumbDisabled):(g?(e.boxShadow="0px 0px 0px 8px rgba(115, 29, 207, 0.5)",e.cursor="grabbing"):p&&(e.boxShadow="0px 0px 0px 8px rgba(115, 29, 207, 0.08)"),e.left=`${y}%`,e)})(),onMouseEnter:()=>!u&&x(!0),onMouseLeave:()=>!u&&x(!1),onFocus:()=>!u&&f(!0),onBlur:()=>!u&&f(!1)},{children:e.jsx("div",Object.assign({style:(()=>{const e=Object.assign({},k.valueLabel);return m||p?Object.assign(Object.assign({},e),k.valueLabelVisible):e})()},{children:e.jsx("span",Object.assign({style:k.valueLabelText},{children:b}))}))}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),a=require("../../constants/Theme.js");exports.BikSlider=n=>{let{min:r=0,max:o=100,defaultValue:s,onChange:i,step:l=1,disabled:u=!1}=n;const b=void 0!==s?s:r,[c,d]=t.useState(b),[g,h]=t.useState(!1),[m,p]=t.useState(!1),[x,f]=t.useState(!1),v=t.useRef(null),k=t.useRef(null),w=t.useMemo((()=>(e=>({container:{position:"relative",marginTop:"30px",height:"8px",width:"100%",cursor:e?"not-allowed":"pointer",opacity:e?.5:1},track:{position:"absolute",top:0,left:0,right:0,height:"8px",backgroundColor:"#E0E0E0",borderRadius:"4px"},filledTrack:{position:"absolute",top:0,left:0,height:"8px",backgroundColor:a.COLORS.background.brand,borderRadius:"4px",transition:"width 0.1s ease"},filledTrackDragging:{position:"absolute",top:0,left:0,height:"8px",backgroundColor:a.COLORS.background.brand,borderRadius:"4px",transition:"none"},thumb:{position:"absolute",top:"50%",width:"24px",height:"24px",backgroundColor:a.COLORS.background.brand,border:`2px solid ${a.COLORS.background.brand}`,borderRadius:"50%",transform:"translate(-50%, -50%)",cursor:e?"not-allowed":"grab",transition:"box-shadow 0.2s ease",outline:"none",zIndex:1},thumbDisabled:{cursor:"not-allowed"},valueLabel:{position:"absolute",bottom:"100%",left:"50%",marginBottom:"16px",width:"32px",height:"32px",backgroundColor:a.COLORS.background.brand,borderRadius:"50% 50% 50% 0",transform:"translate(0, 0) rotate(-45deg) scale(0)",transformOrigin:"bottom left",transition:"transform 0.2s ease",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},valueLabelVisible:{transform:"translate(0, 0) rotate(-45deg) scale(1)"},valueLabelText:{transform:"rotate(45deg)",color:"white",fontSize:"12px",lineHeight:1.2,fontWeight:500}}))(u)),[u]);t.useEffect((()=>{d(void 0!==s?s:r)}),[s,r]);const O=t.useCallback((e=>{if(!v.current)return r;const t=v.current.getBoundingClientRect(),a=Math.max(0,Math.min(1,(e-t.left)/t.width)),n=r+a*(o-r),s=Math.round(n/l)*l;return Math.max(r,Math.min(o,s))}),[r,o,l]),j=t.useCallback((e=>{if(u)return;e.preventDefault(),h(!0),f(!0);const t=O(e.clientX);d(t);const a=new Event("change",{bubbles:!0});i(a,t)}),[u,O,i]),L=t.useCallback((e=>{if(!g||u)return;const t=O(e.clientX);d(t);const a=new Event("change",{bubbles:!0});i(a,t)}),[g,u,O,i]),C=t.useCallback((()=>{h(!1),f(!1)}),[]),M=t.useCallback((e=>{if(u)return;let t=c;switch(e.key){case"ArrowLeft":case"ArrowDown":t=Math.max(r,c-l);break;case"ArrowRight":case"ArrowUp":t=Math.min(o,c+l);break;case"Home":t=r;break;case"End":t=o;break;default:return}e.preventDefault(),d(t);const a=new Event("change",{bubbles:!0});i(a,t)}),[u,c,r,o,l,i]);t.useEffect((()=>{if(g)return document.addEventListener("mousemove",L),document.addEventListener("mouseup",C),()=>{document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",C)}}),[g,L,C]);const E=(c-r)/(o-r)*100,R=isNaN(E)?0:Math.max(0,Math.min(100,E)),S=t.useMemo((()=>{const e=Object.assign({},w.thumb);return u?Object.assign(Object.assign({},e),w.thumbDisabled):(g?(e.boxShadow="0px 0px 0px 8px rgba(115, 29, 207, 0.5)",e.cursor="grabbing"):m&&(e.boxShadow="0px 0px 0px 8px rgba(115, 29, 207, 0.08)"),e.left=`${R}%`,e)}),[w.thumb,w.thumbDisabled,u,g,m,R]),y=t.useMemo((()=>{const e=Object.assign({},w.valueLabel);return x||m?Object.assign(Object.assign({},e),w.valueLabelVisible):e}),[w.valueLabel,w.valueLabelVisible,x,m]);return e.jsxs("div",Object.assign({ref:v,style:w.container,onMouseDown:j,role:"slider","aria-label":"bik slider","aria-valuemin":r,"aria-valuemax":o,"aria-valuenow":c,tabIndex:u?-1:0,onKeyDown:M},{children:[e.jsx("div",{style:w.track}),e.jsx("div",{style:Object.assign(Object.assign({},g?w.filledTrackDragging:w.filledTrack),{width:`${R}%`})}),e.jsx("div",Object.assign({ref:k,style:S,onMouseEnter:()=>!u&&p(!0),onMouseLeave:()=>!u&&p(!1),onFocus:()=>!u&&f(!0),onBlur:()=>!u&&f(!1)},{children:e.jsx("div",Object.assign({style:y},{children:e.jsx("span",Object.assign({style:w.valueLabelText},{children:c}))}))}))]}))};
@@ -1,24 +1,8 @@
1
- export type StepperStates = 'default' | 'completed' | 'error' | 'active' | 'inactive';
1
+ import { EachStep } from './Stepper.model';
2
2
  export interface StepperProps {
3
3
  steps: EachStep[];
4
4
  activeStep: EachStep;
5
5
  onClickingEachStep: (step: EachStep) => void;
6
6
  hideHoverState?: boolean;
7
7
  }
8
- export interface EachStep {
9
- stepKey: string;
10
- stepName: string;
11
- isCompleted: boolean;
12
- isError: boolean;
13
- isInActive: boolean;
14
- }
15
- export interface SingleStepperProps {
16
- index: number;
17
- isLastElement: boolean;
18
- eachStep: EachStep;
19
- isActive: boolean;
20
- onClickingStep: (step: EachStep) => void;
21
- stepsCount: number;
22
- hideHoverState?: boolean;
23
- }
24
8
  export declare const Stepper: (stepperDetails: StepperProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ export type StepperStates = 'default' | 'completed' | 'error' | 'active' | 'inactive';
2
+ export interface EachStep {
3
+ stepKey: string;
4
+ stepName: string;
5
+ isCompleted: boolean;
6
+ isError: boolean;
7
+ isInActive: boolean;
8
+ }
9
+ export interface SingleStepperProps {
10
+ index: number;
11
+ isLastElement: boolean;
12
+ eachStep: EachStep;
13
+ isActive: boolean;
14
+ onClickingStep: (step: EachStep) => void;
15
+ stepsCount: number;
16
+ hideHoverState?: boolean;
17
+ }
@@ -1,4 +1,4 @@
1
- import { StepperStates } from './Stepper';
1
+ import type { StepperStates } from './Stepper.model';
2
2
  export declare const StepperContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
3
3
  export declare const SingleStepperChildContainer: import("styled-components").StyledComponent<"div", any, {
4
4
  selectedState: StepperStates;
@@ -1,4 +1,4 @@
1
- import { EachStep } from './Stepper';
1
+ import { EachStep } from './Stepper.model';
2
2
  export default class StepperService {
3
3
  updateSteps: (steps: EachStep[], stepToUpdate: EachStep, propertiesToUpdate: Partial<EachStep>) => EachStep[];
4
4
  }
@@ -1,4 +1,4 @@
1
- import type { StepperStates } from './Stepper';
1
+ import type { StepperStates } from './Stepper.model';
2
2
  export declare function getTheme(step: StepperStates): {
3
3
  textColor: string;
4
4
  badgeColor: string;
@@ -1,13 +1,13 @@
1
- import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
2
- import { VariableListInterfaceV2 } from "../add-variableV2/AddVariableV2";
3
- import { CarouselProduct } from "./modalElements/EditWhatsAppCarouselTemplateV2";
4
- import { WhatsAppCarouselTemplateVariables } from "../template-preview/models/WhatsappCarouselTemplate";
1
+ import type { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
2
+ import type { VariableListInterfaceV2 } from "../add-variableV2/AddVariableV2";
3
+ import type { WhatsAppCarouselTemplateVariables } from "../template-preview/models/WhatsappCarouselTemplate";
5
4
  import { CHANNEL_TYPE } from '../template-preview/models/Channels';
6
- import { CUSTOM_VARIABLE, GlobalPlaceholderType } from '../template-preview/models/TemplateMeta';
7
- import { AllTemplateTypes, AllTemplateVariables, NonNullTemplateTypes } from '../template-preview/models/types';
8
- import { WebpushTemplateVariables } from '../template-preview/models/WebpushTemplate';
9
- import { ExtrasWhatsapp, POD, TemplateAnalyticsI, WhatsAppPickerMeta, WhatsAppTemplateVariables } from '../template-preview/models/WhatsAppTemplate';
10
- import { VariableV3 } from '../variable-picker-v3/model';
5
+ import { CUSTOM_VARIABLE, type GlobalPlaceholderType } from '../template-preview/models/TemplateMeta';
6
+ import type { AllTemplateTypes, AllTemplateVariables, NonNullTemplateTypes } from '../template-preview/models/types';
7
+ import type { WebpushTemplateVariables } from '../template-preview/models/WebpushTemplate';
8
+ import { type ExtrasWhatsapp, POD, type TemplateAnalyticsI, type WhatsAppPickerMeta, type WhatsAppTemplateVariables } from '../template-preview/models/WhatsAppTemplate';
9
+ import type { VariableV3 } from '../variable-picker-v3/model';
10
+ import { CarouselProduct } from './modalElements/modal';
11
11
  export interface TemplateContextMapperProps {
12
12
  selectedTemplate: NonNullTemplateTypes;
13
13
  closeDialog?: () => void;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lodash"),l=require("react"),a=require("../../utils/StringUtils.js"),o=require("../../constants/Theme.js"),i=require("../modals/styledModal.js"),r=require("../template-preview/helpers/templateMiscHelper.js"),s=require("../template-preview/models/Channels.js"),n=require("../template-preview/models/WhatsAppTemplate.js"),d=require("./context/templateModalContext.js"),u=require("./modalElements/Footer.js"),c=require("./modalElements/TemplateAnalyticsComponent.js"),p=require("./modalElements/TemplateSelectModalContent.js"),v=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=m=>{var C,h,b,S,E,x,f,T;const{selectedTemplate:P,closeDialog:g,showVariableMapping:y,channel:I,htmlContent:D,templateVariables:L,onTemplateSelect:j,globalPlaceholders:w,showOnlyContent:A,whatsappSpecificPickerMeta:k,zIndex:M,showVariableModal:V,variableList:H,discountCode:N,setDiscountCode:O,onBackPress:q,enabledCustomText:B,variableListForImage:F,showSampleValues:_,disableEditVariable:W,pod:Y,extras:R,pickerConf:$,selectedCarouselProducts:z,disableEditExpiry:Q,cardWidth:U,onDeleteSelectedProducts:G,fileName:J,setFileName:K,hideDeviceContainerInPreview:X,maxCharLimit:Z,onDefaultVariableSelect:ee,skipDefaultVariableContent:te,disableDatePicker:le,disableCopyCode:ae,initialExpiryDateTime:oe,showDiscountCodeExpiryInfo:ie,footerButtonText:re,footerInfoText:se,templateAnalytics:ne}=m;l.useEffect((()=>{be(D)}),[D]);const de=r.determineCardIndex(I),ue=r.isItCarousal(I,P),ce=null==P?void 0:P.isProductCarouselType,[pe,ve]=l.useState(I===s.CHANNEL_TYPE.EMAIL||I==s.CHANNEL_TYPE.WEBPUSH||ue?"desktop":"mobile"),[me,Ce]=l.useState(!1),[he,be]=l.useState(D),[Se,Ee]=l.useState(!1),[xe,fe]=l.useState([]),[Te,Pe]=l.useState({}),[ge,ye]=l.useState(P),[Ie,De]=l.useState([]),[Le,je]=l.useState(null),[we,Ae]=l.useState(!1),[ke,Me]=l.useState(null!=L?L:[]),[Ve,He]=l.useState(!1),[Ne,Oe]=l.useState(ue?(null===(h=null===(C=null==ge?void 0:ge.mapping)||void 0===C?void 0:C.body)||void 0===h?void 0:h.length)?-1:0:-1),[qe,Be]=l.useState([]),[Fe,_e]=l.useState(void 0),We=l.useRef(null),[Ye,Re]=l.useState(!1),[$e,ze]=l.useState(!1),[Qe,Ue]=l.useState(!1),[Ge,Je]=l.useState(!0),[Ke,Xe]=l.useState(!0),[Ze,et]=l.useState({});l.useEffect((()=>{z?Be(z):ce&&Be([])}),[z]),l.useEffect((()=>{var e;if(!we&&ce&&(!z||0===Be.length)){const t=null===(e=null==ge?void 0:ge.components)||void 0===e?void 0:e[de].cards,l=[];null==t||t.forEach((e=>{var t;null===(t=null==e?void 0:e.components)||void 0===t||t.forEach((e=>{var t,a,o;"HEADER"===e.type&&l.push(null!==(o=null===(a=null===(t=e.example)||void 0===t?void 0:t.header_handle)||void 0===a?void 0:a[0])&&void 0!==o?o:"")}))})),De(l),Ae(!0)}}),[we]);const tt=l.useMemo((()=>v.convertPlaceholdersToBikDropdown(w)),[w]);return l.useEffect((()=>{_e(t.cloneDeep(H))}),[H]),(null==ne?void 0:ne.show)&&Ge&&ne.templateQuality&&Object.values(n.TEMPLATE_QUALITY).find((e=>e===String(ne.templateQuality)))?e.jsx(c.TemplateAnalyticsComponent,{headingTitle:null==ge?void 0:ge.label,headingSubtitle:I===s.CHANNEL_TYPE.WHATSAPP?`${a.default.capitaliseFirstLetterOfString(null!==(b=null==ge?void 0:ge.category)&&void 0!==b?b:"")} • ${null!==(S=null==ge?void 0:ge.templateCategory)&&void 0!==S?S:""}`:"",templateAnalytics:ne,analyticsData:ne.data,onClose:()=>{null==g||g(),Je(!1),Xe(!1)},onCancel:()=>{Je(!1),Xe(!1)},onProceed:()=>{Je(!1),Xe(!0)},templateId:(null==ge?void 0:ge.templateId)||""}):e.jsx(d.TemplateModalContext.Provider,Object.assign({value:{hideFooterButton:Qe,setHideFooterButton:Ue,hideCrossButton:$e,setHideCrossButton:ze,variableList:Fe,setVariableList:_e,variableCallback:Le,setVariableCallback:je,showVariablePicker:me,setShowVariablePicker:Ce,template:ge,setTemplate:ye,device:pe,setDevice:ve,display_content:he,setDisplayContent:be,originalVariableList:ke,setOriginalVariableList:Me,isError:Se,setIsError:Ee,channel:I,globalNormalizedPlaceholders:tt,templateSelectionTriggered:Ve,setTemplateSelectionTriggered:He,enabledCustomText:B,disableEditVariable:W,pod:Y,extras:R,isWhatsappCarousel:ue,selectedCarouselIndex:Ne,setSelectedCarouselIndex:Oe,isProductCarouselType:ce,templateErrorIndexes:Te,cardCount:ue?null===(x=null===(E=P.components)||void 0===E?void 0:E[de].cards)||void 0===x?void 0:x.length:void 0,errorIndexes:xe,setErrorIndexes:fe,pickerConf:$,carouselProducts:qe,setCarouselProducts:Be,disableEditExpiry:Q,cardWidth:U,cardImages:Ie,onDeleteSelectedProducts:G,hideDeviceContainerInPreview:X,sliderRef:We,isCarouselHovered:Ye,setIsCarouselHovered:Re,maxCharLimit:Z,ctaOptionsErrors:Ze,setCtaOptionsErrors:et,onDefaultVariableSelect:ee,disableDatePicker:le,disableCopyCode:ae,initialExpiryDateTime:oe,showDiscountCodeExpiryInfo:ie,cardIndex:de}},{children:A?e.jsx(p.default,{variableListFromProps:H,channel:s.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(i.StyledModal,Object.assign({hideCrossButton:$e,zIndex:M,centralContainerStyles:{width:ue?900:I===s.CHANNEL_TYPE.EMAIL&&y?1e3:800},open:Ke,onClose:()=>{Xe(!1),null==g||g()},headingTitle:null==ge?void 0:ge.label,headingSubtitle:I===s.CHANNEL_TYPE.WHATSAPP||r.isRCSChannel(I)?`${a.default.capitaliseFirstLetterOfString(null!==(f=null==ge?void 0:ge.category)&&void 0!==f?f:"")} • ${null!==(T=null==ge?void 0:ge.templateCategory)&&void 0!==T?T:""}`:"",onBackPress:()=>{if(null==ne?void 0:ne.show)return Je(!0),void Xe(!1);null==q||q()},modalHeaderStyles:{borderBottom:`1px solid ${o.COLORS.stroke.primary}`}},{children:[e.jsx(p.default,{variableListFromProps:H,showSampleValues:_,showVariableMapping:y,channel:I,whatsappSpecificPickerMeta:k,showVariableModal:V,discountCode:N,setDiscountCode:O,variableListForImage:F&&(null==F?void 0:F.length)>0?F:Fe,fileName:J,setFileName:e=>{null==K||K(e)},skipDefaultVariableContent:te}),j?e.jsx(u.default,{isWhatsappCarousel:null!=ue&&ue,onSelect:function(){var e;if((null==qe?void 0:qe.length)<1&&ce)return void Ee(!0);if(Object.keys(Ze).length>0&&Y!==n.POD.CHATBOT)return void Ee(!0);const t=null==j?void 0:j(ge,ke,null!=he?he:"",qe);Pe(null!==(e=null==t?void 0:t.templateErrorIndexes)&&void 0!==e?e:{body:[],buttons:[]}),(null==t?void 0:t.errorIndexes)||(null==t?void 0:t.error)?((null==t?void 0:t.errorIndexes)&&fe(t.errorIndexes),(null==t?void 0:t.error)&&Ee(!!(null==t?void 0:t.error))):He(!0)},footerButtonText:re,footerInfoText:se}):e.jsx(e.Fragment,{})]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lodash/cloneDeep"),l=require("react"),a=require("../../utils/StringUtils.js"),o=require("../../constants/Theme.js"),i=require("../modals/styledModal.js"),r=require("../template-preview/helpers/templateMiscHelper.js"),s=require("../template-preview/models/Channels.js"),n=require("../template-preview/models/WhatsAppTemplate.js"),d=require("./context/templateModalContext.js"),u=require("./modalElements/Footer.js"),c=require("./modalElements/TemplateAnalyticsComponent.js"),p=require("./modalElements/TemplateSelectModalContent.js"),v=require("./utils/convertPlaceholdersToBikDropdown.js");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var C=m(t);exports.TemplateContextMapper=t=>{var m,h,b,S,f,E,x,T;const{selectedTemplate:P,closeDialog:g,showVariableMapping:y,channel:I,htmlContent:j,templateVariables:D,onTemplateSelect:L,globalPlaceholders:w,showOnlyContent:A,whatsappSpecificPickerMeta:k,zIndex:M,showVariableModal:V,variableList:H,discountCode:N,setDiscountCode:O,onBackPress:q,enabledCustomText:B,variableListForImage:F,showSampleValues:_,disableEditVariable:W,pod:Y,extras:R,pickerConf:$,selectedCarouselProducts:z,disableEditExpiry:Q,cardWidth:U,onDeleteSelectedProducts:G,fileName:J,setFileName:K,hideDeviceContainerInPreview:X,maxCharLimit:Z,onDefaultVariableSelect:ee,skipDefaultVariableContent:te,disableDatePicker:le,disableCopyCode:ae,initialExpiryDateTime:oe,showDiscountCodeExpiryInfo:ie,footerButtonText:re,footerInfoText:se,templateAnalytics:ne}=t;l.useEffect((()=>{be(j)}),[j]);const de=r.determineCardIndex(I),ue=r.isItCarousal(I,P),ce=null==P?void 0:P.isProductCarouselType,[pe,ve]=l.useState(I===s.CHANNEL_TYPE.EMAIL||I==s.CHANNEL_TYPE.WEBPUSH||ue?"desktop":"mobile"),[me,Ce]=l.useState(!1),[he,be]=l.useState(j),[Se,fe]=l.useState(!1),[Ee,xe]=l.useState([]),[Te,Pe]=l.useState({}),[ge,ye]=l.useState(P),[Ie,je]=l.useState([]),[De,Le]=l.useState(null),[we,Ae]=l.useState(!1),[ke,Me]=l.useState(null!=D?D:[]),[Ve,He]=l.useState(!1),[Ne,Oe]=l.useState(ue?(null===(h=null===(m=null==ge?void 0:ge.mapping)||void 0===m?void 0:m.body)||void 0===h?void 0:h.length)?-1:0:-1),[qe,Be]=l.useState([]),[Fe,_e]=l.useState(void 0),We=l.useRef(null),[Ye,Re]=l.useState(!1),[$e,ze]=l.useState(!1),[Qe,Ue]=l.useState(!1),[Ge,Je]=l.useState(!0),[Ke,Xe]=l.useState(!0),[Ze,et]=l.useState({});l.useEffect((()=>{z?Be(z):ce&&Be([])}),[z]),l.useEffect((()=>{var e;if(!we&&ce&&(!z||0===Be.length)){const t=null===(e=null==ge?void 0:ge.components)||void 0===e?void 0:e[de].cards,l=[];null==t||t.forEach((e=>{var t;null===(t=null==e?void 0:e.components)||void 0===t||t.forEach((e=>{var t,a,o;"HEADER"===e.type&&l.push(null!==(o=null===(a=null===(t=e.example)||void 0===t?void 0:t.header_handle)||void 0===a?void 0:a[0])&&void 0!==o?o:"")}))})),je(l),Ae(!0)}}),[we]);const tt=l.useMemo((()=>v.convertPlaceholdersToBikDropdown(w)),[w]);return l.useEffect((()=>{_e(C.default(H))}),[H]),(null==ne?void 0:ne.show)&&Ge&&ne.templateQuality&&Object.values(n.TEMPLATE_QUALITY).find((e=>e===String(ne.templateQuality)))?e.jsx(c.TemplateAnalyticsComponent,{headingTitle:null==ge?void 0:ge.label,headingSubtitle:I===s.CHANNEL_TYPE.WHATSAPP?`${a.default.capitaliseFirstLetterOfString(null!==(b=null==ge?void 0:ge.category)&&void 0!==b?b:"")} • ${null!==(S=null==ge?void 0:ge.templateCategory)&&void 0!==S?S:""}`:"",templateAnalytics:ne,analyticsData:ne.data,onClose:()=>{null==g||g(),Je(!1),Xe(!1)},onCancel:()=>{Je(!1),Xe(!1)},onProceed:()=>{Je(!1),Xe(!0)},templateId:(null==ge?void 0:ge.templateId)||""}):e.jsx(d.TemplateModalContext.Provider,Object.assign({value:{hideFooterButton:Qe,setHideFooterButton:Ue,hideCrossButton:$e,setHideCrossButton:ze,variableList:Fe,setVariableList:_e,variableCallback:De,setVariableCallback:Le,showVariablePicker:me,setShowVariablePicker:Ce,template:ge,setTemplate:ye,device:pe,setDevice:ve,display_content:he,setDisplayContent:be,originalVariableList:ke,setOriginalVariableList:Me,isError:Se,setIsError:fe,channel:I,globalNormalizedPlaceholders:tt,templateSelectionTriggered:Ve,setTemplateSelectionTriggered:He,enabledCustomText:B,disableEditVariable:W,pod:Y,extras:R,isWhatsappCarousel:ue,selectedCarouselIndex:Ne,setSelectedCarouselIndex:Oe,isProductCarouselType:ce,templateErrorIndexes:Te,cardCount:ue?null===(E=null===(f=P.components)||void 0===f?void 0:f[de].cards)||void 0===E?void 0:E.length:void 0,errorIndexes:Ee,setErrorIndexes:xe,pickerConf:$,carouselProducts:qe,setCarouselProducts:Be,disableEditExpiry:Q,cardWidth:U,cardImages:Ie,onDeleteSelectedProducts:G,hideDeviceContainerInPreview:X,sliderRef:We,isCarouselHovered:Ye,setIsCarouselHovered:Re,maxCharLimit:Z,ctaOptionsErrors:Ze,setCtaOptionsErrors:et,onDefaultVariableSelect:ee,disableDatePicker:le,disableCopyCode:ae,initialExpiryDateTime:oe,showDiscountCodeExpiryInfo:ie,cardIndex:de}},{children:A?e.jsx(p.default,{variableListFromProps:H,channel:s.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(i.StyledModal,Object.assign({hideCrossButton:$e,zIndex:M,centralContainerStyles:{width:ue?900:I===s.CHANNEL_TYPE.EMAIL&&y?1e3:800},open:Ke,onClose:()=>{Xe(!1),null==g||g()},headingTitle:null==ge?void 0:ge.label,headingSubtitle:I===s.CHANNEL_TYPE.WHATSAPP||r.isRCSChannel(I)?`${a.default.capitaliseFirstLetterOfString(null!==(x=null==ge?void 0:ge.category)&&void 0!==x?x:"")} • ${null!==(T=null==ge?void 0:ge.templateCategory)&&void 0!==T?T:""}`:"",onBackPress:()=>{if(null==ne?void 0:ne.show)return Je(!0),void Xe(!1);null==q||q()},modalHeaderStyles:{borderBottom:`1px solid ${o.COLORS.stroke.primary}`}},{children:[e.jsx(p.default,{variableListFromProps:H,showSampleValues:_,showVariableMapping:y,channel:I,whatsappSpecificPickerMeta:k,showVariableModal:V,discountCode:N,setDiscountCode:O,variableListForImage:F&&(null==F?void 0:F.length)>0?F:Fe,fileName:J,setFileName:e=>{null==K||K(e)},skipDefaultVariableContent:te}),L?e.jsx(u.default,{isWhatsappCarousel:null!=ue&&ue,onSelect:function(){var e;if((null==qe?void 0:qe.length)<1&&ce)return void fe(!0);if(Object.keys(Ze).length>0&&Y!==n.POD.CHATBOT)return void fe(!0);const t=null==L?void 0:L(ge,ke,null!=he?he:"",qe);Pe(null!==(e=null==t?void 0:t.templateErrorIndexes)&&void 0!==e?e:{body:[],buttons:[]}),(null==t?void 0:t.errorIndexes)||(null==t?void 0:t.error)?((null==t?void 0:t.errorIndexes)&&xe(t.errorIndexes),(null==t?void 0:t.error)&&fe(!!(null==t?void 0:t.error))):He(!0)},footerButtonText:re,footerInfoText:se}):e.jsx(e.Fragment,{})]}))}))};
@@ -1,13 +1,13 @@
1
- import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
2
- import { VariableV3 } from "../../../helpers";
1
+ import type { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
2
+ import type { VariableV3 } from "../../../helpers";
3
3
  import React, { LegacyRef } from 'react';
4
4
  import Slider from 'react-slick';
5
- import { VariableListInterfaceV2 } from "../../add-variableV2";
6
- import { CarouselProduct } from "../modalElements/EditWhatsAppCarouselTemplateV2";
5
+ import type { VariableListInterfaceV2 } from "../../add-variableV2/AddVariableV2";
7
6
  import { CHANNEL_TYPE } from "../../template-preview/models/Channels";
8
- import { globalNormalizedPlaceholdersType } from "../../template-preview/models/TemplateMeta";
9
- import { AllTemplateTypes, AllTemplateVariables } from "../../template-preview/models/types";
10
- import { ExtrasWhatsapp } from "../../template-preview/models/WhatsAppTemplate";
7
+ import type { globalNormalizedPlaceholdersType } from "../../template-preview/models/TemplateMeta";
8
+ import type { AllTemplateTypes, AllTemplateVariables } from "../../template-preview/models/types";
9
+ import type { ExtrasWhatsapp } from "../../template-preview/models/WhatsAppTemplate";
10
+ import { CarouselProduct } from '../modalElements/modal';
11
11
  export type DEVICE_TYPES = 'desktop' | 'mobile';
12
12
  export declare const TemplateModalContext: React.Context<{
13
13
  showDiscountCodeExpiryInfo?: boolean | undefined;
@@ -1,4 +1,4 @@
1
- import { VariableListInterfaceV2 } from "../../add-variableV2/AddVariableV2";
1
+ import type { VariableListInterfaceV2 } from "../../add-variableV2/AddVariableV2";
2
2
  export type AdditionalVariableProps = {
3
3
  variableList?: VariableListInterfaceV2[];
4
4
  categoryDisplayName: string;
@@ -1,6 +1,8 @@
1
- import { VariableListInterfaceV2 } from "../../add-variableV2";
2
- import { AllTemplateVariables, BUTTON_TYPE, CUSTOM_VARIABLE } from "../../template-preview";
3
- import { WebPushTemplateComponent, WebpushTemplateType } from "../../template-preview/models/WebpushTemplate";
1
+ import type { VariableListInterfaceV2 } from "../../add-variableV2/AddVariableV2";
2
+ import type { CUSTOM_VARIABLE } from "../../template-preview/models/TemplateMeta";
3
+ import type { AllTemplateVariables } from "../../template-preview/models/types";
4
+ import type { WebPushTemplateComponent, WebpushTemplateType } from "../../template-preview/models/WebpushTemplate";
5
+ import { BUTTON_TYPE } from "../../template-preview/models/WhatsAppTemplate";
4
6
  declare const useWebPushTemplate: () => {
5
7
  processWebpushTemplate: (template: WebpushTemplateType, variableList: VariableListInterfaceV2[], originalVar?: AllTemplateVariables, disableEditVariable?: boolean) => Promise<{
6
8
  templateVariableMapping: {
@@ -49,7 +51,7 @@ declare const useWebPushTemplate: () => {
49
51
  redirectionLink?: string[] | undefined;
50
52
  } | undefined;
51
53
  components: WebPushTemplateComponent;
52
- whatsappSpecificPickerMeta?: import("../../template-preview").WhatsAppPickerMeta | undefined;
54
+ whatsappSpecificPickerMeta?: import("../../template-preview/models/WhatsAppTemplate").WhatsAppPickerMeta | undefined;
53
55
  };
54
56
  }>;
55
57
  isValidUrl: (url: string) => boolean;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js");require("../../template-preview/TemplatePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../../constants/Theme.js"),require("../../curtain/CurtainHelper.js"),require("../../variable-picker-v3/model.js"),require("../../template-preview/models/TemplateMeta.js");var t=require("../../template-preview/models/WhatsAppTemplate.js");require("../../template-preview/models/Channels.js");var i=require("../../template-preview/constants/TemplateConstants.js"),l=require("../../../utils/variableUtils.js");exports.default=()=>{function n(e,t,i,n){const r=t.map(((t,r)=>{const u=a(t);if(n)return{variableName:t,isEditableVariable:!1,updatedValue:t,index:r,variableValue:t,type:"string"};const s=function(e,t,i){const n=i&&i.length?i:l.extractVariables(e);if(!n||!n.length)return[];const a=[];return n.forEach(((e,i)=>{const l=o(t,`{{${e}}}`);if(l){const{actualValue:e,defaultValue:t}=l,n="{{custom.text}}"===e||"{{custom.url}}"===e;a.push({editable:n,variableVal:t,editableDefaultValues:t,variableName:e,idx:i})}})),a}(u?t:i,e);if(s.length>0){const e=s[0];return{variableName:e.variableName,isEditableVariable:!0,updatedValue:(null==e?void 0:e.updatedValue)?null==e?void 0:e.updatedValue:u?e.variableName:t,index:r,variableValue:e.variableVal,type:"string"}}return null})).filter((e=>null!==e));return r}const a=e=>e.includes("{{")&&e.includes("}}"),r=(e,t)=>e&&e.length?e.flatMap(((e,i)=>{var n;return a(e)?e.includes("editableVariable")?(null===(n=null==t?void 0:t[i])||void 0===n?void 0:n.value)||e:l.extractVariables(e).map((e=>`{{${e}}}`))||[]:e})):[];const o=(e,t)=>{for(const i of e)for(const e in i.variables){const l=i.variables[e];if(l.actualValue===t||t.includes("editableVariable")&&l.actualValue.includes("custom.text"))return l}return null};return{processWebpushTemplate:function(o,u,s,d){var b,v,c,p,m,h,f,L;return e.__awaiter(this,void 0,void 0,(function*(){const e=Object.assign({},o);e.components=function(e){let t;if("string"==typeof e)try{t=JSON.parse(e)}catch(e){console.error("Error parsing webpush component JSON:",e),t={}}else t=e;return t}(e.components);const{components:{title:V,body:g,buttons:w,icon:y,image:_},webpushBroadcastConfig:C}=e;let x={title:r(null!==(b=null==C?void 0:C.title)&&void 0!==b?b:[]),body:r(null!==(v=null==C?void 0:C.body)&&void 0!==v?v:[],null==g?void 0:g.variables),buttonsW:null!==(c=null==C?void 0:C.buttons)&&void 0!==c?c:[]};if(!e.webpushBroadcastConfig){const t=null!==(p=null==g?void 0:g.text)&&void 0!==p?p:"string"==typeof g?g:"",n=w&&(null==w?void 0:w.length)?w.map((e=>(null==e?void 0:e.websiteLink)==i.CUSTOM_URL_PLACEHOLDER?null==e?void 0:e.redirectionLink:null==e?void 0:e.websiteLink)).filter((e=>void 0!==e)):[],a=l.extractVariables(t).map(((e,t)=>{var i,l;return e.includes("editableVariable")?(null===(l=null===(i=null==g?void 0:g.variables)||void 0===i?void 0:i[t])||void 0===l?void 0:l.value)||e:`{{${e}}}`}));x={title:l.extractVariables(V).map((e=>`{{${e}}}`)),body:a,buttonsW:[]};const r={title:null!==(m=x.title)&&void 0!==m?m:[],body:null!==(h=x.body)&&void 0!==h?h:[],buttons:n,icon:y?[y]:void 0,image:_?[_]:void 0,redirectionLink:(null==g?void 0:g.redirectionLink)?[null==g?void 0:g.redirectionLink]:[]};e.webpushBroadcastConfig=r}const W=w&&w.length?w.map(((e,l)=>({type:t.BUTTON_TYPE.URL,text:null==e?void 0:e.text,url:"https://d.bik.ai/{{1}}",example:x.buttonsW&&x.buttonsW.length?a(x.buttonsW[l])?[""]:[x.buttonsW[l]]:e.redirectionLink?[e.redirectionLink]:void 0,buttonVariable:x.buttonsW&&x.buttonsW.length?a(x.buttonsW[l])?x.buttonsW[l]:i.CUSTOM_URL_PLACEHOLDER_VAR:e.websiteLink?e.websiteLink==i.CUSTOM_URL_PLACEHOLDER?i.CUSTOM_URL_PLACEHOLDER_VAR:e.websiteLink:i.CUSTOM_URL_PLACEHOLDER_VAR,index:l}))):[],k={title:n(u,x.title,V,d),body:n(u,x.body,(null==g?void 0:g.text)||"",d),buttons:W};return{templateVariableMapping:{title:(null===(f=null==s?void 0:s.title)||void 0===f?void 0:f.length)?s.title:k.title,body:(null===(L=null==s?void 0:s.body)||void 0===L?void 0:L.length)?s.body:k.body,buttons:k.buttons,icon:[],header:[]},webpushBroadcastConfig:e.webpushBroadcastConfig,template:e}}))},isValidUrl:e=>{try{return new URL(e),!0}catch(e){return!1}}}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../../_virtual/_tslib.js"),e=require("../../template-preview/constants/TemplateConstants.js"),i=require("../../template-preview/models/WhatsAppTemplate.js"),l=require("../../../utils/variableUtils.js");exports.default=()=>{function n(t,e,i,n){const o=e.map(((e,o)=>{const u=a(e);if(n)return{variableName:e,isEditableVariable:!1,updatedValue:e,index:o,variableValue:e,type:"string"};const s=function(t,e,i){const n=i&&i.length?i:l.extractVariables(t);if(!n||!n.length)return[];const a=[];return n.forEach(((t,i)=>{const l=r(e,`{{${t}}}`);if(l){const{actualValue:t,defaultValue:e}=l,n="{{custom.text}}"===t||"{{custom.url}}"===t;a.push({editable:n,variableVal:e,editableDefaultValues:e,variableName:t,idx:i})}})),a}(u?e:i,t);if(s.length>0){const t=s[0];return{variableName:t.variableName,isEditableVariable:!0,updatedValue:(null==t?void 0:t.updatedValue)?null==t?void 0:t.updatedValue:u?t.variableName:e,index:o,variableValue:t.variableVal,type:"string"}}return null})).filter((t=>null!==t));return o}const a=t=>t.includes("{{")&&t.includes("}}"),o=(t,e)=>t&&t.length?t.flatMap(((t,i)=>{var n;return a(t)?t.includes("editableVariable")?(null===(n=null==e?void 0:e[i])||void 0===n?void 0:n.value)||t:l.extractVariables(t).map((t=>`{{${t}}}`))||[]:t})):[];const r=(t,e)=>{for(const i of t)for(const t in i.variables){const l=i.variables[t];if(l.actualValue===e||e.includes("editableVariable")&&l.actualValue.includes("custom.text"))return l}return null};return{processWebpushTemplate:function(r,u,s,d){var b,c,v,p,f,m,L,V;return t.__awaiter(this,void 0,void 0,(function*(){const t=Object.assign({},r);t.components=function(t){let e;if("string"==typeof t)try{e=JSON.parse(t)}catch(t){console.error("Error parsing webpush component JSON:",t),e={}}else e=t;return e}(t.components);const{components:{title:h,body:g,buttons:y,icon:_,image:x},webpushBroadcastConfig:C}=t;let w={title:o(null!==(b=null==C?void 0:C.title)&&void 0!==b?b:[]),body:o(null!==(c=null==C?void 0:C.body)&&void 0!==c?c:[],null==g?void 0:g.variables),buttonsW:null!==(v=null==C?void 0:C.buttons)&&void 0!==v?v:[]};if(!t.webpushBroadcastConfig){const i=null!==(p=null==g?void 0:g.text)&&void 0!==p?p:"string"==typeof g?g:"",n=y&&(null==y?void 0:y.length)?y.map((t=>(null==t?void 0:t.websiteLink)==e.CUSTOM_URL_PLACEHOLDER?null==t?void 0:t.redirectionLink:null==t?void 0:t.websiteLink)).filter((t=>void 0!==t)):[],a=l.extractVariables(i).map(((t,e)=>{var i,l;return t.includes("editableVariable")?(null===(l=null===(i=null==g?void 0:g.variables)||void 0===i?void 0:i[e])||void 0===l?void 0:l.value)||t:`{{${t}}}`}));w={title:l.extractVariables(h).map((t=>`{{${t}}}`)),body:a,buttonsW:[]};const o={title:null!==(f=w.title)&&void 0!==f?f:[],body:null!==(m=w.body)&&void 0!==m?m:[],buttons:n,icon:_?[_]:void 0,image:x?[x]:void 0,redirectionLink:(null==g?void 0:g.redirectionLink)?[null==g?void 0:g.redirectionLink]:[]};t.webpushBroadcastConfig=o}const E=y&&y.length?y.map(((t,l)=>({type:i.BUTTON_TYPE.URL,text:null==t?void 0:t.text,url:"https://d.bik.ai/{{1}}",example:w.buttonsW&&w.buttonsW.length?a(w.buttonsW[l])?[""]:[w.buttonsW[l]]:t.redirectionLink?[t.redirectionLink]:void 0,buttonVariable:w.buttonsW&&w.buttonsW.length?a(w.buttonsW[l])?w.buttonsW[l]:e.CUSTOM_URL_PLACEHOLDER_VAR:t.websiteLink?t.websiteLink==e.CUSTOM_URL_PLACEHOLDER?e.CUSTOM_URL_PLACEHOLDER_VAR:t.websiteLink:e.CUSTOM_URL_PLACEHOLDER_VAR,index:l}))):[],O={title:n(u,w.title,h,d),body:n(u,w.body,(null==g?void 0:g.text)||"",d),buttons:E};return{templateVariableMapping:{title:(null===(L=null==s?void 0:s.title)||void 0===L?void 0:L.length)?s.title:O.title,body:(null===(V=null==s?void 0:s.body)||void 0===V?void 0:V.length)?s.body:O.body,buttons:O.buttons,icon:[],header:[]},webpushBroadcastConfig:t.webpushBroadcastConfig,template:t}}))},isValidUrl:t=>{try{return new URL(t),!0}catch(t){return!1}}}};
@@ -1,5 +1,5 @@
1
- import { VariableListInterfaceV2 } from "../../add-variableV2/AddVariableV2";
2
- import { WhatsAppPickerMeta } from "../../template-preview/models/WhatsAppTemplate";
1
+ import type { VariableListInterfaceV2 } from "../../add-variableV2/AddVariableV2";
2
+ import type { WhatsAppPickerMeta } from "../../template-preview/models/WhatsAppTemplate";
3
3
  export interface BodyProps {
4
4
  showVariableMapping: boolean;
5
5
  showOnlyContent?: boolean;