crmbonus-component-wake 2.0.125 → 2.0.126
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.
- package/dist/{esm → crmbonus-component-wake}/app-modal.entry.js +2 -3
- package/dist/crmbonus-component-wake/app-modal.entry.js.map +1 -0
- package/dist/{components/p-abbfbc98.js → crmbonus-component-wake/cart.helper-4e40ffa9.js} +3 -2
- package/dist/crmbonus-component-wake/cart.helper-4e40ffa9.js.map +1 -0
- package/dist/{esm/cart.helper-30a40560.js → crmbonus-component-wake/cart.helper-a921d7f9.js} +3 -2
- package/dist/crmbonus-component-wake/cart.helper-a921d7f9.js.map +1 -0
- package/dist/{components/p-2b3b8d6b.js → crmbonus-component-wake/countdown-timer.entry.js} +7 -27
- package/dist/crmbonus-component-wake/countdown-timer.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/crm-bonus-form.entry.js +4 -5
- package/dist/crmbonus-component-wake/{p-c23f3a07.entry.js.map → crm-bonus-form.entry.js.map} +1 -1
- package/dist/{esm → crmbonus-component-wake}/crm-bonus-note.entry.js +9 -10
- package/dist/crmbonus-component-wake/crm-bonus-note.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/crm-bonus.entry.js +8 -7
- package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/crm-button.entry.js +20 -0
- package/dist/crmbonus-component-wake/crm-button.entry.js.map +1 -0
- package/dist/{esm/crm-giftback-form_2.entry.js → crmbonus-component-wake/crm-giftback-form.entry.js} +12 -27
- package/dist/crmbonus-component-wake/crm-giftback-form.entry.js.map +1 -0
- package/dist/{components/p-58b97429.js → crmbonus-component-wake/crm-tooltip.entry.js} +8 -27
- package/dist/crmbonus-component-wake/crm-tooltip.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/crmbonus-component-wake.css +7 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +48 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
- package/dist/{esm/crmbonus.service-42fbd7fa.js → crmbonus-component-wake/crmbonus.service-67550994.js} +162 -90
- package/dist/crmbonus-component-wake/crmbonus.service-67550994.js.map +1 -0
- package/dist/{components/p-6eda79c3.js → crmbonus-component-wake/crmbonus.service-9f4c6fd7.js} +165 -93
- package/dist/crmbonus-component-wake/crmbonus.service-9f4c6fd7.js.map +1 -0
- package/dist/{components/p-b79c86a8.js → crmbonus-component-wake/giftback-finish.entry.js} +8 -25
- package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +1 -0
- package/dist/{components/p-2671d669.js → crmbonus-component-wake/giftback-info.entry.js} +12 -52
- package/dist/crmbonus-component-wake/giftback-info.entry.js.map +1 -0
- package/dist/{components/p-6186ddcc.js → crmbonus-component-wake/giftback-pin.entry.js} +8 -38
- package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +1 -0
- package/dist/{components/p-7c744cca.js → crmbonus-component-wake/giftback-progress.entry.js} +8 -37
- package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +1 -0
- package/dist/{esm/i18n-e8150dff.js → crmbonus-component-wake/i18n-11138a2c.js} +16 -1
- package/dist/{esm/i18n-e8150dff.js.map → crmbonus-component-wake/i18n-11138a2c.js.map} +1 -1
- package/dist/crmbonus-component-wake/index-d0fd1dc0.js +3039 -0
- package/dist/crmbonus-component-wake/index-d0fd1dc0.js.map +1 -0
- package/dist/crmbonus-component-wake/index.esm.js +12 -1
- package/dist/crmbonus-component-wake/index.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/loading-container.entry.js +18 -0
- package/dist/crmbonus-component-wake/loading-container.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/loading-spinner.entry.js +2 -3
- package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +1 -0
- package/dist/{components/p-246a3e9d.js → crmbonus-component-wake/name-input.entry.js} +8 -37
- package/dist/crmbonus-component-wake/name-input.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/pedido-finalizado.entry.js +4 -4
- package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/phone-cancel-input.entry.js +1 -1
- package/dist/crmbonus-component-wake/phone-cancel-input.entry.js.map +1 -0
- package/dist/{components/p-6c546e48.js → crmbonus-component-wake/phone-form.entry.js} +8 -47
- package/dist/crmbonus-component-wake/phone-form.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/phone-input-mask.entry.js +2 -3
- package/dist/crmbonus-component-wake/phone-input-mask.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/phone-input.entry.js +1 -1
- package/dist/crmbonus-component-wake/phone-input.entry.js.map +1 -0
- package/dist/{components/p-83a12a8f.js → crmbonus-component-wake/pin-form.entry.js} +9 -56
- package/dist/crmbonus-component-wake/pin-form.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js +334 -0
- package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js.map +1 -0
- package/dist/{collection/utils/utils.js → crmbonus-component-wake/utils-96cf9ae0.js} +8 -5
- package/dist/crmbonus-component-wake/utils-96cf9ae0.js.map +1 -0
- package/dist/types/home/darlison/Projects/Bycoders/crmbonus/crmbonus-component/.stencil/env.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/app-globals-3a1e7e63.js +0 -7
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/app-modal.cjs.entry.js +0 -28
- package/dist/cjs/app-modal.cjs.entry.js.map +0 -1
- package/dist/cjs/cart.helper-d4d8d619.js +0 -77
- package/dist/cjs/cart.helper-d4d8d619.js.map +0 -1
- package/dist/cjs/countdown-timer_2.cjs.entry.js +0 -63
- package/dist/cjs/countdown-timer_2.cjs.entry.js.map +0 -1
- package/dist/cjs/crm-bonus-form.cjs.entry.js +0 -104
- package/dist/cjs/crm-bonus-form.cjs.entry.js.map +0 -1
- package/dist/cjs/crm-bonus-note.cjs.entry.js +0 -101
- package/dist/cjs/crm-bonus-note.cjs.entry.js.map +0 -1
- package/dist/cjs/crm-bonus.cjs.entry.js +0 -247
- package/dist/cjs/crm-bonus.cjs.entry.js.map +0 -1
- package/dist/cjs/crm-giftback-form_2.cjs.entry.js +0 -253
- package/dist/cjs/crm-giftback-form_2.cjs.entry.js.map +0 -1
- package/dist/cjs/crm-tooltip_4.cjs.entry.js +0 -211
- package/dist/cjs/crm-tooltip_4.cjs.entry.js.map +0 -1
- package/dist/cjs/crmbonus-component-wake.cjs.js +0 -27
- package/dist/cjs/crmbonus-component-wake.cjs.js.map +0 -1
- package/dist/cjs/crmbonus.service-9067d00d.js +0 -3877
- package/dist/cjs/crmbonus.service-9067d00d.js.map +0 -1
- package/dist/cjs/giftback-finish_4.cjs.entry.js +0 -131
- package/dist/cjs/giftback-finish_4.cjs.entry.js.map +0 -1
- package/dist/cjs/i18n-f2a6f60e.js +0 -2219
- package/dist/cjs/i18n-f2a6f60e.js.map +0 -1
- package/dist/cjs/index-6054ed44.js +0 -21
- package/dist/cjs/index-6054ed44.js.map +0 -1
- package/dist/cjs/index-d11684bd.js +0 -1599
- package/dist/cjs/index-d11684bd.js.map +0 -1
- package/dist/cjs/index.cjs.js +0 -11
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/info.config.helper-c5d9f781.js +0 -16
- package/dist/cjs/info.config.helper-c5d9f781.js.map +0 -1
- package/dist/cjs/keys.storage-de7744aa.js +0 -17
- package/dist/cjs/keys.storage-de7744aa.js.map +0 -1
- package/dist/cjs/loader.cjs.js +0 -17
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/loading-spinner.cjs.entry.js +0 -24
- package/dist/cjs/loading-spinner.cjs.entry.js.map +0 -1
- package/dist/cjs/pedido-finalizado.cjs.entry.js +0 -39
- package/dist/cjs/pedido-finalizado.cjs.entry.js.map +0 -1
- package/dist/cjs/phone-cancel-input.cjs.entry.js +0 -25
- package/dist/cjs/phone-cancel-input.cjs.entry.js.map +0 -1
- package/dist/cjs/phone-input-mask.cjs.entry.js +0 -61
- package/dist/cjs/phone-input-mask.cjs.entry.js.map +0 -1
- package/dist/cjs/phone-input.cjs.entry.js +0 -25
- package/dist/cjs/phone-input.cjs.entry.js.map +0 -1
- package/dist/cjs/utils-e9413ee3.js +0 -25
- package/dist/cjs/utils-e9413ee3.js.map +0 -1
- package/dist/collection/assets/svg/info-circle-svgrepo-com.svg +0 -6
- package/dist/collection/assets/svg/money-dollars-svgrepo-com.svg +0 -6
- package/dist/collection/collection-manifest.json +0 -32
- package/dist/collection/components/button/crm-button.css +0 -22
- package/dist/collection/components/button/index.js +0 -76
- package/dist/collection/components/button/index.js.map +0 -1
- package/dist/collection/components/countdown-timer/countdown-timer.js +0 -81
- package/dist/collection/components/countdown-timer/countdown-timer.js.map +0 -1
- package/dist/collection/components/crm-bonus/assets/logo.svg +0 -18
- package/dist/collection/components/crm-bonus/assets/success-svgrepo-com.svg +0 -8
- package/dist/collection/components/crm-bonus/assets/svg/logo.svg +0 -18
- package/dist/collection/components/crm-bonus/assets/svg/success-svgrepo-com.svg +0 -8
- package/dist/collection/components/crm-bonus/crm-bonus.css +0 -84
- package/dist/collection/components/crm-bonus/crm-bonus.js +0 -311
- package/dist/collection/components/crm-bonus/crm-bonus.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +0 -19
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +0 -348
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css +0 -10
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +0 -20
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css +0 -70
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +0 -126
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css +0 -110
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +0 -127
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.css +0 -108
- package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js +0 -110
- package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +0 -75
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js +0 -75
- package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js.map +0 -1
- package/dist/collection/components/giftback-form/giftback-form.css +0 -75
- package/dist/collection/components/giftback-form/giftback-form.js +0 -410
- package/dist/collection/components/giftback-form/giftback-form.js.map +0 -1
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.css +0 -181
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js +0 -221
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js.map +0 -1
- package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js +0 -11
- package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js.map +0 -1
- package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js +0 -103
- package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js.map +0 -1
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.css +0 -84
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js +0 -197
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js.map +0 -1
- package/dist/collection/components/loading-container/loading-container.css +0 -47
- package/dist/collection/components/loading-container/loading-container.js +0 -43
- package/dist/collection/components/loading-container/loading-container.js.map +0 -1
- package/dist/collection/components/loading-spinner/loading-spinner.css +0 -17
- package/dist/collection/components/loading-spinner/loading-spinner.js +0 -63
- package/dist/collection/components/loading-spinner/loading-spinner.js.map +0 -1
- package/dist/collection/components/modal/app-modal.css +0 -45
- package/dist/collection/components/modal/app-modal.js +0 -83
- package/dist/collection/components/modal/app-modal.js.map +0 -1
- package/dist/collection/components/note/crm-bonus-note.css +0 -71
- package/dist/collection/components/note/crm-bonus-note.js +0 -117
- package/dist/collection/components/note/crm-bonus-note.js.map +0 -1
- package/dist/collection/components/pedido/pedido.js +0 -52
- package/dist/collection/components/pedido/pedido.js.map +0 -1
- package/dist/collection/components/phone/phone-input-mask.css +0 -40
- package/dist/collection/components/phone/phone-input-mask.js +0 -125
- package/dist/collection/components/phone/phone-input-mask.js.map +0 -1
- package/dist/collection/components/tooltip/crm-tooltip.css +0 -49
- package/dist/collection/components/tooltip/tooltip.js +0 -61
- package/dist/collection/components/tooltip/tooltip.js.map +0 -1
- package/dist/collection/contants/index.js +0 -16
- package/dist/collection/contants/index.js.map +0 -1
- package/dist/collection/contants/mocks.js +0 -28
- package/dist/collection/contants/mocks.js.map +0 -1
- package/dist/collection/dto/pin.sent.js +0 -2
- package/dist/collection/dto/pin.sent.js.map +0 -1
- package/dist/collection/dto/update.order.dto.js +0 -2
- package/dist/collection/dto/update.order.dto.js.map +0 -1
- package/dist/collection/dto/validate.pin.bonus.js +0 -5
- package/dist/collection/dto/validate.pin.bonus.js.map +0 -1
- package/dist/collection/helpers/build.payload.helper.js +0 -25
- package/dist/collection/helpers/build.payload.helper.js.map +0 -1
- package/dist/collection/helpers/cart.helper.js +0 -27
- package/dist/collection/helpers/cart.helper.js.map +0 -1
- package/dist/collection/helpers/info.config.helper.js +0 -11
- package/dist/collection/helpers/info.config.helper.js.map +0 -1
- package/dist/collection/helpers/time.helper.js +0 -12
- package/dist/collection/helpers/time.helper.js.map +0 -1
- package/dist/collection/i18n/i18n.js +0 -35
- package/dist/collection/i18n/i18n.js.map +0 -1
- package/dist/collection/index.js +0 -11
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/objectvalues/cart.wake.js +0 -46
- package/dist/collection/objectvalues/cart.wake.js.map +0 -1
- package/dist/collection/services/crmbonus.service.js +0 -118
- package/dist/collection/services/crmbonus.service.js.map +0 -1
- package/dist/collection/utils/keys.storage.js +0 -9
- package/dist/collection/utils/keys.storage.js.map +0 -1
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/app-modal.js +0 -46
- package/dist/components/app-modal.js.map +0 -1
- package/dist/components/countdown-timer.js +0 -8
- package/dist/components/countdown-timer.js.map +0 -1
- package/dist/components/crm-bonus-form.js +0 -165
- package/dist/components/crm-bonus-form.js.map +0 -1
- package/dist/components/crm-bonus-note.js +0 -139
- package/dist/components/crm-bonus-note.js.map +0 -1
- package/dist/components/crm-bonus.js +0 -337
- package/dist/components/crm-bonus.js.map +0 -1
- package/dist/components/crm-button.js +0 -8
- package/dist/components/crm-button.js.map +0 -1
- package/dist/components/crm-giftback-form.js +0 -8
- package/dist/components/crm-giftback-form.js.map +0 -1
- package/dist/components/crm-tooltip.js +0 -8
- package/dist/components/crm-tooltip.js.map +0 -1
- package/dist/components/giftback-finish.js +0 -8
- package/dist/components/giftback-finish.js.map +0 -1
- package/dist/components/giftback-info.js +0 -8
- package/dist/components/giftback-info.js.map +0 -1
- package/dist/components/giftback-pin.js +0 -8
- package/dist/components/giftback-pin.js.map +0 -1
- package/dist/components/giftback-progress.js +0 -8
- package/dist/components/giftback-progress.js.map +0 -1
- package/dist/components/index.js +0 -4
- package/dist/components/index.js.map +0 -1
- package/dist/components/loading-container.js +0 -8
- package/dist/components/loading-container.js.map +0 -1
- package/dist/components/loading-spinner.js +0 -8
- package/dist/components/loading-spinner.js.map +0 -1
- package/dist/components/name-input.js +0 -8
- package/dist/components/name-input.js.map +0 -1
- package/dist/components/p-11085d9b.js +0 -79
- package/dist/components/p-11085d9b.js.map +0 -1
- package/dist/components/p-246a3e9d.js.map +0 -1
- package/dist/components/p-2671d669.js.map +0 -1
- package/dist/components/p-2b3b8d6b.js.map +0 -1
- package/dist/components/p-3e84f78c.js +0 -1408
- package/dist/components/p-3e84f78c.js.map +0 -1
- package/dist/components/p-47f9da55.js +0 -46
- package/dist/components/p-47f9da55.js.map +0 -1
- package/dist/components/p-58b97429.js.map +0 -1
- package/dist/components/p-6186ddcc.js.map +0 -1
- package/dist/components/p-6c546e48.js.map +0 -1
- package/dist/components/p-6eda79c3.js.map +0 -1
- package/dist/components/p-75ba7b9a.js +0 -14
- package/dist/components/p-75ba7b9a.js.map +0 -1
- package/dist/components/p-7c744cca.js.map +0 -1
- package/dist/components/p-7cfea8fe.js +0 -19
- package/dist/components/p-7cfea8fe.js.map +0 -1
- package/dist/components/p-83a12a8f.js.map +0 -1
- package/dist/components/p-abbfbc98.js.map +0 -1
- package/dist/components/p-b79c86a8.js.map +0 -1
- package/dist/components/p-ba369e65.js +0 -21
- package/dist/components/p-ba369e65.js.map +0 -1
- package/dist/components/p-cc1ea33f.js +0 -36
- package/dist/components/p-cc1ea33f.js.map +0 -1
- package/dist/components/p-e18e11ae.js +0 -316
- package/dist/components/p-e18e11ae.js.map +0 -1
- package/dist/components/p-e8c19a64.js +0 -2217
- package/dist/components/p-e8c19a64.js.map +0 -1
- package/dist/components/p-f9aeffc1.js +0 -12
- package/dist/components/p-f9aeffc1.js.map +0 -1
- package/dist/components/p-fe9c3966.js +0 -39
- package/dist/components/p-fe9c3966.js.map +0 -1
- package/dist/components/pedido-finalizado.js +0 -54
- package/dist/components/pedido-finalizado.js.map +0 -1
- package/dist/components/phone-cancel-input.js +0 -55
- package/dist/components/phone-cancel-input.js.map +0 -1
- package/dist/components/phone-form.js +0 -8
- package/dist/components/phone-form.js.map +0 -1
- package/dist/components/phone-input-mask.js +0 -8
- package/dist/components/phone-input-mask.js.map +0 -1
- package/dist/components/phone-input.js +0 -55
- package/dist/components/phone-input.js.map +0 -1
- package/dist/components/pin-form.js +0 -8
- package/dist/components/pin-form.js.map +0 -1
- package/dist/crmbonus-component-wake/p-03b77c41.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-03b77c41.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-3d6152b1.js +0 -3
- package/dist/crmbonus-component-wake/p-3d6152b1.js.map +0 -1
- package/dist/crmbonus-component-wake/p-4fa63df0.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-4fa63df0.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-620ec1a3.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-620ec1a3.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-6eda79c3.js +0 -2
- package/dist/crmbonus-component-wake/p-6eda79c3.js.map +0 -1
- package/dist/crmbonus-component-wake/p-74206c91.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-74206c91.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-75ba7b9a.js +0 -2
- package/dist/crmbonus-component-wake/p-75ba7b9a.js.map +0 -1
- package/dist/crmbonus-component-wake/p-7b7fb354.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-7b7fb354.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-7cdb2c4a.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-7cdb2c4a.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-7cfea8fe.js +0 -2
- package/dist/crmbonus-component-wake/p-7cfea8fe.js.map +0 -1
- package/dist/crmbonus-component-wake/p-885fc30e.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-885fc30e.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-90716188.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-90716188.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-a33f7c24.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-a33f7c24.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-abbfbc98.js +0 -2
- package/dist/crmbonus-component-wake/p-abbfbc98.js.map +0 -1
- package/dist/crmbonus-component-wake/p-b7a8f915.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-b7a8f915.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-ba369e65.js +0 -2
- package/dist/crmbonus-component-wake/p-ba369e65.js.map +0 -1
- package/dist/crmbonus-component-wake/p-be3ddacc.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-be3ddacc.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-c23f3a07.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-e1255160.js +0 -2
- package/dist/crmbonus-component-wake/p-e1255160.js.map +0 -1
- package/dist/crmbonus-component-wake/p-e8c19a64.js +0 -2
- package/dist/crmbonus-component-wake/p-e8c19a64.js.map +0 -1
- package/dist/crmbonus-component-wake/p-f9aeffc1.js +0 -2
- package/dist/crmbonus-component-wake/p-f9aeffc1.js.map +0 -1
- package/dist/crmbonus-component-wake/p-fad20959.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-fad20959.entry.js.map +0 -1
- package/dist/env.js +0 -3
- package/dist/env.js.map +0 -1
- package/dist/esm/app-modal.entry.js.map +0 -1
- package/dist/esm/cart.helper-30a40560.js.map +0 -1
- package/dist/esm/countdown-timer_2.entry.js +0 -58
- package/dist/esm/countdown-timer_2.entry.js.map +0 -1
- package/dist/esm/crm-bonus-form.entry.js.map +0 -1
- package/dist/esm/crm-bonus-note.entry.js.map +0 -1
- package/dist/esm/crm-bonus.entry.js.map +0 -1
- package/dist/esm/crm-giftback-form_2.entry.js.map +0 -1
- package/dist/esm/crm-tooltip_4.entry.js +0 -204
- package/dist/esm/crm-tooltip_4.entry.js.map +0 -1
- package/dist/esm/crmbonus-component-wake.js +0 -22
- package/dist/esm/crmbonus-component-wake.js.map +0 -1
- package/dist/esm/crmbonus.service-42fbd7fa.js.map +0 -1
- package/dist/esm/giftback-finish_4.entry.js +0 -124
- package/dist/esm/giftback-finish_4.entry.js.map +0 -1
- package/dist/esm/index-e8724c8f.js +0 -1571
- package/dist/esm/index-e8724c8f.js.map +0 -1
- package/dist/esm/index.js +0 -3
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js +0 -13
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/loading-spinner.entry.js.map +0 -1
- package/dist/esm/pedido-finalizado.entry.js.map +0 -1
- package/dist/esm/phone-cancel-input.entry.js.map +0 -1
- package/dist/esm/phone-input-mask.entry.js.map +0 -1
- package/dist/esm/phone-input.entry.js.map +0 -1
- package/dist/esm/utils-d642b4db.js +0 -21
- package/dist/esm/utils-d642b4db.js.map +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- /package/dist/{esm → crmbonus-component-wake}/app-globals-0f993ce5.js +0 -0
- /package/dist/{esm → crmbonus-component-wake}/app-globals-0f993ce5.js.map +0 -0
- /package/dist/{esm → crmbonus-component-wake}/index-5b567099.js +0 -0
- /package/dist/{esm → crmbonus-component-wake}/index-5b567099.js.map +0 -0
- /package/dist/{esm → crmbonus-component-wake}/info.config.helper-42d9ddf9.js +0 -0
- /package/dist/{esm → crmbonus-component-wake}/info.config.helper-42d9ddf9.js.map +0 -0
- /package/dist/{esm → crmbonus-component-wake}/keys.storage-8c76fcd7.js +0 -0
- /package/dist/{esm → crmbonus-component-wake}/keys.storage-8c76fcd7.js.map +0 -0
@@ -1,75 +0,0 @@
|
|
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
|
-
}
|
@@ -1,410 +0,0 @@
|
|
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
|
-
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: '8856b0021380c06a1b6d0fe377d0836de0308e40', class: "crm-container-form fbits-responsive-carrinho-desconto" }, h("label", { key: 'ef51aa9f64f7438ae887f5af0688df3c216d810c', class: "crm-title" }, this.config.giftbackTitle), this.step === StepFormEnum.STEP_PHONE &&
|
219
|
-
h("phone-form", { key: '12cd253b89c74738fe27a3ef0a2a46ce50b4f71d', 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: 'fb7c11d2d94e0035be7615d342cd6e9bf04924e4', 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: '5c8071135ce7f287cb6203f78d0c05988eee3d13', class: "crm-message-info" }, this.sucess), this.error && h("p", { key: 'e0516266cfa7886049a4d751595318ceaf0131f7', class: "crm-message-error" }, this.error)), this.step === StepFormEnum.STEP_RESERVE &&
|
221
|
-
h("giftback-info", { key: 'b36f43a03dd113bc743c985b4327762647aea00c', 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: 'cfeacde74e0b598e2ab93a86af5dc6838ef040cb', 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
|
@@ -1 +0,0 @@
|
|
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,i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5D,IAAI,CAAC,KAAK,IAAI,0DAAG,KAAK,EAAC,mBAAmB,IAAE,IAAI,CAAC,KAAK,CAAK,CAEnD;YAIX,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,YAAY;gBACvC,sEACE,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,MAAM,EAAE,GAAG,EAAE,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 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}"]}
|