crmbonus-component-wake 2.0.128 → 2.0.130

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 (370) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +7 -0
  2. package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
  3. package/dist/cjs/app-modal.cjs.entry.js +28 -0
  4. package/dist/cjs/app-modal.cjs.entry.js.map +1 -0
  5. package/dist/cjs/cart.helper-d4d8d619.js +77 -0
  6. package/dist/cjs/cart.helper-d4d8d619.js.map +1 -0
  7. package/dist/cjs/countdown-timer_2.cjs.entry.js +63 -0
  8. package/dist/cjs/countdown-timer_2.cjs.entry.js.map +1 -0
  9. package/dist/cjs/crm-bonus-form.cjs.entry.js +104 -0
  10. package/dist/cjs/crm-bonus-form.cjs.entry.js.map +1 -0
  11. package/dist/cjs/crm-bonus-note.cjs.entry.js +101 -0
  12. package/dist/cjs/crm-bonus-note.cjs.entry.js.map +1 -0
  13. package/dist/cjs/crm-bonus.cjs.entry.js +249 -0
  14. package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -0
  15. package/dist/cjs/crm-giftback-form_2.cjs.entry.js +253 -0
  16. package/dist/{crmbonus-component-wake/crm-giftback-form.entry.js.map → cjs/crm-giftback-form_2.cjs.entry.js.map} +1 -1
  17. package/dist/cjs/crm-tooltip_4.cjs.entry.js +211 -0
  18. package/dist/cjs/crm-tooltip_4.cjs.entry.js.map +1 -0
  19. package/dist/cjs/crmbonus-component-wake.cjs.js +27 -0
  20. package/dist/cjs/crmbonus-component-wake.cjs.js.map +1 -0
  21. package/dist/cjs/crmbonus.service-9067d00d.js +3877 -0
  22. package/dist/cjs/crmbonus.service-9067d00d.js.map +1 -0
  23. package/dist/cjs/giftback-finish_4.cjs.entry.js +131 -0
  24. package/dist/cjs/giftback-finish_4.cjs.entry.js.map +1 -0
  25. package/dist/cjs/i18n-f2a6f60e.js +2219 -0
  26. package/dist/cjs/i18n-f2a6f60e.js.map +1 -0
  27. package/dist/cjs/index-6054ed44.js +21 -0
  28. package/dist/cjs/index-6054ed44.js.map +1 -0
  29. package/dist/cjs/index-d11684bd.js +1599 -0
  30. package/dist/cjs/index-d11684bd.js.map +1 -0
  31. package/dist/cjs/index.cjs.js +11 -0
  32. package/dist/cjs/index.cjs.js.map +1 -0
  33. package/dist/cjs/info.config.helper-c5d9f781.js +16 -0
  34. package/dist/cjs/info.config.helper-c5d9f781.js.map +1 -0
  35. package/dist/cjs/keys.storage-de7744aa.js +17 -0
  36. package/dist/cjs/keys.storage-de7744aa.js.map +1 -0
  37. package/dist/cjs/loader.cjs.js +17 -0
  38. package/dist/cjs/loader.cjs.js.map +1 -0
  39. package/dist/cjs/loading-spinner.cjs.entry.js +24 -0
  40. package/dist/cjs/loading-spinner.cjs.entry.js.map +1 -0
  41. package/dist/cjs/pedido-finalizado.cjs.entry.js +39 -0
  42. package/dist/cjs/pedido-finalizado.cjs.entry.js.map +1 -0
  43. package/dist/cjs/phone-cancel-input.cjs.entry.js +25 -0
  44. package/dist/cjs/phone-cancel-input.cjs.entry.js.map +1 -0
  45. package/dist/cjs/phone-input-mask.cjs.entry.js +61 -0
  46. package/dist/cjs/phone-input-mask.cjs.entry.js.map +1 -0
  47. package/dist/cjs/phone-input.cjs.entry.js +25 -0
  48. package/dist/cjs/phone-input.cjs.entry.js.map +1 -0
  49. package/dist/cjs/utils-e9413ee3.js +25 -0
  50. package/dist/cjs/utils-e9413ee3.js.map +1 -0
  51. package/dist/collection/assets/svg/info-circle-svgrepo-com.svg +6 -0
  52. package/dist/collection/assets/svg/money-dollars-svgrepo-com.svg +6 -0
  53. package/dist/collection/collection-manifest.json +32 -0
  54. package/dist/collection/components/button/crm-button.css +22 -0
  55. package/dist/collection/components/button/index.js +76 -0
  56. package/dist/collection/components/button/index.js.map +1 -0
  57. package/dist/collection/components/countdown-timer/countdown-timer.js +81 -0
  58. package/dist/collection/components/countdown-timer/countdown-timer.js.map +1 -0
  59. package/dist/collection/components/crm-bonus/assets/logo.svg +18 -0
  60. package/dist/collection/components/crm-bonus/assets/success-svgrepo-com.svg +8 -0
  61. package/dist/collection/components/crm-bonus/assets/svg/logo.svg +18 -0
  62. package/dist/collection/components/crm-bonus/assets/svg/success-svgrepo-com.svg +8 -0
  63. package/dist/collection/components/crm-bonus/crm-bonus.css +84 -0
  64. package/dist/collection/components/crm-bonus/crm-bonus.js +313 -0
  65. package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -0
  66. package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +19 -0
  67. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +348 -0
  68. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +1 -0
  69. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css +10 -0
  70. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +20 -0
  71. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js.map +1 -0
  72. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css +70 -0
  73. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +126 -0
  74. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js.map +1 -0
  75. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css +110 -0
  76. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +127 -0
  77. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +1 -0
  78. package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.css +108 -0
  79. package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js +110 -0
  80. package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js.map +1 -0
  81. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +75 -0
  82. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +1 -0
  83. package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js +75 -0
  84. package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js.map +1 -0
  85. package/dist/collection/components/giftback-form/giftback-form.css +75 -0
  86. package/dist/collection/components/giftback-form/giftback-form.js +410 -0
  87. package/dist/collection/components/giftback-form/giftback-form.js.map +1 -0
  88. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.css +181 -0
  89. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js +221 -0
  90. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js.map +1 -0
  91. package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js +11 -0
  92. package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js.map +1 -0
  93. package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js +103 -0
  94. package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js.map +1 -0
  95. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.css +84 -0
  96. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js +197 -0
  97. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js.map +1 -0
  98. package/dist/collection/components/loading-container/loading-container.css +47 -0
  99. package/dist/collection/components/loading-container/loading-container.js +43 -0
  100. package/dist/collection/components/loading-container/loading-container.js.map +1 -0
  101. package/dist/collection/components/loading-spinner/loading-spinner.css +17 -0
  102. package/dist/collection/components/loading-spinner/loading-spinner.js +63 -0
  103. package/dist/collection/components/loading-spinner/loading-spinner.js.map +1 -0
  104. package/dist/collection/components/modal/app-modal.css +45 -0
  105. package/dist/collection/components/modal/app-modal.js +83 -0
  106. package/dist/collection/components/modal/app-modal.js.map +1 -0
  107. package/dist/collection/components/note/crm-bonus-note.css +71 -0
  108. package/dist/collection/components/note/crm-bonus-note.js +117 -0
  109. package/dist/collection/components/note/crm-bonus-note.js.map +1 -0
  110. package/dist/collection/components/pedido/pedido.js +52 -0
  111. package/dist/collection/components/pedido/pedido.js.map +1 -0
  112. package/dist/collection/components/phone/phone-input-mask.css +40 -0
  113. package/dist/collection/components/phone/phone-input-mask.js +125 -0
  114. package/dist/collection/components/phone/phone-input-mask.js.map +1 -0
  115. package/dist/collection/components/tooltip/crm-tooltip.css +49 -0
  116. package/dist/collection/components/tooltip/tooltip.js +61 -0
  117. package/dist/collection/components/tooltip/tooltip.js.map +1 -0
  118. package/dist/collection/contants/index.js +16 -0
  119. package/dist/collection/contants/index.js.map +1 -0
  120. package/dist/collection/contants/mocks.js +28 -0
  121. package/dist/collection/contants/mocks.js.map +1 -0
  122. package/dist/collection/dto/pin.sent.js +2 -0
  123. package/dist/collection/dto/pin.sent.js.map +1 -0
  124. package/dist/collection/dto/update.order.dto.js +2 -0
  125. package/dist/collection/dto/update.order.dto.js.map +1 -0
  126. package/dist/collection/dto/validate.pin.bonus.js +5 -0
  127. package/dist/collection/dto/validate.pin.bonus.js.map +1 -0
  128. package/dist/collection/helpers/build.payload.helper.js +25 -0
  129. package/dist/collection/helpers/build.payload.helper.js.map +1 -0
  130. package/dist/collection/helpers/cart.helper.js +27 -0
  131. package/dist/collection/helpers/cart.helper.js.map +1 -0
  132. package/dist/collection/helpers/info.config.helper.js +11 -0
  133. package/dist/collection/helpers/info.config.helper.js.map +1 -0
  134. package/dist/collection/helpers/time.helper.js +12 -0
  135. package/dist/collection/helpers/time.helper.js.map +1 -0
  136. package/dist/collection/i18n/i18n.js +35 -0
  137. package/dist/collection/i18n/i18n.js.map +1 -0
  138. package/dist/collection/index.js +11 -0
  139. package/dist/collection/index.js.map +1 -0
  140. package/dist/collection/objectvalues/cart.wake.js +46 -0
  141. package/dist/collection/objectvalues/cart.wake.js.map +1 -0
  142. package/dist/collection/services/crmbonus.service.js +118 -0
  143. package/dist/collection/services/crmbonus.service.js.map +1 -0
  144. package/dist/collection/utils/keys.storage.js +9 -0
  145. package/dist/collection/utils/keys.storage.js.map +1 -0
  146. package/dist/{crmbonus-component-wake/utils-96cf9ae0.js → collection/utils/utils.js} +5 -8
  147. package/dist/collection/utils/utils.js.map +1 -0
  148. package/dist/components/app-modal.js +46 -0
  149. package/dist/components/app-modal.js.map +1 -0
  150. package/dist/components/countdown-timer.js +8 -0
  151. package/dist/components/countdown-timer.js.map +1 -0
  152. package/dist/components/crm-bonus-form.js +165 -0
  153. package/dist/components/crm-bonus-form.js.map +1 -0
  154. package/dist/components/crm-bonus-note.js +139 -0
  155. package/dist/components/crm-bonus-note.js.map +1 -0
  156. package/dist/components/crm-bonus.js +339 -0
  157. package/dist/components/crm-bonus.js.map +1 -0
  158. package/dist/components/crm-button.js +8 -0
  159. package/dist/components/crm-button.js.map +1 -0
  160. package/dist/components/crm-giftback-form.js +8 -0
  161. package/dist/components/crm-giftback-form.js.map +1 -0
  162. package/dist/components/crm-tooltip.js +8 -0
  163. package/dist/components/crm-tooltip.js.map +1 -0
  164. package/dist/components/giftback-finish.js +8 -0
  165. package/dist/components/giftback-finish.js.map +1 -0
  166. package/dist/components/giftback-info.js +8 -0
  167. package/dist/components/giftback-info.js.map +1 -0
  168. package/dist/components/giftback-pin.js +8 -0
  169. package/dist/components/giftback-pin.js.map +1 -0
  170. package/dist/components/giftback-progress.js +8 -0
  171. package/dist/components/giftback-progress.js.map +1 -0
  172. package/dist/components/index.js +4 -0
  173. package/dist/components/index.js.map +1 -0
  174. package/dist/components/loading-container.js +8 -0
  175. package/dist/components/loading-container.js.map +1 -0
  176. package/dist/components/loading-spinner.js +8 -0
  177. package/dist/components/loading-spinner.js.map +1 -0
  178. package/dist/components/name-input.js +8 -0
  179. package/dist/components/name-input.js.map +1 -0
  180. package/dist/components/p-11085d9b.js +79 -0
  181. package/dist/components/p-11085d9b.js.map +1 -0
  182. package/dist/{crmbonus-component-wake/name-input.entry.js → components/p-246a3e9d.js} +37 -8
  183. package/dist/components/p-246a3e9d.js.map +1 -0
  184. package/dist/{crmbonus-component-wake/giftback-info.entry.js → components/p-2671d669.js} +52 -12
  185. package/dist/components/p-2671d669.js.map +1 -0
  186. package/dist/{crmbonus-component-wake/countdown-timer.entry.js → components/p-2b3b8d6b.js} +27 -7
  187. package/dist/components/p-2b3b8d6b.js.map +1 -0
  188. package/dist/components/p-3e84f78c.js +1408 -0
  189. package/dist/components/p-3e84f78c.js.map +1 -0
  190. package/dist/components/p-47f9da55.js +46 -0
  191. package/dist/components/p-47f9da55.js.map +1 -0
  192. package/dist/components/p-5443db37.js +316 -0
  193. package/dist/components/p-5443db37.js.map +1 -0
  194. package/dist/{crmbonus-component-wake/crm-tooltip.entry.js → components/p-58b97429.js} +27 -8
  195. package/dist/components/p-58b97429.js.map +1 -0
  196. package/dist/{crmbonus-component-wake/giftback-pin.entry.js → components/p-6186ddcc.js} +38 -8
  197. package/dist/components/p-6186ddcc.js.map +1 -0
  198. package/dist/{crmbonus-component-wake/phone-form.entry.js → components/p-6c546e48.js} +47 -8
  199. package/dist/components/p-6c546e48.js.map +1 -0
  200. package/dist/{crmbonus-component-wake/crmbonus.service-9f4c6fd7.js → components/p-6eda79c3.js} +93 -165
  201. package/dist/components/p-6eda79c3.js.map +1 -0
  202. package/dist/components/p-75ba7b9a.js +14 -0
  203. package/dist/components/p-75ba7b9a.js.map +1 -0
  204. package/dist/{crmbonus-component-wake/giftback-progress.entry.js → components/p-7c744cca.js} +37 -8
  205. package/dist/components/p-7c744cca.js.map +1 -0
  206. package/dist/components/p-7cfea8fe.js +19 -0
  207. package/dist/components/p-7cfea8fe.js.map +1 -0
  208. package/dist/{crmbonus-component-wake/pin-form.entry.js → components/p-83a12a8f.js} +56 -9
  209. package/dist/components/p-83a12a8f.js.map +1 -0
  210. package/dist/{crmbonus-component-wake/cart.helper-4e40ffa9.js → components/p-abbfbc98.js} +2 -3
  211. package/dist/components/p-abbfbc98.js.map +1 -0
  212. package/dist/{crmbonus-component-wake/giftback-finish.entry.js → components/p-b79c86a8.js} +25 -8
  213. package/dist/components/p-b79c86a8.js.map +1 -0
  214. package/dist/components/p-ba369e65.js +21 -0
  215. package/dist/components/p-ba369e65.js.map +1 -0
  216. package/dist/components/p-cc1ea33f.js +36 -0
  217. package/dist/components/p-cc1ea33f.js.map +1 -0
  218. package/dist/{crmbonus-component-wake/i18n-11138a2c.js → components/p-e8c19a64.js} +1 -16
  219. package/dist/components/p-e8c19a64.js.map +1 -0
  220. package/dist/components/p-f9aeffc1.js +12 -0
  221. package/dist/components/p-f9aeffc1.js.map +1 -0
  222. package/dist/components/p-fe9c3966.js +39 -0
  223. package/dist/components/p-fe9c3966.js.map +1 -0
  224. package/dist/components/pedido-finalizado.js +54 -0
  225. package/dist/components/pedido-finalizado.js.map +1 -0
  226. package/dist/components/phone-cancel-input.js +55 -0
  227. package/dist/components/phone-cancel-input.js.map +1 -0
  228. package/dist/components/phone-form.js +8 -0
  229. package/dist/components/phone-form.js.map +1 -0
  230. package/dist/components/phone-input-mask.js +8 -0
  231. package/dist/components/phone-input-mask.js.map +1 -0
  232. package/dist/components/phone-input.js +55 -0
  233. package/dist/components/phone-input.js.map +1 -0
  234. package/dist/components/pin-form.js +8 -0
  235. package/dist/components/pin-form.js.map +1 -0
  236. package/dist/crmbonus-component-wake/crmbonus-component-wake.css +1 -7
  237. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -48
  238. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
  239. package/dist/crmbonus-component-wake/index.esm.js +1 -12
  240. package/dist/crmbonus-component-wake/index.esm.js.map +1 -1
  241. package/dist/crmbonus-component-wake/p-03b77c41.entry.js +2 -0
  242. package/dist/crmbonus-component-wake/p-03b77c41.entry.js.map +1 -0
  243. package/dist/crmbonus-component-wake/p-3d6152b1.js +3 -0
  244. package/dist/crmbonus-component-wake/p-3d6152b1.js.map +1 -0
  245. package/dist/crmbonus-component-wake/p-620ec1a3.entry.js +2 -0
  246. package/dist/crmbonus-component-wake/p-620ec1a3.entry.js.map +1 -0
  247. package/dist/crmbonus-component-wake/p-6eda79c3.js +2 -0
  248. package/dist/crmbonus-component-wake/p-6eda79c3.js.map +1 -0
  249. package/dist/crmbonus-component-wake/p-74206c91.entry.js +2 -0
  250. package/dist/crmbonus-component-wake/p-74206c91.entry.js.map +1 -0
  251. package/dist/crmbonus-component-wake/p-75ba7b9a.js +2 -0
  252. package/dist/crmbonus-component-wake/p-75ba7b9a.js.map +1 -0
  253. package/dist/crmbonus-component-wake/p-7b7fb354.entry.js +2 -0
  254. package/dist/crmbonus-component-wake/p-7b7fb354.entry.js.map +1 -0
  255. package/dist/crmbonus-component-wake/p-7cfea8fe.js +2 -0
  256. package/dist/crmbonus-component-wake/p-7cfea8fe.js.map +1 -0
  257. package/dist/crmbonus-component-wake/p-885fc30e.entry.js +2 -0
  258. package/dist/crmbonus-component-wake/p-885fc30e.entry.js.map +1 -0
  259. package/dist/crmbonus-component-wake/p-8df3f949.entry.js +2 -0
  260. package/dist/crmbonus-component-wake/p-8df3f949.entry.js.map +1 -0
  261. package/dist/crmbonus-component-wake/p-90716188.entry.js +2 -0
  262. package/dist/crmbonus-component-wake/p-90716188.entry.js.map +1 -0
  263. package/dist/crmbonus-component-wake/p-a33f7c24.entry.js +2 -0
  264. package/dist/crmbonus-component-wake/p-a33f7c24.entry.js.map +1 -0
  265. package/dist/crmbonus-component-wake/p-abbfbc98.js +2 -0
  266. package/dist/crmbonus-component-wake/p-abbfbc98.js.map +1 -0
  267. package/dist/crmbonus-component-wake/p-b7a8f915.entry.js +2 -0
  268. package/dist/crmbonus-component-wake/p-b7a8f915.entry.js.map +1 -0
  269. package/dist/crmbonus-component-wake/p-ba369e65.js +2 -0
  270. package/dist/crmbonus-component-wake/p-ba369e65.js.map +1 -0
  271. package/dist/crmbonus-component-wake/p-be3ddacc.entry.js +2 -0
  272. package/dist/crmbonus-component-wake/p-be3ddacc.entry.js.map +1 -0
  273. package/dist/crmbonus-component-wake/p-c23f3a07.entry.js +2 -0
  274. package/dist/crmbonus-component-wake/{crm-bonus-form.entry.js.map → p-c23f3a07.entry.js.map} +1 -1
  275. package/dist/crmbonus-component-wake/p-e1255160.js +2 -0
  276. package/dist/crmbonus-component-wake/p-e1255160.js.map +1 -0
  277. package/dist/crmbonus-component-wake/p-e8bd92d1.entry.js +2 -0
  278. package/dist/crmbonus-component-wake/p-e8bd92d1.entry.js.map +1 -0
  279. package/dist/crmbonus-component-wake/p-e8c19a64.js +2 -0
  280. package/dist/crmbonus-component-wake/p-e8c19a64.js.map +1 -0
  281. package/dist/crmbonus-component-wake/p-f9aeffc1.js +2 -0
  282. package/dist/crmbonus-component-wake/p-f9aeffc1.js.map +1 -0
  283. package/dist/crmbonus-component-wake/p-fad20959.entry.js +2 -0
  284. package/dist/crmbonus-component-wake/p-fad20959.entry.js.map +1 -0
  285. package/dist/env.js +3 -0
  286. package/dist/env.js.map +1 -0
  287. package/dist/{crmbonus-component-wake → esm}/app-modal.entry.js +3 -2
  288. package/dist/esm/app-modal.entry.js.map +1 -0
  289. package/dist/{crmbonus-component-wake/cart.helper-a921d7f9.js → esm/cart.helper-30a40560.js} +2 -3
  290. package/dist/esm/cart.helper-30a40560.js.map +1 -0
  291. package/dist/esm/countdown-timer_2.entry.js +58 -0
  292. package/dist/esm/countdown-timer_2.entry.js.map +1 -0
  293. package/dist/{crmbonus-component-wake → esm}/crm-bonus-form.entry.js +5 -4
  294. package/dist/esm/crm-bonus-form.entry.js.map +1 -0
  295. package/dist/{crmbonus-component-wake → esm}/crm-bonus-note.entry.js +10 -9
  296. package/dist/esm/crm-bonus-note.entry.js.map +1 -0
  297. package/dist/{crmbonus-component-wake → esm}/crm-bonus.entry.js +8 -7
  298. package/dist/esm/crm-bonus.entry.js.map +1 -0
  299. package/dist/{crmbonus-component-wake/crm-giftback-form.entry.js → esm/crm-giftback-form_2.entry.js} +26 -11
  300. package/dist/esm/crm-giftback-form_2.entry.js.map +1 -0
  301. package/dist/esm/crm-tooltip_4.entry.js +204 -0
  302. package/dist/esm/crm-tooltip_4.entry.js.map +1 -0
  303. package/dist/esm/crmbonus-component-wake.js +22 -0
  304. package/dist/esm/crmbonus-component-wake.js.map +1 -0
  305. package/dist/{crmbonus-component-wake/crmbonus.service-67550994.js → esm/crmbonus.service-42fbd7fa.js} +90 -162
  306. package/dist/esm/crmbonus.service-42fbd7fa.js.map +1 -0
  307. package/dist/esm/giftback-finish_4.entry.js +124 -0
  308. package/dist/esm/giftback-finish_4.entry.js.map +1 -0
  309. package/dist/esm/i18n-e8150dff.js +2217 -0
  310. package/dist/{crmbonus-component-wake/i18n-11138a2c.js.map → esm/i18n-e8150dff.js.map} +1 -1
  311. package/dist/esm/index-e8724c8f.js +1571 -0
  312. package/dist/esm/index-e8724c8f.js.map +1 -0
  313. package/dist/esm/index.js +3 -0
  314. package/dist/esm/index.js.map +1 -0
  315. package/dist/esm/loader.js +13 -0
  316. package/dist/esm/loader.js.map +1 -0
  317. package/dist/{crmbonus-component-wake → esm}/loading-spinner.entry.js +3 -2
  318. package/dist/esm/loading-spinner.entry.js.map +1 -0
  319. package/dist/{crmbonus-component-wake → esm}/pedido-finalizado.entry.js +4 -4
  320. package/dist/esm/pedido-finalizado.entry.js.map +1 -0
  321. package/dist/{crmbonus-component-wake → esm}/phone-cancel-input.entry.js +1 -1
  322. package/dist/esm/phone-cancel-input.entry.js.map +1 -0
  323. package/dist/{crmbonus-component-wake → esm}/phone-input-mask.entry.js +3 -2
  324. package/dist/esm/phone-input-mask.entry.js.map +1 -0
  325. package/dist/{crmbonus-component-wake → esm}/phone-input.entry.js +1 -1
  326. package/dist/esm/phone-input.entry.js.map +1 -0
  327. package/dist/esm/utils-d642b4db.js +21 -0
  328. package/dist/esm/utils-d642b4db.js.map +1 -0
  329. package/dist/index.cjs.js +1 -0
  330. package/dist/index.js +1 -0
  331. package/dist/types/home/darlison/Projects/Bycoders/crmbonus/crmbonus-component/.stencil/env.d.ts +1 -1
  332. package/package.json +1 -1
  333. package/dist/crmbonus-component-wake/app-modal.entry.js.map +0 -1
  334. package/dist/crmbonus-component-wake/cart.helper-4e40ffa9.js.map +0 -1
  335. package/dist/crmbonus-component-wake/cart.helper-a921d7f9.js.map +0 -1
  336. package/dist/crmbonus-component-wake/countdown-timer.entry.js.map +0 -1
  337. package/dist/crmbonus-component-wake/crm-bonus-note.entry.js.map +0 -1
  338. package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +0 -1
  339. package/dist/crmbonus-component-wake/crm-button.entry.js +0 -20
  340. package/dist/crmbonus-component-wake/crm-button.entry.js.map +0 -1
  341. package/dist/crmbonus-component-wake/crm-tooltip.entry.js.map +0 -1
  342. package/dist/crmbonus-component-wake/crmbonus.service-67550994.js.map +0 -1
  343. package/dist/crmbonus-component-wake/crmbonus.service-9f4c6fd7.js.map +0 -1
  344. package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +0 -1
  345. package/dist/crmbonus-component-wake/giftback-info.entry.js.map +0 -1
  346. package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +0 -1
  347. package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +0 -1
  348. package/dist/crmbonus-component-wake/index-d0fd1dc0.js +0 -3039
  349. package/dist/crmbonus-component-wake/index-d0fd1dc0.js.map +0 -1
  350. package/dist/crmbonus-component-wake/loading-container.entry.js +0 -18
  351. package/dist/crmbonus-component-wake/loading-container.entry.js.map +0 -1
  352. package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +0 -1
  353. package/dist/crmbonus-component-wake/name-input.entry.js.map +0 -1
  354. package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +0 -1
  355. package/dist/crmbonus-component-wake/phone-cancel-input.entry.js.map +0 -1
  356. package/dist/crmbonus-component-wake/phone-form.entry.js.map +0 -1
  357. package/dist/crmbonus-component-wake/phone-input-mask.entry.js.map +0 -1
  358. package/dist/crmbonus-component-wake/phone-input.entry.js.map +0 -1
  359. package/dist/crmbonus-component-wake/pin-form.entry.js.map +0 -1
  360. package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js +0 -334
  361. package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js.map +0 -1
  362. package/dist/crmbonus-component-wake/utils-96cf9ae0.js.map +0 -1
  363. /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js +0 -0
  364. /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js.map +0 -0
  365. /package/dist/{crmbonus-component-wake → esm}/index-5b567099.js +0 -0
  366. /package/dist/{crmbonus-component-wake → esm}/index-5b567099.js.map +0 -0
  367. /package/dist/{crmbonus-component-wake → esm}/info.config.helper-42d9ddf9.js +0 -0
  368. /package/dist/{crmbonus-component-wake → esm}/info.config.helper-42d9ddf9.js.map +0 -0
  369. /package/dist/{crmbonus-component-wake → esm}/keys.storage-8c76fcd7.js +0 -0
  370. /package/dist/{crmbonus-component-wake → esm}/keys.storage-8c76fcd7.js.map +0 -0
@@ -0,0 +1,75 @@
1
+ * {
2
+ margin: 0;
3
+ padding: 0;
4
+ box-sizing: border-box;
5
+ }
6
+
7
+ :host {
8
+ --crmfont-sizebodymd: 14px;
9
+ --crmline-heightbodymd: 20px;
10
+ --crmletter-spacingtitle-md: 0px
11
+ }
12
+
13
+ .container-message {
14
+ font-family: Roboto;
15
+ font-size: var(--crmfont-sizebodymd);
16
+ font-weight: 400;
17
+ line-height: var(--crmline-heightbodymd);
18
+ letter-spacing: var(--crmletter-spacingtitle-md);
19
+ text-align: left;
20
+ text-underline-position: from-font;
21
+ text-decoration-skip-ink: none;
22
+ }
23
+
24
+ .crm-container-form {
25
+ display: flex;
26
+ flex-direction: column;
27
+ justify-content: space-around;
28
+ height: auto;
29
+ padding: 20px 24px 20px 24px;
30
+ border: 1px solid #CCCC;
31
+ writing-mode: horizontal-tb;
32
+ gap: 16px;
33
+ border-top: 1px solid #ccc !important;
34
+ border-bottom: 1px solid #ccc !important;
35
+ }
36
+
37
+ /* .fbits-responsive-carrinho-desconto {
38
+ overflow: hidden;
39
+ border: 1px solid #ccc;
40
+ border-top: 0;
41
+ border-bottom: 0;
42
+ } */
43
+
44
+ .crm-phone-form {
45
+ display: flex;
46
+ flex-direction: column;
47
+ height: 100%;
48
+ /* justify-content: space-around; */
49
+ gap: 16px;
50
+ }
51
+
52
+ .crm-subtitle {
53
+ font-size: 14px;
54
+ color: var(--crm-btn);
55
+ font-weight: 100;
56
+ }
57
+
58
+ .crm-title {
59
+ font-weight: 700;
60
+ line-height: 20px;
61
+ color: #262626;
62
+ font-size: 16px;
63
+ }
64
+
65
+ .crm-message-info {
66
+ color: #619013;
67
+ font-weight: 500;
68
+ font-size: 12px;
69
+ }
70
+
71
+ .crm-message-error {
72
+ color: #E11D48;
73
+ font-weight: 500;
74
+ font-size: 12px;
75
+ }
@@ -0,0 +1,410 @@
1
+ import { h } from "@stencil/core";
2
+ import { CrmBonusService } from "../../services/crmbonus.service";
3
+ import { StepFormEnum } from "../../contants";
4
+ import { getInfoCustomization } from "../../helpers/info.config.helper";
5
+ import i18next from "../../i18n/i18n";
6
+ import { USED_KEY, getKeyReserveByCartId } from "../../utils/keys.storage";
7
+ export class CrmBonus {
8
+ constructor() {
9
+ // private phoneInputMask: HTMLPhoneFormElement;
10
+ this.crmBonusService = CrmBonusService.getInstance();
11
+ this.storeName = undefined;
12
+ this.cartId = undefined;
13
+ this.products = undefined;
14
+ this.customer = undefined;
15
+ this.loadProducts = undefined;
16
+ this.value = undefined;
17
+ this.loading = false;
18
+ this.message = undefined;
19
+ this.phone = undefined;
20
+ this.pinInfo = undefined;
21
+ this.step = StepFormEnum.STEP_RESERVE;
22
+ this.bonus = undefined;
23
+ this.sucess = "";
24
+ this.error = "";
25
+ this.config = undefined;
26
+ this.hasApplyBonus = false;
27
+ }
28
+ async setStep(step) {
29
+ this.step = step;
30
+ }
31
+ async processBonus(products = [], hasNewProduct = false) {
32
+ this.sucess = "";
33
+ console.log('processBonus', []);
34
+ if (hasNewProduct) {
35
+ this.products = products;
36
+ }
37
+ const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));
38
+ if (_bonus) {
39
+ const bonus = JSON.parse(_bonus);
40
+ this.bonus = bonus;
41
+ this.phone = bonus.phone;
42
+ this.pinInfo = {
43
+ storeId: bonus.storeId,
44
+ userId: bonus.userId
45
+ };
46
+ await this.validateBonus("2018");
47
+ //this.step = StepFormEnum.STEP_RESERVE;
48
+ }
49
+ }
50
+ async handleSendPin(phone) {
51
+ this.message = "";
52
+ if (!phone) {
53
+ this.message = "Informe seu telefone";
54
+ return;
55
+ }
56
+ this.phone = phone;
57
+ this.sendPin();
58
+ }
59
+ async componentWillLoad() {
60
+ this.sucess = "";
61
+ this.error = "";
62
+ this.config = getInfoCustomization(this.storeName);
63
+ const phoneAgain = this.getPhoneNumberAgain();
64
+ if (phoneAgain) {
65
+ this.step = StepFormEnum.STEP_PHONE;
66
+ return;
67
+ }
68
+ await this.processBonus();
69
+ }
70
+ getPhoneNumberAgain() {
71
+ const consulta_bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));
72
+ if (!consulta_bonus)
73
+ return true;
74
+ const bonus = JSON.parse(consulta_bonus);
75
+ return !bonus.hasBonus;
76
+ }
77
+ convertStringToNumber() {
78
+ const _phone = this.phone.replace(/\D/g, '');
79
+ return Number(_phone);
80
+ }
81
+ async sendPin() {
82
+ var _a, _b, _c;
83
+ this.loading = true;
84
+ this.message = "";
85
+ this.sucess = "";
86
+ this.error = "";
87
+ try {
88
+ const _phone = this.convertStringToNumber();
89
+ const pinInfoCache = localStorage.getItem(`bc:${this.phone}`);
90
+ if (!pinInfoCache) {
91
+ this.pinInfo = await this.crmBonusService.sendPin(_phone, (_a = this.customer) === null || _a === void 0 ? void 0 : _a.name, this.storeName);
92
+ }
93
+ if (pinInfoCache) {
94
+ const bonus = JSON.parse(pinInfoCache);
95
+ this.pinInfo = {
96
+ storeId: bonus.storeId,
97
+ userId: bonus.userId
98
+ };
99
+ await this.validateBonus("2018");
100
+ this.step = StepFormEnum.STEP_RESERVE;
101
+ }
102
+ else {
103
+ this.step = StepFormEnum.STEP_PIN;
104
+ }
105
+ }
106
+ catch (error) {
107
+ this.message = (_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message;
108
+ }
109
+ finally {
110
+ this.loading = false;
111
+ }
112
+ }
113
+ changePhone() {
114
+ this.sucess = "";
115
+ this.error = "";
116
+ this.step = StepFormEnum.STEP_PHONE;
117
+ }
118
+ async validateBonus(pin) {
119
+ var _a, _b, _c;
120
+ await this.loadProducts();
121
+ const used_or_no = localStorage.getItem(USED_KEY);
122
+ if (used_or_no == "dontUse") {
123
+ this.step = StepFormEnum.STEP_RESERVE;
124
+ return;
125
+ }
126
+ this.loading = true;
127
+ this.sucess = "";
128
+ this.error = "";
129
+ const payload = {
130
+ pin: pin,
131
+ cellphone: this.convertStringToNumber(),
132
+ storeId: this.pinInfo.storeId.toString(),
133
+ userId: this.pinInfo.userId.toString(),
134
+ checkoutId: this.cartId,
135
+ checkoutProducts: this.products,
136
+ name: (_a = this.customer) === null || _a === void 0 ? void 0 : _a.name,
137
+ storeName: this.storeName
138
+ };
139
+ try {
140
+ this.bonus = await this.crmBonusService.validatePinBonus(payload);
141
+ if (!this.bonus.hasBonus) {
142
+ localStorage.setItem(getKeyReserveByCartId(this.cartId), JSON.stringify(Object.assign(Object.assign({}, this.bonus), { phone: this.phone })));
143
+ this.loading = false;
144
+ this.step = StepFormEnum.STEP_NO_BONUS;
145
+ return;
146
+ }
147
+ this.sucess = "Código validado com sucesso!";
148
+ localStorage.setItem(getKeyReserveByCartId(this.cartId), JSON.stringify(Object.assign(Object.assign({}, this.bonus), { phone: this.phone })));
149
+ localStorage.setItem(`bc:${this.phone}`, JSON.stringify(this.bonus));
150
+ localStorage.setItem(USED_KEY, "use");
151
+ localStorage.setItem(this.cartId, this.bonus.bonusBalance.toString());
152
+ this.step = StepFormEnum.STEP_RESERVE;
153
+ }
154
+ catch (error) {
155
+ const _error = (_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message;
156
+ if (_error.includes("Pin")) {
157
+ this.error = "Código inválido!";
158
+ }
159
+ else {
160
+ this.error = _error;
161
+ this.step = StepFormEnum.STEP_NO_BONUS;
162
+ }
163
+ }
164
+ finally {
165
+ this.loading = false;
166
+ }
167
+ }
168
+ handleCancel() {
169
+ // this.step = StepFormEnum.STEP_PHONE;
170
+ this.cancel();
171
+ }
172
+ async cancel() {
173
+ this.message = "";
174
+ this.loading = true;
175
+ try {
176
+ await this.crmBonusService.cancel(this.cartId);
177
+ localStorage.setItem(USED_KEY, "dontUse");
178
+ this.save(0);
179
+ }
180
+ catch (error) {
181
+ this.message = "Não consegui cancelar o bônus, tente novamente!";
182
+ }
183
+ finally {
184
+ this.loading = false;
185
+ }
186
+ }
187
+ async reserveApply(amount) {
188
+ this.loading = true;
189
+ this.message = "";
190
+ try {
191
+ await this.reserve(amount);
192
+ this.save(amount);
193
+ }
194
+ catch (error) {
195
+ this.message = "ocorreu um error ao solicitar a aplicação do bonus! tente novamente";
196
+ this.step = StepFormEnum.STEP_NO_BONUS;
197
+ localStorage.removeItem(this.cartId);
198
+ }
199
+ finally {
200
+ this.loading = false;
201
+ }
202
+ }
203
+ save(amount) {
204
+ localStorage.setItem(this.cartId, amount.toString());
205
+ }
206
+ async reserve(amount) {
207
+ await this.crmBonusService.reserve({
208
+ redeemedBonus: amount,
209
+ cartId: this.cartId,
210
+ ticket: this.cartId,
211
+ grossValue: Number(this.bonus.totalValue),
212
+ storeName: this.storeName,
213
+ storeId: this.bonus.storeId.toString(),
214
+ userId: this.bonus.userId
215
+ });
216
+ }
217
+ render() {
218
+ return (h("div", { key: '6c4697a291f53468febca649827943dcf170ebf0', class: "crm-container-form fbits-responsive-carrinho-desconto" }, h("label", { key: '03d30744802d895cf0e3debada89a002553ed086', class: "crm-title" }, this.config.giftbackTitle), this.step === StepFormEnum.STEP_PHONE &&
219
+ h("phone-form", { key: 'c587112386a887f01b3c34f219ee2bbc70793977', value: this.customer.phone, config: this.config, loading: this.loading, handlerSubmit: (phone) => this.handleSendPin(phone) }), this.step === StepFormEnum.STEP_PIN &&
220
+ h("pin-form", { key: '77ea15afe3c337b99fd9f6b61a6371145970e910', config: this.config, phone: this.phone, cancel: () => this.changePhone(), resend: () => this.sendPin(), validate: (data) => this.validateBonus(data), loading: this.loading }, this.sucess && h("p", { key: '8be745c614e20e582e8d060cc582432b471dc1c8', class: "crm-message-info" }, this.sucess), this.error && h("p", { key: '38095e8e2f34b9113273ca060a505f25131e9140', class: "crm-message-error" }, this.error)), this.step === StepFormEnum.STEP_RESERVE &&
221
+ h("giftback-info", { key: 'f76e120f6e7ccf5a353b69bc78d8d10ae9fc34de', config: this.config, loading: this.loading, cancel: () => this.handleCancel(), bonus: this.bonus, reserve: () => this.processBonus() }), this.step === StepFormEnum.STEP_NO_BONUS &&
222
+ (h("div", { key: 'bb59357639b70c4f2a23a14f1ed7beace379dacb', class: "container-message" }, i18next.t("noGiftback", { storename: this.config.giftbackTitle })))));
223
+ }
224
+ static get is() { return "crm-giftback-form"; }
225
+ static get originalStyleUrls() {
226
+ return {
227
+ "$": ["giftback-form.css"]
228
+ };
229
+ }
230
+ static get styleUrls() {
231
+ return {
232
+ "$": ["giftback-form.css"]
233
+ };
234
+ }
235
+ static get properties() {
236
+ return {
237
+ "storeName": {
238
+ "type": "any",
239
+ "mutable": false,
240
+ "complexType": {
241
+ "original": "any",
242
+ "resolved": "any",
243
+ "references": {}
244
+ },
245
+ "required": false,
246
+ "optional": false,
247
+ "docs": {
248
+ "tags": [],
249
+ "text": ""
250
+ },
251
+ "attribute": "storename",
252
+ "reflect": false
253
+ },
254
+ "cartId": {
255
+ "type": "any",
256
+ "mutable": false,
257
+ "complexType": {
258
+ "original": "any",
259
+ "resolved": "any",
260
+ "references": {}
261
+ },
262
+ "required": false,
263
+ "optional": false,
264
+ "docs": {
265
+ "tags": [],
266
+ "text": ""
267
+ },
268
+ "attribute": "cart-id",
269
+ "reflect": false
270
+ },
271
+ "products": {
272
+ "type": "unknown",
273
+ "mutable": false,
274
+ "complexType": {
275
+ "original": "Array<IProduct>",
276
+ "resolved": "IProduct[]",
277
+ "references": {
278
+ "Array": {
279
+ "location": "global",
280
+ "id": "global::Array"
281
+ },
282
+ "IProduct": {
283
+ "location": "import",
284
+ "path": "../../dto/validate.pin.bonus",
285
+ "id": "src/dto/validate.pin.bonus.ts::IProduct"
286
+ }
287
+ }
288
+ },
289
+ "required": false,
290
+ "optional": false,
291
+ "docs": {
292
+ "tags": [],
293
+ "text": ""
294
+ }
295
+ },
296
+ "customer": {
297
+ "type": "unknown",
298
+ "mutable": false,
299
+ "complexType": {
300
+ "original": "ICustomer",
301
+ "resolved": "ICustomer",
302
+ "references": {
303
+ "ICustomer": {
304
+ "location": "import",
305
+ "path": "../../dto/validate.pin.bonus",
306
+ "id": "src/dto/validate.pin.bonus.ts::ICustomer"
307
+ }
308
+ }
309
+ },
310
+ "required": false,
311
+ "optional": false,
312
+ "docs": {
313
+ "tags": [],
314
+ "text": ""
315
+ }
316
+ },
317
+ "loadProducts": {
318
+ "type": "unknown",
319
+ "mutable": false,
320
+ "complexType": {
321
+ "original": "() => void",
322
+ "resolved": "() => void",
323
+ "references": {}
324
+ },
325
+ "required": false,
326
+ "optional": false,
327
+ "docs": {
328
+ "tags": [],
329
+ "text": ""
330
+ }
331
+ }
332
+ };
333
+ }
334
+ static get states() {
335
+ return {
336
+ "value": {},
337
+ "loading": {},
338
+ "message": {},
339
+ "phone": {},
340
+ "pinInfo": {},
341
+ "step": {},
342
+ "bonus": {},
343
+ "sucess": {},
344
+ "error": {},
345
+ "config": {},
346
+ "hasApplyBonus": {}
347
+ };
348
+ }
349
+ static get methods() {
350
+ return {
351
+ "setStep": {
352
+ "complexType": {
353
+ "signature": "(step: StepFormEnum) => Promise<void>",
354
+ "parameters": [{
355
+ "name": "step",
356
+ "type": "StepFormEnum",
357
+ "docs": ""
358
+ }],
359
+ "references": {
360
+ "Promise": {
361
+ "location": "global",
362
+ "id": "global::Promise"
363
+ },
364
+ "StepFormEnum": {
365
+ "location": "import",
366
+ "path": "../../contants",
367
+ "id": "src/contants/index.ts::StepFormEnum"
368
+ }
369
+ },
370
+ "return": "Promise<void>"
371
+ },
372
+ "docs": {
373
+ "text": "",
374
+ "tags": []
375
+ }
376
+ },
377
+ "processBonus": {
378
+ "complexType": {
379
+ "signature": "(products?: IProduct[], hasNewProduct?: boolean) => Promise<void>",
380
+ "parameters": [{
381
+ "name": "products",
382
+ "type": "IProduct[]",
383
+ "docs": ""
384
+ }, {
385
+ "name": "hasNewProduct",
386
+ "type": "boolean",
387
+ "docs": ""
388
+ }],
389
+ "references": {
390
+ "Promise": {
391
+ "location": "global",
392
+ "id": "global::Promise"
393
+ },
394
+ "IProduct": {
395
+ "location": "import",
396
+ "path": "../../dto/validate.pin.bonus",
397
+ "id": "src/dto/validate.pin.bonus.ts::IProduct"
398
+ }
399
+ },
400
+ "return": "Promise<void>"
401
+ },
402
+ "docs": {
403
+ "text": "",
404
+ "tags": []
405
+ }
406
+ }
407
+ };
408
+ }
409
+ }
410
+ //# sourceMappingURL=giftback-form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"giftback-form.js","sourceRoot":"","sources":["../../../../src/components/giftback-form/giftback-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAc,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAEpF,OAAO,OAAO,MAAM,iBAAiB,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAM3E,MAAM,OAAO,QAAQ;;QACn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,CAAC,IAAI,CAAC,YAAY,EAAE,EACjC,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,GAClC;YAIF,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,aAAa;gBACxC,CACE,4DAAK,KAAK,EAAC,mBAAmB,IAC3B,OAAO,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAC9D,CACP,CAGC,CACP,CAAA;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Method, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { StepFormEnum } from \"../../contants\";\nimport { IPinSent } from '../../dto/pin.sent'\nimport { IBonus, ICustomer, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport i18next from \"../../i18n/i18n\"\nimport { USED_KEY, getKeyReserveByCartId } from \"../../utils/keys.storage\";\n\n@Component({\n tag: 'crm-giftback-form',\n styleUrl: 'giftback-form.css'\n})\nexport class CrmBonus {\n // private phoneInputMask: HTMLPhoneFormElement;\n\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n @Prop() customer: ICustomer;\n @Prop() loadProducts: () => void;\n\n @State() value: string;\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: string;\n @State() pinInfo: IPinSent;\n @State() step: StepFormEnum = StepFormEnum.STEP_RESERVE;\n @State() bonus: IBonus;\n\n @State() sucess: string = \"\";\n @State() error: string = \"\";\n @State() config: IInfoStore;\n\n @State() hasApplyBonus = false;\n\n\n @Method()\n async setStep(step: StepFormEnum) {\n this.step = step\n }\n\n @Method()\n async processBonus(products: IProduct[] = [], hasNewProduct = false) {\n this.sucess = \"\";\n\n console.log('processBonus', [])\n if (hasNewProduct) {\n this.products = products;\n }\n\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n if (_bonus) {\n\n const bonus = JSON.parse(_bonus)\n\n this.bonus = bonus;\n\n this.phone = bonus.phone;\n this.pinInfo = {\n storeId: bonus.storeId,\n userId: bonus.userId\n }\n\n await this.validateBonus(\"2018\");\n //this.step = StepFormEnum.STEP_RESERVE;\n\n }\n }\n\n async handleSendPin(phone: string) {\n\n this.message = \"\"\n if (!phone) {\n this.message = \"Informe seu telefone\";\n return;\n }\n\n this.phone = phone;\n\n this.sendPin();\n }\n\n async componentWillLoad() {\n this.sucess = \"\";\n this.error = \"\"\n this.config = getInfoCustomization(this.storeName);\n\n const phoneAgain = this.getPhoneNumberAgain();\n\n if (phoneAgain) {\n this.step = StepFormEnum.STEP_PHONE;\n return\n }\n\n await this.processBonus();\n\n }\n\n getPhoneNumberAgain() {\n const consulta_bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n if (!consulta_bonus) return true;\n\n const bonus = JSON.parse(consulta_bonus);\n\n return !bonus.hasBonus;\n }\n\n private convertStringToNumber(): number {\n const _phone = this.phone.replace(/\\D/g, '');\n return Number(_phone);\n }\n\n public async sendPin() {\n this.loading = true;\n this.message = \"\";\n this.sucess = \"\";\n this.error = \"\"\n\n try {\n\n const _phone = this.convertStringToNumber();\n const pinInfoCache = localStorage.getItem(`bc:${this.phone}`);\n\n if (!pinInfoCache) {\n this.pinInfo = await this.crmBonusService.sendPin(_phone, this.customer?.name, this.storeName);\n }\n\n if (pinInfoCache) {\n\n const bonus = JSON.parse(pinInfoCache);\n\n this.pinInfo = {\n storeId: bonus.storeId,\n userId: bonus.userId\n }\n\n await this.validateBonus(\"2018\");\n this.step = StepFormEnum.STEP_RESERVE;\n } else {\n this.step = StepFormEnum.STEP_PIN;\n }\n\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n changePhone() {\n this.sucess = \"\";\n this.error = \"\"\n this.step = StepFormEnum.STEP_PHONE;\n }\n\n public async validateBonus(pin: string) {\n\n await this.loadProducts();\n\n const used_or_no = localStorage.getItem(USED_KEY);\n\n if (used_or_no == \"dontUse\") {\n this.step = StepFormEnum.STEP_RESERVE;\n return\n }\n\n this.loading = true;\n this.sucess = \"\";\n this.error = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.convertStringToNumber(),\n storeId: this.pinInfo.storeId.toString(),\n userId: this.pinInfo.userId.toString(),\n checkoutId: this.cartId,\n checkoutProducts: this.products,\n name: this.customer?.name,\n storeName: this.storeName\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload);\n\n if (!this.bonus.hasBonus) {\n\n localStorage.setItem(getKeyReserveByCartId(this.cartId), JSON.stringify({ ...this.bonus, phone: this.phone }));\n\n this.loading = false;\n this.step = StepFormEnum.STEP_NO_BONUS;\n return\n }\n\n this.sucess = \"Código validado com sucesso!\";\n localStorage.setItem(getKeyReserveByCartId(this.cartId), JSON.stringify({ ...this.bonus, phone: this.phone }));\n localStorage.setItem(`bc:${this.phone}`, JSON.stringify(this.bonus));\n\n localStorage.setItem(USED_KEY, \"use\");\n localStorage.setItem(this.cartId, this.bonus.bonusBalance.toString());\n\n this.step = StepFormEnum.STEP_RESERVE;\n\n } catch (error) {\n const _error: string = error?.response?.data?.message;\n\n if (_error.includes(\"Pin\")) {\n this.error = \"Código inválido!\"\n } else {\n this.error = _error;\n this.step = StepFormEnum.STEP_NO_BONUS;\n }\n\n\n } finally {\n this.loading = false;\n }\n }\n\n public handleCancel() {\n // this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n async cancel() {\n this.message = \"\";\n this.loading = true;\n try {\n await this.crmBonusService.cancel(this.cartId);\n\n localStorage.setItem(USED_KEY, \"dontUse\");\n this.save(0)\n } catch (error) {\n this.message = \"Não consegui cancelar o bônus, tente novamente!\"\n } finally {\n this.loading = false;\n }\n }\n\n public async reserveApply(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.reserve(amount);\n this.save(amount);\n\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n\n this.step = StepFormEnum.STEP_NO_BONUS;\n localStorage.removeItem(this.cartId);\n } finally {\n this.loading = false;\n }\n }\n\n save(amount: number) {\n localStorage.setItem(this.cartId, amount.toString());\n }\n\n public async reserve(amount: number) {\n\n await this.crmBonusService.reserve({\n redeemedBonus: amount,\n cartId: this.cartId,\n ticket: this.cartId,\n grossValue: Number(this.bonus.totalValue),\n storeName: this.storeName,\n storeId: this.bonus.storeId.toString(),\n userId: this.bonus.userId\n });\n }\n\n render() {\n return (\n <div class=\"crm-container-form fbits-responsive-carrinho-desconto\" >\n\n {/* <loading-container /> */}\n\n <label class=\"crm-title\">{this.config.giftbackTitle}</label>\n\n {this.step === StepFormEnum.STEP_PHONE &&\n <phone-form\n value={this.customer.phone}\n config={this.config}\n loading={this.loading}\n handlerSubmit={(phone) => this.handleSendPin(phone)}\n />}\n {\n this.step === StepFormEnum.STEP_PIN &&\n <pin-form\n config={this.config}\n phone={this.phone}\n cancel={() => this.changePhone()}\n resend={() => this.sendPin()}\n validate={(data) => this.validateBonus(data)}\n loading={this.loading}\n >\n {this.sucess && <p class=\"crm-message-info\">{this.sucess}</p>}\n {this.error && <p class=\"crm-message-error\">{this.error}</p>}\n\n </pin-form>\n }\n\n {\n this.step === StepFormEnum.STEP_RESERVE &&\n <giftback-info\n config={this.config}\n loading={this.loading}\n cancel={() => this.handleCancel()}\n bonus={this.bonus}\n reserve={() => this.processBonus()}\n />\n }\n\n {\n this.step === StepFormEnum.STEP_NO_BONUS &&\n (\n <div class=\"container-message\">\n {i18next.t(\"noGiftback\", { storename: this.config.giftbackTitle })}\n </div>\n )\n\n }\n </div>\n )\n }\n}"]}