crmbonus-component-wake 2.0.49 → 2.0.51

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 (322) hide show
  1. package/dist/{esm → crmbonus-component-wake}/app-modal.entry.js +3 -4
  2. package/dist/crmbonus-component-wake/app-modal.entry.js.map +1 -0
  3. package/dist/crmbonus-component-wake/countdown-timer.entry.js +30 -0
  4. package/dist/crmbonus-component-wake/countdown-timer.entry.js.map +1 -0
  5. package/dist/{esm → crmbonus-component-wake}/crm-bonus-form.entry.js +4 -5
  6. package/dist/crmbonus-component-wake/crm-bonus-form.entry.js.map +1 -0
  7. package/dist/crmbonus-component-wake/crm-bonus-note.entry.js +48 -0
  8. package/dist/crmbonus-component-wake/crm-bonus-note.entry.js.map +1 -0
  9. package/dist/{esm → crmbonus-component-wake}/crm-bonus.entry.js +7 -6
  10. package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +1 -0
  11. package/dist/{esm → crmbonus-component-wake}/crm-button.entry.js +4 -4
  12. package/dist/crmbonus-component-wake/crm-button.entry.js.map +1 -0
  13. package/dist/{esm → crmbonus-component-wake}/crm-giftback-form.entry.js +12 -11
  14. package/dist/crmbonus-component-wake/crm-giftback-form.entry.js.map +1 -0
  15. package/dist/crmbonus-component-wake/crmbonus-component-wake.css +7 -1
  16. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +48 -1
  17. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
  18. package/dist/{esm/crmbonus.service-a846150c.js → crmbonus-component-wake/crmbonus.service-0e166281.js} +167 -92
  19. package/dist/crmbonus-component-wake/crmbonus.service-0e166281.js.map +1 -0
  20. package/dist/{components/p-384fabf7.js → crmbonus-component-wake/crmbonus.service-98a7bcf0.js} +167 -92
  21. package/dist/crmbonus-component-wake/crmbonus.service-98a7bcf0.js.map +1 -0
  22. package/dist/crmbonus-component-wake/giftback-finish.entry.js +19 -0
  23. package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +1 -0
  24. package/dist/{components/p-0a57e57f.js → crmbonus-component-wake/giftback-info.entry.js} +13 -36
  25. package/dist/crmbonus-component-wake/giftback-info.entry.js.map +1 -0
  26. package/dist/{components/p-4f18f4c0.js → crmbonus-component-wake/giftback-pin.entry.js} +9 -39
  27. package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +1 -0
  28. package/dist/crmbonus-component-wake/giftback-progress.entry.js +40 -0
  29. package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +1 -0
  30. package/dist/{esm/i18n-853fedb3.js → crmbonus-component-wake/i18n-a17a0837.js} +17 -2
  31. package/dist/{esm/i18n-853fedb3.js.map → crmbonus-component-wake/i18n-a17a0837.js.map} +1 -1
  32. package/dist/crmbonus-component-wake/index-bdc90e13.js +3039 -0
  33. package/dist/crmbonus-component-wake/index-bdc90e13.js.map +1 -0
  34. package/dist/crmbonus-component-wake/index.esm.js +16 -1
  35. package/dist/crmbonus-component-wake/index.esm.js.map +1 -1
  36. package/dist/{esm → crmbonus-component-wake}/loading-spinner.entry.js +3 -4
  37. package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +1 -0
  38. package/dist/{components/p-a30bd6b1.js → crmbonus-component-wake/name-input.entry.js} +9 -38
  39. package/dist/crmbonus-component-wake/name-input.entry.js.map +1 -0
  40. package/dist/{esm → crmbonus-component-wake}/pedido-finalizado.entry.js +3 -3
  41. package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +1 -0
  42. package/dist/{esm → crmbonus-component-wake}/phone-cancel-input.entry.js +2 -2
  43. package/dist/crmbonus-component-wake/phone-cancel-input.entry.js.map +1 -0
  44. package/dist/crmbonus-component-wake/phone-form.entry.js +26 -0
  45. package/dist/crmbonus-component-wake/phone-form.entry.js.map +1 -0
  46. package/dist/{esm → crmbonus-component-wake}/phone-input-mask.entry.js +6 -4
  47. package/dist/{cjs/phone-input-mask.cjs.entry.js.map → crmbonus-component-wake/phone-input-mask.entry.js.map} +1 -1
  48. package/dist/{esm → crmbonus-component-wake}/phone-input.entry.js +2 -2
  49. package/dist/crmbonus-component-wake/phone-input.entry.js.map +1 -0
  50. package/dist/{components/p-5dfa24e0.js → crmbonus-component-wake/pin-form.entry.js} +13 -56
  51. package/dist/crmbonus-component-wake/pin-form.entry.js.map +1 -0
  52. package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js +334 -0
  53. package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js.map +1 -0
  54. package/dist/types/components/button/index.d.ts +1 -0
  55. package/dist/types/components/giftback-form/subcomponents/phone-form/phone-form.d.ts +2 -0
  56. package/dist/types/components/giftback-form/subcomponents/pin-form/pin-form.d.ts +2 -0
  57. package/dist/types/components.d.ts +8 -0
  58. package/package.json +1 -1
  59. package/dist/cjs/app-globals-3a1e7e63.js +0 -7
  60. package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
  61. package/dist/cjs/app-modal.cjs.entry.js +0 -28
  62. package/dist/cjs/app-modal.cjs.entry.js.map +0 -1
  63. package/dist/cjs/countdown-timer_4.cjs.entry.js +0 -176
  64. package/dist/cjs/countdown-timer_4.cjs.entry.js.map +0 -1
  65. package/dist/cjs/crm-bonus-form.cjs.entry.js +0 -103
  66. package/dist/cjs/crm-bonus-form.cjs.entry.js.map +0 -1
  67. package/dist/cjs/crm-bonus-note.cjs.entry.js +0 -52
  68. package/dist/cjs/crm-bonus-note.cjs.entry.js.map +0 -1
  69. package/dist/cjs/crm-bonus.cjs.entry.js +0 -204
  70. package/dist/cjs/crm-bonus.cjs.entry.js.map +0 -1
  71. package/dist/cjs/crm-button.cjs.entry.js +0 -24
  72. package/dist/cjs/crm-button.cjs.entry.js.map +0 -1
  73. package/dist/cjs/crm-giftback-form.cjs.entry.js +0 -171
  74. package/dist/cjs/crm-giftback-form.cjs.entry.js.map +0 -1
  75. package/dist/cjs/crmbonus-component-wake.cjs.js +0 -27
  76. package/dist/cjs/crmbonus-component-wake.cjs.js.map +0 -1
  77. package/dist/cjs/crmbonus.service-7991795d.js +0 -3852
  78. package/dist/cjs/crmbonus.service-7991795d.js.map +0 -1
  79. package/dist/cjs/giftback-finish_4.cjs.entry.js +0 -132
  80. package/dist/cjs/giftback-finish_4.cjs.entry.js.map +0 -1
  81. package/dist/cjs/i18n-818275e6.js +0 -2209
  82. package/dist/cjs/i18n-818275e6.js.map +0 -1
  83. package/dist/cjs/index-80419303.js +0 -1253
  84. package/dist/cjs/index-80419303.js.map +0 -1
  85. package/dist/cjs/index-96a8951f.js +0 -16
  86. package/dist/cjs/index-96a8951f.js.map +0 -1
  87. package/dist/cjs/index.cjs.js +0 -11
  88. package/dist/cjs/index.cjs.js.map +0 -1
  89. package/dist/cjs/info.config.helper-c5d9f781.js +0 -16
  90. package/dist/cjs/info.config.helper-c5d9f781.js.map +0 -1
  91. package/dist/cjs/loader.cjs.js +0 -17
  92. package/dist/cjs/loader.cjs.js.map +0 -1
  93. package/dist/cjs/loading-spinner.cjs.entry.js +0 -24
  94. package/dist/cjs/loading-spinner.cjs.entry.js.map +0 -1
  95. package/dist/cjs/pedido-finalizado.cjs.entry.js +0 -36
  96. package/dist/cjs/pedido-finalizado.cjs.entry.js.map +0 -1
  97. package/dist/cjs/phone-cancel-input.cjs.entry.js +0 -25
  98. package/dist/cjs/phone-cancel-input.cjs.entry.js.map +0 -1
  99. package/dist/cjs/phone-input-mask.cjs.entry.js +0 -58
  100. package/dist/cjs/phone-input.cjs.entry.js +0 -25
  101. package/dist/cjs/phone-input.cjs.entry.js.map +0 -1
  102. package/dist/collection/collection-manifest.json +0 -30
  103. package/dist/collection/components/button/crm-button.css +0 -22
  104. package/dist/collection/components/button/index.js +0 -60
  105. package/dist/collection/components/button/index.js.map +0 -1
  106. package/dist/collection/components/countdown-timer/countdown-timer.js +0 -51
  107. package/dist/collection/components/countdown-timer/countdown-timer.js.map +0 -1
  108. package/dist/collection/components/crm-bonus/assets/logo.svg +0 -18
  109. package/dist/collection/components/crm-bonus/assets/success-svgrepo-com.svg +0 -8
  110. package/dist/collection/components/crm-bonus/assets/svg/logo.svg +0 -18
  111. package/dist/collection/components/crm-bonus/assets/svg/success-svgrepo-com.svg +0 -8
  112. package/dist/collection/components/crm-bonus/crm-bonus.css +0 -84
  113. package/dist/collection/components/crm-bonus/crm-bonus.js +0 -291
  114. package/dist/collection/components/crm-bonus/crm-bonus.js.map +0 -1
  115. package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +0 -19
  116. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +0 -348
  117. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +0 -1
  118. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css +0 -10
  119. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +0 -20
  120. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js.map +0 -1
  121. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css +0 -70
  122. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +0 -127
  123. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js.map +0 -1
  124. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css +0 -110
  125. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +0 -127
  126. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +0 -1
  127. package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.css +0 -108
  128. package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js +0 -110
  129. package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js.map +0 -1
  130. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +0 -75
  131. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +0 -1
  132. package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js +0 -75
  133. package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js.map +0 -1
  134. package/dist/collection/components/giftback-form/giftback-form.css +0 -74
  135. package/dist/collection/components/giftback-form/giftback-form.js +0 -246
  136. package/dist/collection/components/giftback-form/giftback-form.js.map +0 -1
  137. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.css +0 -154
  138. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js +0 -156
  139. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js.map +0 -1
  140. package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js +0 -11
  141. package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js.map +0 -1
  142. package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js +0 -80
  143. package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js.map +0 -1
  144. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.css +0 -84
  145. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js +0 -174
  146. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js.map +0 -1
  147. package/dist/collection/components/loading-spinner/loading-spinner.css +0 -17
  148. package/dist/collection/components/loading-spinner/loading-spinner.js +0 -63
  149. package/dist/collection/components/loading-spinner/loading-spinner.js.map +0 -1
  150. package/dist/collection/components/modal/app-modal.css +0 -45
  151. package/dist/collection/components/modal/app-modal.js +0 -83
  152. package/dist/collection/components/modal/app-modal.js.map +0 -1
  153. package/dist/collection/components/note/crm-bonus-note.css +0 -51
  154. package/dist/collection/components/note/crm-bonus-note.js +0 -94
  155. package/dist/collection/components/note/crm-bonus-note.js.map +0 -1
  156. package/dist/collection/components/pedido/pedido.js +0 -83
  157. package/dist/collection/components/pedido/pedido.js.map +0 -1
  158. package/dist/collection/components/phone/phone-input-mask.css +0 -39
  159. package/dist/collection/components/phone/phone-input-mask.js +0 -122
  160. package/dist/collection/components/phone/phone-input-mask.js.map +0 -1
  161. package/dist/collection/contants/index.js +0 -11
  162. package/dist/collection/contants/index.js.map +0 -1
  163. package/dist/collection/contants/mocks.js +0 -28
  164. package/dist/collection/contants/mocks.js.map +0 -1
  165. package/dist/collection/dto/pin.sent.js +0 -2
  166. package/dist/collection/dto/pin.sent.js.map +0 -1
  167. package/dist/collection/dto/update.order.dto.js +0 -2
  168. package/dist/collection/dto/update.order.dto.js.map +0 -1
  169. package/dist/collection/dto/validate.pin.bonus.js +0 -2
  170. package/dist/collection/dto/validate.pin.bonus.js.map +0 -1
  171. package/dist/collection/helpers/info.config.helper.js +0 -11
  172. package/dist/collection/helpers/info.config.helper.js.map +0 -1
  173. package/dist/collection/i18n/i18n.js +0 -25
  174. package/dist/collection/i18n/i18n.js.map +0 -1
  175. package/dist/collection/index.js +0 -11
  176. package/dist/collection/index.js.map +0 -1
  177. package/dist/collection/services/crmbonus.service.js +0 -96
  178. package/dist/collection/services/crmbonus.service.js.map +0 -1
  179. package/dist/collection/utils/utils.js +0 -4
  180. package/dist/collection/utils/utils.js.map +0 -1
  181. package/dist/components/app-modal.js +0 -46
  182. package/dist/components/app-modal.js.map +0 -1
  183. package/dist/components/countdown-timer.js +0 -8
  184. package/dist/components/countdown-timer.js.map +0 -1
  185. package/dist/components/crm-bonus-form.js +0 -165
  186. package/dist/components/crm-bonus-form.js.map +0 -1
  187. package/dist/components/crm-bonus-note.js +0 -71
  188. package/dist/components/crm-bonus-note.js.map +0 -1
  189. package/dist/components/crm-bonus.js +0 -282
  190. package/dist/components/crm-bonus.js.map +0 -1
  191. package/dist/components/crm-button.js +0 -8
  192. package/dist/components/crm-button.js.map +0 -1
  193. package/dist/components/crm-giftback-form.js +0 -8
  194. package/dist/components/crm-giftback-form.js.map +0 -1
  195. package/dist/components/giftback-finish.js +0 -8
  196. package/dist/components/giftback-finish.js.map +0 -1
  197. package/dist/components/giftback-info.js +0 -8
  198. package/dist/components/giftback-info.js.map +0 -1
  199. package/dist/components/giftback-pin.js +0 -8
  200. package/dist/components/giftback-pin.js.map +0 -1
  201. package/dist/components/giftback-progress.js +0 -8
  202. package/dist/components/giftback-progress.js.map +0 -1
  203. package/dist/components/index.js +0 -9
  204. package/dist/components/index.js.map +0 -1
  205. package/dist/components/loading-spinner.js +0 -8
  206. package/dist/components/loading-spinner.js.map +0 -1
  207. package/dist/components/name-input.js +0 -8
  208. package/dist/components/name-input.js.map +0 -1
  209. package/dist/components/p-0a57e57f.js.map +0 -1
  210. package/dist/components/p-11bd8050.js +0 -62
  211. package/dist/components/p-11bd8050.js.map +0 -1
  212. package/dist/components/p-1d5eeac0.js +0 -2207
  213. package/dist/components/p-1d5eeac0.js.map +0 -1
  214. package/dist/components/p-25f37293.js +0 -238
  215. package/dist/components/p-25f37293.js.map +0 -1
  216. package/dist/components/p-2f266d73.js +0 -1068
  217. package/dist/components/p-2f266d73.js.map +0 -1
  218. package/dist/components/p-384fabf7.js.map +0 -1
  219. package/dist/components/p-39d680b6.js +0 -49
  220. package/dist/components/p-39d680b6.js.map +0 -1
  221. package/dist/components/p-46578efa.js +0 -44
  222. package/dist/components/p-46578efa.js.map +0 -1
  223. package/dist/components/p-4f18f4c0.js.map +0 -1
  224. package/dist/components/p-5c3fe5a8.js +0 -39
  225. package/dist/components/p-5c3fe5a8.js.map +0 -1
  226. package/dist/components/p-5dfa24e0.js.map +0 -1
  227. package/dist/components/p-75ba7b9a.js +0 -14
  228. package/dist/components/p-75ba7b9a.js.map +0 -1
  229. package/dist/components/p-a30bd6b1.js.map +0 -1
  230. package/dist/components/p-a561251a.js +0 -14
  231. package/dist/components/p-a561251a.js.map +0 -1
  232. package/dist/components/p-be365312.js +0 -76
  233. package/dist/components/p-be365312.js.map +0 -1
  234. package/dist/components/p-f168d5f6.js +0 -69
  235. package/dist/components/p-f168d5f6.js.map +0 -1
  236. package/dist/components/p-f5fcff75.js +0 -36
  237. package/dist/components/p-f5fcff75.js.map +0 -1
  238. package/dist/components/pedido-finalizado.js +0 -54
  239. package/dist/components/pedido-finalizado.js.map +0 -1
  240. package/dist/components/phone-cancel-input.js +0 -55
  241. package/dist/components/phone-cancel-input.js.map +0 -1
  242. package/dist/components/phone-form.js +0 -8
  243. package/dist/components/phone-form.js.map +0 -1
  244. package/dist/components/phone-input-mask.js +0 -8
  245. package/dist/components/phone-input-mask.js.map +0 -1
  246. package/dist/components/phone-input.js +0 -55
  247. package/dist/components/phone-input.js.map +0 -1
  248. package/dist/components/pin-form.js +0 -8
  249. package/dist/components/pin-form.js.map +0 -1
  250. package/dist/crmbonus-component-wake/p-1d5eeac0.js +0 -2
  251. package/dist/crmbonus-component-wake/p-1d5eeac0.js.map +0 -1
  252. package/dist/crmbonus-component-wake/p-384fabf7.js +0 -2
  253. package/dist/crmbonus-component-wake/p-384fabf7.js.map +0 -1
  254. package/dist/crmbonus-component-wake/p-3beb5158.entry.js +0 -2
  255. package/dist/crmbonus-component-wake/p-3beb5158.entry.js.map +0 -1
  256. package/dist/crmbonus-component-wake/p-5a8fa5b9.entry.js +0 -2
  257. package/dist/crmbonus-component-wake/p-5a8fa5b9.entry.js.map +0 -1
  258. package/dist/crmbonus-component-wake/p-5ede3b10.entry.js +0 -2
  259. package/dist/crmbonus-component-wake/p-5ede3b10.entry.js.map +0 -1
  260. package/dist/crmbonus-component-wake/p-66f41fd0.entry.js +0 -2
  261. package/dist/crmbonus-component-wake/p-66f41fd0.entry.js.map +0 -1
  262. package/dist/crmbonus-component-wake/p-6e6bf96e.js +0 -3
  263. package/dist/crmbonus-component-wake/p-6e6bf96e.js.map +0 -1
  264. package/dist/crmbonus-component-wake/p-75ba7b9a.js +0 -2
  265. package/dist/crmbonus-component-wake/p-75ba7b9a.js.map +0 -1
  266. package/dist/crmbonus-component-wake/p-830b5bdc.entry.js +0 -2
  267. package/dist/crmbonus-component-wake/p-830b5bdc.entry.js.map +0 -1
  268. package/dist/crmbonus-component-wake/p-8b9a1aec.entry.js +0 -2
  269. package/dist/crmbonus-component-wake/p-8b9a1aec.entry.js.map +0 -1
  270. package/dist/crmbonus-component-wake/p-9514339e.entry.js +0 -2
  271. package/dist/crmbonus-component-wake/p-9514339e.entry.js.map +0 -1
  272. package/dist/crmbonus-component-wake/p-a561251a.js +0 -2
  273. package/dist/crmbonus-component-wake/p-a561251a.js.map +0 -1
  274. package/dist/crmbonus-component-wake/p-adb37e26.entry.js +0 -2
  275. package/dist/crmbonus-component-wake/p-adb37e26.entry.js.map +0 -1
  276. package/dist/crmbonus-component-wake/p-af160cdc.entry.js +0 -2
  277. package/dist/crmbonus-component-wake/p-af160cdc.entry.js.map +0 -1
  278. package/dist/crmbonus-component-wake/p-c271c472.entry.js +0 -2
  279. package/dist/crmbonus-component-wake/p-c271c472.entry.js.map +0 -1
  280. package/dist/crmbonus-component-wake/p-c72a11ba.entry.js +0 -2
  281. package/dist/crmbonus-component-wake/p-c72a11ba.entry.js.map +0 -1
  282. package/dist/crmbonus-component-wake/p-cc452df3.entry.js +0 -2
  283. package/dist/crmbonus-component-wake/p-cc452df3.entry.js.map +0 -1
  284. package/dist/crmbonus-component-wake/p-d0349daf.entry.js +0 -2
  285. package/dist/crmbonus-component-wake/p-d0349daf.entry.js.map +0 -1
  286. package/dist/crmbonus-component-wake/p-e1255160.js +0 -2
  287. package/dist/crmbonus-component-wake/p-e1255160.js.map +0 -1
  288. package/dist/env.js +0 -5
  289. package/dist/env.js.map +0 -1
  290. package/dist/esm/app-modal.entry.js.map +0 -1
  291. package/dist/esm/countdown-timer_4.entry.js +0 -169
  292. package/dist/esm/countdown-timer_4.entry.js.map +0 -1
  293. package/dist/esm/crm-bonus-form.entry.js.map +0 -1
  294. package/dist/esm/crm-bonus-note.entry.js +0 -48
  295. package/dist/esm/crm-bonus-note.entry.js.map +0 -1
  296. package/dist/esm/crm-bonus.entry.js.map +0 -1
  297. package/dist/esm/crm-button.entry.js.map +0 -1
  298. package/dist/esm/crm-giftback-form.entry.js.map +0 -1
  299. package/dist/esm/crmbonus-component-wake.js +0 -22
  300. package/dist/esm/crmbonus-component-wake.js.map +0 -1
  301. package/dist/esm/crmbonus.service-a846150c.js.map +0 -1
  302. package/dist/esm/giftback-finish_4.entry.js +0 -125
  303. package/dist/esm/giftback-finish_4.entry.js.map +0 -1
  304. package/dist/esm/index-a4c14fca.js +0 -1225
  305. package/dist/esm/index-a4c14fca.js.map +0 -1
  306. package/dist/esm/index.js +0 -7
  307. package/dist/esm/index.js.map +0 -1
  308. package/dist/esm/loader.js +0 -13
  309. package/dist/esm/loader.js.map +0 -1
  310. package/dist/esm/loading-spinner.entry.js.map +0 -1
  311. package/dist/esm/pedido-finalizado.entry.js.map +0 -1
  312. package/dist/esm/phone-cancel-input.entry.js.map +0 -1
  313. package/dist/esm/phone-input-mask.entry.js.map +0 -1
  314. package/dist/esm/phone-input.entry.js.map +0 -1
  315. package/dist/index.cjs.js +0 -1
  316. package/dist/index.js +0 -1
  317. /package/dist/{esm → crmbonus-component-wake}/app-globals-0f993ce5.js +0 -0
  318. /package/dist/{esm → crmbonus-component-wake}/app-globals-0f993ce5.js.map +0 -0
  319. /package/dist/{esm → crmbonus-component-wake}/index-3c6d4feb.js +0 -0
  320. /package/dist/{esm → crmbonus-component-wake}/index-3c6d4feb.js.map +0 -0
  321. /package/dist/{esm → crmbonus-component-wake}/info.config.helper-42d9ddf9.js +0 -0
  322. /package/dist/{esm → crmbonus-component-wake}/info.config.helper-42d9ddf9.js.map +0 -0
@@ -1,291 +0,0 @@
1
- import { h } from "@stencil/core";
2
- import { CrmBonusService } from "../../services/crmbonus.service";
3
- import { StepFormEnum } from "../../contants";
4
- import i18next from "../../i18n/i18n";
5
- console.log('i18next', i18next.language);
6
- export class CrmBonus {
7
- constructor() {
8
- this.crmBonusService = CrmBonusService.getInstance();
9
- this.showModal = false;
10
- this.userId = undefined;
11
- this.storeName = undefined;
12
- this.productsInString = undefined;
13
- this.cartId = undefined;
14
- this.products = undefined;
15
- this.customer = {
16
- birthDate: "",
17
- document: "",
18
- name: "",
19
- phone: ""
20
- };
21
- this.loading = false;
22
- this.message = undefined;
23
- this.phone = undefined;
24
- this.canCancel = false;
25
- this.amountCancel = undefined;
26
- this.sent = undefined;
27
- this.session = undefined;
28
- }
29
- async componentWillLoad() {
30
- i18next.changeLanguage(i18next.language);
31
- await this.loadSession();
32
- await this.loadConfigStore();
33
- await this.handleLoad();
34
- }
35
- async loadConfigStore() {
36
- await this.crmBonusService.getCustomization(this.storeName);
37
- }
38
- async handleLoad() {
39
- try {
40
- if (this.userId) {
41
- this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);
42
- }
43
- const amount = localStorage.getItem(this.cartId);
44
- if (amount) {
45
- this.canCancel = true;
46
- this.amountCancel = amount;
47
- }
48
- }
49
- catch (error) {
50
- console.log('info customer');
51
- }
52
- this.buildAndGetProducts();
53
- }
54
- async loadSession() {
55
- this.session = await this.crmBonusService.getToken(this.storeName);
56
- setTimeout(() => {
57
- this.loadSession();
58
- }, 1500000);
59
- }
60
- async buildAndGetProducts() {
61
- const key = `bc-products:${this.cartId}`;
62
- const cache_products = localStorage.getItem(key);
63
- if (!cache_products) {
64
- localStorage.setItem(key, this.productsInString);
65
- }
66
- const productsInCart = JSON.parse(this.productsInString);
67
- const products_in_cache = JSON.parse(localStorage.getItem(key));
68
- const products = [];
69
- for (const product_cart of productsInCart) {
70
- const [pro] = products_in_cache.filter(p => p.ProdutoVarianteId == product_cart.ProdutoVarianteId);
71
- if (pro) {
72
- products.push(Object.assign(Object.assign({}, product_cart), { PrecoPor: pro.PrecoPor }));
73
- }
74
- else {
75
- products.push(product_cart);
76
- }
77
- }
78
- this.products = products; //cache_products ? JSON.parse(cache_products) : JSON.parse(this.productsInString);
79
- }
80
- async sendPin(phone) {
81
- var _a, _b;
82
- this.loading = true;
83
- this.message = "";
84
- try {
85
- const _phone = phone.replace(/\D/g, '');
86
- this.phone = Number(_phone);
87
- this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.storeName);
88
- ;
89
- await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);
90
- this.showModal = true;
91
- }
92
- catch (error) {
93
- this.message = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.message;
94
- }
95
- finally {
96
- this.loading = false;
97
- }
98
- }
99
- async sendPinName(customerName) {
100
- var _a, _b;
101
- this.loading = true;
102
- this.message = "";
103
- try {
104
- this.customer.name = customerName;
105
- this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.storeName);
106
- ;
107
- await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);
108
- this.showModal = true;
109
- }
110
- catch (error) {
111
- this.message = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.message;
112
- }
113
- finally {
114
- this.loading = false;
115
- }
116
- }
117
- buildProducts() {
118
- return this.products.map(product => ({ sku: product.SKU, value: (product.PrecoPor * product.Quantidade), productVariantId: product.ProdutoVarianteId.toString(), quantity: product.Quantidade }));
119
- }
120
- handleCloseModal() {
121
- this.showModal = false;
122
- }
123
- save(amount) {
124
- localStorage.setItem(this.cartId, amount.toString());
125
- this.canCancel = true;
126
- this.amountCancel = amount.toString();
127
- }
128
- async cancel() {
129
- this.message = "";
130
- this.loading = true;
131
- try {
132
- await this.crmBonusService.cancel(this.cartId);
133
- this.canCancel = false;
134
- localStorage.removeItem(this.cartId);
135
- }
136
- catch (error) {
137
- this.message = "Não consegui cancelar o bônus, tente novamente!";
138
- }
139
- finally {
140
- this.loading = false;
141
- }
142
- }
143
- async handleSendPin(phone) {
144
- this.message = "";
145
- if (!phone) {
146
- this.message = "Informe seu telefone";
147
- return;
148
- }
149
- this.customer.phone = phone;
150
- const _phone = phone.replace(/\D/g, '');
151
- this.phone = Number(_phone);
152
- if (this.customer.name) {
153
- return this.sendPin(phone);
154
- }
155
- await this.crmBonusRef.setStep(StepFormEnum.STEP_NAME);
156
- this.showModal = true;
157
- }
158
- render() {
159
- return (h("crm-giftback-form", { key: '79182d3759f4942334af4a8c0bf0da42b3752db3', storeName: this.storeName, products: this.buildProducts(), cartId: this.cartId })
160
- // <div class="section-cart-crm">
161
- // <p class="text-left fbits-responsive-carrinho-desconto-texto">Giftback</p>
162
- // <div class="container-button">
163
- // {/* <img src={logo} onClick={() => (this.showModal = true)} /> */}
164
- // {
165
- // this.canCancel ? <phone-cancel-input value={this.amountCancel} sendPin={() => { this.cancel() }} loading={this.loading} />
166
- // : <phone-input value={this.customer.phone} sendPin={(phone) => { this.handleSendPin(phone) }} loading={this.loading} />
167
- // }
168
- // </div>
169
- // <p class="message-alert" >{this.message}</p>
170
- // <app-modal
171
- // isOpen={this.showModal}
172
- // modalTitle={`Giftback`}
173
- // onModalClosed={() => (this.showModal = false)}
174
- // >
175
- // <crm-bonus-form
176
- // loadingModal={this.loading}
177
- // saveStore={(amount: number) => this.save(amount)}
178
- // ref={ref => this.crmBonusRef = ref}
179
- // sent={this.sent}
180
- // phone={this.phone}
181
- // cancel={() => this.handleCloseModal()}
182
- // storeName={this.storeName}
183
- // products={this.buildProducts()}
184
- // cartId={this.cartId} customer={this.customer}
185
- // handleCustomerName={(name: string) => this.sendPinName(name)}
186
- // />
187
- // </app-modal>
188
- // </div>
189
- );
190
- }
191
- static get is() { return "crm-bonus"; }
192
- static get encapsulation() { return "shadow"; }
193
- static get originalStyleUrls() {
194
- return {
195
- "$": ["crm-bonus.css"]
196
- };
197
- }
198
- static get styleUrls() {
199
- return {
200
- "$": ["crm-bonus.css"]
201
- };
202
- }
203
- static get assetsDirs() { return ["assets"]; }
204
- static get properties() {
205
- return {
206
- "userId": {
207
- "type": "number",
208
- "mutable": false,
209
- "complexType": {
210
- "original": "number",
211
- "resolved": "number",
212
- "references": {}
213
- },
214
- "required": false,
215
- "optional": false,
216
- "docs": {
217
- "tags": [],
218
- "text": ""
219
- },
220
- "attribute": "userid",
221
- "reflect": false
222
- },
223
- "storeName": {
224
- "type": "any",
225
- "mutable": false,
226
- "complexType": {
227
- "original": "any",
228
- "resolved": "any",
229
- "references": {}
230
- },
231
- "required": false,
232
- "optional": false,
233
- "docs": {
234
- "tags": [],
235
- "text": ""
236
- },
237
- "attribute": "storename",
238
- "reflect": false
239
- },
240
- "productsInString": {
241
- "type": "string",
242
- "mutable": false,
243
- "complexType": {
244
- "original": "string",
245
- "resolved": "string",
246
- "references": {}
247
- },
248
- "required": false,
249
- "optional": false,
250
- "docs": {
251
- "tags": [],
252
- "text": ""
253
- },
254
- "attribute": "products",
255
- "reflect": false
256
- },
257
- "cartId": {
258
- "type": "any",
259
- "mutable": false,
260
- "complexType": {
261
- "original": "any",
262
- "resolved": "any",
263
- "references": {}
264
- },
265
- "required": false,
266
- "optional": false,
267
- "docs": {
268
- "tags": [],
269
- "text": ""
270
- },
271
- "attribute": "cartid",
272
- "reflect": false
273
- }
274
- };
275
- }
276
- static get states() {
277
- return {
278
- "showModal": {},
279
- "products": {},
280
- "customer": {},
281
- "loading": {},
282
- "message": {},
283
- "phone": {},
284
- "canCancel": {},
285
- "amountCancel": {},
286
- "sent": {},
287
- "session": {}
288
- };
289
- }
290
- }
291
- //# sourceMappingURL=crm-bonus.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"crm-bonus.js","sourceRoot":"","sources":["../../../../src/components/crm-bonus/crm-bonus.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,OAAO,MAAM,iBAAiB,CAAA;AAErC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;AAQxC,MAAM,OAAO,QAAQ;;QAEX,oBAAe,GAAoB,eAAe,CAAC,WAAW,EAAE,CAAC;yBAI3C,KAAK;;;;;;wBAOJ;YAC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,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, State, h } from '@stencil/core';\nimport { IProduct, IProductWake, ICustomer } from '../../dto/validate.pin.bonus';\nimport { CrmBonusService } from '../../services/crmbonus.service';\nimport { IPinSent } from '../../components';\nimport { StepFormEnum } from '../../contants';\n\nimport i18next from '../../i18n/i18n'\n\nconsole.log('i18next', i18next.language)\n\n@Component({\n tag: 'crm-bonus',\n styleUrl: 'crm-bonus.css',\n shadow: true,\n assetsDirs: ['assets']\n})\nexport class CrmBonus {\n\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\n private crmBonusRef: HTMLCrmBonusFormElement;\n\n @State() showModal: boolean = false;\n @Prop({ attribute: 'userid' }) userId: number;\n @Prop({ attribute: 'storename' }) storeName;\n @Prop({ attribute: 'products' }) productsInString: string;\n @Prop({ attribute: 'cartid' }) cartId;\n\n @State() products: Array<IProductWake>;\n @State() customer: ICustomer = {\n birthDate: \"\",\n document: \"\",\n name: \"\",\n phone: \"\"\n };\n\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: number;\n @State() canCancel: boolean = false;\n @State() amountCancel: string;\n @State() sent: IPinSent;\n\n @State() session: string;\n\n async componentWillLoad() {\n i18next.changeLanguage(i18next.language);\n\n await this.loadSession();\n await this.loadConfigStore()\n await this.handleLoad();\n }\n\n async loadConfigStore() {\n await this.crmBonusService.getCustomization(this.storeName);\n }\n\n async handleLoad() {\n try {\n if (this.userId) {\n this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);\n }\n\n const amount = localStorage.getItem(this.cartId);\n\n if (amount) {\n this.canCancel = true;\n this.amountCancel = amount;\n }\n\n } catch (error) {\n console.log('info customer')\n }\n \n this.buildAndGetProducts();\n }\n\n\n async loadSession() {\n this.session = await this.crmBonusService.getToken(this.storeName);\n\n setTimeout(() => {\n this.loadSession()\n }, 1500000)\n\n }\n\n async buildAndGetProducts() {\n const key = `bc-products:${this.cartId}`;\n const cache_products = localStorage.getItem(key)\n\n if (!cache_products) {\n localStorage.setItem(key, this.productsInString);\n }\n\n const productsInCart = JSON.parse(this.productsInString);\n const products_in_cache = JSON.parse(localStorage.getItem(key));\n\n const products: Array<IProductWake> = []\n\n for (const product_cart of productsInCart) {\n\n const [pro] = products_in_cache.filter(p => p.ProdutoVarianteId == product_cart.ProdutoVarianteId)\n\n if (pro) {\n products.push({\n ...product_cart,\n PrecoPor: pro.PrecoPor\n })\n } else {\n products.push(product_cart)\n }\n \n }\n\n this.products = products; //cache_products ? JSON.parse(cache_products) : JSON.parse(this.productsInString);\n\n }\n\n public async sendPin(phone: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n\n this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.storeName);;\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n\n this.showModal = true;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n public async sendPinName(customerName: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n this.customer.name = customerName;\n\n this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.storeName);;\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n\n this.showModal = true;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n buildProducts(): IProduct[] {\n return this.products.map(product => ({ sku: product.SKU, value: (product.PrecoPor * product.Quantidade), productVariantId: product.ProdutoVarianteId.toString(), quantity: product.Quantidade }))\n }\n\n handleCloseModal() {\n this.showModal = false;\n }\n\n save(amount: number) {\n localStorage.setItem(this.cartId, amount.toString());\n this.canCancel = true;\n this.amountCancel = amount.toString()\n }\n\n async cancel() {\n this.message = \"\";\n this.loading = true;\n try {\n await this.crmBonusService.cancel(this.cartId);\n this.canCancel = false;\n\n localStorage.removeItem(this.cartId);\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 async handleSendPin(phone: string) {\n this.message = \"\"\n if (!phone) {\n this.message = \"Informe seu telefone\";\n return;\n }\n\n this.customer.phone = phone;\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n\n if (this.customer.name) {\n return this.sendPin(phone)\n }\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_NAME);\n this.showModal = true;\n }\n\n render() {\n\n return (\n <crm-giftback-form \n storeName={this.storeName}\n products={this.buildProducts()}\n cartId={this.cartId}\n />\n // <div class=\"section-cart-crm\">\n // <p class=\"text-left fbits-responsive-carrinho-desconto-texto\">Giftback</p>\n // <div class=\"container-button\">\n // {/* <img src={logo} onClick={() => (this.showModal = true)} /> */}\n // {\n // this.canCancel ? <phone-cancel-input value={this.amountCancel} sendPin={() => { this.cancel() }} loading={this.loading} />\n // : <phone-input value={this.customer.phone} sendPin={(phone) => { this.handleSendPin(phone) }} loading={this.loading} />\n // }\n // </div>\n // <p class=\"message-alert\" >{this.message}</p>\n // <app-modal\n // isOpen={this.showModal}\n // modalTitle={`Giftback`}\n // onModalClosed={() => (this.showModal = false)}\n // >\n // <crm-bonus-form\n // loadingModal={this.loading}\n // saveStore={(amount: number) => this.save(amount)}\n // ref={ref => this.crmBonusRef = ref}\n // sent={this.sent}\n // phone={this.phone}\n // cancel={() => this.handleCloseModal()}\n // storeName={this.storeName}\n // products={this.buildProducts()}\n // cartId={this.cartId} customer={this.customer}\n // handleCustomerName={(name: string) => this.sendPinName(name)}\n // />\n // </app-modal>\n // </div>\n )\n }\n}\n"]}
@@ -1,19 +0,0 @@
1
- .form-container {
2
- width: 100%;
3
- display: flex;
4
- justify-content: center;
5
- justify-content: space-around;
6
- }
7
-
8
- .disabled {
9
- opacity: 0.6;
10
- cursor: not-allowed;
11
- }
12
-
13
- .message-error {
14
- color: #d11111;
15
- font-weight: bold;
16
- font-family: Arial;
17
- font-size: small;
18
- margin-left: 16px;
19
- }
@@ -1,348 +0,0 @@
1
- import { Host, h } from "@stencil/core";
2
- import { CrmBonusService } from "../../services/crmbonus.service";
3
- import { StepFormEnum } from "../../contants";
4
- export class CrmBonusForm {
5
- constructor() {
6
- this.crmBonusService = CrmBonusService.getInstance();
7
- this.storeName = undefined;
8
- this.cartId = undefined;
9
- this.products = undefined;
10
- this.customer = {
11
- phone: "",
12
- birthDate: "",
13
- document: "",
14
- name: ""
15
- };
16
- this.sent = undefined;
17
- this.stepNext = undefined;
18
- this.phone = undefined;
19
- this.loadingModal = undefined;
20
- this.saveStore = undefined;
21
- this.cancel = undefined;
22
- this.handleCustomerName = undefined;
23
- this.loading = false;
24
- this.step = StepFormEnum.STEP_NAME;
25
- this.message = undefined;
26
- this.bonus = undefined;
27
- }
28
- async setStep(step) {
29
- this.step = step;
30
- }
31
- async validateBonus(pin) {
32
- var _a, _b;
33
- this.loading = true;
34
- this.message = "";
35
- const payload = {
36
- pin: pin,
37
- cellphone: this.phone.toString(),
38
- storeId: this.sent.storeId.toString(),
39
- userId: this.sent.userId.toString(),
40
- checkoutId: this.cartId,
41
- checkoutProducts: this.products,
42
- name: null,
43
- storeName: this.storeName
44
- };
45
- try {
46
- this.bonus = await this.crmBonusService.validatePinBonus(payload);
47
- this.step = StepFormEnum.STEP_RESERVE;
48
- }
49
- catch (error) {
50
- this.message = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.message;
51
- }
52
- finally {
53
- this.loading = false;
54
- }
55
- }
56
- async reserveApply(amount) {
57
- this.loading = true;
58
- this.message = "";
59
- try {
60
- await this.reserve(amount);
61
- this.step = StepFormEnum.STEP_APPLY;
62
- this.saveStore(amount);
63
- }
64
- catch (error) {
65
- this.message = "ocorreu um error ao solicitar a aplicação do bonus! tente novamente";
66
- }
67
- finally {
68
- this.loading = false;
69
- }
70
- }
71
- async reserve(amount) {
72
- await this.crmBonusService.reserve({
73
- redeemedBonus: amount,
74
- cartId: this.cartId,
75
- ticket: this.cartId,
76
- grossValue: Number(this.bonus.totalValue),
77
- storeName: this.storeName,
78
- storeId: this.bonus.storeId.toString(),
79
- userId: this.bonus.userId
80
- });
81
- }
82
- handleCancel() {
83
- this.step = StepFormEnum.STEP_PHONE;
84
- this.cancel();
85
- }
86
- render() {
87
- return (h(Host, { key: '56bef07243aafe1abb78fdfd38922801b84c269b' }, this.step == StepFormEnum.STEP_NAME && h("name-input", { key: '685df95ea0cd693f9a62893798464834524f5168', loading: this.loadingModal, value: this.customer.name, applyName: (name) => this.handleCustomerName(name) }), this.step === StepFormEnum.STEP_PIN && h("giftback-pin", { key: 'af82b751ed04382498e25614276ac08d5cade07a', cancel: () => this.handleCancel(), sent: this.sent, validate: (data) => this.validateBonus(data), loading: this.loading }), this.step === StepFormEnum.STEP_RESERVE && h("giftback-progress", { key: '1b493c06bf11bc7596d672fcec789a9f93573751', loading: this.loading, cancel: () => this.handleCancel(), bonus: this.bonus, reserve: (amountRedeemed) => this.reserveApply(amountRedeemed) }), this.step === StepFormEnum.STEP_APPLY && h("giftback-finish", { key: '272438aa4dbc8bb1ef9fdb45d3c2cc657d41ef4a' }), h("p", { key: 'a3a0e8a1be44d65b1edd34e28956d1b34b732fef', class: "message-error" }, this.message)));
88
- }
89
- static get is() { return "crm-bonus-form"; }
90
- static get encapsulation() { return "shadow"; }
91
- static get originalStyleUrls() {
92
- return {
93
- "$": ["crm-bonus-form.css"]
94
- };
95
- }
96
- static get styleUrls() {
97
- return {
98
- "$": ["crm-bonus-form.css"]
99
- };
100
- }
101
- static get properties() {
102
- return {
103
- "storeName": {
104
- "type": "any",
105
- "mutable": false,
106
- "complexType": {
107
- "original": "any",
108
- "resolved": "any",
109
- "references": {}
110
- },
111
- "required": false,
112
- "optional": false,
113
- "docs": {
114
- "tags": [],
115
- "text": ""
116
- },
117
- "attribute": "storename",
118
- "reflect": false
119
- },
120
- "cartId": {
121
- "type": "any",
122
- "mutable": false,
123
- "complexType": {
124
- "original": "any",
125
- "resolved": "any",
126
- "references": {}
127
- },
128
- "required": false,
129
- "optional": false,
130
- "docs": {
131
- "tags": [],
132
- "text": ""
133
- },
134
- "attribute": "cart-id",
135
- "reflect": false
136
- },
137
- "products": {
138
- "type": "unknown",
139
- "mutable": false,
140
- "complexType": {
141
- "original": "Array<IProduct>",
142
- "resolved": "IProduct[]",
143
- "references": {
144
- "Array": {
145
- "location": "global",
146
- "id": "global::Array"
147
- },
148
- "IProduct": {
149
- "location": "import",
150
- "path": "../../dto/validate.pin.bonus",
151
- "id": "src/dto/validate.pin.bonus.ts::IProduct"
152
- }
153
- }
154
- },
155
- "required": false,
156
- "optional": false,
157
- "docs": {
158
- "tags": [],
159
- "text": ""
160
- }
161
- },
162
- "customer": {
163
- "type": "unknown",
164
- "mutable": false,
165
- "complexType": {
166
- "original": "ICustomer",
167
- "resolved": "ICustomer",
168
- "references": {
169
- "ICustomer": {
170
- "location": "import",
171
- "path": "../../dto/validate.pin.bonus",
172
- "id": "src/dto/validate.pin.bonus.ts::ICustomer"
173
- }
174
- }
175
- },
176
- "required": false,
177
- "optional": false,
178
- "docs": {
179
- "tags": [],
180
- "text": ""
181
- },
182
- "defaultValue": "{\n phone: \"\",\n birthDate: \"\",\n document: \"\",\n name: \"\"\n }"
183
- },
184
- "sent": {
185
- "type": "unknown",
186
- "mutable": false,
187
- "complexType": {
188
- "original": "IPinSent",
189
- "resolved": "IPinSent",
190
- "references": {
191
- "IPinSent": {
192
- "location": "import",
193
- "path": "../../dto/pin.sent",
194
- "id": "src/dto/pin.sent.ts::IPinSent"
195
- }
196
- }
197
- },
198
- "required": false,
199
- "optional": false,
200
- "docs": {
201
- "tags": [],
202
- "text": ""
203
- }
204
- },
205
- "stepNext": {
206
- "type": "number",
207
- "mutable": false,
208
- "complexType": {
209
- "original": "StepFormEnum",
210
- "resolved": "StepFormEnum.STEP_APPLY | StepFormEnum.STEP_NAME | StepFormEnum.STEP_NO_BONUS | StepFormEnum.STEP_PHONE | StepFormEnum.STEP_PIN | StepFormEnum.STEP_RESERVE",
211
- "references": {
212
- "StepFormEnum": {
213
- "location": "import",
214
- "path": "../../contants",
215
- "id": "src/contants/index.ts::StepFormEnum"
216
- }
217
- }
218
- },
219
- "required": false,
220
- "optional": false,
221
- "docs": {
222
- "tags": [],
223
- "text": ""
224
- },
225
- "attribute": "step-next",
226
- "reflect": false
227
- },
228
- "phone": {
229
- "type": "number",
230
- "mutable": false,
231
- "complexType": {
232
- "original": "number",
233
- "resolved": "number",
234
- "references": {}
235
- },
236
- "required": false,
237
- "optional": false,
238
- "docs": {
239
- "tags": [],
240
- "text": ""
241
- },
242
- "attribute": "phone",
243
- "reflect": false
244
- },
245
- "loadingModal": {
246
- "type": "boolean",
247
- "mutable": false,
248
- "complexType": {
249
- "original": "boolean",
250
- "resolved": "boolean",
251
- "references": {}
252
- },
253
- "required": false,
254
- "optional": false,
255
- "docs": {
256
- "tags": [],
257
- "text": ""
258
- },
259
- "attribute": "loading-modal",
260
- "reflect": false
261
- },
262
- "saveStore": {
263
- "type": "unknown",
264
- "mutable": false,
265
- "complexType": {
266
- "original": "(amount: number) => void",
267
- "resolved": "(amount: number) => void",
268
- "references": {}
269
- },
270
- "required": false,
271
- "optional": false,
272
- "docs": {
273
- "tags": [],
274
- "text": ""
275
- }
276
- },
277
- "cancel": {
278
- "type": "unknown",
279
- "mutable": false,
280
- "complexType": {
281
- "original": "() => void",
282
- "resolved": "() => void",
283
- "references": {}
284
- },
285
- "required": false,
286
- "optional": false,
287
- "docs": {
288
- "tags": [],
289
- "text": ""
290
- }
291
- },
292
- "handleCustomerName": {
293
- "type": "unknown",
294
- "mutable": false,
295
- "complexType": {
296
- "original": "(name: string) => void",
297
- "resolved": "(name: string) => void",
298
- "references": {}
299
- },
300
- "required": false,
301
- "optional": false,
302
- "docs": {
303
- "tags": [],
304
- "text": ""
305
- }
306
- }
307
- };
308
- }
309
- static get states() {
310
- return {
311
- "loading": {},
312
- "step": {},
313
- "message": {},
314
- "bonus": {}
315
- };
316
- }
317
- static get methods() {
318
- return {
319
- "setStep": {
320
- "complexType": {
321
- "signature": "(step: StepFormEnum) => Promise<void>",
322
- "parameters": [{
323
- "name": "step",
324
- "type": "StepFormEnum",
325
- "docs": ""
326
- }],
327
- "references": {
328
- "Promise": {
329
- "location": "global",
330
- "id": "global::Promise"
331
- },
332
- "StepFormEnum": {
333
- "location": "import",
334
- "path": "../../contants",
335
- "id": "src/contants/index.ts::StepFormEnum"
336
- }
337
- },
338
- "return": "Promise<void>"
339
- },
340
- "docs": {
341
- "text": "",
342
- "tags": []
343
- }
344
- }
345
- };
346
- }
347
- }
348
- //# sourceMappingURL=crm-bonus-form.js.map