crmbonus-component-wake 2.0.51 → 2.0.52
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/cjs/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/app-modal.cjs.entry.js +28 -0
- package/dist/cjs/app-modal.cjs.entry.js.map +1 -0
- package/dist/cjs/countdown-timer_4.cjs.entry.js +181 -0
- package/dist/cjs/countdown-timer_4.cjs.entry.js.map +1 -0
- package/dist/cjs/crm-bonus-form.cjs.entry.js +103 -0
- package/dist/cjs/crm-bonus-form.cjs.entry.js.map +1 -0
- package/dist/cjs/crm-bonus-note.cjs.entry.js +53 -0
- package/dist/{crmbonus-component-wake/crm-bonus-note.entry.js.map → cjs/crm-bonus-note.cjs.entry.js.map} +1 -1
- package/dist/cjs/crm-bonus.cjs.entry.js +204 -0
- package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -0
- package/dist/cjs/crm-button.cjs.entry.js +25 -0
- package/dist/cjs/crm-button.cjs.entry.js.map +1 -0
- package/dist/cjs/crm-giftback-form.cjs.entry.js +173 -0
- package/dist/cjs/crm-giftback-form.cjs.entry.js.map +1 -0
- package/dist/cjs/crmbonus-component-wake.cjs.js +27 -0
- package/dist/cjs/crmbonus-component-wake.cjs.js.map +1 -0
- package/dist/cjs/crmbonus.service-3c4ebbdf.js +3852 -0
- package/dist/cjs/crmbonus.service-3c4ebbdf.js.map +1 -0
- package/dist/cjs/giftback-finish_4.cjs.entry.js +132 -0
- package/dist/cjs/giftback-finish_4.cjs.entry.js.map +1 -0
- package/dist/cjs/i18n-efd790a3.js +2209 -0
- package/dist/cjs/i18n-efd790a3.js.map +1 -0
- package/dist/cjs/index-80419303.js +1253 -0
- package/dist/cjs/index-80419303.js.map +1 -0
- package/dist/cjs/index-96a8951f.js +16 -0
- package/dist/cjs/index-96a8951f.js.map +1 -0
- package/dist/cjs/index.cjs.js +11 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/info.config.helper-c5d9f781.js +16 -0
- package/dist/cjs/info.config.helper-c5d9f781.js.map +1 -0
- package/dist/cjs/loader.cjs.js +17 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/loading-spinner.cjs.entry.js +24 -0
- package/dist/cjs/loading-spinner.cjs.entry.js.map +1 -0
- package/dist/cjs/pedido-finalizado.cjs.entry.js +36 -0
- package/dist/cjs/pedido-finalizado.cjs.entry.js.map +1 -0
- package/dist/cjs/phone-cancel-input.cjs.entry.js +25 -0
- package/dist/cjs/phone-cancel-input.cjs.entry.js.map +1 -0
- package/dist/cjs/phone-input-mask.cjs.entry.js +61 -0
- package/dist/cjs/phone-input-mask.cjs.entry.js.map +1 -0
- package/dist/cjs/phone-input.cjs.entry.js +25 -0
- package/dist/cjs/phone-input.cjs.entry.js.map +1 -0
- package/dist/collection/assets/svg/money-dollars-svgrepo-com.svg +6 -0
- package/dist/collection/collection-manifest.json +30 -0
- package/dist/collection/components/button/crm-button.css +22 -0
- package/dist/collection/components/button/index.js +76 -0
- package/dist/collection/components/button/index.js.map +1 -0
- package/dist/collection/components/countdown-timer/countdown-timer.js +51 -0
- package/dist/collection/components/countdown-timer/countdown-timer.js.map +1 -0
- package/dist/collection/components/crm-bonus/assets/logo.svg +18 -0
- package/dist/collection/components/crm-bonus/assets/success-svgrepo-com.svg +8 -0
- package/dist/collection/components/crm-bonus/assets/svg/logo.svg +18 -0
- package/dist/collection/components/crm-bonus/assets/svg/success-svgrepo-com.svg +8 -0
- package/dist/collection/components/crm-bonus/crm-bonus.css +84 -0
- package/dist/collection/components/crm-bonus/crm-bonus.js +291 -0
- package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +19 -0
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +348 -0
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css +10 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +20 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css +70 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +127 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css +110 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +127 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.css +108 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js +110 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +75 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js +75 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js.map +1 -0
- package/dist/collection/components/giftback-form/giftback-form.css +74 -0
- package/dist/collection/components/giftback-form/giftback-form.js +248 -0
- package/dist/collection/components/giftback-form/giftback-form.js.map +1 -0
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.css +154 -0
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js +156 -0
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js.map +1 -0
- package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js +11 -0
- package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js.map +1 -0
- package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js +103 -0
- package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js.map +1 -0
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.css +84 -0
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js +198 -0
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js.map +1 -0
- package/dist/collection/components/loading-spinner/loading-spinner.css +17 -0
- package/dist/collection/components/loading-spinner/loading-spinner.js +63 -0
- package/dist/collection/components/loading-spinner/loading-spinner.js.map +1 -0
- package/dist/collection/components/modal/app-modal.css +45 -0
- package/dist/collection/components/modal/app-modal.js +83 -0
- package/dist/collection/components/modal/app-modal.js.map +1 -0
- package/dist/collection/components/note/crm-bonus-note.css +54 -0
- package/dist/collection/components/note/crm-bonus-note.js +94 -0
- package/dist/collection/components/note/crm-bonus-note.js.map +1 -0
- package/dist/collection/components/pedido/pedido.js +83 -0
- package/dist/collection/components/pedido/pedido.js.map +1 -0
- package/dist/collection/components/phone/phone-input-mask.css +39 -0
- package/dist/collection/components/phone/phone-input-mask.js +125 -0
- package/dist/collection/components/phone/phone-input-mask.js.map +1 -0
- package/dist/collection/contants/index.js +11 -0
- package/dist/collection/contants/index.js.map +1 -0
- package/dist/collection/contants/mocks.js +28 -0
- package/dist/collection/contants/mocks.js.map +1 -0
- package/dist/collection/dto/pin.sent.js +2 -0
- package/dist/collection/dto/pin.sent.js.map +1 -0
- package/dist/collection/dto/update.order.dto.js +2 -0
- package/dist/collection/dto/update.order.dto.js.map +1 -0
- package/dist/collection/dto/validate.pin.bonus.js +2 -0
- package/dist/collection/dto/validate.pin.bonus.js.map +1 -0
- package/dist/collection/helpers/info.config.helper.js +11 -0
- package/dist/collection/helpers/info.config.helper.js.map +1 -0
- package/dist/collection/i18n/i18n.js +25 -0
- package/dist/collection/i18n/i18n.js.map +1 -0
- package/dist/collection/index.js +11 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/services/crmbonus.service.js +96 -0
- package/dist/collection/services/crmbonus.service.js.map +1 -0
- package/dist/collection/utils/utils.js +4 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/components/app-modal.js +46 -0
- package/dist/components/app-modal.js.map +1 -0
- package/dist/components/countdown-timer.js +8 -0
- package/dist/components/countdown-timer.js.map +1 -0
- package/dist/components/crm-bonus-form.js +165 -0
- package/dist/components/crm-bonus-form.js.map +1 -0
- package/dist/components/crm-bonus-note.js +72 -0
- package/dist/components/crm-bonus-note.js.map +1 -0
- package/dist/components/crm-bonus.js +282 -0
- package/dist/components/crm-bonus.js.map +1 -0
- package/dist/components/crm-button.js +8 -0
- package/dist/components/crm-button.js.map +1 -0
- package/dist/components/crm-giftback-form.js +8 -0
- package/dist/components/crm-giftback-form.js.map +1 -0
- package/dist/components/giftback-finish.js +8 -0
- package/dist/components/giftback-finish.js.map +1 -0
- package/dist/components/giftback-info.js +8 -0
- package/dist/components/giftback-info.js.map +1 -0
- package/dist/components/giftback-pin.js +8 -0
- package/dist/components/giftback-pin.js.map +1 -0
- package/dist/components/giftback-progress.js +8 -0
- package/dist/components/giftback-progress.js.map +1 -0
- package/dist/components/index.js +9 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/loading-spinner.js +8 -0
- package/dist/components/loading-spinner.js.map +1 -0
- package/dist/components/name-input.js +8 -0
- package/dist/components/name-input.js.map +1 -0
- package/dist/components/p-2f266d73.js +1068 -0
- package/dist/components/p-2f266d73.js.map +1 -0
- package/dist/components/p-39d680b6.js +49 -0
- package/dist/components/p-39d680b6.js.map +1 -0
- package/dist/{crmbonus-component-wake/giftback-pin.entry.js → components/p-4f18f4c0.js} +39 -9
- package/dist/components/p-4f18f4c0.js.map +1 -0
- package/dist/components/p-57ec707e.js +79 -0
- package/dist/components/p-57ec707e.js.map +1 -0
- package/dist/components/p-5c3fe5a8.js +39 -0
- package/dist/components/p-5c3fe5a8.js.map +1 -0
- package/dist/components/p-73e75b43.js +240 -0
- package/dist/components/p-73e75b43.js.map +1 -0
- package/dist/components/p-75ba7b9a.js +14 -0
- package/dist/components/p-75ba7b9a.js.map +1 -0
- package/dist/components/p-9f68d2a1.js +65 -0
- package/dist/components/p-9f68d2a1.js.map +1 -0
- package/dist/{crmbonus-component-wake/name-input.entry.js → components/p-a30bd6b1.js} +38 -9
- package/dist/components/p-a30bd6b1.js.map +1 -0
- package/dist/components/p-a561251a.js +14 -0
- package/dist/components/p-a561251a.js.map +1 -0
- package/dist/{crmbonus-component-wake/crmbonus.service-98a7bcf0.js → components/p-dd6f6ab7.js} +90 -165
- package/dist/components/p-dd6f6ab7.js.map +1 -0
- package/dist/components/p-e4ac17bf.js +46 -0
- package/dist/components/p-e4ac17bf.js.map +1 -0
- package/dist/components/p-f168d5f6.js +69 -0
- package/dist/components/p-f168d5f6.js.map +1 -0
- package/dist/{crmbonus-component-wake/pin-form.entry.js → components/p-f4244087.js} +57 -10
- package/dist/components/p-f4244087.js.map +1 -0
- package/dist/{crmbonus-component-wake/giftback-info.entry.js → components/p-f579d773.js} +36 -13
- package/dist/components/p-f579d773.js.map +1 -0
- package/dist/components/p-f5fcff75.js +36 -0
- package/dist/components/p-f5fcff75.js.map +1 -0
- package/dist/{crmbonus-component-wake/i18n-a17a0837.js → components/p-fb505488.js} +1 -16
- package/dist/components/p-fb505488.js.map +1 -0
- package/dist/components/pedido-finalizado.js +54 -0
- package/dist/components/pedido-finalizado.js.map +1 -0
- package/dist/components/phone-cancel-input.js +55 -0
- package/dist/components/phone-cancel-input.js.map +1 -0
- package/dist/components/phone-form.js +8 -0
- package/dist/components/phone-form.js.map +1 -0
- package/dist/components/phone-input-mask.js +8 -0
- package/dist/components/phone-input-mask.js.map +1 -0
- package/dist/components/phone-input.js +55 -0
- package/dist/components/phone-input.js.map +1 -0
- package/dist/components/pin-form.js +8 -0
- package/dist/components/pin-form.js.map +1 -0
- package/dist/crmbonus-component-wake/crmbonus-component-wake.css +1 -7
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -48
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/index.esm.js +1 -16
- package/dist/crmbonus-component-wake/index.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/p-118fc099.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-118fc099.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-298d8fff.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-298d8fff.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-312caf3f.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-312caf3f.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-3522a3e3.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-3522a3e3.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-3beb5158.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-3beb5158.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-66f41fd0.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-66f41fd0.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-6e6bf96e.js +3 -0
- package/dist/crmbonus-component-wake/p-6e6bf96e.js.map +1 -0
- package/dist/crmbonus-component-wake/p-75ba7b9a.js +2 -0
- package/dist/crmbonus-component-wake/p-75ba7b9a.js.map +1 -0
- package/dist/crmbonus-component-wake/p-830b5bdc.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-830b5bdc.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-8b9a1aec.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-8b9a1aec.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-9acd4f81.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-9acd4f81.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-a561251a.js +2 -0
- package/dist/crmbonus-component-wake/p-a561251a.js.map +1 -0
- package/dist/crmbonus-component-wake/p-adb37e26.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-adb37e26.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-c4cc29a0.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-c4cc29a0.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-c8054eaf.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-c8054eaf.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-c86583a2.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-c86583a2.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-dd6f6ab7.js +2 -0
- package/dist/crmbonus-component-wake/p-dd6f6ab7.js.map +1 -0
- package/dist/crmbonus-component-wake/p-e1255160.js +2 -0
- package/dist/crmbonus-component-wake/p-e1255160.js.map +1 -0
- package/dist/crmbonus-component-wake/p-fb505488.js +2 -0
- package/dist/crmbonus-component-wake/p-fb505488.js.map +1 -0
- package/dist/env.js +5 -0
- package/dist/env.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/app-modal.entry.js +4 -3
- package/dist/esm/app-modal.entry.js.map +1 -0
- package/dist/esm/countdown-timer_4.entry.js +174 -0
- package/dist/esm/countdown-timer_4.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/crm-bonus-form.entry.js +5 -4
- package/dist/esm/crm-bonus-form.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/crm-bonus-note.entry.js +6 -5
- package/dist/esm/crm-bonus-note.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/crm-bonus.entry.js +6 -7
- package/dist/esm/crm-bonus.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/crm-button.entry.js +4 -3
- package/dist/esm/crm-button.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/crm-giftback-form.entry.js +11 -10
- package/dist/esm/crm-giftback-form.entry.js.map +1 -0
- package/dist/esm/crmbonus-component-wake.js +22 -0
- package/dist/esm/crmbonus-component-wake.js.map +1 -0
- package/dist/{crmbonus-component-wake/crmbonus.service-0e166281.js → esm/crmbonus.service-9cba7b49.js} +92 -167
- package/dist/esm/crmbonus.service-9cba7b49.js.map +1 -0
- package/dist/esm/giftback-finish_4.entry.js +125 -0
- package/dist/esm/giftback-finish_4.entry.js.map +1 -0
- package/dist/esm/i18n-887a3ef8.js +2207 -0
- package/dist/{crmbonus-component-wake/i18n-a17a0837.js.map → esm/i18n-887a3ef8.js.map} +1 -1
- package/dist/esm/index-a4c14fca.js +1225 -0
- package/dist/esm/index-a4c14fca.js.map +1 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/loading-spinner.entry.js +4 -3
- package/dist/esm/loading-spinner.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/pedido-finalizado.entry.js +3 -3
- package/dist/esm/pedido-finalizado.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/phone-cancel-input.entry.js +2 -2
- package/dist/esm/phone-cancel-input.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/phone-input-mask.entry.js +4 -3
- package/dist/esm/phone-input-mask.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/phone-input.entry.js +2 -2
- package/dist/esm/phone-input.entry.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
- package/dist/crmbonus-component-wake/app-modal.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/countdown-timer.entry.js +0 -30
- package/dist/crmbonus-component-wake/countdown-timer.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crm-bonus-form.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crm-button.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crm-giftback-form.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crmbonus.service-0e166281.js.map +0 -1
- package/dist/crmbonus-component-wake/crmbonus.service-98a7bcf0.js.map +0 -1
- package/dist/crmbonus-component-wake/giftback-finish.entry.js +0 -19
- package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/giftback-info.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/giftback-progress.entry.js +0 -40
- package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/index-bdc90e13.js +0 -3039
- package/dist/crmbonus-component-wake/index-bdc90e13.js.map +0 -1
- package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/name-input.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/phone-cancel-input.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/phone-form.entry.js +0 -26
- package/dist/crmbonus-component-wake/phone-form.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/phone-input-mask.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/phone-input.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/pin-form.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js +0 -334
- package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js.map +0 -1
- /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js +0 -0
- /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js.map +0 -0
- /package/dist/{crmbonus-component-wake → esm}/index-3c6d4feb.js +0 -0
- /package/dist/{crmbonus-component-wake → esm}/index-3c6d4feb.js.map +0 -0
- /package/dist/{crmbonus-component-wake → esm}/info.config.helper-42d9ddf9.js +0 -0
- /package/dist/{crmbonus-component-wake → esm}/info.config.helper-42d9ddf9.js.map +0 -0
@@ -0,0 +1,291 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
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;YAC7B,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,EAAE;YACR,KAAK,EAAE,EAAE;SACV;uBAE2B,KAAK;;;yBAGH,KAAK;;;;;IAMnC,KAAK,CAAC,iBAAiB;QACrB,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAEzC,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QACzB,MAAM,IAAI,CAAC,eAAe,EAAE,CAAA;QAC5B,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IAC1B,CAAC;IAED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AK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QAE5B,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAC5B,CAAC;QAED,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QACvD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,CAAC;IAED,MAAM;QAEJ,OAAO,CACL,0EACE,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,EAC9B,MAAM,EAAE,IAAI,CAAC,MAAM,GACnB;QACF,iCAAiC;QACjC,+EAA+E;QAC/E,mCAAmC;QACnC,yEAAyE;QACzE,QAAQ;QACR,mIAAmI;QACnI,kIAAkI;QAClI,QAAQ;QACR,WAAW;QACX,iDAAiD;QACjD,eAAe;QACf,8BAA8B;QAC9B,8BAA8B;QAC9B,qDAAqD;QACrD,MAAM;QACN,sBAAsB;QACtB,oCAAoC;QACpC,0DAA0D;QAC1D,4CAA4C;QAC5C,yBAAyB;QACzB,2BAA2B;QAC3B,+CAA+C;QAC/C,mCAAmC;QACnC,wCAAwC;QACxC,sDAAsD;QACtD,sEAAsE;QACtE,SAAS;QACT,iBAAiB;QACjB,SAAS;SACV,CAAA;IACH,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"]}
|
@@ -0,0 +1,19 @@
|
|
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
|
+
}
|
@@ -0,0 +1,348 @@
|
|
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
|