contentoh-components-library 21.4.102 → 21.4.104

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 (665) hide show
  1. package/dist/_utils/helper.js +20 -15
  2. package/dist/assets/images/Icons/beenhere.svg +9 -0
  3. package/dist/assets/images/Icons/close-magenta.svg +9 -0
  4. package/dist/assets/images/Icons/closeCircle.svg +8 -0
  5. package/dist/assets/images/Icons/delete-forever-red.svg +9 -0
  6. package/dist/assets/images/Icons/delete-forever-white.svg +10 -0
  7. package/dist/assets/images/Icons/fullscreen.svg +3 -0
  8. package/dist/assets/images/Icons/save-white.svg +9 -0
  9. package/dist/assets/images/Icons/upload-file-white.svg +4 -0
  10. package/dist/assets/images/Icons/upload-file.svg +10 -0
  11. package/dist/assets/images/Icons/upload_file.svg +10 -0
  12. package/dist/components/atoms/ActivedFilter/ActivedFilter.stories.js +16 -5
  13. package/dist/components/atoms/ActivedFilter/index.js +8 -4
  14. package/dist/components/atoms/ActivedFilter/styles.js +9 -1
  15. package/dist/components/atoms/AsignationOption/AsignationOptions.stories.js +17 -6
  16. package/dist/components/atoms/AsignationOption/index.js +32 -16
  17. package/dist/components/atoms/AsignationOption/styles.js +9 -1
  18. package/dist/components/atoms/AtomList/AtomList.stories.js +16 -5
  19. package/dist/components/atoms/AtomList/index.js +11 -7
  20. package/dist/components/atoms/AtomList/styles.js +9 -1
  21. package/dist/components/atoms/Avatar/AsignationImage.stories.js +16 -5
  22. package/dist/components/atoms/Avatar/index.js +13 -8
  23. package/dist/components/atoms/Avatar/styles.js +8 -1
  24. package/dist/components/atoms/Button/index.js +4 -1
  25. package/dist/components/atoms/Button/styles.js +19 -3
  26. package/dist/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +17 -6
  27. package/dist/components/atoms/ButtonFileChooser/index.js +70 -37
  28. package/dist/components/atoms/ButtonFileChooser/styles.js +9 -1
  29. package/dist/components/atoms/ButtonV2/ButtonV2.stories.js +18 -6
  30. package/dist/components/atoms/ButtonV2/index.js +61 -24
  31. package/dist/components/atoms/ButtonV2/styles.js +31 -39
  32. package/dist/components/atoms/Card/Card.stories.js +16 -5
  33. package/dist/components/atoms/Card/index.js +26 -14
  34. package/dist/components/atoms/Card/styles.js +9 -1
  35. package/dist/components/atoms/CharCounter/CharCounter.stories.js +16 -5
  36. package/dist/components/atoms/CharCounter/index.js +7 -5
  37. package/dist/components/atoms/CharCounter/styles.js +9 -1
  38. package/dist/components/atoms/CharsMissing/Wysiwyg.stories.js +16 -5
  39. package/dist/components/atoms/CharsMissing/index.js +56 -23
  40. package/dist/components/atoms/CharsMissing/styles.js +18 -18
  41. package/dist/components/atoms/CheckBox/CheckBox.stories.js +16 -5
  42. package/dist/components/atoms/CheckBox/index.js +19 -12
  43. package/dist/components/atoms/CheckBox/styles.js +15 -5
  44. package/dist/components/atoms/Commentary/index.js +7 -5
  45. package/dist/components/atoms/Commentary/styles.js +11 -5
  46. package/dist/components/atoms/CustomChip/CustomChip.stories.js +16 -5
  47. package/dist/components/atoms/CustomChip/index.js +26 -10
  48. package/dist/components/atoms/CustomChip/styles.js +9 -1
  49. package/dist/components/atoms/CustomIcon/CustomIcon.stories.js +17 -5
  50. package/dist/components/atoms/CustomIcon/index.js +16 -15
  51. package/dist/components/atoms/CustomIcon/styles.js +18 -18
  52. package/dist/components/atoms/CustomSelectItem/CustomSelectItem.stories.js +16 -5
  53. package/dist/components/atoms/CustomSelectItem/index.js +117 -92
  54. package/dist/components/atoms/CustomSelectItem/styles.js +10 -1
  55. package/dist/components/atoms/CustomerTypeImage/CustomerTypeImage.stories.js +16 -5
  56. package/dist/components/atoms/CustomerTypeImage/index.js +10 -4
  57. package/dist/components/atoms/CustomerTypeImage/styles.js +10 -5
  58. package/dist/components/atoms/DropDownButton/DropDownButton.stories.js +16 -5
  59. package/dist/components/atoms/DropDownButton/index.js +8 -4
  60. package/dist/components/atoms/DropDownButton/styles.js +8 -1
  61. package/dist/components/atoms/EditField/EditField.stories.js +16 -5
  62. package/dist/components/atoms/EditField/index.js +9 -5
  63. package/dist/components/atoms/EditField/styles.js +9 -1
  64. package/dist/components/atoms/FeatureTag/FeatureTag.stories.js +16 -5
  65. package/dist/components/atoms/FeatureTag/index.js +7 -5
  66. package/dist/components/atoms/FeatureTag/styles.js +10 -1
  67. package/dist/components/atoms/FeatureTagv2/FeatureTagv2.stories.js +16 -5
  68. package/dist/components/atoms/FeatureTagv2/index.js +9 -7
  69. package/dist/components/atoms/FeatureTagv2/styles.js +10 -1
  70. package/dist/components/atoms/GeneralButton/GeneralButton.stories.js +18 -13
  71. package/dist/components/atoms/GeneralButton/index.js +17 -12
  72. package/dist/components/atoms/GeneralButton/styles.js +27 -1
  73. package/dist/components/atoms/GeneralInput/GeneralInput.stories.js +18 -6
  74. package/dist/components/atoms/GeneralInput/index.js +89 -48
  75. package/dist/components/atoms/GeneralInput/styles.js +15 -13
  76. package/dist/components/atoms/GeneralInputv2/GeneralInputv2.stories.js +18 -6
  77. package/dist/components/atoms/GeneralInputv2/index.js +89 -48
  78. package/dist/components/atoms/GeneralInputv2/styles.js +15 -13
  79. package/dist/components/atoms/GeneralTextBox/GeneralTextBox.stories.js +16 -5
  80. package/dist/components/atoms/GeneralTextBox/index.js +9 -7
  81. package/dist/components/atoms/GeneralTextBox/styles.js +9 -1
  82. package/dist/components/atoms/GenericModal/GenericModal.stories.js +29 -9
  83. package/dist/components/atoms/GenericModal/index.js +12 -7
  84. package/dist/components/atoms/GenericModal/styles.js +10 -1
  85. package/dist/components/atoms/GradientPanel/GradientPanel.stories.js +32 -8
  86. package/dist/components/atoms/GradientPanel/index.js +12 -7
  87. package/dist/components/atoms/GradientPanel/styles.js +13 -9
  88. package/dist/components/atoms/Graphic/Graphic.stories.js +16 -5
  89. package/dist/components/atoms/Graphic/index.js +24 -22
  90. package/dist/components/atoms/Graphic/styles.js +8 -1
  91. package/dist/components/atoms/IconFile/IconFile.stories.js +16 -5
  92. package/dist/components/atoms/IconFile/index.js +20 -17
  93. package/dist/components/atoms/IconFile/styles.js +11 -5
  94. package/dist/components/atoms/Image/Image.stories.js +26 -13
  95. package/dist/components/atoms/Image/index.js +33 -24
  96. package/dist/components/atoms/Image/styles.js +25 -21
  97. package/dist/components/atoms/ImageCarousel/ImgeSlider.stories.js +16 -5
  98. package/dist/components/atoms/ImageCarousel/index.js +60 -31
  99. package/dist/components/atoms/ImageCarousel/styles.js +8 -1
  100. package/dist/components/atoms/ImageLink/ImageLink.stories.js +26 -13
  101. package/dist/components/atoms/ImageLink/index.js +30 -18
  102. package/dist/components/atoms/ImageLink/styles.js +23 -17
  103. package/dist/components/atoms/ImagePreview/ImagePreview.stories.js +26 -13
  104. package/dist/components/atoms/ImagePreview/index.js +89 -53
  105. package/dist/components/atoms/ImagePreview/styles.js +27 -18
  106. package/dist/components/atoms/Input/index.js +12 -4
  107. package/dist/components/atoms/Input/style.js +15 -2
  108. package/dist/components/atoms/InputFormatter/Wysiwyg.stories.js +16 -5
  109. package/dist/components/atoms/InputFormatter/index.js +93 -41
  110. package/dist/components/atoms/InputFormatter/styles.js +18 -18
  111. package/dist/components/atoms/InputFormatterv2/Wysiwyg.stories.js +16 -5
  112. package/dist/components/atoms/InputFormatterv2/index.js +93 -41
  113. package/dist/components/atoms/InputFormatterv2/styles.js +18 -18
  114. package/dist/components/atoms/InputImages/InputImages.stories.js +15 -5
  115. package/dist/components/atoms/InputImages/index.js +18 -8
  116. package/dist/components/atoms/InputImages/styles.js +9 -1
  117. package/dist/components/atoms/InputText/InputText.stories.js +18 -7
  118. package/dist/components/atoms/InputText/index.js +28 -34
  119. package/dist/components/atoms/InputText/styles.js +17 -17
  120. package/dist/components/atoms/LabelToInput/index.js +29 -9
  121. package/dist/components/atoms/LabelToInput/style.js +11 -1
  122. package/dist/components/atoms/LoadImageMenu/LoadImageMenu.stories.js +16 -5
  123. package/dist/components/atoms/LoadImageMenu/index.js +36 -19
  124. package/dist/components/atoms/LoadImageMenu/styles.js +9 -1
  125. package/dist/components/atoms/Loading/Loading.stories.js +16 -5
  126. package/dist/components/atoms/Loading/index.js +5 -1
  127. package/dist/components/atoms/Loading/styles.js +12 -2
  128. package/dist/components/atoms/LogoImage/LogoImage.stories.js +16 -5
  129. package/dist/components/atoms/LogoImage/index.js +7 -1
  130. package/dist/components/atoms/LogoImage/styles.js +8 -1
  131. package/dist/components/atoms/MenuNotification/MenuNotification.stories.js +16 -5
  132. package/dist/components/atoms/MenuNotification/index.js +22 -15
  133. package/dist/components/atoms/MenuNotification/styles.js +9 -1
  134. package/dist/components/atoms/MenuProfile/MenuProfile.stories.js +16 -5
  135. package/dist/components/atoms/MenuProfile/index.js +24 -16
  136. package/dist/components/atoms/MenuProfile/styles.js +9 -1
  137. package/dist/components/atoms/MetricCard/MetricCard.stories.js +16 -5
  138. package/dist/components/atoms/MetricCard/index.js +7 -5
  139. package/dist/components/atoms/MetricCard/styles.js +9 -1
  140. package/dist/components/atoms/MetricSelect/MetricSelect.stories.js +26 -8
  141. package/dist/components/atoms/MetricSelect/index.js +16 -12
  142. package/dist/components/atoms/MetricSelect/styles.js +9 -1
  143. package/dist/components/atoms/Multiselect/Multiselect.stories.js +16 -5
  144. package/dist/components/atoms/Multiselect/index.js +247 -141
  145. package/dist/components/atoms/Multiselect/styles.js +8 -1
  146. package/dist/components/atoms/NotFound/NotFound.stories.js +18 -6
  147. package/dist/components/atoms/NotFound/index.js +28 -13
  148. package/dist/components/atoms/NotFound/styles.js +9 -1
  149. package/dist/components/atoms/Notification/Notification.stories.js +16 -5
  150. package/dist/components/atoms/Notification/index.js +9 -6
  151. package/dist/components/atoms/Notification/styles.js +9 -1
  152. package/dist/components/atoms/NumberMandatory/NumberMandatory.stories.js +15 -5
  153. package/dist/components/atoms/NumberMandatory/index.js +12 -7
  154. package/dist/components/atoms/NumberMandatory/styles.js +9 -1
  155. package/dist/components/atoms/ObservationFlag/ObservationFlag.stories.js +16 -5
  156. package/dist/components/atoms/ObservationFlag/index.js +130 -66
  157. package/dist/components/atoms/ObservationFlag/styles.js +27 -12
  158. package/dist/components/atoms/PercentTag/PercentTag.stories.js +16 -5
  159. package/dist/components/atoms/PercentTag/index.js +7 -5
  160. package/dist/components/atoms/PercentTag/styles.js +11 -1
  161. package/dist/components/atoms/PriorityFlag/PriorityFlag.stories.js +16 -5
  162. package/dist/components/atoms/PriorityFlag/index.js +16 -10
  163. package/dist/components/atoms/PriorityFlag/styles.js +8 -1
  164. package/dist/components/atoms/PriorityFlagv2/PriorityFlagv2.stories.js +16 -5
  165. package/dist/components/atoms/PriorityFlagv2/index.js +16 -10
  166. package/dist/components/atoms/PriorityFlagv2/styles.js +8 -1
  167. package/dist/components/atoms/ProductImage/ProductImage.stories.js +15 -5
  168. package/dist/components/atoms/ProductImage/index.js +12 -7
  169. package/dist/components/atoms/ProductImage/styles.js +8 -1
  170. package/dist/components/atoms/ProductImagev2/ProductImagev2.stories.js +15 -5
  171. package/dist/components/atoms/ProductImagev2/index.js +12 -7
  172. package/dist/components/atoms/ProductImagev2/styles.js +8 -1
  173. package/dist/components/atoms/ProductPercentCard/Percent.stories.js +17 -6
  174. package/dist/components/atoms/ProductPercentCard/index.js +12 -6
  175. package/dist/components/atoms/ProductPercentCard/styles.js +9 -1
  176. package/dist/components/atoms/Progress/Progress.stories.js +17 -5
  177. package/dist/components/atoms/Progress/index.js +14 -10
  178. package/dist/components/atoms/Progress/styles.js +19 -2
  179. package/dist/components/atoms/ProgressBar/ProgressBar.stories.js +17 -5
  180. package/dist/components/atoms/ProgressBar/index.js +9 -6
  181. package/dist/components/atoms/ProgressBar/styles.js +19 -2
  182. package/dist/components/atoms/RatingStars/RatingStars.stories.js +16 -5
  183. package/dist/components/atoms/RatingStars/index.js +34 -12
  184. package/dist/components/atoms/RatingStars/styles.js +8 -1
  185. package/dist/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +16 -5
  186. package/dist/components/atoms/RetailerCatalog/index.js +40 -16
  187. package/dist/components/atoms/RetailerCatalog/styles.js +9 -1
  188. package/dist/components/atoms/RetailerOption/RetailerOption.stories.js +16 -5
  189. package/dist/components/atoms/RetailerOption/index.js +21 -7
  190. package/dist/components/atoms/RetailerOption/styles.js +9 -1
  191. package/dist/components/atoms/RetailersList/RetailersList.stories.js +16 -5
  192. package/dist/components/atoms/RetailersList/index.js +27 -12
  193. package/dist/components/atoms/RetailersList/styles.js +8 -1
  194. package/dist/components/atoms/ScreenHeader/ScreenHeader.stories.js +21 -7
  195. package/dist/components/atoms/ScreenHeader/index.js +12 -9
  196. package/dist/components/atoms/ScreenHeader/styles.js +25 -25
  197. package/dist/components/atoms/ScreenHeaderv2/ScreenHeaderv2.stories.js +21 -7
  198. package/dist/components/atoms/ScreenHeaderv2/index.js +59 -32
  199. package/dist/components/atoms/ScreenHeaderv2/styles.js +23 -25
  200. package/dist/components/atoms/Select/VersionSelect.js +17 -12
  201. package/dist/components/atoms/Select/index.js +16 -14
  202. package/dist/components/atoms/Select/style.js +23 -10
  203. package/dist/components/atoms/SelectItemV2/SelectItemV2.stories.js +17 -6
  204. package/dist/components/atoms/SelectItemV2/index.js +23 -22
  205. package/dist/components/atoms/SelectItemV2/styles.js +15 -9
  206. package/dist/components/atoms/Selectv2/VersionSelect.js +17 -12
  207. package/dist/components/atoms/Selectv2/index.js +16 -14
  208. package/dist/components/atoms/Selectv2/style.js +23 -10
  209. package/dist/components/atoms/SideMenuButton/SideMenuButton.stories.js +16 -5
  210. package/dist/components/atoms/SideMenuButton/index.js +8 -6
  211. package/dist/components/atoms/SideMenuButton/styles.js +9 -1
  212. package/dist/components/atoms/SliderToolTip/SliderToolTip.stories.js +26 -6
  213. package/dist/components/atoms/SliderToolTip/index.js +70 -50
  214. package/dist/components/atoms/SliderToolTip/styles.js +13 -2
  215. package/dist/components/atoms/Status/Status.stories.js +16 -5
  216. package/dist/components/atoms/Status/index.js +7 -5
  217. package/dist/components/atoms/Status/styles.js +9 -1
  218. package/dist/components/atoms/TabSection/TabSection.stories.js +18 -6
  219. package/dist/components/atoms/TabSection/index.js +8 -6
  220. package/dist/components/atoms/TabSection/styles.js +9 -1
  221. package/dist/components/atoms/TabSectionv2/TabSection.stories.js +18 -6
  222. package/dist/components/atoms/TabSectionv2/index.js +9 -7
  223. package/dist/components/atoms/TabSectionv2/styles.js +9 -1
  224. package/dist/components/atoms/Tooltip/Tooltip.stories.js +16 -5
  225. package/dist/components/atoms/Tooltip/index.js +24 -22
  226. package/dist/components/atoms/Tooltip/styles.js +9 -1
  227. package/dist/components/atoms/TooltipLight/Tooltip.stories.js +16 -5
  228. package/dist/components/atoms/TooltipLight/index.js +44 -33
  229. package/dist/components/atoms/TooltipLight/styles.js +11 -5
  230. package/dist/components/atoms/UserCatalog/UserCatalog.stories.js +16 -5
  231. package/dist/components/atoms/UserCatalog/index.js +34 -15
  232. package/dist/components/atoms/UserCatalog/styles.js +8 -1
  233. package/dist/components/atoms/UserOption/UserOption.stories.js +16 -5
  234. package/dist/components/atoms/UserOption/index.js +55 -19
  235. package/dist/components/atoms/UserOption/styles.js +9 -1
  236. package/dist/components/atoms/UserSelector/UserSelector.stories.js +16 -5
  237. package/dist/components/atoms/UserSelector/index.js +56 -30
  238. package/dist/components/atoms/UserSelector/styles.js +17 -17
  239. package/dist/components/atoms/ValidationPanel/ValidationPanel.stories.js +16 -5
  240. package/dist/components/atoms/ValidationPanel/index.js +21 -15
  241. package/dist/components/atoms/ValidationPanel/styles.js +9 -1
  242. package/dist/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +19 -5
  243. package/dist/components/atoms/VerticalSideMenuMainPage/index.js +42 -19
  244. package/dist/components/atoms/VerticalSideMenuMainPage/styles.js +28 -26
  245. package/dist/components/atoms/WordsMissing/Wysiwyg.stories.js +16 -5
  246. package/dist/components/atoms/WordsMissing/index.js +56 -23
  247. package/dist/components/atoms/WordsMissing/styles.js +9 -1
  248. package/dist/components/molecules/AddProvidersAndProducts/AddProvidersAndProducts.stories.js +16 -5
  249. package/dist/components/molecules/AddProvidersAndProducts/index.js +12 -7
  250. package/dist/components/molecules/AddProvidersAndProducts/styles.js +9 -1
  251. package/dist/components/molecules/AsignationInfo/AsignationInfo.stories.js +16 -5
  252. package/dist/components/molecules/AsignationInfo/index.js +62 -32
  253. package/dist/components/molecules/AsignationInfo/styles.js +9 -1
  254. package/dist/components/molecules/AssignedWork/AssignedWork.stories.js +18 -6
  255. package/dist/components/molecules/AssignedWork/index.js +18 -9
  256. package/dist/components/molecules/AssignedWork/styles.js +9 -1
  257. package/dist/components/molecules/AvatarAndValidation/AvatarAndValidation.stories.js +16 -5
  258. package/dist/components/molecules/AvatarAndValidation/index.js +37 -18
  259. package/dist/components/molecules/AvatarAndValidation/styles.js +8 -1
  260. package/dist/components/molecules/BoxAttribute/BoxAttribute.stories.js +16 -5
  261. package/dist/components/molecules/BoxAttribute/index.js +52 -42
  262. package/dist/components/molecules/BoxAttribute/styles.js +11 -5
  263. package/dist/components/molecules/BoxButtons/BoxButtons.stories.js +16 -5
  264. package/dist/components/molecules/BoxButtons/index.js +11 -8
  265. package/dist/components/molecules/BoxButtons/styles.js +13 -2
  266. package/dist/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +20 -8
  267. package/dist/components/molecules/ButtonDownloadFile/index.js +129 -59
  268. package/dist/components/molecules/ButtonDownloadFile/styles.js +11 -5
  269. package/dist/components/molecules/CarouselImagesLogin/CarouselImagesLogin.stories.js +18 -5
  270. package/dist/components/molecules/CarouselImagesLogin/index.js +38 -20
  271. package/dist/components/molecules/CarouselImagesLogin/styles.js +10 -5
  272. package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +17 -6
  273. package/dist/components/molecules/CustomSelect/SelectItem.js +91 -39
  274. package/dist/components/molecules/CustomSelect/index.js +164 -85
  275. package/dist/components/molecules/CustomSelect/styles.js +13 -5
  276. package/dist/components/molecules/Dropdown/Dropdown.stories.js +24 -11
  277. package/dist/components/molecules/Dropdown/index.js +45 -38
  278. package/dist/components/molecules/Dropdown/styles.js +13 -9
  279. package/dist/components/molecules/EditionActiveImage/EditionActiveImage.stories.js +16 -5
  280. package/dist/components/molecules/EditionActiveImage/index.js +13 -7
  281. package/dist/components/molecules/EditionActiveImage/styles.js +8 -1
  282. package/dist/components/molecules/EditionActiveImagev2/EditionActiveImagev2.stories.js +16 -5
  283. package/dist/components/molecules/EditionActiveImagev2/index.js +13 -7
  284. package/dist/components/molecules/EditionActiveImagev2/styles.js +8 -1
  285. package/dist/components/molecules/EditionTabs/EditionTabs.stories.js +30 -0
  286. package/dist/components/molecules/EditionTabs/index.js +59 -0
  287. package/dist/components/molecules/EditionTabs/styles.js +21 -0
  288. package/dist/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +16 -5
  289. package/dist/components/molecules/EmailResetPasswordLogin/index.js +97 -28
  290. package/dist/components/molecules/EmailResetPasswordLogin/styles.js +9 -1
  291. package/dist/components/molecules/FeaturesBar/FeaturesBar.stories.js +16 -5
  292. package/dist/components/molecules/FeaturesBar/index.js +26 -10
  293. package/dist/components/molecules/FeaturesBar/styles.js +8 -1
  294. package/dist/components/molecules/FeaturesBarv2/FeaturesBarv2.stories.js +16 -5
  295. package/dist/components/molecules/FeaturesBarv2/index.js +30 -14
  296. package/dist/components/molecules/FeaturesBarv2/styles.js +8 -1
  297. package/dist/components/molecules/GalleryElement/GalleryElement.stories.js +16 -5
  298. package/dist/components/molecules/GalleryElement/index.js +65 -34
  299. package/dist/components/molecules/GalleryElement/styles.js +9 -1
  300. package/dist/components/molecules/GalleryElementv2/GalleryElementv2.stories.js +16 -5
  301. package/dist/components/molecules/GalleryElementv2/index.js +70 -36
  302. package/dist/components/molecules/GalleryElementv2/styles.js +9 -1
  303. package/dist/components/molecules/GalleryHeader/GalleryHeader.stories.js +16 -5
  304. package/dist/components/molecules/GalleryHeader/index.js +19 -10
  305. package/dist/components/molecules/GalleryHeader/styles.js +9 -1
  306. package/dist/components/molecules/GalleryHeaderv2/GalleryHeaderv2.stories.js +16 -5
  307. package/dist/components/molecules/GalleryHeaderv2/index.js +19 -10
  308. package/dist/components/molecules/GalleryHeaderv2/styles.js +9 -1
  309. package/dist/components/molecules/GridItem/GridItem.stories.js +86 -93
  310. package/dist/components/molecules/GridItem/index.js +62 -33
  311. package/dist/components/molecules/GridItem/styles.js +9 -1
  312. package/dist/components/molecules/GroupSelect/GroupSelect.stories.js +17 -6
  313. package/dist/components/molecules/GroupSelect/SelectItem.js +91 -39
  314. package/dist/components/molecules/GroupSelect/index.js +164 -84
  315. package/dist/components/molecules/GroupSelect/styles.js +13 -5
  316. package/dist/components/molecules/HeaderItem/ColumnItem.js +8 -6
  317. package/dist/components/molecules/HeaderItem/HeaderItem.stories.js +16 -5
  318. package/dist/components/molecules/HeaderItem/index.js +21 -12
  319. package/dist/components/molecules/HeaderItem/styles.js +17 -10
  320. package/dist/components/molecules/HeaderTop/HeaderTop.stories.js +16 -5
  321. package/dist/components/molecules/HeaderTop/index.js +48 -22
  322. package/dist/components/molecules/HeaderTop/styles.js +8 -1
  323. package/dist/components/molecules/HeaderTopv2/HeaderTopv2.stories.js +16 -5
  324. package/dist/components/molecules/HeaderTopv2/index.js +47 -21
  325. package/dist/components/molecules/HeaderTopv2/styles.js +8 -1
  326. package/dist/components/molecules/ImageSelector/ImageSelector.stories.js +16 -5
  327. package/dist/components/molecules/ImageSelector/index.js +21 -12
  328. package/dist/components/molecules/ImageSelector/styles.js +8 -1
  329. package/dist/components/molecules/ImageSelectorv2/ImageSelectorv2.stories.js +16 -5
  330. package/dist/components/molecules/ImageSelectorv2/index.js +21 -12
  331. package/dist/components/molecules/ImageSelectorv2/styles.js +8 -1
  332. package/dist/components/molecules/ImageTooltip/ImageTooltip.stories.js +26 -13
  333. package/dist/components/molecules/ImageTooltip/index.js +35 -23
  334. package/dist/components/molecules/ImageTooltip/styles.js +18 -13
  335. package/dist/components/molecules/LoginPasswordStrength/LoginPasswordStrength.stories.js +16 -5
  336. package/dist/components/molecules/LoginPasswordStrength/index.js +44 -18
  337. package/dist/components/molecules/LoginPasswordStrength/styles.js +26 -4
  338. package/dist/components/molecules/LogoLoading/Loading.stories.js +16 -5
  339. package/dist/components/molecules/LogoLoading/index.js +7 -1
  340. package/dist/components/molecules/LogoLoading/styles.js +8 -1
  341. package/dist/components/molecules/ParentComponent/ParentComponent.stories.js +21 -8
  342. package/dist/components/molecules/ParentComponent/index.js +17 -3
  343. package/dist/components/molecules/ParentComponent/styles.js +8 -1
  344. package/dist/components/molecules/PayMethod/PayMethod.stories.js +16 -5
  345. package/dist/components/molecules/PayMethod/index.js +14 -2
  346. package/dist/components/molecules/PayMethod/styles.js +9 -1
  347. package/dist/components/molecules/Phase/Phase.stories.js +17 -5
  348. package/dist/components/molecules/Phase/index.js +408 -183
  349. package/dist/components/molecules/Phase/styles.js +13 -2
  350. package/dist/components/molecules/PlanSelection/PlanSelection.stories.js +16 -5
  351. package/dist/components/molecules/PlanSelection/index.js +25 -14
  352. package/dist/components/molecules/PlanSelection/styles.js +8 -1
  353. package/dist/components/molecules/ProductNameHeader/ProductNameHeader.stories.js +17 -5
  354. package/dist/components/molecules/ProductNameHeader/index.js +22 -17
  355. package/dist/components/molecules/ProductNameHeader/styles.js +8 -1
  356. package/dist/components/molecules/ProductNameHeaderv2/ProductNameHeaderv2.stories.js +17 -5
  357. package/dist/components/molecules/ProductNameHeaderv2/index.js +7 -4
  358. package/dist/components/molecules/ProductNameHeaderv2/styles.js +8 -1
  359. package/dist/components/molecules/ProductNotification/ProductNotification.stories.js +16 -5
  360. package/dist/components/molecules/ProductNotification/index.js +25 -9
  361. package/dist/components/molecules/ProductNotification/styles.js +9 -1
  362. package/dist/components/molecules/ProductSkuStatus/ProductSkuStatus.stories.js +19 -7
  363. package/dist/components/molecules/ProductSkuStatus/index.js +12 -8
  364. package/dist/components/molecules/ProductSkuStatus/styles.js +8 -1
  365. package/dist/components/molecules/ProfileHeader/ProfileHeader.stories.js +16 -5
  366. package/dist/components/molecules/ProfileHeader/index.js +29 -11
  367. package/dist/components/molecules/ProfileHeader/styles.js +9 -1
  368. package/dist/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +16 -5
  369. package/dist/components/molecules/RegistrationFirstStep/index.js +90 -27
  370. package/dist/components/molecules/RegistrationFirstStep/styles.js +9 -1
  371. package/dist/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +16 -5
  372. package/dist/components/molecules/RegistrationSecondStep/index.js +63 -18
  373. package/dist/components/molecules/RegistrationSecondStep/styles.js +9 -1
  374. package/dist/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +16 -5
  375. package/dist/components/molecules/RegistrationThirdStep/index.js +51 -14
  376. package/dist/components/molecules/RegistrationThirdStep/styles.js +9 -1
  377. package/dist/components/molecules/RetailerSelector/RetailerSelector.stories.js +16 -5
  378. package/dist/components/molecules/RetailerSelector/index.js +73 -31
  379. package/dist/components/molecules/RetailerSelector/styles.js +9 -1
  380. package/dist/components/molecules/RetailerSelectorv2/RetailerSelectorv2.stories.js +16 -5
  381. package/dist/components/molecules/RetailerSelectorv2/index.js +72 -31
  382. package/dist/components/molecules/RetailerSelectorv2/styles.js +9 -1
  383. package/dist/components/molecules/RowItem/ColumnItem.js +8 -6
  384. package/dist/components/molecules/RowItem/RowItem.stories.js +18 -5
  385. package/dist/components/molecules/RowItem/index.js +30 -21
  386. package/dist/components/molecules/RowItem/styles.js +17 -10
  387. package/dist/components/molecules/SelectV2/SelectV2.stories.js +17 -6
  388. package/dist/components/molecules/SelectV2/index.js +130 -101
  389. package/dist/components/molecules/SelectV2/styles.js +24 -25
  390. package/dist/components/molecules/SelectV2/test.js +24 -7
  391. package/dist/components/molecules/SelectV2/test.stories.js +16 -5
  392. package/dist/components/molecules/ServiceDataValidator/ServiceDataValidator.stories.js +16 -5
  393. package/dist/components/molecules/ServiceDataValidator/index.js +22 -17
  394. package/dist/components/molecules/ServiceDataValidator/styles.js +9 -1
  395. package/dist/components/molecules/SidebarNotification/SidebarNotification.stories.js +19 -7
  396. package/dist/components/molecules/SidebarNotification/index.js +40 -20
  397. package/dist/components/molecules/SidebarNotification/styles.js +9 -1
  398. package/dist/components/molecules/SignInLogin/SignInLogin.stories.js +16 -5
  399. package/dist/components/molecules/SignInLogin/index.js +197 -83
  400. package/dist/components/molecules/SignInLogin/styles.js +9 -1
  401. package/dist/components/molecules/StatusAsignationInfo/FinancedCompanies.js +2 -1
  402. package/dist/components/molecules/StatusAsignationInfo/StatusAsignationInfo.stories.js +16 -5
  403. package/dist/components/molecules/StatusAsignationInfo/index.js +89 -48
  404. package/dist/components/molecules/StatusAsignationInfo/styles.js +9 -1
  405. package/dist/components/molecules/StatusRetailer/StatusAsignationInfo.stories.js +16 -5
  406. package/dist/components/molecules/StatusRetailer/index.js +34 -15
  407. package/dist/components/molecules/StatusRetailer/styles.js +9 -1
  408. package/dist/components/molecules/StripeCardForm/StripeCardForm.stories.js +16 -5
  409. package/dist/components/molecules/StripeCardForm/index.js +63 -18
  410. package/dist/components/molecules/StripeCardForm/paymentForm.js +121 -57
  411. package/dist/components/molecules/StripeCardForm/styles.js +15 -6
  412. package/dist/components/molecules/StripeCardSelector/CardSelector.stories.js +16 -5
  413. package/dist/components/molecules/StripeCardSelector/index.js +90 -29
  414. package/dist/components/molecules/StripeCardSelector/styles.js +10 -5
  415. package/dist/components/molecules/StripeCardSelector/utils.js +46 -14
  416. package/dist/components/molecules/TableHeader/TableHeader.stories.js +16 -5
  417. package/dist/components/molecules/TableHeader/index.js +17 -12
  418. package/dist/components/molecules/TableHeader/styles.js +9 -1
  419. package/dist/components/molecules/TableRow/TableRow.stories.js +16 -5
  420. package/dist/components/molecules/TableRow/index.js +9 -6
  421. package/dist/components/molecules/TableRow/styles.js +8 -1
  422. package/dist/components/molecules/TabsMenu/TabsMenu.stories.js +16 -5
  423. package/dist/components/molecules/TabsMenu/index.js +83 -38
  424. package/dist/components/molecules/TabsMenu/styles.js +8 -1
  425. package/dist/components/molecules/TabsMenuv2/TabsMenuv2.stories.js +16 -5
  426. package/dist/components/molecules/TabsMenuv2/index.js +85 -40
  427. package/dist/components/molecules/TabsMenuv2/styles.js +8 -1
  428. package/dist/components/molecules/TagAndInput/TagAndInput.stories.js +18 -6
  429. package/dist/components/molecules/TagAndInput/index.js +74 -52
  430. package/dist/components/molecules/TagAndInput/styles.js +15 -13
  431. package/dist/components/molecules/TagAndInputv2/TagAndInputv2.stories.js +18 -6
  432. package/dist/components/molecules/TagAndInputv2/index.js +37 -33
  433. package/dist/components/molecules/TagAndInputv2/styles.js +15 -13
  434. package/dist/components/molecules/Validation/Validation.stories.js +16 -5
  435. package/dist/components/molecules/Validation/index.js +38 -18
  436. package/dist/components/molecules/Validation/styles.js +8 -1
  437. package/dist/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +16 -5
  438. package/dist/components/molecules/VerificationCodeResetPasswordLogin/index.js +116 -41
  439. package/dist/components/molecules/VerificationCodeResetPasswordLogin/styles.js +9 -1
  440. package/dist/components/molecules/VerificationCodeResetPasswordLogin/utils.js +21 -12
  441. package/dist/components/molecules/VersionItem/VersionItem.stories.js +16 -5
  442. package/dist/components/molecules/VersionItem/index.js +28 -12
  443. package/dist/components/molecules/VersionItem/styles.js +9 -1
  444. package/dist/components/molecules/VersionItemv2/VersionItemv2.stories.js +16 -5
  445. package/dist/components/molecules/VersionItemv2/index.js +28 -12
  446. package/dist/components/molecules/VersionItemv2/styles.js +9 -1
  447. package/dist/components/organisms/BarButtons/BarButtons.stories.js +16 -5
  448. package/dist/components/organisms/BarButtons/index.js +54 -28
  449. package/dist/components/organisms/BarButtons/styles.js +13 -2
  450. package/dist/components/organisms/Box/Box.stories.js +18 -5
  451. package/dist/components/organisms/Box/index.js +94 -57
  452. package/dist/components/organisms/Box/styles.js +9 -1
  453. package/dist/components/organisms/BoxOnboarding/BoxOnboarding.stories.js +18 -5
  454. package/dist/components/organisms/BoxOnboarding/index.js +35 -15
  455. package/dist/components/organisms/BoxOnboarding/styles.js +9 -1
  456. package/dist/components/organisms/Calendar/Calendar.stories.js +16 -5
  457. package/dist/components/organisms/Calendar/index.js +11 -6
  458. package/dist/components/organisms/Calendar/styles.js +9 -1
  459. package/dist/components/organisms/ChangePassword/ChangePassword.stories.js +16 -5
  460. package/dist/components/organisms/ChangePassword/index.js +82 -26
  461. package/dist/components/organisms/ChangePassword/styles.js +8 -1
  462. package/dist/components/organisms/Chat/Chat.stories.js +39 -28
  463. package/dist/components/organisms/Chat/ChatLists/ChatLists.stories.js +26 -14
  464. package/dist/components/organisms/Chat/ChatLists/index.js +48 -23
  465. package/dist/components/organisms/Chat/ChatLists/styles.js +17 -4
  466. package/dist/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +26 -17
  467. package/dist/components/organisms/Chat/ContainerItems/index.js +245 -137
  468. package/dist/components/organisms/Chat/ContainerItems/styles.js +9 -1
  469. package/dist/components/organisms/Chat/ContentChat/ContentChat.stories.js +24 -16
  470. package/dist/components/organisms/Chat/ContentChat/index.js +1391 -670
  471. package/dist/components/organisms/Chat/ContentChat/styles.js +9 -1
  472. package/dist/components/organisms/Chat/Footer/Footer.stories.js +19 -8
  473. package/dist/components/organisms/Chat/Footer/index.js +718 -321
  474. package/dist/components/organisms/Chat/Footer/styles.js +21 -4
  475. package/dist/components/organisms/Chat/Header/Header.stories.js +28 -16
  476. package/dist/components/organisms/Chat/Header/index.js +22 -15
  477. package/dist/components/organisms/Chat/Header/styles.js +9 -1
  478. package/dist/components/organisms/Chat/index.js +142 -125
  479. package/dist/components/organisms/Chat/styles.js +17 -3
  480. package/dist/components/organisms/Chatv2/ChatLists/ChatLists.stories.js +26 -14
  481. package/dist/components/organisms/Chatv2/ChatLists/index.js +48 -23
  482. package/dist/components/organisms/Chatv2/ChatLists/styles.js +17 -4
  483. package/dist/components/organisms/Chatv2/Chatv2.stories.js +39 -28
  484. package/dist/components/organisms/Chatv2/ContainerItems/ContainerItems.stories.js +26 -17
  485. package/dist/components/organisms/Chatv2/ContainerItems/index.js +245 -137
  486. package/dist/components/organisms/Chatv2/ContainerItems/styles.js +9 -1
  487. package/dist/components/organisms/Chatv2/ContentChat/ContentChat.stories.js +24 -16
  488. package/dist/components/organisms/Chatv2/ContentChat/index.js +1391 -670
  489. package/dist/components/organisms/Chatv2/ContentChat/styles.js +9 -1
  490. package/dist/components/organisms/Chatv2/Footer/Footer.stories.js +19 -8
  491. package/dist/components/organisms/Chatv2/Footer/index.js +718 -321
  492. package/dist/components/organisms/Chatv2/Footer/styles.js +21 -4
  493. package/dist/components/organisms/Chatv2/Header/Header.stories.js +28 -16
  494. package/dist/components/organisms/Chatv2/Header/index.js +22 -15
  495. package/dist/components/organisms/Chatv2/Header/styles.js +9 -1
  496. package/dist/components/organisms/Chatv2/index.js +142 -125
  497. package/dist/components/organisms/Chatv2/styles.js +21 -5
  498. package/dist/components/organisms/CompleteServices/CompleteServices.stories.js +16 -5
  499. package/dist/components/organisms/CompleteServices/index.js +24 -16
  500. package/dist/components/organisms/CompleteServices/styles.js +9 -1
  501. package/dist/components/organisms/CreateVersion/CreateVersion.stories.js +16 -5
  502. package/dist/components/organisms/CreateVersion/RenderChilds.js +41 -10
  503. package/dist/components/organisms/CreateVersion/index.js +88 -35
  504. package/dist/components/organisms/CreateVersion/styles.js +17 -4
  505. package/dist/components/organisms/DashboardMetric/DashboardMetric.stories.js +16 -5
  506. package/dist/components/organisms/DashboardMetric/dashboardMetricUtils.js +54 -5
  507. package/dist/components/organisms/DashboardMetric/index.js +59 -41
  508. package/dist/components/organisms/DashboardMetric/styles.js +9 -1
  509. package/dist/components/organisms/DragAndDropPhases/DragAndDropPhases.stories.js +16 -5
  510. package/dist/components/organisms/DragAndDropPhases/index.js +350 -170
  511. package/dist/components/organisms/DragAndDropPhases/styles.js +13 -2
  512. package/dist/components/organisms/DragPrueba/DragPrueba.stories.js +16 -5
  513. package/dist/components/organisms/DragPrueba/index.js +57 -19
  514. package/dist/components/organisms/DragPrueba/styles.js +9 -1
  515. package/dist/components/organisms/EditGroup/EditGroup.stories.js +16 -5
  516. package/dist/components/organisms/EditGroup/index.js +416 -199
  517. package/dist/components/organisms/EditGroup/styles.js +16 -3
  518. package/dist/components/organisms/FullProductNameHeader/FullProductNameHeader.stories.js +16 -5
  519. package/dist/components/organisms/FullProductNameHeader/index.js +45 -28
  520. package/dist/components/organisms/FullProductNameHeader/styles.js +8 -1
  521. package/dist/components/organisms/FullProductNamev2/FullProductNamev2.stories.js +16 -5
  522. package/dist/components/organisms/FullProductNamev2/index.js +37 -16
  523. package/dist/components/organisms/FullProductNamev2/styles.js +9 -1
  524. package/dist/components/organisms/FullTabsMenu/FullTabsMenu.stories.js +16 -5
  525. package/dist/components/organisms/FullTabsMenu/index.js +43 -28
  526. package/dist/components/organisms/FullTabsMenu/styles.js +8 -1
  527. package/dist/components/organisms/FullTabsMenuv2/FullTabsMenuv2.stories.js +16 -5
  528. package/dist/components/organisms/FullTabsMenuv2/index.js +71 -45
  529. package/dist/components/organisms/FullTabsMenuv2/styles.js +8 -1
  530. package/dist/components/organisms/Fullplan/FullPlan.stories.js +16 -5
  531. package/dist/components/organisms/Fullplan/index.js +23 -7
  532. package/dist/components/organisms/Fullplan/styles.js +9 -1
  533. package/dist/components/organisms/GlobalModal/index.js +10 -1
  534. package/dist/components/organisms/GlobalModal/styles.js +56 -12
  535. package/dist/components/organisms/GridProducts/GridProducts.stories.js +52 -29
  536. package/dist/components/organisms/GridProducts/index.js +25 -18
  537. package/dist/components/organisms/GridProducts/styles.js +8 -1
  538. package/dist/components/organisms/GridProducts/utils.js +25 -22
  539. package/dist/components/organisms/ImageDataTable/ImageDataTable.stories.js +16 -5
  540. package/dist/components/organisms/ImageDataTable/index.js +55 -37
  541. package/dist/components/organisms/ImageDataTable/styles.js +13 -9
  542. package/dist/components/organisms/ImageDataTablev2/ImageDataTablev2.stories.js +16 -5
  543. package/dist/components/organisms/ImageDataTablev2/index.js +55 -37
  544. package/dist/components/organisms/ImageDataTablev2/styles.js +13 -9
  545. package/dist/components/organisms/ImagePreviewer/ImagePreviewer.stories.js +16 -5
  546. package/dist/components/organisms/ImagePreviewer/index.js +12 -7
  547. package/dist/components/organisms/ImagePreviewer/styles.js +8 -1
  548. package/dist/components/organisms/ImagePreviewerv2/ImagePreviewerv2.stories.js +16 -5
  549. package/dist/components/organisms/ImagePreviewerv2/index.js +14 -8
  550. package/dist/components/organisms/ImagePreviewerv2/styles.js +8 -1
  551. package/dist/components/organisms/ImagesGroup/index.js +11 -2
  552. package/dist/components/organisms/ImagesGroup/styles.js +8 -1
  553. package/dist/components/organisms/InputGroup/InputGroup.stories.js +16 -5
  554. package/dist/components/organisms/InputGroup/index.js +55 -26
  555. package/dist/components/organisms/InputGroup/styles.js +9 -1
  556. package/dist/components/organisms/InputGroupv2/InputGroupv2.stories.js +16 -5
  557. package/dist/components/organisms/InputGroupv2/index.js +54 -29
  558. package/dist/components/organisms/InputGroupv2/styles.js +17 -2
  559. package/dist/components/organisms/MandatoryBar/MandatoryBar.stories.js +16 -5
  560. package/dist/components/organisms/MandatoryBar/index.js +9 -6
  561. package/dist/components/organisms/MandatoryBar/styles.js +9 -1
  562. package/dist/components/organisms/Modal/Modal.stories.js +21 -8
  563. package/dist/components/organisms/Modal/index.js +29 -24
  564. package/dist/components/organisms/Modal/styles.js +9 -1
  565. package/dist/components/organisms/OrderDetail/OrderDetail.stories.js +209 -42
  566. package/dist/components/organisms/OrderDetail/index.js +73 -36
  567. package/dist/components/organisms/OrderDetail/styles.js +29 -6
  568. package/dist/components/organisms/OrderDetail/utils/ImageGroup/index.js +38 -19
  569. package/dist/components/organisms/OrderDetail/utils/ImageGroup/styles.js +24 -14
  570. package/dist/components/organisms/OrderDetail/utils/Table/index.js +121 -62
  571. package/dist/components/organisms/OrderDetail/utils/Table/styles.js +23 -18
  572. package/dist/components/organisms/OrderDetail/utils/Table/utils.js +5 -2
  573. package/dist/components/organisms/PanelLayout/PanelLayout.stories.js +21 -6
  574. package/dist/components/organisms/PanelLayout/index.js +9 -7
  575. package/dist/components/organisms/PanelLayout/styles.js +21 -4
  576. package/dist/components/organisms/ProductImageModal/ProductImageModal.stories.js +16 -5
  577. package/dist/components/organisms/ProductImageModal/index.js +53 -18
  578. package/dist/components/organisms/ProductImageModal/styles.js +9 -1
  579. package/dist/components/organisms/ProductImageModalv2/ProductImageModalv2.stories.js +16 -5
  580. package/dist/components/organisms/ProductImageModalv2/index.js +44 -15
  581. package/dist/components/organisms/ProductImageModalv2/styles.js +9 -1
  582. package/dist/components/organisms/RangeCalendar/RangeCalendar.stories.js +16 -5
  583. package/dist/components/organisms/RangeCalendar/index.js +60 -27
  584. package/dist/components/organisms/RangeCalendar/styles.js +15 -6
  585. package/dist/components/organisms/RenameImagesBar/RenameImagesBar.stories.js +16 -5
  586. package/dist/components/organisms/RenameImagesBar/index.js +10 -5
  587. package/dist/components/organisms/RenameImagesBar/styles.js +9 -1
  588. package/dist/components/organisms/SideModal/SideModal.stories.js +17 -5
  589. package/dist/components/organisms/SideModal/index.js +24 -14
  590. package/dist/components/organisms/SideModal/styles.js +8 -1
  591. package/dist/components/organisms/Table/Table.stories.js +554 -0
  592. package/dist/components/organisms/Table/index.js +105 -0
  593. package/dist/components/organisms/Table/styles.js +48 -0
  594. package/dist/components/organisms/TableResizable/TableResizable.stories.js +17 -5
  595. package/dist/components/organisms/TableResizable/index.js +74 -44
  596. package/dist/components/organisms/TableResizable/styles.js +16 -3
  597. package/dist/components/organisms/TableResizable/utils.js +3 -2
  598. package/dist/components/organisms/VersionSelector/VersionSelector.stories.js +16 -5
  599. package/dist/components/organisms/VersionSelector/index.js +110 -40
  600. package/dist/components/organisms/VersionSelector/styles.js +9 -1
  601. package/dist/components/organisms/VersionSelectorv2/VersionSelectorv2.stories.js +16 -5
  602. package/dist/components/organisms/VersionSelectorv2/index.js +109 -40
  603. package/dist/components/organisms/VersionSelectorv2/styles.js +9 -1
  604. package/dist/components/pages/ChangePasswordLogin/ChangePasswordLogin.stories.js +18 -5
  605. package/dist/components/pages/ChangePasswordLogin/index.js +47 -15
  606. package/dist/components/pages/ChangePasswordLogin/styles.js +8 -1
  607. package/dist/components/pages/CustomerLogin/CustomerLogin.stories.js +23 -5
  608. package/dist/components/pages/CustomerLogin/index.js +8 -5
  609. package/dist/components/pages/CustomerLogin/styles.js +8 -1
  610. package/dist/components/pages/CustomerPayMethod/CustomerPayMethod.stories.js +20 -5
  611. package/dist/components/pages/CustomerPayMethod/index.js +8 -5
  612. package/dist/components/pages/CustomerPayMethod/styles.js +8 -1
  613. package/dist/components/pages/CustomerType/CustomerType.stories.js +20 -5
  614. package/dist/components/pages/CustomerType/index.js +8 -5
  615. package/dist/components/pages/CustomerType/styles.js +8 -1
  616. package/dist/components/pages/Dashboard/Dashboard.stories.js +16 -5
  617. package/dist/components/pages/Dashboard/dashboardUtils.js +105 -48
  618. package/dist/components/pages/Dashboard/index.js +416 -183
  619. package/dist/components/pages/Dashboard/styles.js +8 -1
  620. package/dist/components/pages/EmailResetPassword/EmailResetPassword.stories.js +18 -5
  621. package/dist/components/pages/EmailResetPassword/index.js +65 -16
  622. package/dist/components/pages/EmailResetPassword/styles.js +9 -1
  623. package/dist/components/pages/MultipleEdition/MultipleEdition.stories.js +33 -0
  624. package/dist/components/pages/MultipleEdition/components/ImageUploader.js +97 -0
  625. package/dist/components/pages/MultipleEdition/components/ImageUploaderStyles.js +18 -0
  626. package/dist/components/pages/MultipleEdition/components/ImageVisor.js +199 -0
  627. package/dist/components/pages/MultipleEdition/components/styles.js +29 -0
  628. package/dist/components/pages/MultipleEdition/index.js +257 -0
  629. package/dist/components/pages/MultipleEdition/saveData.js +200 -0
  630. package/dist/components/pages/MultipleEdition/styles.js +20 -0
  631. package/dist/components/pages/MultipleEdition/utils.js +539 -0
  632. package/dist/components/pages/OnboardPlan/OnboardPlan.stories.js +20 -5
  633. package/dist/components/pages/OnboardPlan/index.js +8 -5
  634. package/dist/components/pages/OnboardPlan/styles.js +8 -1
  635. package/dist/components/pages/ProductEditionv2/ProductEditionv2.stories.js +19 -6
  636. package/dist/components/pages/ProductEditionv2/index.js +1830 -890
  637. package/dist/components/pages/ProductEditionv2/styles.js +11 -5
  638. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +19 -6
  639. package/dist/components/pages/ProviderProductEdition/index.js +1753 -858
  640. package/dist/components/pages/ProviderProductEdition/styles.js +11 -5
  641. package/dist/components/pages/RegistrationLoginSecondStep/RegistrationLoginSecondStep.stories.js +18 -5
  642. package/dist/components/pages/RegistrationLoginSecondStep/index.js +79 -24
  643. package/dist/components/pages/RegistrationLoginSecondStep/styles.js +9 -1
  644. package/dist/components/pages/RegistrationLoginThirdStep/RegistrationLoginThirdStep.stories.js +18 -5
  645. package/dist/components/pages/RegistrationLoginThirdStep/index.js +80 -23
  646. package/dist/components/pages/RegistrationLoginThirdStep/styles.js +9 -1
  647. package/dist/components/pages/RetailerPlan/RetailerPlan.stories.js +20 -5
  648. package/dist/components/pages/RetailerPlan/index.js +9 -5
  649. package/dist/components/pages/RetailerPlan/styles.js +8 -1
  650. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +16 -5
  651. package/dist/components/pages/RetailerProductEdition/index.js +1654 -783
  652. package/dist/components/pages/RetailerProductEdition/styles.js +10 -5
  653. package/dist/components/pages/RetailerProductEdition/utils.js +91 -24
  654. package/dist/components/pages/VerificationCodeResetPassword/VerificationCodeResetPassword.stories.js +18 -5
  655. package/dist/components/pages/VerificationCodeResetPassword/index.js +50 -21
  656. package/dist/components/pages/VerificationCodeResetPassword/styles.js +9 -1
  657. package/dist/components/pages/VerificationCodeResetPassword/utils.js +21 -12
  658. package/dist/global-files/customHooks.js +19 -5
  659. package/dist/global-files/data.js +206 -79
  660. package/dist/global-files/handle_http.js +315 -175
  661. package/dist/global-files/handle_userTech.js +8 -4
  662. package/dist/global-files/utils.js +188 -90
  663. package/dist/global-files/variables.js +6 -3
  664. package/dist/index.js +309 -103
  665. package/package.json +1 -1
@@ -1,104 +1,198 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.ContentChat = void 0;
9
+
10
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
+
12
+ var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createForOfIteratorHelper"));
13
+
14
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
15
+
16
+ var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
17
+
18
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
19
+
20
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
21
+
8
22
  var _reactHowler = _interopRequireDefault(require("react-howler"));
23
+
9
24
  var _styles = require("./styles");
25
+
10
26
  var _react = require("react");
27
+
11
28
  var _NotFound = require("../../../atoms/NotFound");
29
+
12
30
  var _Header = require("../Header");
31
+
13
32
  var _freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons");
33
+
14
34
  var _Loading = require("../../../atoms/Loading");
35
+
15
36
  var _ContainerItems = require("../ContainerItems");
37
+
16
38
  var _Footer = require("../Footer");
39
+
17
40
  var _ChatLists = require("../ChatLists");
41
+
18
42
  var _CustomIcon = require("../../../atoms/CustomIcon");
43
+
19
44
  var _handle_http = require("../../../../global-files/handle_http");
45
+
20
46
  var _utils = require("../../../../global-files/utils");
47
+
21
48
  var _newMessage = _interopRequireDefault(require("../../../../assets/sounds/newMessage.mp3"));
49
+
22
50
  var _jsxRuntime = require("react/jsx-runtime");
23
- const ContentChat = props => {
24
- const {
25
- chatType,
26
- // "merchant_product" | "order_product" | "ticket"
27
- chatContainerType,
28
- // "fixed" | "popUp"
29
- dataChat,
30
- // { data | error }
31
- showBtnClose,
32
- // boolean
33
- onClickBtnClose,
34
- // () => {}
35
- showPopUpChat,
36
- // boolean
37
- ticketCompany,
38
- // id de la compañía que creó el ticket
39
- activeRetailer // object retailer
40
- } = props;
41
- const [companies, setCompanies] = (0, _react.useState)({}); /* {
42
- companyId: {
43
- name: string,
44
- statusChat: string => current | open | closed
45
- items: [{..}] ,
46
- enabledLoadMore: boolean
47
- },
48
- ...
49
- } chat orderProduct */
50
- const [singleChat, setSingleChat] = (0, _react.useState)({
51
+
52
+ var ContentChat = function ContentChat(props) {
53
+ var chatType = props.chatType,
54
+ chatContainerType = props.chatContainerType,
55
+ dataChat = props.dataChat,
56
+ showBtnClose = props.showBtnClose,
57
+ onClickBtnClose = props.onClickBtnClose,
58
+ showPopUpChat = props.showPopUpChat,
59
+ ticketCompany = props.ticketCompany,
60
+ activeRetailer = props.activeRetailer;
61
+
62
+ var _useState = (0, _react.useState)({}),
63
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
64
+ companies = _useState2[0],
65
+ setCompanies = _useState2[1];
66
+ /* {
67
+ companyId: {
68
+ name: string,
69
+ statusChat: string => current | open | closed
70
+ items: [{..}] ,
71
+ enabledLoadMore: boolean
72
+ },
73
+ ...
74
+ } chat orderProduct */
75
+
76
+
77
+ var _useState3 = (0, _react.useState)({
51
78
  items: undefined,
52
79
  enabledLoadMore: false,
53
80
  statusChat: undefined
54
- }); // chat merchantProduct o ticket
55
- const [activeCompanyId, setActiveCompanyId] = (0, _react.useState)(); // number
56
- const [allUsers, setAllUsers] = (0, _react.useState)({}); // {...}
57
- const [currentUser, setCurrentUser] = (0, _react.useState)({
81
+ }),
82
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
83
+ singleChat = _useState4[0],
84
+ setSingleChat = _useState4[1]; // chat merchantProduct o ticket
85
+
86
+
87
+ var _useState5 = (0, _react.useState)(),
88
+ _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
89
+ activeCompanyId = _useState6[0],
90
+ setActiveCompanyId = _useState6[1]; // number
91
+
92
+
93
+ var _useState7 = (0, _react.useState)({}),
94
+ _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
95
+ allUsers = _useState8[0],
96
+ setAllUsers = _useState8[1]; // {...}
97
+
98
+
99
+ var _useState9 = (0, _react.useState)({
58
100
  id: undefined,
59
101
  companyId: undefined
60
- });
61
- const [currentArticle, setCurrentArticle] = (0, _react.useState)({
102
+ }),
103
+ _useState10 = (0, _slicedToArray2.default)(_useState9, 2),
104
+ currentUser = _useState10[0],
105
+ setCurrentUser = _useState10[1];
106
+
107
+ var _useState11 = (0, _react.useState)({
62
108
  status: undefined,
63
109
  version: undefined
64
- });
65
- const [lastUpdateDate, setLastUpdateDate] = (0, _react.useState)(); // string
66
- const [isLoading, setIsLoading] = (0, _react.useState)(true); // boolean
67
- const [showChatsList, setShowChatsList] = (0, _react.useState)(false); // boolean
68
- const [processUpdateID, setProcessUpdateID] = (0, _react.useState)(); // number
69
- const [startUpdate, setStartUpdate] = (0, _react.useState)(0); // number
70
- const [runUpdate, setRunUpdate] = (0, _react.useState)(0); // number
71
- const [errorChat, setErrorChat] = (0, _react.useState)({
110
+ }),
111
+ _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
112
+ currentArticle = _useState12[0],
113
+ setCurrentArticle = _useState12[1];
114
+
115
+ var _useState13 = (0, _react.useState)(),
116
+ _useState14 = (0, _slicedToArray2.default)(_useState13, 2),
117
+ lastUpdateDate = _useState14[0],
118
+ setLastUpdateDate = _useState14[1]; // string
119
+
120
+
121
+ var _useState15 = (0, _react.useState)(true),
122
+ _useState16 = (0, _slicedToArray2.default)(_useState15, 2),
123
+ isLoading = _useState16[0],
124
+ setIsLoading = _useState16[1]; // boolean
125
+
126
+
127
+ var _useState17 = (0, _react.useState)(false),
128
+ _useState18 = (0, _slicedToArray2.default)(_useState17, 2),
129
+ showChatsList = _useState18[0],
130
+ setShowChatsList = _useState18[1]; // boolean
131
+
132
+
133
+ var _useState19 = (0, _react.useState)(),
134
+ _useState20 = (0, _slicedToArray2.default)(_useState19, 2),
135
+ processUpdateID = _useState20[0],
136
+ setProcessUpdateID = _useState20[1]; // number
137
+
138
+
139
+ var _useState21 = (0, _react.useState)(0),
140
+ _useState22 = (0, _slicedToArray2.default)(_useState21, 2),
141
+ startUpdate = _useState22[0],
142
+ setStartUpdate = _useState22[1]; // number
143
+
144
+
145
+ var _useState23 = (0, _react.useState)(0),
146
+ _useState24 = (0, _slicedToArray2.default)(_useState23, 2),
147
+ runUpdate = _useState24[0],
148
+ setRunUpdate = _useState24[1]; // number
149
+
150
+
151
+ var _useState25 = (0, _react.useState)({
72
152
  existError: false,
73
153
  code: undefined,
74
154
  message: undefined,
75
155
  errorDetail: undefined
76
- });
77
- const [errorUpdate, setErrorUpdate] = (0, _react.useState)({
156
+ }),
157
+ _useState26 = (0, _slicedToArray2.default)(_useState25, 2),
158
+ errorChat = _useState26[0],
159
+ setErrorChat = _useState26[1];
160
+
161
+ var _useState27 = (0, _react.useState)({
78
162
  startDate: undefined,
79
163
  // Date()
80
164
  lastDate: undefined // Date()
81
- });
82
- const [playSound, setPlaySound] = (0, _react.useState)(false);
83
165
 
84
- // matar update al desmontar el componente del chat
85
- (0, _react.useEffect)(() => {
86
- return () => {
166
+ }),
167
+ _useState28 = (0, _slicedToArray2.default)(_useState27, 2),
168
+ errorUpdate = _useState28[0],
169
+ setErrorUpdate = _useState28[1];
170
+
171
+ var _useState29 = (0, _react.useState)(false),
172
+ _useState30 = (0, _slicedToArray2.default)(_useState29, 2),
173
+ playSound = _useState30[0],
174
+ setPlaySound = _useState30[1]; // matar update al desmontar el componente del chat
175
+
176
+
177
+ (0, _react.useEffect)(function () {
178
+ return function () {
87
179
  if (processUpdateID !== undefined) clearTimeout(processUpdateID);
88
180
  };
89
181
  }, []);
90
- const stopUpdate = () => {
182
+
183
+ var stopUpdate = function stopUpdate() {
91
184
  if (processUpdateID !== undefined) {
92
185
  clearTimeout(processUpdateID);
93
186
  setProcessUpdateID(undefined);
94
187
  }
95
- };
188
+ }; // al cargar el componente
189
+
96
190
 
97
- // al cargar el componente
98
- (0, _react.useEffect)(() => {
191
+ (0, _react.useEffect)(function () {
99
192
  //if (dataChat && showPopUpChat) {
100
193
  if (Object.keys(dataChat || {}).length) {
101
194
  stopUpdate();
195
+
102
196
  if (dataChat.code) {
103
197
  setErrorChat({
104
198
  existError: true,
@@ -109,26 +203,30 @@ const ContentChat = props => {
109
203
  setIsLoading(false);
110
204
  return;
111
205
  }
206
+
112
207
  if (chatType === "merchant_product") getInitialMerchantProduct();else if (chatType === "order_product") getInitialOrderProduct();else if (chatType === "product_status") getInitialProductStatus();else getInitialTicket();
113
208
  }
209
+
114
210
  if (!showPopUpChat) {
115
211
  stopUpdate();
116
212
  }
117
- }, [dataChat, showPopUpChat]);
213
+ }, [dataChat, showPopUpChat]); // comenzar temporizador del update de 20s
118
214
 
119
- // comenzar temporizador del update de 20s
120
- (0, _react.useEffect)(() => {
215
+ (0, _react.useEffect)(function () {
121
216
  // return; // -- descomentarizar para hacer pruebas sin update
122
217
  if (startUpdate === 0) return;
123
- const processID = setTimeout(() => {
124
- setRunUpdate(prev => prev + 1);
218
+ var processID = setTimeout(function () {
219
+ setRunUpdate(function (prev) {
220
+ return prev + 1;
221
+ });
125
222
  }, 15000);
126
223
  setProcessUpdateID(processID);
127
- return () => clearTimeout(processID);
128
- }, [startUpdate]);
224
+ return function () {
225
+ return clearTimeout(processID);
226
+ };
227
+ }, [startUpdate]); // ejecutar update
129
228
 
130
- // ejecutar update
131
- (0, _react.useEffect)(() => {
229
+ (0, _react.useEffect)(function () {
132
230
  if (chatType === "merchant_product") {
133
231
  if (singleChat.items) getUpdateLatestMerchantProduct(true);else getInitialMerchantProduct();
134
232
  } else if (chatType === "order_product") {
@@ -139,457 +237,799 @@ const ContentChat = props => {
139
237
  if (singleChat.items) getUpdateLatestTicket(true);else getInitialTicket();
140
238
  }
141
239
  }, [runUpdate]);
142
-
143
240
  /*=======================================================================
144
241
  PETICION GET INICIAL SEGUN EL TIPO DE CHAT
145
242
  ======================================================================= */
146
- const getInitialProductStatus = async () => {
147
- const paramsQuery = {
148
- articleData: JSON.stringify({
149
- articleId: JSON.stringify(dataChat.id),
150
- version: JSON.stringify(dataChat.version),
151
- retailerId: JSON.stringify(dataChat.retailerId),
152
- status: dataChat.status
153
- })
154
- };
155
- const paramsHeaders = {
156
- Authorization: dataChat.userToken
157
- };
158
- const response = await (0, _handle_http.fetchGET)(process.env.REACT_APP_READ_MESSAGES, paramsQuery, paramsHeaders);
159
- if (!response.body) {
160
- setErrorChat({
161
- existError: true,
162
- code: 400,
163
- message: response.message,
164
- errorDetail: response.errorDetail
165
- });
166
- setIsLoading(false);
167
- return;
168
- }
169
- // success
170
- setStartUpdate(prev => prev + 1);
171
- setCurrentUser({
172
- id: response.body.data.currentUserId,
173
- companyId: response.body.data.currentCompanyId
174
- });
175
- setLastUpdateDate(response.body.data.lastUpdateDate);
176
- setAllUsers(response.body.users);
177
- setSingleChat({
178
- items: response.body.items,
179
- enabledLoadMore: response.body.items.length === 50
180
- });
181
- setErrorChat({
182
- existError: false
183
- });
184
- setIsLoading(false);
185
- };
186
- const getInitialMerchantProduct = async () => {
187
- const paramsQuery = {
188
- getType: "initial",
189
- id: JSON.stringify(dataChat.id),
190
- version: JSON.stringify(dataChat.version)
191
- };
192
- const paramsHeaders = {
193
- Authorization: dataChat.userToken
194
- };
195
- const response = await (0, _handle_http.fetchGET)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsQuery, paramsHeaders);
196
- if (!response.body) {
197
- setErrorChat({
198
- existError: true,
199
- code: 400,
200
- message: response.message,
201
- errorDetail: response.errorDetail
202
- });
203
- setIsLoading(false);
204
- return;
205
- }
206
- // success
207
- setStartUpdate(prev => prev + 1);
208
- setCurrentUser({
209
- id: response.body.data.currentUserId,
210
- companyId: response.body.data.currentCompanyId
211
- });
212
- setLastUpdateDate(response.body.data.lastUpdateDate);
213
- setAllUsers(response.body.users);
214
- setSingleChat({
215
- items: response.body.items,
216
- enabledLoadMore: response.body.items.length === 50
217
- });
218
- setErrorChat({
219
- existError: false
220
- });
221
- setIsLoading(false);
222
- };
223
- const getInitialOrderProduct = async () => {
224
- clearTimeout(processUpdateID); // finalizamos el temporizador
225
- const paramsQuery = {
226
- getType: "initial",
227
- id: JSON.stringify(dataChat.id),
228
- orderId: JSON.stringify(dataChat.orderId),
229
- retailerId: JSON.stringify(dataChat.retailerId)
230
- };
231
- const paramsHeaders = {
232
- Authorization: dataChat.userToken
243
+
244
+ var getInitialProductStatus = /*#__PURE__*/function () {
245
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
246
+ var paramsQuery, paramsHeaders, response;
247
+ return _regenerator.default.wrap(function _callee$(_context) {
248
+ while (1) {
249
+ switch (_context.prev = _context.next) {
250
+ case 0:
251
+ paramsQuery = {
252
+ articleData: JSON.stringify({
253
+ articleId: JSON.stringify(dataChat.id),
254
+ version: JSON.stringify(dataChat.version),
255
+ retailerId: JSON.stringify(dataChat.retailerId),
256
+ status: dataChat.status
257
+ })
258
+ };
259
+ paramsHeaders = {
260
+ Authorization: dataChat.userToken
261
+ };
262
+ _context.next = 4;
263
+ return (0, _handle_http.fetchGET)(process.env.REACT_APP_READ_MESSAGES, paramsQuery, paramsHeaders);
264
+
265
+ case 4:
266
+ response = _context.sent;
267
+
268
+ if (response.body) {
269
+ _context.next = 9;
270
+ break;
271
+ }
272
+
273
+ setErrorChat({
274
+ existError: true,
275
+ code: 400,
276
+ message: response.message,
277
+ errorDetail: response.errorDetail
278
+ });
279
+ setIsLoading(false);
280
+ return _context.abrupt("return");
281
+
282
+ case 9:
283
+ // success
284
+ setStartUpdate(function (prev) {
285
+ return prev + 1;
286
+ });
287
+ setCurrentUser({
288
+ id: response.body.data.currentUserId,
289
+ companyId: response.body.data.currentCompanyId
290
+ });
291
+ setLastUpdateDate(response.body.data.lastUpdateDate);
292
+ setAllUsers(response.body.users);
293
+ setSingleChat({
294
+ items: response.body.items,
295
+ enabledLoadMore: response.body.items.length === 50
296
+ });
297
+ setErrorChat({
298
+ existError: false
299
+ });
300
+ setIsLoading(false);
301
+
302
+ case 16:
303
+ case "end":
304
+ return _context.stop();
305
+ }
306
+ }
307
+ }, _callee);
308
+ }));
309
+
310
+ return function getInitialProductStatus() {
311
+ return _ref.apply(this, arguments);
233
312
  };
234
- const response = await (0, _handle_http.fetchGET)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsQuery, paramsHeaders);
235
- setStartUpdate(prev => prev + 1); // TEMPORAL
236
- if (!response.body) {
237
- setErrorChat({
238
- existError: true,
239
- code: 400,
240
- message: response.message,
241
- errorDetail: response.errorDetail
242
- });
243
- setIsLoading(false);
244
- return;
245
- }
246
- // success
247
- setCurrentUser({
248
- id: response.body.data.currentUserId,
249
- companyId: response.body.data.currentCompanyId
250
- });
251
- setLastUpdateDate(response.body.data.lastUpdateDate);
252
- setCurrentArticle({
253
- status: response.body.data.status,
254
- version: response.body.data.version
255
- });
256
- setAllUsers(response.body.users);
257
- const companiesList = response.body.companies;
258
- const companiesIdList = Object.keys(companiesList);
259
- let companyActive;
260
- // encontrar el chat inicial a cargar y si se debe permitir cargar mas
261
- for (const companyId of companiesIdList) {
262
- if (companiesList[companyId].items.length < 50) {
263
- companiesList[companyId].enabledLoadMore = false;
264
- } else {
265
- companiesList[companyId].enabledLoadMore = true;
266
- }
267
- if (companiesList[companyId].statusChat === "current") {
268
- companyActive = Number(companyId);
269
- }
270
- }
271
- if (!companyActive && companiesIdList.length) {
272
- companyActive = Number(companiesIdList[0]);
273
- }
274
- setCompanies(companiesList);
275
- if (companyActive) setActiveCompanyId(companyActive);
276
- setErrorChat({
277
- existError: false
278
- });
279
- setIsLoading(false);
280
- };
281
- const getInitialTicket = async () => {
282
- var _dataChat$currentUser, _dataChat$currentUser2, _dataChat$currentUser3, _dataChat$currentUser4;
283
- stopUpdate(); // finalizamos el temporizador
284
- const dataUser = {
285
- id: (_dataChat$currentUser = dataChat.currentUser) === null || _dataChat$currentUser === void 0 ? void 0 : _dataChat$currentUser.id,
286
- companyId: (_dataChat$currentUser2 = dataChat.currentUser) === null || _dataChat$currentUser2 === void 0 ? void 0 : _dataChat$currentUser2.companyId,
287
- isUserTech: (_dataChat$currentUser3 = dataChat.currentUser) === null || _dataChat$currentUser3 === void 0 ? void 0 : _dataChat$currentUser3.isUserTech
313
+ }();
314
+
315
+ var getInitialMerchantProduct = /*#__PURE__*/function () {
316
+ var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
317
+ var paramsQuery, paramsHeaders, response;
318
+ return _regenerator.default.wrap(function _callee2$(_context2) {
319
+ while (1) {
320
+ switch (_context2.prev = _context2.next) {
321
+ case 0:
322
+ paramsQuery = {
323
+ getType: "initial",
324
+ id: JSON.stringify(dataChat.id),
325
+ version: JSON.stringify(dataChat.version)
326
+ };
327
+ paramsHeaders = {
328
+ Authorization: dataChat.userToken
329
+ };
330
+ _context2.next = 4;
331
+ return (0, _handle_http.fetchGET)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsQuery, paramsHeaders);
332
+
333
+ case 4:
334
+ response = _context2.sent;
335
+
336
+ if (response.body) {
337
+ _context2.next = 9;
338
+ break;
339
+ }
340
+
341
+ setErrorChat({
342
+ existError: true,
343
+ code: 400,
344
+ message: response.message,
345
+ errorDetail: response.errorDetail
346
+ });
347
+ setIsLoading(false);
348
+ return _context2.abrupt("return");
349
+
350
+ case 9:
351
+ // success
352
+ setStartUpdate(function (prev) {
353
+ return prev + 1;
354
+ });
355
+ setCurrentUser({
356
+ id: response.body.data.currentUserId,
357
+ companyId: response.body.data.currentCompanyId
358
+ });
359
+ setLastUpdateDate(response.body.data.lastUpdateDate);
360
+ setAllUsers(response.body.users);
361
+ setSingleChat({
362
+ items: response.body.items,
363
+ enabledLoadMore: response.body.items.length === 50
364
+ });
365
+ setErrorChat({
366
+ existError: false
367
+ });
368
+ setIsLoading(false);
369
+
370
+ case 16:
371
+ case "end":
372
+ return _context2.stop();
373
+ }
374
+ }
375
+ }, _callee2);
376
+ }));
377
+
378
+ return function getInitialMerchantProduct() {
379
+ return _ref2.apply(this, arguments);
288
380
  };
289
- const paramsQuery = {
290
- //id: JSON.stringify(dataChat.id),
291
- id: dataChat.id,
292
- getType: "initial",
293
- //currentUser: encodeUriJson(dataUser),
294
- currentUser: encodeURIComponent(JSON.stringify(dataUser)),
295
- currentItemsFront: (0, _utils.encodeUriJson)(getItemsIdSingleChat())
381
+ }();
382
+
383
+ var getInitialOrderProduct = /*#__PURE__*/function () {
384
+ var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
385
+ var paramsQuery, paramsHeaders, response, companiesList, companiesIdList, companyActive, _i, _companiesIdList, companyId;
386
+
387
+ return _regenerator.default.wrap(function _callee3$(_context3) {
388
+ while (1) {
389
+ switch (_context3.prev = _context3.next) {
390
+ case 0:
391
+ clearTimeout(processUpdateID); // finalizamos el temporizador
392
+
393
+ paramsQuery = {
394
+ getType: "initial",
395
+ id: JSON.stringify(dataChat.id),
396
+ orderId: JSON.stringify(dataChat.orderId),
397
+ retailerId: JSON.stringify(dataChat.retailerId)
398
+ };
399
+ paramsHeaders = {
400
+ Authorization: dataChat.userToken
401
+ };
402
+ _context3.next = 5;
403
+ return (0, _handle_http.fetchGET)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsQuery, paramsHeaders);
404
+
405
+ case 5:
406
+ response = _context3.sent;
407
+ setStartUpdate(function (prev) {
408
+ return prev + 1;
409
+ }); // TEMPORAL
410
+
411
+ if (response.body) {
412
+ _context3.next = 11;
413
+ break;
414
+ }
415
+
416
+ setErrorChat({
417
+ existError: true,
418
+ code: 400,
419
+ message: response.message,
420
+ errorDetail: response.errorDetail
421
+ });
422
+ setIsLoading(false);
423
+ return _context3.abrupt("return");
424
+
425
+ case 11:
426
+ // success
427
+ setCurrentUser({
428
+ id: response.body.data.currentUserId,
429
+ companyId: response.body.data.currentCompanyId
430
+ });
431
+ setLastUpdateDate(response.body.data.lastUpdateDate);
432
+ setCurrentArticle({
433
+ status: response.body.data.status,
434
+ version: response.body.data.version
435
+ });
436
+ setAllUsers(response.body.users);
437
+ companiesList = response.body.companies;
438
+ companiesIdList = Object.keys(companiesList);
439
+
440
+ // encontrar el chat inicial a cargar y si se debe permitir cargar mas
441
+ for (_i = 0, _companiesIdList = companiesIdList; _i < _companiesIdList.length; _i++) {
442
+ companyId = _companiesIdList[_i];
443
+
444
+ if (companiesList[companyId].items.length < 50) {
445
+ companiesList[companyId].enabledLoadMore = false;
446
+ } else {
447
+ companiesList[companyId].enabledLoadMore = true;
448
+ }
449
+
450
+ if (companiesList[companyId].statusChat === "current") {
451
+ companyActive = Number(companyId);
452
+ }
453
+ }
454
+
455
+ if (!companyActive && companiesIdList.length) {
456
+ companyActive = Number(companiesIdList[0]);
457
+ }
458
+
459
+ setCompanies(companiesList);
460
+ if (companyActive) setActiveCompanyId(companyActive);
461
+ setErrorChat({
462
+ existError: false
463
+ });
464
+ setIsLoading(false);
465
+
466
+ case 23:
467
+ case "end":
468
+ return _context3.stop();
469
+ }
470
+ }
471
+ }, _callee3);
472
+ }));
473
+
474
+ return function getInitialOrderProduct() {
475
+ return _ref3.apply(this, arguments);
296
476
  };
297
- const response = await (0, _handle_http.fetchGET)(process.env.REACT_APP_TICKETS_CHAT_ENDPOINT, paramsQuery, {
298
- Authorization: (_dataChat$currentUser4 = dataChat.currentUser) === null || _dataChat$currentUser4 === void 0 ? void 0 : _dataChat$currentUser4.token
299
- });
300
- // programar update en 20s
301
- setStartUpdate(prev => prev + 1);
302
- if (!response.body) {
303
- setErrorChat({
304
- existError: true,
305
- code: 400,
306
- message: response.message,
307
- errorDetail: response.errorDetail
308
- });
309
- setIsLoading(false);
310
- return;
311
- }
312
- // success
313
- setLastUpdateDate(response.body.data.lastUpdateDate);
314
- setAllUsers(response.body.users);
315
- setSingleChat({
316
- items: response.body.items,
317
- enabledLoadMore: response.body.items.length === 50,
318
- statusChat: dataChat.statusChat
319
- });
320
- setErrorChat({
321
- existError: false
322
- });
323
- setIsLoading(false);
324
- };
477
+ }();
478
+
479
+ var getInitialTicket = /*#__PURE__*/function () {
480
+ var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
481
+ var _dataChat$currentUser, _dataChat$currentUser2, _dataChat$currentUser3, _dataChat$currentUser4;
482
+
483
+ var dataUser, paramsQuery, response;
484
+ return _regenerator.default.wrap(function _callee4$(_context4) {
485
+ while (1) {
486
+ switch (_context4.prev = _context4.next) {
487
+ case 0:
488
+ stopUpdate(); // finalizamos el temporizador
489
+
490
+ dataUser = {
491
+ id: (_dataChat$currentUser = dataChat.currentUser) === null || _dataChat$currentUser === void 0 ? void 0 : _dataChat$currentUser.id,
492
+ companyId: (_dataChat$currentUser2 = dataChat.currentUser) === null || _dataChat$currentUser2 === void 0 ? void 0 : _dataChat$currentUser2.companyId,
493
+ isUserTech: (_dataChat$currentUser3 = dataChat.currentUser) === null || _dataChat$currentUser3 === void 0 ? void 0 : _dataChat$currentUser3.isUserTech
494
+ };
495
+ paramsQuery = {
496
+ //id: JSON.stringify(dataChat.id),
497
+ id: dataChat.id,
498
+ getType: "initial",
499
+ //currentUser: encodeUriJson(dataUser),
500
+ currentUser: encodeURIComponent(JSON.stringify(dataUser)),
501
+ currentItemsFront: (0, _utils.encodeUriJson)(getItemsIdSingleChat())
502
+ };
503
+ _context4.next = 5;
504
+ return (0, _handle_http.fetchGET)(process.env.REACT_APP_TICKETS_CHAT_ENDPOINT, paramsQuery, {
505
+ Authorization: (_dataChat$currentUser4 = dataChat.currentUser) === null || _dataChat$currentUser4 === void 0 ? void 0 : _dataChat$currentUser4.token
506
+ });
507
+
508
+ case 5:
509
+ response = _context4.sent;
510
+ // programar update en 20s
511
+ setStartUpdate(function (prev) {
512
+ return prev + 1;
513
+ });
514
+
515
+ if (response.body) {
516
+ _context4.next = 11;
517
+ break;
518
+ }
519
+
520
+ setErrorChat({
521
+ existError: true,
522
+ code: 400,
523
+ message: response.message,
524
+ errorDetail: response.errorDetail
525
+ });
526
+ setIsLoading(false);
527
+ return _context4.abrupt("return");
528
+
529
+ case 11:
530
+ // success
531
+ setLastUpdateDate(response.body.data.lastUpdateDate);
532
+ setAllUsers(response.body.users);
533
+ setSingleChat({
534
+ items: response.body.items,
535
+ enabledLoadMore: response.body.items.length === 50,
536
+ statusChat: dataChat.statusChat
537
+ });
538
+ setErrorChat({
539
+ existError: false
540
+ });
541
+ setIsLoading(false);
325
542
 
543
+ case 16:
544
+ case "end":
545
+ return _context4.stop();
546
+ }
547
+ }
548
+ }, _callee4);
549
+ }));
550
+
551
+ return function getInitialTicket() {
552
+ return _ref4.apply(this, arguments);
553
+ };
554
+ }();
326
555
  /*=======================================================================
327
556
  PETICION GET LOAD_MORE SEGUN EL TIPO DE CHAT
328
557
  ======================================================================= */
329
- const getLoadMoreMerchantProduct = async () => {
330
- clearTimeout(processUpdateID); // finalizamos el temporizador
331
- let date = singleChat.items[singleChat.items.length - 1].date;
332
- const paramsQuery = {
333
- getType: "loadMore",
334
- id: JSON.stringify(dataChat.id),
335
- version: JSON.stringify(dataChat.version),
336
- date: encodeURIComponent(date)
337
- };
338
- const response = await (0, _handle_http.fetchGET)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsQuery);
339
- //setStartUpdate((prev) => prev + 1); // comendar un nuevo temporizador
340
- if (!response.body) {
341
- return {
342
- title: response.message,
343
- message: response.errorDetail
344
- };
345
- }
346
- // success
347
- // actualizar la lista de los users
348
- updateAllUsers(response.body.users);
349
- // actualizar los items del chat
350
- let newSingleChat = {
351
- ...singleChat
352
- };
353
- newSingleChat.items = addOldItemsChat(newSingleChat.items, response.body.items);
354
- newSingleChat.enabledLoadMore = response.body.items.length === 50;
355
- setSingleChat(newSingleChat);
356
- };
357
- const getLoadMoreOrderProduct = async () => {
358
- clearTimeout(processUpdateID); // finalizamos el temporizador
359
- let company = companies[activeCompanyId];
360
- let date = company.items[company.items.length - 1].date;
361
- const paramsQuery = {
362
- getType: "loadMore",
363
- id: JSON.stringify(dataChat.id),
364
- orderId: JSON.stringify(dataChat.orderId),
365
- version: JSON.stringify(currentArticle.version),
366
- currentCompanyId: JSON.stringify(currentUser.companyId),
367
- date: encodeURIComponent(date),
368
- othersCompanyId: JSON.stringify([activeCompanyId])
369
- };
370
- const response = await (0, _handle_http.fetchGET)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsQuery);
371
- //setStartUpdate((prev) => prev + 1); // comendar un nuevo temporizador
372
- if (!response.body) {
373
- return {
374
- title: response.message,
375
- message: response.errorDetail
376
- };
377
- }
378
- // success
379
- // actualizar la lista de los users
380
- updateAllUsers(response.body.users);
381
- // actualizar los items del chat y la lista de users
382
- company.items = addOldItemsChat(company.items, response.body.items);
383
- company.enabledLoadMore = response.body.items.length === 50;
384
- setCompanies(prev => ({
385
- ...prev,
386
- [activeCompanyId]: company
558
+
559
+
560
+ var getLoadMoreMerchantProduct = /*#__PURE__*/function () {
561
+ var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
562
+ var date, paramsQuery, response, newSingleChat;
563
+ return _regenerator.default.wrap(function _callee5$(_context5) {
564
+ while (1) {
565
+ switch (_context5.prev = _context5.next) {
566
+ case 0:
567
+ clearTimeout(processUpdateID); // finalizamos el temporizador
568
+
569
+ date = singleChat.items[singleChat.items.length - 1].date;
570
+ paramsQuery = {
571
+ getType: "loadMore",
572
+ id: JSON.stringify(dataChat.id),
573
+ version: JSON.stringify(dataChat.version),
574
+ date: encodeURIComponent(date)
575
+ };
576
+ _context5.next = 5;
577
+ return (0, _handle_http.fetchGET)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsQuery);
578
+
579
+ case 5:
580
+ response = _context5.sent;
581
+
582
+ if (response.body) {
583
+ _context5.next = 8;
584
+ break;
585
+ }
586
+
587
+ return _context5.abrupt("return", {
588
+ title: response.message,
589
+ message: response.errorDetail
590
+ });
591
+
592
+ case 8:
593
+ // success
594
+ // actualizar la lista de los users
595
+ updateAllUsers(response.body.users); // actualizar los items del chat
596
+
597
+ newSingleChat = (0, _objectSpread3.default)({}, singleChat);
598
+ newSingleChat.items = addOldItemsChat(newSingleChat.items, response.body.items);
599
+ newSingleChat.enabledLoadMore = response.body.items.length === 50;
600
+ setSingleChat(newSingleChat);
601
+
602
+ case 13:
603
+ case "end":
604
+ return _context5.stop();
605
+ }
606
+ }
607
+ }, _callee5);
387
608
  }));
388
- };
389
609
 
390
- // este GET obtiene la lista de compañoas con las que se puede chatear
391
- const getLoadMoreTicket = async () => {
392
- var _dataChat$currentUser5, _dataChat$currentUser6, _dataChat$currentUser7, _dataChat$currentUser8;
393
- stopUpdate(); // finalizamos el temporizador
394
- let date = singleChat.items[singleChat.items.length - 1].date;
395
- const dataUser = {
396
- id: (_dataChat$currentUser5 = dataChat.currentUser) === null || _dataChat$currentUser5 === void 0 ? void 0 : _dataChat$currentUser5.id,
397
- companyId: (_dataChat$currentUser6 = dataChat.currentUser) === null || _dataChat$currentUser6 === void 0 ? void 0 : _dataChat$currentUser6.companyId,
398
- isUserTech: (_dataChat$currentUser7 = dataChat.currentUser) === null || _dataChat$currentUser7 === void 0 ? void 0 : _dataChat$currentUser7.isUserTech
399
- };
400
- const paramsQuery = {
401
- id: JSON.stringify(dataChat.id),
402
- getType: "loadMore",
403
- date: encodeURIComponent(date),
404
- currentUser: (0, _utils.encodeUriJson)(dataUser),
405
- currentItemsFront: (0, _utils.encodeUriJson)(getItemsIdSingleChat())
610
+ return function getLoadMoreMerchantProduct() {
611
+ return _ref5.apply(this, arguments);
406
612
  };
407
- const response = await (0, _handle_http.fetchGET)(process.env.REACT_APP_TICKETS_CHAT_ENDPOINT, paramsQuery, {
408
- Authorization: (_dataChat$currentUser8 = dataChat.currentUser) === null || _dataChat$currentUser8 === void 0 ? void 0 : _dataChat$currentUser8.token
409
- });
410
- //programar update en 20s
411
- setStartUpdate(prev => prev + 1);
412
- if (!response.body) {
413
- return {
414
- title: response.message,
415
- message: response.errorDetail
416
- };
417
- }
418
- // success
419
- // actualizar la lista de los users
420
- updateAllUsers(response.body.users);
421
- // actualizar los items del chat
422
- let newSingleChat = {
423
- ...singleChat
613
+ }();
614
+
615
+ var getLoadMoreOrderProduct = /*#__PURE__*/function () {
616
+ var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
617
+ var company, date, paramsQuery, response;
618
+ return _regenerator.default.wrap(function _callee6$(_context6) {
619
+ while (1) {
620
+ switch (_context6.prev = _context6.next) {
621
+ case 0:
622
+ clearTimeout(processUpdateID); // finalizamos el temporizador
623
+
624
+ company = companies[activeCompanyId];
625
+ date = company.items[company.items.length - 1].date;
626
+ paramsQuery = {
627
+ getType: "loadMore",
628
+ id: JSON.stringify(dataChat.id),
629
+ orderId: JSON.stringify(dataChat.orderId),
630
+ version: JSON.stringify(currentArticle.version),
631
+ currentCompanyId: JSON.stringify(currentUser.companyId),
632
+ date: encodeURIComponent(date),
633
+ othersCompanyId: JSON.stringify([activeCompanyId])
634
+ };
635
+ _context6.next = 6;
636
+ return (0, _handle_http.fetchGET)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsQuery);
637
+
638
+ case 6:
639
+ response = _context6.sent;
640
+
641
+ if (response.body) {
642
+ _context6.next = 9;
643
+ break;
644
+ }
645
+
646
+ return _context6.abrupt("return", {
647
+ title: response.message,
648
+ message: response.errorDetail
649
+ });
650
+
651
+ case 9:
652
+ // success
653
+ // actualizar la lista de los users
654
+ updateAllUsers(response.body.users); // actualizar los items del chat y la lista de users
655
+
656
+ company.items = addOldItemsChat(company.items, response.body.items);
657
+ company.enabledLoadMore = response.body.items.length === 50;
658
+ setCompanies(function (prev) {
659
+ return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, activeCompanyId, company));
660
+ });
661
+
662
+ case 13:
663
+ case "end":
664
+ return _context6.stop();
665
+ }
666
+ }
667
+ }, _callee6);
668
+ }));
669
+
670
+ return function getLoadMoreOrderProduct() {
671
+ return _ref6.apply(this, arguments);
424
672
  };
425
- newSingleChat.items = addOldItemsChat(newSingleChat.items, response.body.items);
426
- newSingleChat.enabledLoadMore = response.body.items.length === 50;
427
- setSingleChat(newSingleChat);
428
- };
673
+ }(); // este GET obtiene la lista de compañoas con las que se puede chatear
674
+
675
+
676
+ var getLoadMoreTicket = /*#__PURE__*/function () {
677
+ var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
678
+ var _dataChat$currentUser5, _dataChat$currentUser6, _dataChat$currentUser7, _dataChat$currentUser8;
679
+
680
+ var date, dataUser, paramsQuery, response, newSingleChat;
681
+ return _regenerator.default.wrap(function _callee7$(_context7) {
682
+ while (1) {
683
+ switch (_context7.prev = _context7.next) {
684
+ case 0:
685
+ stopUpdate(); // finalizamos el temporizador
686
+
687
+ date = singleChat.items[singleChat.items.length - 1].date;
688
+ dataUser = {
689
+ id: (_dataChat$currentUser5 = dataChat.currentUser) === null || _dataChat$currentUser5 === void 0 ? void 0 : _dataChat$currentUser5.id,
690
+ companyId: (_dataChat$currentUser6 = dataChat.currentUser) === null || _dataChat$currentUser6 === void 0 ? void 0 : _dataChat$currentUser6.companyId,
691
+ isUserTech: (_dataChat$currentUser7 = dataChat.currentUser) === null || _dataChat$currentUser7 === void 0 ? void 0 : _dataChat$currentUser7.isUserTech
692
+ };
693
+ paramsQuery = {
694
+ id: JSON.stringify(dataChat.id),
695
+ getType: "loadMore",
696
+ date: encodeURIComponent(date),
697
+ currentUser: (0, _utils.encodeUriJson)(dataUser),
698
+ currentItemsFront: (0, _utils.encodeUriJson)(getItemsIdSingleChat())
699
+ };
700
+ _context7.next = 6;
701
+ return (0, _handle_http.fetchGET)(process.env.REACT_APP_TICKETS_CHAT_ENDPOINT, paramsQuery, {
702
+ Authorization: (_dataChat$currentUser8 = dataChat.currentUser) === null || _dataChat$currentUser8 === void 0 ? void 0 : _dataChat$currentUser8.token
703
+ });
704
+
705
+ case 6:
706
+ response = _context7.sent;
707
+ //programar update en 20s
708
+ setStartUpdate(function (prev) {
709
+ return prev + 1;
710
+ });
711
+
712
+ if (response.body) {
713
+ _context7.next = 10;
714
+ break;
715
+ }
429
716
 
717
+ return _context7.abrupt("return", {
718
+ title: response.message,
719
+ message: response.errorDetail
720
+ });
721
+
722
+ case 10:
723
+ // success
724
+ // actualizar la lista de los users
725
+ updateAllUsers(response.body.users); // actualizar los items del chat
726
+
727
+ newSingleChat = (0, _objectSpread3.default)({}, singleChat);
728
+ newSingleChat.items = addOldItemsChat(newSingleChat.items, response.body.items);
729
+ newSingleChat.enabledLoadMore = response.body.items.length === 50;
730
+ setSingleChat(newSingleChat);
731
+
732
+ case 15:
733
+ case "end":
734
+ return _context7.stop();
735
+ }
736
+ }
737
+ }, _callee7);
738
+ }));
739
+
740
+ return function getLoadMoreTicket() {
741
+ return _ref7.apply(this, arguments);
742
+ };
743
+ }();
430
744
  /*=======================================================================
431
745
  PETICION GET UPDATE_LATEST SEGUN EL TIPO DE CHAT
432
746
  ======================================================================= */
433
- const getUpdateLatestMerchantProduct = async function () {
434
- let fromUpdate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
435
- const paramsQuery = {
436
- getType: "updateLatest",
437
- id: JSON.stringify(dataChat.id),
438
- version: JSON.stringify(dataChat.version),
439
- date: encodeURIComponent(lastUpdateDate)
440
- };
441
- const paramsHeaders = {
442
- Authorization: dataChat.userToken
443
- };
444
- const response = await (0, _handle_http.fetchGET)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsQuery, paramsHeaders);
445
- if (!response.body) {
446
- console.log("ERROR updateLatest:", {
447
- message: response.message,
448
- errorDetail: response.errorDetail
449
- });
450
- return;
451
- }
452
- // success
453
- setStartUpdate(prev => prev + 1);
454
- setLastUpdateDate(response.body.data.lastUpdateDate);
455
- // actualizar la lista de los users
456
- updateAllUsers(response.body.users);
457
- // actualizar los items del chat
458
- let newSingleChat = {
459
- ...singleChat
460
- };
461
- newSingleChat.items = addNewItemsChat(newSingleChat.items, response.body.items, fromUpdate);
462
- setSingleChat(newSingleChat);
463
- };
464
- const getUpdateLatestOrderProduct = async function () {
465
- let fromUpdate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
466
- const paramsQuery = {
467
- getType: "updateLatest",
468
- id: JSON.stringify(dataChat.id),
469
- orderId: JSON.stringify(dataChat.orderId),
470
- retailerId: JSON.stringify(dataChat.retailerId),
471
- version: JSON.stringify(currentArticle.version),
472
- status: currentArticle.status,
473
- currentCompanyId: JSON.stringify(currentUser.companyId),
474
- othersCompanyId: encodeURIComponent(JSON.stringify(Object.keys(companies))),
475
- date: encodeURIComponent(lastUpdateDate)
476
- };
477
- const response = await (0, _handle_http.fetchGET)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsQuery);
478
- if (!response.body) {
479
- console.log("ERROR update: ", {
480
- message: response.message,
481
- errorDetail: response.errorDetail
482
- });
483
- return;
484
- }
485
- // success
486
- setStartUpdate(prev => prev + 1);
487
- // cuando cambie la lista de chats por un cambio de version o estatus
488
- if (response.body.data.status) {
489
- setIsLoading(true);
490
- setTimeout(() => {
491
- setLastUpdateDate(response.body.data.lastUpdateDate);
492
- setCurrentArticle({
493
- status: response.body.data.status,
494
- version: response.body.data.version
495
- });
496
- setAllUsers(response.body.users);
497
- const companiesList = response.body.companies;
498
- const companiesIdList = Object.keys(companiesList);
499
- let companyActive;
500
- // encontrar el chat inicial a cargar y si se debe permitir cargar mas
501
- for (const companyId of companiesIdList) {
502
- if (companiesList[companyId].items.length < 50) {
503
- companiesList[companyId].enabledLoadMore = false;
504
- } else {
505
- companiesList[companyId].enabledLoadMore = true;
506
- }
507
- if (companiesList[companyId].statusChat === "current") {
508
- companyActive = Number(companyId);
747
+
748
+
749
+ var getUpdateLatestMerchantProduct = /*#__PURE__*/function () {
750
+ var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
751
+ var fromUpdate,
752
+ paramsQuery,
753
+ paramsHeaders,
754
+ response,
755
+ newSingleChat,
756
+ _args8 = arguments;
757
+ return _regenerator.default.wrap(function _callee8$(_context8) {
758
+ while (1) {
759
+ switch (_context8.prev = _context8.next) {
760
+ case 0:
761
+ fromUpdate = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : false;
762
+ paramsQuery = {
763
+ getType: "updateLatest",
764
+ id: JSON.stringify(dataChat.id),
765
+ version: JSON.stringify(dataChat.version),
766
+ date: encodeURIComponent(lastUpdateDate)
767
+ };
768
+ paramsHeaders = {
769
+ Authorization: dataChat.userToken
770
+ };
771
+ _context8.next = 5;
772
+ return (0, _handle_http.fetchGET)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsQuery, paramsHeaders);
773
+
774
+ case 5:
775
+ response = _context8.sent;
776
+
777
+ if (response.body) {
778
+ _context8.next = 9;
779
+ break;
780
+ }
781
+
782
+ console.log("ERROR updateLatest:", {
783
+ message: response.message,
784
+ errorDetail: response.errorDetail
785
+ });
786
+ return _context8.abrupt("return");
787
+
788
+ case 9:
789
+ // success
790
+ setStartUpdate(function (prev) {
791
+ return prev + 1;
792
+ });
793
+ setLastUpdateDate(response.body.data.lastUpdateDate); // actualizar la lista de los users
794
+
795
+ updateAllUsers(response.body.users); // actualizar los items del chat
796
+
797
+ newSingleChat = (0, _objectSpread3.default)({}, singleChat);
798
+ newSingleChat.items = addNewItemsChat(newSingleChat.items, response.body.items, fromUpdate);
799
+ setSingleChat(newSingleChat);
800
+
801
+ case 15:
802
+ case "end":
803
+ return _context8.stop();
509
804
  }
510
805
  }
511
- if (!companyActive && companiesIdList.length) {
512
- companyActive = Number(companiesIdList[0]);
513
- }
514
- setCompanies(companiesList);
515
- if (companyActive) setActiveCompanyId(companyActive);
516
- setErrorChat({
517
- existError: false
518
- });
519
- setIsLoading(false);
520
- }, 2000);
521
- }
522
- // cuando se hizo un update de los mismos chats
523
- else {
524
- setLastUpdateDate(response.body.data.lastUpdateDate);
525
- // actualizar la lista de los users
526
- updateAllUsers(response.body.users);
527
- // actualizar los items de los chats
528
- let companiesList = {
529
- ...companies
530
- };
531
- Object.keys(response.body.companies).forEach(companyId => {
532
- companiesList[companyId].items = addNewItemsChat(companiesList[companyId].items, response.body.companies[companyId].items, fromUpdate);
533
- });
534
- setCompanies(companiesList);
535
- }
536
- };
537
- const getUpdateLatestTicket = async function () {
538
- var _dataChat$currentUser9, _dataChat$currentUser10, _dataChat$currentUser11, _dataChat$currentUser12;
539
- let fromUpdate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
540
- if (singleChat.statusChat === "closed") return;
541
- const dataUser = {
542
- id: (_dataChat$currentUser9 = dataChat.currentUser) === null || _dataChat$currentUser9 === void 0 ? void 0 : _dataChat$currentUser9.id,
543
- companyId: (_dataChat$currentUser10 = dataChat.currentUser) === null || _dataChat$currentUser10 === void 0 ? void 0 : _dataChat$currentUser10.companyId,
544
- isUserTech: (_dataChat$currentUser11 = dataChat.currentUser) === null || _dataChat$currentUser11 === void 0 ? void 0 : _dataChat$currentUser11.isUserTech
545
- };
546
- const paramsQuery = {
547
- id: JSON.stringify(dataChat.id),
548
- getType: "updateLatest",
549
- date: encodeURIComponent(lastUpdateDate),
550
- currentUser: (0, _utils.encodeUriJson)(dataUser),
551
- currentItemsFront: (0, _utils.encodeUriJson)(getItemsIdSingleChat())
806
+ }, _callee8);
807
+ }));
808
+
809
+ return function getUpdateLatestMerchantProduct() {
810
+ return _ref8.apply(this, arguments);
552
811
  };
553
- const response = await (0, _handle_http.fetchGET)(process.env.REACT_APP_TICKETS_CHAT_ENDPOINT, paramsQuery, {
554
- Authorization: (_dataChat$currentUser12 = dataChat.currentUser) === null || _dataChat$currentUser12 === void 0 ? void 0 : _dataChat$currentUser12.token
555
- });
556
- //programar update en 20s
557
- setStartUpdate(prev => prev + 1);
558
- if (!response.body) {
559
- if (errorUpdate.startDate) {
560
- setErrorUpdate(prev => ({
561
- ...prev,
562
- lastDate: new Date()
563
- }));
564
- } else {
565
- setErrorUpdate(prev => ({
566
- startDate: new Date()
567
- }));
568
- }
569
- console.log("ERROR updateLatest:", {
570
- message: response.message,
571
- errorDetail: response.errorDetail
572
- });
573
- return;
574
- }
575
- // limpiar error update
576
- if (errorUpdate.startDate) {
577
- setErrorUpdate({});
578
- }
579
- // success
580
- setLastUpdateDate(response.body.data.lastUpdateDate);
581
- // actualizar la lista de los users
582
- updateAllUsers(response.body.users);
583
- // actualizar los items del chat
584
- if (response.body.items.length === 0) return;
585
- let newSingleChat = {
586
- ...singleChat
812
+ }();
813
+
814
+ var getUpdateLatestOrderProduct = /*#__PURE__*/function () {
815
+ var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
816
+ var fromUpdate,
817
+ paramsQuery,
818
+ response,
819
+ companiesList,
820
+ _args9 = arguments;
821
+ return _regenerator.default.wrap(function _callee9$(_context9) {
822
+ while (1) {
823
+ switch (_context9.prev = _context9.next) {
824
+ case 0:
825
+ fromUpdate = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : false;
826
+ paramsQuery = {
827
+ getType: "updateLatest",
828
+ id: JSON.stringify(dataChat.id),
829
+ orderId: JSON.stringify(dataChat.orderId),
830
+ retailerId: JSON.stringify(dataChat.retailerId),
831
+ version: JSON.stringify(currentArticle.version),
832
+ status: currentArticle.status,
833
+ currentCompanyId: JSON.stringify(currentUser.companyId),
834
+ othersCompanyId: encodeURIComponent(JSON.stringify(Object.keys(companies))),
835
+ date: encodeURIComponent(lastUpdateDate)
836
+ };
837
+ _context9.next = 4;
838
+ return (0, _handle_http.fetchGET)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsQuery);
839
+
840
+ case 4:
841
+ response = _context9.sent;
842
+
843
+ if (response.body) {
844
+ _context9.next = 8;
845
+ break;
846
+ }
847
+
848
+ console.log("ERROR update: ", {
849
+ message: response.message,
850
+ errorDetail: response.errorDetail
851
+ });
852
+ return _context9.abrupt("return");
853
+
854
+ case 8:
855
+ // success
856
+ setStartUpdate(function (prev) {
857
+ return prev + 1;
858
+ }); // cuando cambie la lista de chats por un cambio de version o estatus
859
+
860
+ if (response.body.data.status) {
861
+ setIsLoading(true);
862
+ setTimeout(function () {
863
+ setLastUpdateDate(response.body.data.lastUpdateDate);
864
+ setCurrentArticle({
865
+ status: response.body.data.status,
866
+ version: response.body.data.version
867
+ });
868
+ setAllUsers(response.body.users);
869
+ var companiesList = response.body.companies;
870
+ var companiesIdList = Object.keys(companiesList);
871
+ var companyActive; // encontrar el chat inicial a cargar y si se debe permitir cargar mas
872
+
873
+ for (var _i2 = 0, _companiesIdList2 = companiesIdList; _i2 < _companiesIdList2.length; _i2++) {
874
+ var companyId = _companiesIdList2[_i2];
875
+
876
+ if (companiesList[companyId].items.length < 50) {
877
+ companiesList[companyId].enabledLoadMore = false;
878
+ } else {
879
+ companiesList[companyId].enabledLoadMore = true;
880
+ }
881
+
882
+ if (companiesList[companyId].statusChat === "current") {
883
+ companyActive = Number(companyId);
884
+ }
885
+ }
886
+
887
+ if (!companyActive && companiesIdList.length) {
888
+ companyActive = Number(companiesIdList[0]);
889
+ }
890
+
891
+ setCompanies(companiesList);
892
+ if (companyActive) setActiveCompanyId(companyActive);
893
+ setErrorChat({
894
+ existError: false
895
+ });
896
+ setIsLoading(false);
897
+ }, 2000);
898
+ } // cuando se hizo un update de los mismos chats
899
+ else {
900
+ setLastUpdateDate(response.body.data.lastUpdateDate); // actualizar la lista de los users
901
+
902
+ updateAllUsers(response.body.users); // actualizar los items de los chats
903
+
904
+ companiesList = (0, _objectSpread3.default)({}, companies);
905
+ Object.keys(response.body.companies).forEach(function (companyId) {
906
+ companiesList[companyId].items = addNewItemsChat(companiesList[companyId].items, response.body.companies[companyId].items, fromUpdate);
907
+ });
908
+ setCompanies(companiesList);
909
+ }
910
+
911
+ case 10:
912
+ case "end":
913
+ return _context9.stop();
914
+ }
915
+ }
916
+ }, _callee9);
917
+ }));
918
+
919
+ return function getUpdateLatestOrderProduct() {
920
+ return _ref9.apply(this, arguments);
587
921
  };
588
- newSingleChat.items = addNewItemsChat(newSingleChat.items, response.body.items, fromUpdate);
589
- newSingleChat.statusChat = response.body.data.statusChat;
590
- setSingleChat(newSingleChat);
591
- };
922
+ }();
923
+
924
+ var getUpdateLatestTicket = /*#__PURE__*/function () {
925
+ var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
926
+ var _dataChat$currentUser9, _dataChat$currentUser10, _dataChat$currentUser11, _dataChat$currentUser12;
927
+
928
+ var fromUpdate,
929
+ dataUser,
930
+ paramsQuery,
931
+ response,
932
+ newSingleChat,
933
+ _args10 = arguments;
934
+ return _regenerator.default.wrap(function _callee10$(_context10) {
935
+ while (1) {
936
+ switch (_context10.prev = _context10.next) {
937
+ case 0:
938
+ fromUpdate = _args10.length > 0 && _args10[0] !== undefined ? _args10[0] : false;
939
+
940
+ if (!(singleChat.statusChat === "closed")) {
941
+ _context10.next = 3;
942
+ break;
943
+ }
944
+
945
+ return _context10.abrupt("return");
946
+
947
+ case 3:
948
+ dataUser = {
949
+ id: (_dataChat$currentUser9 = dataChat.currentUser) === null || _dataChat$currentUser9 === void 0 ? void 0 : _dataChat$currentUser9.id,
950
+ companyId: (_dataChat$currentUser10 = dataChat.currentUser) === null || _dataChat$currentUser10 === void 0 ? void 0 : _dataChat$currentUser10.companyId,
951
+ isUserTech: (_dataChat$currentUser11 = dataChat.currentUser) === null || _dataChat$currentUser11 === void 0 ? void 0 : _dataChat$currentUser11.isUserTech
952
+ };
953
+ paramsQuery = {
954
+ id: JSON.stringify(dataChat.id),
955
+ getType: "updateLatest",
956
+ date: encodeURIComponent(lastUpdateDate),
957
+ currentUser: (0, _utils.encodeUriJson)(dataUser),
958
+ currentItemsFront: (0, _utils.encodeUriJson)(getItemsIdSingleChat())
959
+ };
960
+ _context10.next = 7;
961
+ return (0, _handle_http.fetchGET)(process.env.REACT_APP_TICKETS_CHAT_ENDPOINT, paramsQuery, {
962
+ Authorization: (_dataChat$currentUser12 = dataChat.currentUser) === null || _dataChat$currentUser12 === void 0 ? void 0 : _dataChat$currentUser12.token
963
+ });
592
964
 
965
+ case 7:
966
+ response = _context10.sent;
967
+ //programar update en 20s
968
+ setStartUpdate(function (prev) {
969
+ return prev + 1;
970
+ });
971
+
972
+ if (response.body) {
973
+ _context10.next = 13;
974
+ break;
975
+ }
976
+
977
+ if (errorUpdate.startDate) {
978
+ setErrorUpdate(function (prev) {
979
+ return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
980
+ lastDate: new Date()
981
+ });
982
+ });
983
+ } else {
984
+ setErrorUpdate(function (prev) {
985
+ return {
986
+ startDate: new Date()
987
+ };
988
+ });
989
+ }
990
+
991
+ console.log("ERROR updateLatest:", {
992
+ message: response.message,
993
+ errorDetail: response.errorDetail
994
+ });
995
+ return _context10.abrupt("return");
996
+
997
+ case 13:
998
+ // limpiar error update
999
+ if (errorUpdate.startDate) {
1000
+ setErrorUpdate({});
1001
+ } // success
1002
+
1003
+
1004
+ setLastUpdateDate(response.body.data.lastUpdateDate); // actualizar la lista de los users
1005
+
1006
+ updateAllUsers(response.body.users); // actualizar los items del chat
1007
+
1008
+ if (!(response.body.items.length === 0)) {
1009
+ _context10.next = 18;
1010
+ break;
1011
+ }
1012
+
1013
+ return _context10.abrupt("return");
1014
+
1015
+ case 18:
1016
+ newSingleChat = (0, _objectSpread3.default)({}, singleChat);
1017
+ newSingleChat.items = addNewItemsChat(newSingleChat.items, response.body.items, fromUpdate);
1018
+ newSingleChat.statusChat = response.body.data.statusChat;
1019
+ setSingleChat(newSingleChat);
1020
+
1021
+ case 22:
1022
+ case "end":
1023
+ return _context10.stop();
1024
+ }
1025
+ }
1026
+ }, _callee10);
1027
+ }));
1028
+
1029
+ return function getUpdateLatestTicket() {
1030
+ return _ref10.apply(this, arguments);
1031
+ };
1032
+ }();
593
1033
  /*=======================================================================
594
1034
  FUNCION QUE EJECUTA EL MICROSERVICIO CREATE-ITEM
595
1035
  Este metodo recibe los items que queremos agregar al chat.
@@ -601,188 +1041,455 @@ const ContentChat = props => {
601
1041
  value: "mi mensaje"
602
1042
  } ]
603
1043
  ======================================================================= */
604
- const createItemsChat = async function () {
605
- let items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
606
- if (items.length === 0) {
607
- return {
608
- message: "No se especifico ningun mensaje, imagen o archivo nuevo " + "que se quiera enviar al chat",
609
- errorDetail: "Reporta esto a TI"
610
- };
611
- }
612
- for (const item of items) {
613
- if (!["message", "img", "file"].includes(item.type)) {
614
- return {
615
- message: "Uno de los elementos que se quiere enviar al chat " + "no es un tipo valido \"".concat(item.type, "\""),
616
- errorDetail: "Reporta esto a TI"
617
- };
618
- }
619
- if ((0, _utils.isStringEmpty)(item.value)) {
620
- return {
621
- message: "Uno de los elementos que se quiere enviar al chat " + "contiene un valor vacio",
622
- errorDetail: "Reporta esto a TI"
623
- };
624
- }
625
- }
626
- let errorCreate;
627
- stopUpdate(); // finalizamos el temporizador
628
1044
 
629
- // enviar items a la BD
630
- if (chatType === "merchant_product") {
631
- errorCreate = await createItemsMerchantProduct(items);
632
- } else if (chatType === "product_status") {
633
- errorCreate = await createItemsProductStatus(items);
634
- } else if (chatType === "order_product") {
635
- errorCreate = await createItemsOrderProduct(items);
636
- } else errorCreate = await createItemsTicket(items);
637
1045
 
638
- // actualizar chat para que aparezcan los items enviados
639
- if (["merchant_product", "product_status"].includes(chatType)) {
640
- await getUpdateLatestMerchantProduct();
641
- } else if (chatType === "order_product") {
642
- await getUpdateLatestOrderProduct();
643
- } else await getUpdateLatestTicket();
1046
+ var createItemsChat = /*#__PURE__*/function () {
1047
+ var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
1048
+ var items,
1049
+ _iterator,
1050
+ _step,
1051
+ item,
1052
+ errorCreate,
1053
+ _args11 = arguments;
644
1054
 
645
- // cuando no se pudieron guardar los items
646
- if (errorCreate) {
647
- return errorCreate;
648
- }
649
- };
650
- const createItemsMerchantProduct = async function () {
651
- let items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
652
- const {
653
- id,
654
- version,
655
- orderId
656
- } = dataChat;
657
- const {
658
- id: retailerId
659
- } = activeRetailer;
660
- const paramsBody = {
661
- id,
662
- version,
663
- items,
664
- retailerId
665
- };
666
- if (chatType === "product_status") paramsBody["orderId"] = orderId;
667
- const paramsHeaders = {
668
- Authorization: dataChat.userToken
669
- };
670
- const response = await (0, _handle_http.fetchPOST)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsBody, paramsHeaders);
671
- if (!response.body) {
672
- return {
673
- message: response.message,
674
- errorDetail: response.errorDetail
675
- };
676
- }
677
- };
678
- const createItemsProductStatus = async function () {
679
- let items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
680
- const {
681
- id,
682
- version,
683
- orderId,
684
- status
685
- } = dataChat;
686
- const {
687
- id: retailerId
688
- } = activeRetailer;
689
- const paramsBody = {
690
- id,
691
- version,
692
- items,
693
- retailerId,
694
- orderId,
695
- status
696
- };
697
- const paramsHeaders = {
698
- Authorization: dataChat.userToken
699
- };
700
- const response = await (0, _handle_http.fetchPOST)(process.env.REACT_APP_CREATE_MESSAGES, paramsBody, paramsHeaders);
701
- if (!response.body) {
702
- return {
703
- message: response.message,
704
- errorDetail: response.errorDetail
705
- };
706
- }
707
- };
708
- const createItemsOrderProduct = async function () {
709
- let items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
710
- const paramsBody = {
711
- id: dataChat.id,
712
- version: currentArticle.version,
713
- items,
714
- orderId: dataChat.orderId,
715
- retailerId: activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id
1055
+ return _regenerator.default.wrap(function _callee11$(_context11) {
1056
+ while (1) {
1057
+ switch (_context11.prev = _context11.next) {
1058
+ case 0:
1059
+ items = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : [];
1060
+
1061
+ if (!(items.length === 0)) {
1062
+ _context11.next = 3;
1063
+ break;
1064
+ }
1065
+
1066
+ return _context11.abrupt("return", {
1067
+ message: "No se especifico ningun mensaje, imagen o archivo nuevo " + "que se quiera enviar al chat",
1068
+ errorDetail: "Reporta esto a TI"
1069
+ });
1070
+
1071
+ case 3:
1072
+ _iterator = (0, _createForOfIteratorHelper2.default)(items);
1073
+ _context11.prev = 4;
1074
+
1075
+ _iterator.s();
1076
+
1077
+ case 6:
1078
+ if ((_step = _iterator.n()).done) {
1079
+ _context11.next = 14;
1080
+ break;
1081
+ }
1082
+
1083
+ item = _step.value;
1084
+
1085
+ if (["message", "img", "file"].includes(item.type)) {
1086
+ _context11.next = 10;
1087
+ break;
1088
+ }
1089
+
1090
+ return _context11.abrupt("return", {
1091
+ message: "Uno de los elementos que se quiere enviar al chat " + "no es un tipo valido \"".concat(item.type, "\""),
1092
+ errorDetail: "Reporta esto a TI"
1093
+ });
1094
+
1095
+ case 10:
1096
+ if (!(0, _utils.isStringEmpty)(item.value)) {
1097
+ _context11.next = 12;
1098
+ break;
1099
+ }
1100
+
1101
+ return _context11.abrupt("return", {
1102
+ message: "Uno de los elementos que se quiere enviar al chat " + "contiene un valor vacio",
1103
+ errorDetail: "Reporta esto a TI"
1104
+ });
1105
+
1106
+ case 12:
1107
+ _context11.next = 6;
1108
+ break;
1109
+
1110
+ case 14:
1111
+ _context11.next = 19;
1112
+ break;
1113
+
1114
+ case 16:
1115
+ _context11.prev = 16;
1116
+ _context11.t0 = _context11["catch"](4);
1117
+
1118
+ _iterator.e(_context11.t0);
1119
+
1120
+ case 19:
1121
+ _context11.prev = 19;
1122
+
1123
+ _iterator.f();
1124
+
1125
+ return _context11.finish(19);
1126
+
1127
+ case 22:
1128
+ stopUpdate(); // finalizamos el temporizador
1129
+ // enviar items a la BD
1130
+
1131
+ if (!(chatType === "merchant_product")) {
1132
+ _context11.next = 29;
1133
+ break;
1134
+ }
1135
+
1136
+ _context11.next = 26;
1137
+ return createItemsMerchantProduct(items);
1138
+
1139
+ case 26:
1140
+ errorCreate = _context11.sent;
1141
+ _context11.next = 44;
1142
+ break;
1143
+
1144
+ case 29:
1145
+ if (!(chatType === "product_status")) {
1146
+ _context11.next = 35;
1147
+ break;
1148
+ }
1149
+
1150
+ _context11.next = 32;
1151
+ return createItemsProductStatus(items);
1152
+
1153
+ case 32:
1154
+ errorCreate = _context11.sent;
1155
+ _context11.next = 44;
1156
+ break;
1157
+
1158
+ case 35:
1159
+ if (!(chatType === "order_product")) {
1160
+ _context11.next = 41;
1161
+ break;
1162
+ }
1163
+
1164
+ _context11.next = 38;
1165
+ return createItemsOrderProduct(items);
1166
+
1167
+ case 38:
1168
+ errorCreate = _context11.sent;
1169
+ _context11.next = 44;
1170
+ break;
1171
+
1172
+ case 41:
1173
+ _context11.next = 43;
1174
+ return createItemsTicket(items);
1175
+
1176
+ case 43:
1177
+ errorCreate = _context11.sent;
1178
+
1179
+ case 44:
1180
+ if (!["merchant_product", "product_status"].includes(chatType)) {
1181
+ _context11.next = 49;
1182
+ break;
1183
+ }
1184
+
1185
+ _context11.next = 47;
1186
+ return getUpdateLatestMerchantProduct();
1187
+
1188
+ case 47:
1189
+ _context11.next = 56;
1190
+ break;
1191
+
1192
+ case 49:
1193
+ if (!(chatType === "order_product")) {
1194
+ _context11.next = 54;
1195
+ break;
1196
+ }
1197
+
1198
+ _context11.next = 52;
1199
+ return getUpdateLatestOrderProduct();
1200
+
1201
+ case 52:
1202
+ _context11.next = 56;
1203
+ break;
1204
+
1205
+ case 54:
1206
+ _context11.next = 56;
1207
+ return getUpdateLatestTicket();
1208
+
1209
+ case 56:
1210
+ if (!errorCreate) {
1211
+ _context11.next = 58;
1212
+ break;
1213
+ }
1214
+
1215
+ return _context11.abrupt("return", errorCreate);
1216
+
1217
+ case 58:
1218
+ case "end":
1219
+ return _context11.stop();
1220
+ }
1221
+ }
1222
+ }, _callee11, null, [[4, 16, 19, 22]]);
1223
+ }));
1224
+
1225
+ return function createItemsChat() {
1226
+ return _ref11.apply(this, arguments);
716
1227
  };
717
- const paramsHeaders = {
718
- Authorization: dataChat.userToken
1228
+ }();
1229
+
1230
+ var createItemsMerchantProduct = /*#__PURE__*/function () {
1231
+ var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
1232
+ var items,
1233
+ id,
1234
+ version,
1235
+ orderId,
1236
+ retailerId,
1237
+ paramsBody,
1238
+ paramsHeaders,
1239
+ response,
1240
+ _args12 = arguments;
1241
+ return _regenerator.default.wrap(function _callee12$(_context12) {
1242
+ while (1) {
1243
+ switch (_context12.prev = _context12.next) {
1244
+ case 0:
1245
+ items = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : [];
1246
+ id = dataChat.id, version = dataChat.version, orderId = dataChat.orderId;
1247
+ retailerId = activeRetailer.id;
1248
+ paramsBody = {
1249
+ id: id,
1250
+ version: version,
1251
+ items: items,
1252
+ retailerId: retailerId
1253
+ };
1254
+ if (chatType === "product_status") paramsBody["orderId"] = orderId;
1255
+ paramsHeaders = {
1256
+ Authorization: dataChat.userToken
1257
+ };
1258
+ _context12.next = 8;
1259
+ return (0, _handle_http.fetchPOST)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsBody, paramsHeaders);
1260
+
1261
+ case 8:
1262
+ response = _context12.sent;
1263
+
1264
+ if (response.body) {
1265
+ _context12.next = 11;
1266
+ break;
1267
+ }
1268
+
1269
+ return _context12.abrupt("return", {
1270
+ message: response.message,
1271
+ errorDetail: response.errorDetail
1272
+ });
1273
+
1274
+ case 11:
1275
+ case "end":
1276
+ return _context12.stop();
1277
+ }
1278
+ }
1279
+ }, _callee12);
1280
+ }));
1281
+
1282
+ return function createItemsMerchantProduct() {
1283
+ return _ref12.apply(this, arguments);
719
1284
  };
720
- const response = await (0, _handle_http.fetchPOST)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsBody, paramsHeaders);
721
- if (!response.body) {
722
- return {
723
- message: response.message,
724
- errorDetail: response.errorDetail
725
- };
726
- }
727
- };
728
- const createItemsTicket = async function () {
729
- let items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
730
- const paramsBody = {
731
- id: JSON.stringify(dataChat.id),
732
- userId: JSON.stringify(dataChat.currentUser.id),
733
- items: JSON.stringify(items)
1285
+ }();
1286
+
1287
+ var createItemsProductStatus = /*#__PURE__*/function () {
1288
+ var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
1289
+ var items,
1290
+ id,
1291
+ version,
1292
+ orderId,
1293
+ status,
1294
+ retailerId,
1295
+ paramsBody,
1296
+ paramsHeaders,
1297
+ response,
1298
+ _args13 = arguments;
1299
+ return _regenerator.default.wrap(function _callee13$(_context13) {
1300
+ while (1) {
1301
+ switch (_context13.prev = _context13.next) {
1302
+ case 0:
1303
+ items = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : [];
1304
+ id = dataChat.id, version = dataChat.version, orderId = dataChat.orderId, status = dataChat.status;
1305
+ retailerId = activeRetailer.id;
1306
+ paramsBody = {
1307
+ id: id,
1308
+ version: version,
1309
+ items: items,
1310
+ retailerId: retailerId,
1311
+ orderId: orderId,
1312
+ status: status
1313
+ };
1314
+ paramsHeaders = {
1315
+ Authorization: dataChat.userToken
1316
+ };
1317
+ _context13.next = 7;
1318
+ return (0, _handle_http.fetchPOST)(process.env.REACT_APP_CREATE_MESSAGES, paramsBody, paramsHeaders);
1319
+
1320
+ case 7:
1321
+ response = _context13.sent;
1322
+
1323
+ if (response.body) {
1324
+ _context13.next = 10;
1325
+ break;
1326
+ }
1327
+
1328
+ return _context13.abrupt("return", {
1329
+ message: response.message,
1330
+ errorDetail: response.errorDetail
1331
+ });
1332
+
1333
+ case 10:
1334
+ case "end":
1335
+ return _context13.stop();
1336
+ }
1337
+ }
1338
+ }, _callee13);
1339
+ }));
1340
+
1341
+ return function createItemsProductStatus() {
1342
+ return _ref13.apply(this, arguments);
734
1343
  };
735
- const paramsHeaders = {
736
- Authorization: dataChat.userToken
1344
+ }();
1345
+
1346
+ var createItemsOrderProduct = /*#__PURE__*/function () {
1347
+ var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
1348
+ var items,
1349
+ paramsBody,
1350
+ paramsHeaders,
1351
+ response,
1352
+ _args14 = arguments;
1353
+ return _regenerator.default.wrap(function _callee14$(_context14) {
1354
+ while (1) {
1355
+ switch (_context14.prev = _context14.next) {
1356
+ case 0:
1357
+ items = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : [];
1358
+ paramsBody = {
1359
+ id: dataChat.id,
1360
+ version: currentArticle.version,
1361
+ items: items,
1362
+ orderId: dataChat.orderId,
1363
+ retailerId: activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id
1364
+ };
1365
+ paramsHeaders = {
1366
+ Authorization: dataChat.userToken
1367
+ };
1368
+ _context14.next = 5;
1369
+ return (0, _handle_http.fetchPOST)(process.env.REACT_APP_PRODUCTS_CHAT_ENDPOINT, paramsBody, paramsHeaders);
1370
+
1371
+ case 5:
1372
+ response = _context14.sent;
1373
+
1374
+ if (response.body) {
1375
+ _context14.next = 8;
1376
+ break;
1377
+ }
1378
+
1379
+ return _context14.abrupt("return", {
1380
+ message: response.message,
1381
+ errorDetail: response.errorDetail
1382
+ });
1383
+
1384
+ case 8:
1385
+ case "end":
1386
+ return _context14.stop();
1387
+ }
1388
+ }
1389
+ }, _callee14);
1390
+ }));
1391
+
1392
+ return function createItemsOrderProduct() {
1393
+ return _ref14.apply(this, arguments);
737
1394
  };
738
- const response = await (0, _handle_http.fetchPOST)(process.env.REACT_APP_TICKETS_CHAT_ENDPOINT, paramsBody, paramsHeaders);
739
- if (!response.body) {
740
- return {
741
- message: response.message,
742
- errorDetail: response.errorDetail
743
- };
744
- }
745
- };
1395
+ }();
1396
+
1397
+ var createItemsTicket = /*#__PURE__*/function () {
1398
+ var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
1399
+ var items,
1400
+ paramsBody,
1401
+ paramsHeaders,
1402
+ response,
1403
+ _args15 = arguments;
1404
+ return _regenerator.default.wrap(function _callee15$(_context15) {
1405
+ while (1) {
1406
+ switch (_context15.prev = _context15.next) {
1407
+ case 0:
1408
+ items = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : [];
1409
+ paramsBody = {
1410
+ id: JSON.stringify(dataChat.id),
1411
+ userId: JSON.stringify(dataChat.currentUser.id),
1412
+ items: JSON.stringify(items)
1413
+ };
1414
+ paramsHeaders = {
1415
+ Authorization: dataChat.userToken
1416
+ };
1417
+ _context15.next = 5;
1418
+ return (0, _handle_http.fetchPOST)(process.env.REACT_APP_TICKETS_CHAT_ENDPOINT, paramsBody, paramsHeaders);
1419
+
1420
+ case 5:
1421
+ response = _context15.sent;
1422
+
1423
+ if (response.body) {
1424
+ _context15.next = 8;
1425
+ break;
1426
+ }
1427
+
1428
+ return _context15.abrupt("return", {
1429
+ message: response.message,
1430
+ errorDetail: response.errorDetail
1431
+ });
1432
+
1433
+ case 8:
1434
+ case "end":
1435
+ return _context15.stop();
1436
+ }
1437
+ }
1438
+ }, _callee15);
1439
+ }));
746
1440
 
1441
+ return function createItemsTicket() {
1442
+ return _ref15.apply(this, arguments);
1443
+ };
1444
+ }();
747
1445
  /*=======================================================================
748
1446
  SECCION DE FUNCIONES
749
1447
  ======================================================================= */
750
- const isSingleChat = () => {
1448
+
1449
+
1450
+ var isSingleChat = function isSingleChat() {
751
1451
  if (chatType === "merchant_product" || chatType === "ticket" || chatType === "product_status") {
752
1452
  return true;
753
1453
  }
1454
+
754
1455
  if (companies && Object.keys(companies).length < 2) return true;else return false;
755
1456
  };
756
- const getItemsIdSingleChat = () => {
757
- const itemsId = {};
1457
+
1458
+ var getItemsIdSingleChat = function getItemsIdSingleChat() {
1459
+ var itemsId = {};
1460
+
758
1461
  if (Array.isArray(singleChat.items)) {
759
- singleChat.items.forEach(item => {
1462
+ singleChat.items.forEach(function (item) {
760
1463
  if ((0, _utils.isValidNaturalNumber)(item.id)) itemsId[item.id] = true;
761
1464
  });
762
1465
  }
1466
+
763
1467
  return itemsId;
764
1468
  };
765
- const getChatCompany = () => {
1469
+
1470
+ var getChatCompany = function getChatCompany() {
766
1471
  if (chatType === "merchant_product" || chatType === "ticket") {
767
1472
  return undefined;
768
1473
  }
1474
+
769
1475
  if (companies && companies[activeCompanyId]) {
770
- return {
771
- ...companies[activeCompanyId],
1476
+ return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, companies[activeCompanyId]), {}, {
772
1477
  id: activeCompanyId
773
- };
1478
+ });
774
1479
  }
1480
+
775
1481
  return undefined;
776
1482
  };
777
- const addOldItemsChat = function () {
778
- let currentItems = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
779
- let newItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
780
- let items = currentItems.slice();
781
- let itemsId = {};
782
- items.forEach(item => {
1483
+
1484
+ var addOldItemsChat = function addOldItemsChat() {
1485
+ var currentItems = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1486
+ var newItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
1487
+ var items = currentItems.slice();
1488
+ var itemsId = {};
1489
+ items.forEach(function (item) {
783
1490
  itemsId[item.id] = true;
784
1491
  });
785
- newItems.forEach(item => {
1492
+ newItems.forEach(function (item) {
786
1493
  if (!itemsId[item.id]) {
787
1494
  items.push(item);
788
1495
  itemsId[item.id] = true;
@@ -790,29 +1497,32 @@ const ContentChat = props => {
790
1497
  });
791
1498
  return items;
792
1499
  };
793
- const addNewItemsChat = function () {
794
- let currentItems = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
795
- let newItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
796
- let fromUpdate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
797
- let itemsId = {};
798
- currentItems.forEach(item => {
1500
+
1501
+ var addNewItemsChat = function addNewItemsChat() {
1502
+ var currentItems = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1503
+ var newItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
1504
+ var fromUpdate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1505
+ var itemsId = {};
1506
+ currentItems.forEach(function (item) {
799
1507
  itemsId[item.id] = item;
800
1508
  });
801
- let thereAreNewItems = false;
802
- newItems.forEach(newitem => {
1509
+ var thereAreNewItems = false;
1510
+ newItems.forEach(function (newitem) {
803
1511
  if (!itemsId[newitem.id]) {
804
1512
  itemsId[newitem.id] = newitem;
805
1513
  thereAreNewItems = true;
806
1514
  }
807
1515
  });
1516
+
808
1517
  if (thereAreNewItems && fromUpdate) {
809
1518
  setPlaySound(true);
810
- setTimeout(() => {
1519
+ setTimeout(function () {
811
1520
  setPlaySound(false);
812
1521
  }, 5000);
813
1522
  }
1523
+
814
1524
  if (chatType !== "ticket") {
815
- return Object.values(itemsId).sort((a, b) => {
1525
+ return Object.values(itemsId).sort(function (a, b) {
816
1526
  if (a.id > b.id) return 1;
817
1527
  if (a.id < b.id) return -1;
818
1528
  return 0;
@@ -821,46 +1531,49 @@ const ContentChat = props => {
821
1531
  return Object.values(itemsId).reverse();
822
1532
  }
823
1533
  };
824
- const updateAllUsers = function () {
825
- let newUsers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
826
- let currentUsers = {
827
- ...allUsers
828
- };
829
- Object.keys(newUsers).forEach(userId => {
1534
+
1535
+ var updateAllUsers = function updateAllUsers() {
1536
+ var newUsers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1537
+ var currentUsers = (0, _objectSpread3.default)({}, allUsers);
1538
+ Object.keys(newUsers).forEach(function (userId) {
830
1539
  if (!currentUsers[userId]) {
831
1540
  currentUsers[userId] = newUsers[userId];
832
1541
  }
833
1542
  });
834
1543
  setAllUsers(currentUsers);
835
1544
  };
836
- const renderBodyChat = () => {
1545
+
1546
+ var renderBodyChat = function renderBodyChat() {
837
1547
  if (isLoading) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {});
1548
+
838
1549
  if (errorChat.existError) {
839
1550
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_NotFound.NotFound, {
840
1551
  code: errorChat.code,
841
1552
  message: errorChat.message,
842
1553
  details: errorChat.errorDetail
843
1554
  });
844
- }
845
- // cuando se quiere ver la lista de chats
1555
+ } // cuando se quiere ver la lista de chats
1556
+
1557
+
846
1558
  if (showChatsList) {
847
1559
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChatLists.ChatLists, {
848
1560
  companies: companies,
849
1561
  currentCompanyId: currentUser === null || currentUser === void 0 ? void 0 : currentUser.companyId,
850
- onClickCompany: companyIdSelected => {
1562
+ onClickCompany: function onClickCompany(companyIdSelected) {
851
1563
  setActiveCompanyId(Number(companyIdSelected));
852
1564
  setShowChatsList(false);
853
1565
  }
854
1566
  });
855
- }
856
- // mostrar chat?
857
- let items;
858
- let enabledLoadMore;
1567
+ } // mostrar chat?
1568
+
1569
+
1570
+ var items;
1571
+ var enabledLoadMore;
1572
+
859
1573
  if (["merchant_product", "ticket", "product_status"].includes(chatType)) {
860
1574
  items = singleChat.items;
861
1575
  enabledLoadMore = singleChat.enabledLoadMore;
862
- }
863
- // ORDER_PRODUCT
1576
+ } // ORDER_PRODUCT
864
1577
  else if (companies) {
865
1578
  // caso 0 chats
866
1579
  if (Object.keys(companies).length === 0) {
@@ -876,16 +1589,20 @@ const ContentChat = props => {
876
1589
  children: "De acuerdo al estatus del producto, tu compa\xF1ia no tiene disponible ningun chat abierto o cerrado"
877
1590
  })]
878
1591
  });
879
- }
880
- // caso 1 o mas chats
1592
+ } // caso 1 o mas chats
1593
+
1594
+
881
1595
  if (companies[activeCompanyId]) {
882
1596
  items = companies[activeCompanyId].items;
883
1597
  enabledLoadMore = companies[activeCompanyId].enabledLoadMore;
884
1598
  }
885
1599
  }
1600
+
886
1601
  if (items) {
887
1602
  var _getChatCompany, _getChatCompany2;
888
- let containerItems = null;
1603
+
1604
+ var containerItems = null;
1605
+
889
1606
  if (items.length) {
890
1607
  containerItems = /*#__PURE__*/(0, _jsxRuntime.jsx)(_ContainerItems.ContainerItems, {
891
1608
  items: items,
@@ -911,6 +1628,7 @@ const ContentChat = props => {
911
1628
  })]
912
1629
  });
913
1630
  }
1631
+
914
1632
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
915
1633
  children: [containerItems, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Footer.Footer, {
916
1634
  chatType: chatType,
@@ -935,8 +1653,10 @@ const ContentChat = props => {
935
1653
  })]
936
1654
  });
937
1655
  }
1656
+
938
1657
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {});
939
1658
  };
1659
+
940
1660
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
941
1661
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
942
1662
  children: [(chatContainerType !== "fixed" || !isSingleChat()) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Header.Header, {
@@ -945,7 +1665,7 @@ const ContentChat = props => {
945
1665
  showChatsList: showChatsList,
946
1666
  chatCompany: getChatCompany(),
947
1667
  multipleCompanies: !isSingleChat(),
948
- onClickBtnChooseChat: () => {
1668
+ onClickBtnChooseChat: function onClickBtnChooseChat() {
949
1669
  setShowChatsList(true);
950
1670
  }
951
1671
  }), renderBodyChat()]
@@ -955,4 +1675,5 @@ const ContentChat = props => {
955
1675
  })]
956
1676
  });
957
1677
  };
1678
+
958
1679
  exports.ContentChat = ContentChat;