crmbonus-component-wake 2.0.112 → 2.0.114-custom
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/crm-bonus-form.cjs.entry.js +1 -1
- package/dist/cjs/crm-bonus-note.cjs.entry.js +8 -4
- package/dist/cjs/crm-bonus-note.cjs.entry.js.map +1 -1
- package/dist/cjs/crm-bonus.cjs.entry.js +4 -3
- package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -1
- package/dist/cjs/crm-giftback-form_2.cjs.entry.js +1 -1
- package/dist/cjs/crm-tooltip_4.cjs.entry.js +6 -5
- package/dist/cjs/crm-tooltip_4.cjs.entry.js.map +1 -1
- package/dist/cjs/{crmbonus.service-b31b7396.js → crmbonus.service-30fd8ffa.js} +4 -4
- package/dist/{crmbonus-component-wake/p-c44e2f02.js.map → cjs/crmbonus.service-30fd8ffa.js.map} +1 -1
- package/dist/cjs/pedido-finalizado.cjs.entry.js +1 -1
- package/dist/collection/components/crm-bonus/crm-bonus.js +3 -2
- package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -1
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js +6 -5
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js.map +1 -1
- package/dist/collection/components/note/crm-bonus-note.js +8 -4
- package/dist/collection/components/note/crm-bonus-note.js.map +1 -1
- package/dist/collection/services/crmbonus.service.js +2 -2
- package/dist/collection/services/crmbonus.service.js.map +1 -1
- package/dist/components/crm-bonus-form.js +1 -1
- package/dist/components/crm-bonus-note.js +8 -4
- package/dist/components/crm-bonus-note.js.map +1 -1
- package/dist/components/crm-bonus.js +6 -5
- package/dist/components/crm-bonus.js.map +1 -1
- package/dist/components/crm-giftback-form.js +1 -1
- package/dist/components/giftback-info.js +1 -1
- package/dist/components/{p-d3ee0c39.js → p-2671d669.js} +7 -6
- package/dist/components/p-2671d669.js.map +1 -0
- package/dist/components/{p-c44e2f02.js → p-5d98ff4a.js} +4 -4
- package/dist/components/p-5d98ff4a.js.map +1 -0
- package/dist/components/{p-3951010f.js → p-c02769eb.js} +3 -3
- package/dist/components/{p-3951010f.js.map → p-c02769eb.js.map} +1 -1
- package/dist/components/pedido-finalizado.js +1 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
- package/dist/crmbonus-component-wake/{p-21464f24.entry.js → p-163e3e45.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-147ba861.entry.js → p-2c6d5dc9.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-c44e2f02.js → p-5d98ff4a.js} +2 -2
- package/dist/crmbonus-component-wake/p-5d98ff4a.js.map +1 -0
- package/dist/crmbonus-component-wake/{p-35ea89d8.entry.js → p-7751b4be.entry.js} +2 -2
- package/dist/crmbonus-component-wake/p-7751b4be.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/{p-b873347f.entry.js → p-79058653.entry.js} +2 -2
- package/dist/crmbonus-component-wake/p-7b7fb354.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-7b7fb354.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/{p-6276ee63.entry.js → p-91310f0a.entry.js} +2 -2
- package/dist/crmbonus-component-wake/p-91310f0a.entry.js.map +1 -0
- package/dist/env.js +1 -1
- package/dist/env.js.map +1 -1
- package/dist/esm/crm-bonus-form.entry.js +1 -1
- package/dist/esm/crm-bonus-note.entry.js +8 -4
- package/dist/esm/crm-bonus-note.entry.js.map +1 -1
- package/dist/esm/crm-bonus.entry.js +4 -3
- package/dist/esm/crm-bonus.entry.js.map +1 -1
- package/dist/esm/crm-giftback-form_2.entry.js +1 -1
- package/dist/esm/crm-tooltip_4.entry.js +6 -5
- package/dist/esm/crm-tooltip_4.entry.js.map +1 -1
- package/dist/esm/{crmbonus.service-774ebe83.js → crmbonus.service-f5132633.js} +4 -4
- package/dist/esm/crmbonus.service-f5132633.js.map +1 -0
- package/dist/esm/pedido-finalizado.entry.js +1 -1
- package/dist/types/components/note/crm-bonus-note.d.ts +1 -0
- package/dist/types/home/darlison/Projects/Bycoders/crmbonus/crmbonus-component/.stencil/env.d.ts +1 -1
- package/dist/types/services/crmbonus.service.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/crmbonus.service-b31b7396.js.map +0 -1
- package/dist/components/p-c44e2f02.js.map +0 -1
- package/dist/components/p-d3ee0c39.js.map +0 -1
- package/dist/crmbonus-component-wake/p-35ea89d8.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-48a8f372.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-48a8f372.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-6276ee63.entry.js.map +0 -1
- package/dist/esm/crmbonus.service-774ebe83.js.map +0 -1
- /package/dist/crmbonus-component-wake/{p-21464f24.entry.js.map → p-163e3e45.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-147ba861.entry.js.map → p-2c6d5dc9.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-b873347f.entry.js.map → p-79058653.entry.js.map} +0 -0
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
const index = require('./index-d11684bd.js');
|
6
|
-
const crmbonus_service = require('./crmbonus.service-
|
6
|
+
const crmbonus_service = require('./crmbonus.service-30fd8ffa.js');
|
7
7
|
const index$1 = require('./index-6054ed44.js');
|
8
8
|
require('./keys.storage-de7744aa.js');
|
9
9
|
|
@@ -78,13 +78,17 @@ const CrmBonusNote = class {
|
|
78
78
|
}
|
79
79
|
return info;
|
80
80
|
}
|
81
|
+
getTime() {
|
82
|
+
const time = localStorage.getItem("bc:time");
|
83
|
+
return time ? Number(time) : 0;
|
84
|
+
}
|
81
85
|
render() {
|
82
86
|
const giftbackname = this.config.giftbackTitle || "Giftback";
|
83
87
|
const infobonus = this.hasBonus();
|
84
|
-
return (index.h("div", { key: '
|
85
|
-
(index.h("p", { key: '
|
86
|
-
(index.h("p", { key: '
|
87
|
-
(index.h("div", { key: '
|
88
|
+
return (index.h("div", { key: '5e6af682c8a1d449c7b44372cc8392c23d3b8c37' }, index.h("div", { key: 'fdaac56b3f905ccd34ac19f8d26472d13f2e6060', class: "note-container" }, index.h("div", { key: '532921493fa0e6d84628ce344a04c7f3e4c1188b', class: "note-header" }, index.h("p", { key: '09fb8be7eb83b7e5a2cad2a6c8e4ac42bcc8843f', class: "note-title" }, index.h("img", { key: 'b50b4bb1d2b087fdf51d94b66a7618156f4e02b8', src: moneyDollarsSvgrepoComSvg, width: 23 }), this.config.giftbackTitle), infobonus.hasBonus && (index.h("div", { key: 'c4bbcfac356814745248ca0e03b31691dbbfc68e' }, this.showEdit && (index.h("p", { key: '8139ff2556944583c367106d205de783a68793d8', class: "back-cart", onClick: () => this.backCart() }, i18n.instance.t("edit"))), !this.showEdit && index.h("countdown-timer", { key: '9720653f739eadc70b4f44c44f9c10c215350fe4', initialValue: this.getTime(), downtime: () => { this.showEdit = true; } })))), infobonus.hasBonus &&
|
89
|
+
(index.h("p", { key: 'e0a6d0b9aa09699aeaf86633d9a24fe7550ffbe6', class: "note-description-2" }, i18n.instance.t("withApplyBonus", { giftbackname: giftbackname }), " ", index.h("strong", { key: '39728d345ed3cbcf76be108e894095bc0b6f844c' }, "R$ ", this.getAmount(), "."))), (infobonus.requestBonus && !infobonus.hasBonus) &&
|
90
|
+
(index.h("p", { key: 'a92ac10c9e2db555a0244497c5be9654f17cb53b', class: "note-description-not" }, i18n.instance.t("noBonus", { giftbackname: giftbackname }))), !infobonus.requestBonus &&
|
91
|
+
(index.h("div", { key: 'fe95768f91165bd89f4eed467f69122e1c0a2d49', class: "description" }, index.h("p", { key: 'fe0360269c159032c1b8cab772b4613900dd6ce3', class: "note-description-not" }, i18n.instance.t("backCart")), index.h("crm-button", { key: 'da883a2fc5bb08f0435ce4493619c6a9952e6391', txtBtn: "VOLTAR AO CARRINHO", handleClick: () => this.backCart() }))))));
|
88
92
|
}
|
89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,IAAI,CAAC,MAAM,CAAC,aAAa,CAC1B,EAEA,SAAS,CAAC,QAAQ,KACdD,oEACK,IAAI,CAAC,QAAQ,KACVA,gEAAG,KAAK,EAAC,WAAW,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,IAC9CE,aAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAClB,CACP,EACA,CAAC,IAAI,CAAC,QAAQ,IAAIF,8EAAiB,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA,EAAE,GAAI,CAChG,CACT,CAEH,EAGF,SAAS,CAAC,QAAQ;aAEdA,gEAAG,KAAK,EAAC,oBAAoB,IACxBE,aAAO,CAAC,CAAC,CAAC,gBAAgB,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,OAAEF,8EAAY,IAAI,CAAC,SAAS,EAAE,MAAW,CACrG,CACP,EAID,CAAC,SAAS,CAAC,YAAY,IAAI,CAAC,SAAS,CAAC,QAAQ;aAE1CA,gEAAG,KAAK,EAAC,sBAAsB,IAC1BE,aAAO,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CACrD,CACP,EAID,CAAC,SAAS,CAAC,YAAY;aAEnBF,kEAAK,KAAK,EAAC,aAAa,IACpBA,gEAAG,KAAK,EAAC,sBAAsB,IAC1BE,aAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CACtB,EACJF,yEAAY,MAAM,EAAC,oBAAoB,EAAC,WAAW,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,GAAI,CAC5E,CACT,CAMH,CACJ,EACT;KACJ;;;;;;","names":["getInfoCustomization","getKeyReserveByCartId","h","money","i18next"],"sources":["src/assets/svg/money-dollars-svgrepo-com.svg","src/helpers/time.helper.ts","src/components/note/crm-bonus-note.css?tag=crm-bonus-note","src/components/note/crm-bonus-note.tsx"],"sourcesContent":["<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"#000000\" stroke-width=\"2\"/>\n<path d=\"M15 9.94728C14.5 9.3 13.8 8.5 12 8.5C10.2 8.5 9 9.51393 9 9.94728C9 10.3806 9.06786 10.9277 10 11.5C10.7522 11.9618 12.6684 12.0439 13.5 12.5C14.679 13.1467 14.8497 13.8202 14.8497 14.0522C14.8497 14.6837 13.4175 15.4852 12 15.5C10.536 15.5153 9.5 14.7 9 14.0522\" stroke=\"#000000\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 7V17\" stroke=\"#000000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>","export function setTime() {\n\n if(localStorage.getItem(\"bc:time-allow\")) {\n return\n }\n\n const time = localStorage.getItem(\"bc:time\");\n\n if(!time) {\n localStorage.setItem(\"bc:time\", \"360\");\n localStorage.setItem(\"bc:time-allow\", \"true\");\n return\n } \n}",".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n display: flex;\n flex-direction: column;\n gap: 13px;\n\n\n & .description {\n display: flex;\n flex-direction: column;\n gap: 13px;\n }\n}\n\n.note-container hr {\n border: 1px solid #CCC;\n}\n\n.note-container .back-cart {\n display: flex;\n text-align: center;\n}\n\n.note-header {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n}\n\n.note-title {\n font-weight: 700;\n text-align: left;\n display: flex;\n gap: 6px;\n align-items: center;\n margin-top: 11px;\n color: #000;\n}\n\n.note-description {\n font-family: Arial;\n color: #6d6d5f;\n padding: 0;\n margin: 0 auto;\n}\n\n.back-cart {\n font-size: .9em;\n color: #27272A;\n text-decoration: none;\n cursor: pointer;\n margin-top: 11px;\n}\n\n.note-description-2 {\n color: var(--crm-scheme-fg-main-inverse, #262626);\n font-family: Roboto;\n font-size: var(--crm-font-size-body-lg, 16px);\n font-style: normal;\n font-weight: var(--crm-font-weight-body-bold, 400);\n line-height: var(--crm-line-height-body-md, 20px);\n letter-spacing: var(--crm-letter-spacing-title-md, 0px);\n margin-top: 11px;\n color: #000;\n}\n\n.note-description-not {\n font-size: 16px;\n}","import { Component, Prop, State, h } from \"@stencil/core\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport money from '../../assets/svg/money-dollars-svgrepo-com.svg'\nimport { getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport i18next from \"../../i18n/i18n\"\nimport { IBonus } from \"../../components\";\nimport { setTime } from \"../../helpers/time.helper\";\n\n@Component({\n tag: 'crm-bonus-note',\n styleUrl: 'crm-bonus-note.css'\n})\nexport class CrmBonusNote {\n\n @Prop({ attribute: 'cartid' }) cartId;\n @Prop({ attribute: \"storename\" }) storename;\n\n @State() url: string;\n @State() config: IInfoStore;\n\n @State() bonus: IBonus;\n\n @State() showEdit: boolean = false;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl();\n this.startTime();\n }\n\n upadateCheckToFreteAndGetUrl() {\n\n this.config = getInfoCustomization(this.storename);\n const envios = document.getElementsByName('forma-envio');\n envios.forEach((envio: any) => {\n envio.checked = false;\n });\n\n this.url = window.location.origin;\n }\n\n handleHide() {\n const amount = localStorage.getItem(this.cartId);\n return !!amount;\n }\n\n getAmount() {\n const amount = localStorage.getItem(this.cartId);\n\n return amount ? Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\" : \"0,00\";\n }\n\n async backCart() {\n window.location.href = this.url;\n }\n\n\n private startTime() {\n if(document.location.pathname == '/Fechamento') {\n\n if(!localStorage.getItem(\"bc:time-allow\")) {\n localStorage.removeItem(\"bc:time\")\n }\n\n setTime();\n }\n }\n\n\n hasBonus() {\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n const info = {\n hasBonus: false,\n requestBonus: false\n }\n\n if (_bonus) {\n this.bonus = JSON.parse(_bonus);\n info.hasBonus = this.bonus.hasBonus;\n info.requestBonus = true;\n }\n\n return info;\n }\n\n render() {\n\n const giftbackname = this.config.giftbackTitle || \"Giftback\";\n\n const infobonus = this.hasBonus()\n\n return (\n <div>\n <div class=\"note-container\">\n <div class=\"note-header\">\n\n <p class=\"note-title\">\n <img src={money} width={23} />\n {this.config.giftbackTitle}\n </p>\n {\n infobonus.hasBonus && (\n <div>\n {this.showEdit && (\n <p class=\"back-cart\" onClick={() => this.backCart()}>\n {i18next.t(\"edit\")}\n </p>\n )}\n {!this.showEdit && <countdown-timer initialValue={60} downtime={() => { this.showEdit = true }} />}\n </div>\n )\n }\n </div>\n\n {\n infobonus.hasBonus &&\n (\n <p class=\"note-description-2\">\n {i18next.t(\"withApplyBonus\", { giftbackname: giftbackname })} <strong>R$ {this.getAmount()}.</strong>\n </p>\n )\n }\n\n {\n (infobonus.requestBonus && !infobonus.hasBonus) &&\n (\n <p class=\"note-description-not\">\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\n </p>\n )\n }\n\n {\n !infobonus.requestBonus &&\n (\n <div class=\"description\">\n <p class=\"note-description-not\">\n {i18next.t(\"backCart\")}\n </p>\n <crm-button txtBtn=\"VOLTAR AO CARRINHO\" handleClick={() => this.backCart()} />\n </div>\n )\n }\n\n {/* <a class=\"back-cart\" href={this.url}>\n Voltar ao carrinho\n </a> */}\n </div>\n </div>\n )\n }\n}"],"version":3}
|
1
|
+
{"file":"crm-bonus-note.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,yBAAyB,GAAG,4gCAA4gC;;SCA9hC,OAAO;IAEnB,IAAG,YAAY,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;QACtC,OAAM;KACT;IAED,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAE7C,IAAG,CA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C9CE,aAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAClB,CACP,EACA,CAAC,IAAI,CAAC,QAAQ,IAAIF,8EAAiB,YAAY,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,QAAQ,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA,EAAE,GAAI,CAC5G,CACT,CAEH,EAGF,SAAS,CAAC,QAAQ;aAEdA,gEAAG,KAAK,EAAC,oBAAoB,IACxBE,aAAO,CAAC,CAAC,CAAC,gBAAgB,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,OAAEF,8EAAY,IAAI,CAAC,SAAS,EAAE,MAAW,CACrG,CACP,EAID,CAAC,SAAS,CAAC,YAAY,IAAI,CAAC,SAAS,CAAC,QAAQ;aAE1CA,gEAAG,KAAK,EAAC,sBAAsB,IAC1BE,aAAO,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CACrD,CACP,EAID,CAAC,SAAS,CAAC,YAAY;aAEnBF,kEAAK,KAAK,EAAC,aAAa,IACpBA,gEAAG,KAAK,EAAC,sBAAsB,IAC1BE,aAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CACtB,EACJF,yEAAY,MAAM,EAAC,oBAAoB,EAAC,WAAW,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,GAAI,CAC5E,CACT,CAMH,CACJ,EACT;KACJ;;;;;;","names":["getInfoCustomization","getKeyReserveByCartId","h","money","i18next"],"sources":["src/assets/svg/money-dollars-svgrepo-com.svg","src/helpers/time.helper.ts","src/components/note/crm-bonus-note.css?tag=crm-bonus-note","src/components/note/crm-bonus-note.tsx"],"sourcesContent":["<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"#000000\" stroke-width=\"2\"/>\n<path d=\"M15 9.94728C14.5 9.3 13.8 8.5 12 8.5C10.2 8.5 9 9.51393 9 9.94728C9 10.3806 9.06786 10.9277 10 11.5C10.7522 11.9618 12.6684 12.0439 13.5 12.5C14.679 13.1467 14.8497 13.8202 14.8497 14.0522C14.8497 14.6837 13.4175 15.4852 12 15.5C10.536 15.5153 9.5 14.7 9 14.0522\" stroke=\"#000000\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 7V17\" stroke=\"#000000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>","export function setTime() {\n\n if(localStorage.getItem(\"bc:time-allow\")) {\n return\n }\n\n const time = localStorage.getItem(\"bc:time\");\n\n if(!time) {\n localStorage.setItem(\"bc:time\", \"360\");\n localStorage.setItem(\"bc:time-allow\", \"true\");\n return\n } \n}",".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n display: flex;\n flex-direction: column;\n gap: 13px;\n\n\n & .description {\n display: flex;\n flex-direction: column;\n gap: 13px;\n }\n}\n\n.note-container hr {\n border: 1px solid #CCC;\n}\n\n.note-container .back-cart {\n display: flex;\n text-align: center;\n}\n\n.note-header {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n}\n\n.note-title {\n font-weight: 700;\n text-align: left;\n display: flex;\n gap: 6px;\n align-items: center;\n margin-top: 11px;\n color: #000;\n}\n\n.note-description {\n font-family: Arial;\n color: #6d6d5f;\n padding: 0;\n margin: 0 auto;\n}\n\n.back-cart {\n font-size: .9em;\n color: #27272A;\n text-decoration: none;\n cursor: pointer;\n margin-top: 11px;\n}\n\n.note-description-2 {\n color: var(--crm-scheme-fg-main-inverse, #262626);\n font-family: Roboto;\n font-size: var(--crm-font-size-body-lg, 16px);\n font-style: normal;\n font-weight: var(--crm-font-weight-body-bold, 400);\n line-height: var(--crm-line-height-body-md, 20px);\n letter-spacing: var(--crm-letter-spacing-title-md, 0px);\n margin-top: 11px;\n color: #000;\n}\n\n.note-description-not {\n font-size: 16px;\n}","import { Component, Prop, State, h } from \"@stencil/core\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport money from '../../assets/svg/money-dollars-svgrepo-com.svg'\nimport { getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport i18next from \"../../i18n/i18n\"\nimport { IBonus } from \"../../components\";\nimport { setTime } from \"../../helpers/time.helper\";\n\n@Component({\n tag: 'crm-bonus-note',\n styleUrl: 'crm-bonus-note.css'\n})\nexport class CrmBonusNote {\n\n @Prop({ attribute: 'cartid' }) cartId;\n @Prop({ attribute: \"storename\" }) storename;\n\n @State() url: string;\n @State() config: IInfoStore;\n\n @State() bonus: IBonus;\n\n @State() showEdit: boolean = false;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl();\n this.startTime();\n }\n\n upadateCheckToFreteAndGetUrl() {\n\n this.config = getInfoCustomization(this.storename);\n const envios = document.getElementsByName('forma-envio');\n envios.forEach((envio: any) => {\n envio.checked = false;\n });\n\n this.url = window.location.origin;\n }\n\n handleHide() {\n const amount = localStorage.getItem(this.cartId);\n return !!amount;\n }\n\n getAmount() {\n const amount = localStorage.getItem(this.cartId);\n\n return amount ? Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\" : \"0,00\";\n }\n\n async backCart() {\n window.location.href = this.url;\n }\n\n\n private startTime() {\n if(document.location.pathname == '/Fechamento') {\n\n if(!localStorage.getItem(\"bc:time-allow\")) {\n localStorage.removeItem(\"bc:time\")\n }\n\n setTime();\n }\n }\n\n\n hasBonus() {\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n const info = {\n hasBonus: false,\n requestBonus: false\n }\n\n if (_bonus) {\n this.bonus = JSON.parse(_bonus);\n info.hasBonus = this.bonus.hasBonus;\n info.requestBonus = true;\n }\n\n return info;\n }\n\n getTime() {\n const time = localStorage.getItem(\"bc:time\")\n \n return time ? Number(time) : 0;\n }\n\n render() {\n\n const giftbackname = this.config.giftbackTitle || \"Giftback\";\n\n const infobonus = this.hasBonus()\n\n return (\n <div>\n <div class=\"note-container\">\n <div class=\"note-header\">\n\n <p class=\"note-title\">\n <img src={money} width={23} />\n {this.config.giftbackTitle}\n </p>\n {\n infobonus.hasBonus && (\n <div>\n {this.showEdit && (\n <p class=\"back-cart\" onClick={() => this.backCart()}>\n {i18next.t(\"edit\")}\n </p>\n )}\n {!this.showEdit && <countdown-timer initialValue={this.getTime()} downtime={() => { this.showEdit = true }} />}\n </div>\n )\n }\n </div>\n\n {\n infobonus.hasBonus &&\n (\n <p class=\"note-description-2\">\n {i18next.t(\"withApplyBonus\", { giftbackname: giftbackname })} <strong>R$ {this.getAmount()}.</strong>\n </p>\n )\n }\n\n {\n (infobonus.requestBonus && !infobonus.hasBonus) &&\n (\n <p class=\"note-description-not\">\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\n </p>\n )\n }\n\n {\n !infobonus.requestBonus &&\n (\n <div class=\"description\">\n <p class=\"note-description-not\">\n {i18next.t(\"backCart\")}\n </p>\n <crm-button txtBtn=\"VOLTAR AO CARRINHO\" handleClick={() => this.backCart()} />\n </div>\n )\n }\n\n {/* <a class=\"back-cart\" href={this.url}>\n Voltar ao carrinho\n </a> */}\n </div>\n </div>\n )\n }\n}"],"version":3}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
const index = require('./index-d11684bd.js');
|
6
|
-
const crmbonus_service = require('./crmbonus.service-
|
6
|
+
const crmbonus_service = require('./crmbonus.service-30fd8ffa.js');
|
7
7
|
const index$1 = require('./index-6054ed44.js');
|
8
8
|
const i18n = require('./i18n-f2a6f60e.js');
|
9
9
|
require('./keys.storage-de7744aa.js');
|
@@ -143,7 +143,8 @@ const CrmBonus = class {
|
|
143
143
|
}
|
144
144
|
async buildAndGetProducts() {
|
145
145
|
const key = `bc-products:${this.cartId}`;
|
146
|
-
const
|
146
|
+
const baseUrl = window.location.origin; //"https://bycoders.fbits.store" //window.location.origin;
|
147
|
+
const cart = await this.crmBonusService.getInfoCart(baseUrl);
|
147
148
|
this.productsInString = JSON.stringify(cart.Produtos);
|
148
149
|
localStorage.setItem(key, this.productsInString);
|
149
150
|
const productsInCart = JSON.parse(this.productsInString);
|
@@ -238,7 +239,7 @@ const CrmBonus = class {
|
|
238
239
|
this.showModal = true;
|
239
240
|
}
|
240
241
|
render() {
|
241
|
-
return (index.h("loading-container", { key: '
|
242
|
+
return (index.h("loading-container", { key: '7d2a096146b448080fe2e164db1db21bbee5aacf', loading: this.loading_reprocess }, index.h("crm-giftback-form", { key: 'ab3712c2dd84227ebba4458ee513c0292deef850', style: { position: "relative" }, ref: ref => this.crmBonusRef = ref, storeName: this.storeName, products: this.buildProducts(), cartId: this.cartId, customer: this.customer, loadProducts: () => this.buildProducts() })));
|
242
243
|
}
|
243
244
|
static get assetsDirs() { return ["assets"]; }
|
244
245
|
static get watchers() { return {
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"crm-bonus.entry.cjs.js","mappings":";;;;;;;;;;AAQA,IAAY,eAEX;AAFD,WAAY,eAAe;IACvB,iCAAc,CAAA;AAClB,CAAC,EAFW,eAAe,KAAf,eAAe;;SCNX,mBAAmB,CAAC,eAAoC,EAAE;IAEtE,MAAM,QAAQ,GAAoB,EAAE,CAAC;IAErC,KAAM,MAAM,EAAE,IAAI,YAAY,EAAG;QAC7B,IAAI,SAAS,GAAG,WAAW,CAAC,EAAE,CAAC,OAAO,CAAC,CAAA;QAEvC,QAAQ,CAAC,IAAI,CACT;YACI,GAAG,EAAE,EAAE,CAAC,GAAG;YACX,KAAK,GAAG,EAAE,CAAC,QAAQ,GAAG,EAAE,CAAC,UAAU,CAAC;YACpC,gBAAgB,EAAE,EAAE,CAAC,iBAAiB,CAAC,QAAQ,EAAE;YACjD,QAAQ,EAAE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,SAAS,EACzB,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,EAC9B,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,YAAY,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,GAExC,CACgB,EACrB;KACF;;;;;;;;;;","names":["CrmBonusService","StepFormEnum","i18next","h"],"sources":["src/dto/validate.pin.bonus.ts","src/helpers/build.payload.helper.ts","src/components/crm-bonus/crm-bonus.css?tag=crm-bonus&encapsulation=scoped","src/components/crm-bonus/crm-bonus.tsx"],"sourcesContent":["export interface IProduct {\n productVariantId: string;\n sku: string;\n value: number;\n quantity: number;\n discount: number;\n}\n\nexport enum AjustesTipoEnum {\n P = \"Promocao\" \n}\n\nexport interface IAjustes {\n Tipo: AjustesTipoEnum;\n Valor: number;\n}\n\nexport interface IProductWake {\n ProdutoVarianteId: number;\n SKU: string;\n PrecoPor: number;\n Quantidade: number;\n Ajustes: IAjustes[];\n}\n\nexport interface ICustomer {\n birthDate: string;\n document: string;\n name: string;\n phone: string;\n}\n\nexport interface IProccesPinBonusDto {\n storeName: string;\n name: string;\n checkoutId: string;\n checkoutProducts: Array<IProduct>;\n storeId: string;\n userId: string;\n cellphone: number;\n pin: string;\n\n}\n\nexport interface IBonus {\n hasBonus: boolean;\n bonusBalance: number;\n totalBonus: number;\n minimumPurchase: number;\n bonusIds: string;\n firstValidityDate: string\n history: [\n {\n validityStart: string;\n validityEnd: string;\n value: number\n },\n {\n validityStart: string;\n validityEnd: string\n value: number\n }\n ]\n storeId: number;\n userId: number;\n cartId: string\n calculatedValue: number;\n totalValue: number\n}\n\n\nexport interface IReserveDTO {\n storeName: string;\n cartId: string;\n grossValue: number;\n redeemedBonus: number;\n ticket: string;\n storeId: string;\n userId: number;\n}","import { AjustesTipoEnum, IAjustes, IProduct, IProductWake } from \"../dto/validate.pin.bonus\";\n\nexport function buildProductsByWake(productsWake: Array<IProductWake> = []): Array<IProduct> {\n\n const products: Array<IProduct> = [];\n\n for ( const pw of productsWake ) {\n let discounts = getDiscount(pw.Ajustes)\n\n products.push(\n {\n sku: pw.SKU,\n value: (pw.PrecoPor * pw.Quantidade),\n productVariantId: pw.ProdutoVarianteId.toString(),\n quantity: pw.Quantidade,\n discount: (discounts * -1)\n }\n )\n }\n\n return products;\n}\n\nfunction getDiscount(ajustes: IAjustes[] = []) {\n \n let discounts = 0;\n \n for(const discount of ajustes) {\n if(discount.Tipo === AjustesTipoEnum.P) {\n discounts += discount.Valor;\n }\n }\n\n return discounts;\n}","\n.container-button {\n /* max-width: 100%; */\n cursor: pointer;\n padding: 5px 5px 5px 14px;\n /* display: flex; */\n}\n\n/* padding: 0 15px 15px;\nborder: 1px solid #ddd;\nmargin-bottom: 20px; */\n\n.section-crm {\n border: 1px solid #dbd4d4;\n /* min-height: 50px; */\n text-align: -webkit-center;\n margin-bottom: 20px;\n}\n\n.section-cart-crm {\n margin-top: 10px;\n}\n\n.section-cart-crm p {\n padding: 0;\n margin: 0px 0px 0px 15px;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n /* border-radius: 10px; */\n padding: 15px;\n min-height: 30px;\n min-width: 120px;\n font-size: 20px;\n cursor: pointer;\n margin-left: 10px;\n height: 70px;\n}\n\n.form-container {\n width: 97%;\n display: flex;\n justify-content: space-around;\n}\n\n\n.btn {\n display: inline-block;\n padding: 6px 12px;\n margin-bottom: 0;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.42857143;\n text-align: center;\n white-space: nowrap;\n vertical-align: middle;\n -ms-touch-action: manipulation;\n touch-action: manipulation;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n background-image: none;\n border: 1px solid transparent;\n border-radius: 0px;\n}\n\n.form-container .btnCrm {\n background: #00162e;\n border-color: #00162e;\n width: 30%;\n color: #fff;\n}\n\n.message-alert {\n font-family: sans-serif;\n color: #df4d4d;\n margin-top: 5px;\n}","import { Component, Method, Prop, State, Watch, 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'\nimport { buildProductsByWake } from '../../helpers/build.payload.helper';\n\n@Component({\n tag: 'crm-bonus',\n styleUrl: 'crm-bonus.css',\n scoped: true,\n assetsDirs: ['assets']\n})\nexport class CrmBonus {\n\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\n private crmBonusRef: HTMLCrmGiftbackFormElement;\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 @State() loading_reprocess = false;\n\n @Method()\n async resetBonus() {\n console.log('[START RESET BONUS]!!!!!');\n // const used = localStorage.getItem(\"bc:used\");\n\n // if (used == \"use\") {\n // await this.crmBonusService.cancelBonus(this.cartId, this.storeName);\n // }\n\n try {\n await this.crmBonusRef.processBonus(this.buildProducts(), true);\n console.log('[BONUS RESETADO]!!!!!');\n } catch (err) {\n\n this.loading = false;\n console.log('[error ao reprocessar bonous]');\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PHONE);\n } finally {\n this.loading = false;\n }\n }\n\n @Method()\n async reprocess(products: Array<any>) {\n this.loading_reprocess = true\n\n try {\n this.productsInString = JSON.stringify(products);\n await this.handleLoad();\n\n await this.resetBonus();\n } catch (err) {\n console.debug('[watchProducts]', err.message);\n } finally {\n this.loading_reprocess = false\n }\n }\n\n @Watch(\"productsInString\")\n async watchProducts(newValue: string) {\n try {\n console.log('[update products list]');\n this.productsInString = newValue;\n await this.handleLoad();\n\n await this.resetBonus();\n } catch (err) {\n console.debug('[watchProducts]', err.message);\n }\n }\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 console.log('customer', this.customer);\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 await 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\n const key = `bc-products:${this.cartId}`;\n\n const cart = await this.crmBonusService.getInfoCart();\n\n this.productsInString = JSON.stringify(cart.Produtos)\n\n localStorage.setItem(key, this.productsInString);\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 const [ ajuste = { Valor:0 } ] = pro.Ajustes.filter( aj => aj.Tipo === \"Formula\" )\n\n if (pro) {\n products.push({\n ...product_cart,\n PrecoPor: pro.PrecoPor + (ajuste.Valor * -1),\n Quantidade: pro.Quantidade,\n Ajustes: pro.Ajustes\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 buildProductsByWake(this.products);\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 <loading-container loading={this.loading_reprocess} >\n <crm-giftback-form\n style={{ position: \"relative\" }}\n ref={ref => this.crmBonusRef = ref}\n storeName={this.storeName}\n products={this.buildProducts()}\n cartId={this.cartId}\n customer={this.customer}\n loadProducts={() => this.buildProducts()}\n \n />\n </loading-container>\n )\n }\n}\n"],"version":3}
|
1
|
+
{"file":"crm-bonus.entry.cjs.js","mapp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AAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACxC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QAE5B,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;YACtB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;SAC3B;QAED,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAACA,oBAAY,CAAC,SAAS,CAAC,CAAC;QACvD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;KACvB;IAED,MAAM;QAEJ,QACEE,gFAAmB,OAAO,EAAE,IAAI,CAAC,iBAAiB,IAChDA,gFACE,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,EAC/B,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,WAAW,GAAG,GAAG,EAClC,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,EAC9B,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,YAAY,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,GAExC,CACgB,EACrB;KACF;;;;;;;;;;","names":["CrmBonusService","StepFormEnum","i18next","h"],"sources":["src/dto/validate.pin.bonus.ts","src/helpers/build.payload.helper.ts","src/components/crm-bonus/crm-bonus.css?tag=crm-bonus&encapsulation=scoped","src/components/crm-bonus/crm-bonus.tsx"],"sourcesContent":["export interface IProduct {\n productVariantId: string;\n sku: string;\n value: number;\n quantity: number;\n discount: number;\n}\n\nexport enum AjustesTipoEnum {\n P = \"Promocao\" \n}\n\nexport interface IAjustes {\n Tipo: AjustesTipoEnum;\n Valor: number;\n}\n\nexport interface IProductWake {\n ProdutoVarianteId: number;\n SKU: string;\n PrecoPor: number;\n Quantidade: number;\n Ajustes: IAjustes[];\n}\n\nexport interface ICustomer {\n birthDate: string;\n document: string;\n name: string;\n phone: string;\n}\n\nexport interface IProccesPinBonusDto {\n storeName: string;\n name: string;\n checkoutId: string;\n checkoutProducts: Array<IProduct>;\n storeId: string;\n userId: string;\n cellphone: number;\n pin: string;\n\n}\n\nexport interface IBonus {\n hasBonus: boolean;\n bonusBalance: number;\n totalBonus: number;\n minimumPurchase: number;\n bonusIds: string;\n firstValidityDate: string\n history: [\n {\n validityStart: string;\n validityEnd: string;\n value: number\n },\n {\n validityStart: string;\n validityEnd: string\n value: number\n }\n ]\n storeId: number;\n userId: number;\n cartId: string\n calculatedValue: number;\n totalValue: number\n}\n\n\nexport interface IReserveDTO {\n storeName: string;\n cartId: string;\n grossValue: number;\n redeemedBonus: number;\n ticket: string;\n storeId: string;\n userId: number;\n}","import { AjustesTipoEnum, IAjustes, IProduct, IProductWake } from \"../dto/validate.pin.bonus\";\n\nexport function buildProductsByWake(productsWake: Array<IProductWake> = []): Array<IProduct> {\n\n const products: Array<IProduct> = [];\n\n for ( const pw of productsWake ) {\n let discounts = getDiscount(pw.Ajustes)\n\n products.push(\n {\n sku: pw.SKU,\n value: (pw.PrecoPor * pw.Quantidade),\n productVariantId: pw.ProdutoVarianteId.toString(),\n quantity: pw.Quantidade,\n discount: (discounts * -1)\n }\n )\n }\n\n return products;\n}\n\nfunction getDiscount(ajustes: IAjustes[] = []) {\n \n let discounts = 0;\n \n for(const discount of ajustes) {\n if(discount.Tipo === AjustesTipoEnum.P) {\n discounts += discount.Valor;\n }\n }\n\n return discounts;\n}","\n.container-button {\n /* max-width: 100%; */\n cursor: pointer;\n padding: 5px 5px 5px 14px;\n /* display: flex; */\n}\n\n/* padding: 0 15px 15px;\nborder: 1px solid #ddd;\nmargin-bottom: 20px; */\n\n.section-crm {\n border: 1px solid #dbd4d4;\n /* min-height: 50px; */\n text-align: -webkit-center;\n margin-bottom: 20px;\n}\n\n.section-cart-crm {\n margin-top: 10px;\n}\n\n.section-cart-crm p {\n padding: 0;\n margin: 0px 0px 0px 15px;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n /* border-radius: 10px; */\n padding: 15px;\n min-height: 30px;\n min-width: 120px;\n font-size: 20px;\n cursor: pointer;\n margin-left: 10px;\n height: 70px;\n}\n\n.form-container {\n width: 97%;\n display: flex;\n justify-content: space-around;\n}\n\n\n.btn {\n display: inline-block;\n padding: 6px 12px;\n margin-bottom: 0;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.42857143;\n text-align: center;\n white-space: nowrap;\n vertical-align: middle;\n -ms-touch-action: manipulation;\n touch-action: manipulation;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n background-image: none;\n border: 1px solid transparent;\n border-radius: 0px;\n}\n\n.form-container .btnCrm {\n background: #00162e;\n border-color: #00162e;\n width: 30%;\n color: #fff;\n}\n\n.message-alert {\n font-family: sans-serif;\n color: #df4d4d;\n margin-top: 5px;\n}","import { Component, Method, Prop, State, Watch, 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'\nimport { buildProductsByWake } from '../../helpers/build.payload.helper';\n\n@Component({\n tag: 'crm-bonus',\n styleUrl: 'crm-bonus.css',\n scoped: true,\n assetsDirs: ['assets']\n})\nexport class CrmBonus {\n\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\n private crmBonusRef: HTMLCrmGiftbackFormElement;\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 @State() loading_reprocess = false;\n\n @Method()\n async resetBonus() {\n console.log('[START RESET BONUS]!!!!!');\n // const used = localStorage.getItem(\"bc:used\");\n\n // if (used == \"use\") {\n // await this.crmBonusService.cancelBonus(this.cartId, this.storeName);\n // }\n\n try {\n await this.crmBonusRef.processBonus(this.buildProducts(), true);\n console.log('[BONUS RESETADO]!!!!!');\n } catch (err) {\n\n this.loading = false;\n console.log('[error ao reprocessar bonous]');\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PHONE);\n } finally {\n this.loading = false;\n }\n }\n\n @Method()\n async reprocess(products: Array<any>) {\n this.loading_reprocess = true\n\n try {\n this.productsInString = JSON.stringify(products);\n await this.handleLoad();\n\n await this.resetBonus();\n } catch (err) {\n console.debug('[watchProducts]', err.message);\n } finally {\n this.loading_reprocess = false\n }\n }\n\n @Watch(\"productsInString\")\n async watchProducts(newValue: string) {\n try {\n console.log('[update products list]');\n this.productsInString = newValue;\n await this.handleLoad();\n\n await this.resetBonus();\n } catch (err) {\n console.debug('[watchProducts]', err.message);\n }\n }\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 console.log('customer', this.customer);\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 await 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\n const key = `bc-products:${this.cartId}`;\n \n const baseUrl = window.location.origin; //\"https://bycoders.fbits.store\" //window.location.origin;\n \n const cart = await this.crmBonusService.getInfoCart(baseUrl);\n\n this.productsInString = JSON.stringify(cart.Produtos)\n\n localStorage.setItem(key, this.productsInString);\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 const [ ajuste = { Valor:0 } ] = pro.Ajustes.filter( aj => aj.Tipo === \"Formula\" )\n\n if (pro) {\n products.push({\n ...product_cart,\n PrecoPor: pro.PrecoPor + (ajuste.Valor * -1),\n Quantidade: pro.Quantidade,\n Ajustes: pro.Ajustes\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 buildProductsByWake(this.products);\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 <loading-container loading={this.loading_reprocess} >\n <crm-giftback-form\n style={{ position: \"relative\" }}\n ref={ref => this.crmBonusRef = ref}\n storeName={this.storeName}\n products={this.buildProducts()}\n cartId={this.cartId}\n customer={this.customer}\n loadProducts={() => this.buildProducts()}\n \n />\n </loading-container>\n )\n }\n}\n"],"version":3}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
const index = require('./index-d11684bd.js');
|
6
|
-
const crmbonus_service = require('./crmbonus.service-
|
6
|
+
const crmbonus_service = require('./crmbonus.service-30fd8ffa.js');
|
7
7
|
const index$1 = require('./index-6054ed44.js');
|
8
8
|
const info_config_helper = require('./info.config.helper-c5d9f781.js');
|
9
9
|
const i18n = require('./i18n-f2a6f60e.js');
|
@@ -82,6 +82,7 @@ const GiftbackInfo = class {
|
|
82
82
|
async handleOptionChange(option) {
|
83
83
|
this.selectedOption = option;
|
84
84
|
localStorage.setItem(keys_storage.USED_KEY, option);
|
85
|
+
localStorage.removeItem("bc:time-allow");
|
85
86
|
switch (this.selectedOption) {
|
86
87
|
case 'use':
|
87
88
|
await this.reserve(this.usedValue);
|
@@ -107,14 +108,14 @@ const GiftbackInfo = class {
|
|
107
108
|
const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;
|
108
109
|
const translateDescription = i18n.instance.t("giftDescription", { amount: `${this.bonus.totalBonus.toFixed(2).replace(".", ",")}`, custom_name: "Giftback" });
|
109
110
|
const limit = utils.defineLimit(remainingGiftback);
|
110
|
-
return (index.h("div", { key: '
|
111
|
+
return (index.h("div", { key: '1d25355aba20e4c9739d481653c7f2826a5901d3', class: "giftback-container" }, index.h("div", { key: '7b858605ee5acd7796c2757406f4775005863114', class: "container-description" }, index.h("p", { key: 'f568383b7b046a109f2e41445079ff573d1f2a44', innerHTML: translateDescription }), index.h("crm-tooltip", { key: '0570b1e506d96a9df92adf0fe7490f106389bd86', identity: "crm-role-description", text: i18n.instance.t("labelUseGiftback", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: utils.formatDateToBr(this.bonus.firstValidityDate) }) })), index.h("div", { key: '2dd246185100fec070ff6572b562fc51dad30651', class: "slider-wrapper" }, index.h("div", { key: '7a4b262667504980699413d4dd481685413d3300', class: "slider-value", style: {
|
111
112
|
left: `calc(${this.sliderValuePosition}% - 20px)`, // Ajuste para centralizar o texto
|
112
|
-
} }, "R$ ", this.usedValue.toFixed(2).replace(".", ",")), index.h("input", { key: '
|
113
|
+
} }, "R$ ", this.usedValue.toFixed(2).replace(".", ",")), index.h("input", { key: 'dc997ca571f0d421270715c964cc49212be7e57d', id: "position_value_id", disabled: true, type: "range", min: "0", max: this.bonus.totalBonus, value: this.usedValue, class: "slider", step: "0.01", onInput: (event) => this.handleSliderChange(event), style: {
|
113
114
|
background: `linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`,
|
114
|
-
} })), limit.isComplete && (index.h("p", { key: '
|
115
|
-
_a.giftbackTitle)), index.h("div", { key: '
|
115
|
+
} })), limit.isComplete && (index.h("p", { key: '3af0aa73f293811ab5e690b4d940feab402234b6' }, i18n.instance.t("maxAmount"))), !limit.isComplete && (index.h("div", { key: '432091406979ce0ade13e8a7e95e588f9a3dc658', class: "container-description" }, index.h("p", { key: 'd24a3b97c077f1649472a357ee86330adb32ed05' }, "Adicione ", index.h("strong", { key: '8d3b430c29d4022f52d93e7537bacc3b1b791e03' }, "R$ ", remainingGiftback < 0 ? "0,00" : remainingGiftback.toFixed(2).replace(".", ",")), " ao carrinho para atingir o valor m\u00E1ximo!"), index.h("crm-tooltip", { key: 'd6577bf445c465da4a61a1b97333fe2b72f6a4f5', identity: "crm-max-description", text: i18n.instance.t("labelamountPartial") }))), index.h("div", { key: '311ea14d184acaf7fc13eb4cbf7daea42283455c', class: "options" }, index.h("div", { key: 'b0fef511b01ebe088ff8a2c056050f0c6d8623dc', class: "options-option" }, index.h("input", { key: 'c3cc584a67b89c2383957f5d4e8618928bd794e2', disabled: this.showTime(), type: "radio", name: "giftbackOption", value: "use", checked: this.selectedOption === 'use', onChange: () => this.handleOptionChange('use') }), index.h("p", { key: '6d065330e1d662f9f23e0807e1a4721d18a15643' }, "Usar o meu ", (_a = this.config) === null || _a === void 0 ? void 0 :
|
116
|
+
_a.giftbackTitle)), index.h("div", { key: '2eef45ded4e946aa344927c40b050a2e2ceac40b', class: "options-option" }, index.h("input", { key: 'cf01792546fdc00298631718d957e48498c89259', disabled: this.showTime(), type: "radio", name: "giftbackOption", value: "dontUse", checked: this.selectedOption === 'dontUse', onChange: () => this.handleOptionChange('dontUse') }), index.h("p", { key: '4f1418b73a07ca4547ef7c82939e3eef8a0088c6' }, "N\u00E3o usar o meu ", (_b = this.config) === null || _b === void 0 ? void 0 :
|
116
117
|
_b.giftbackTitle))), this.showTime() &&
|
117
|
-
(index.h("div", { key: '
|
118
|
+
(index.h("div", { key: '7a562470ec290f1d9924067c780b88f56f167668', class: "info-box" }, "Ap\u00F3s ", index.h("countdown-timer", { key: '828e16ac201275adb6646fbea52ea20666028b4c', initialValue: this.getTime(), downtime: () => { this.loadingTime = true; } }), ", voc\u00EA poder\u00E1 alterar sua escolha de usar ou n\u00E3o o Giftback.")), index.h("div", { key: 'b129082126619e4f618b020822d3d3a3efab3620', class: "info-box" }, "O Giftback ser\u00E1 aplicado na pr\u00F3xima etapa.")));
|
118
119
|
}
|
119
120
|
static get watchers() { return {
|
120
121
|
"bonus": ["changedBonus"]
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"crm-tooltip.giftback-info.phone-form.pin-form.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,uBAAuB,GAAG,wvCAAwvC;;ACAxxC,MAAM,aAAa,GAAG,y3BAAy3B,CAAC;AACh5B,yBAAe,aAAa;;MCOf,OAAO;;;;;;IAKhB,MAAM;QACF,QACIA,kEAAK,KAAK,EAAC,mCAAmC,IAC1CA,kEAAK,GAAG,EAAEC,uBAAI,GAAI,EAClBD,mEAAM,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAC,aAAa,IAAE,IAAI,CAAC,IAAI,CAAQ,CAC7D,EACR;KACL;;;;ACpBL,MAAM,eAAe,GAAG,k7DAAk7D,CAAC;AAC38D,2BAAe,eAAe;;MCWjB,YAAY;;;yBACQ,CAAC;8BACI,MAAM;uBAEb,KAAK;qBACC;YAC7B,UAAU,EAAE,CAAC;YACb,MAAM,EAAE,EAAE;YACV,eAAe,EAAE,CAAC;YAClB,YAAY,EAAE,CAAC;YACf,eAAe,EAAE,CAAC;YAClB,iBAAiB,EAAE,EAAE;YACrB,UAAU,EAAE,CAAC;SAChB;;;;8BAKiC,CAAC;mCACI,CAAC;2BAEjB,KAAK;;IAG5B,YAAY;QACR,IAAI,CAAC,WAAW,EAAE,CAAA;KACrB;IAEO,WAAW;QACf,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,mBAAmB,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;KACtD;IAED,iBAAiB;QACb,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,cAAc,GAAG,YAAY,CAAC,OAAO,CAACE,qBAAQ,CAAC,CAAC;KACxD;IAED,kBAAkB,CAAC,KA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ACT;KACL;;;;;;;;;","names":["h","info","USED_KEY","i18next","defineLimit","formatDateToBr","giftbackFormCss","Host","index"],"sources":["src/assets/svg/info-circle-svgrepo-com.svg","src/components/tooltip/crm-tooltip.css?tag=crm-tooltip","src/components/tooltip/tooltip.tsx","src/components/giftback-form/subcomponents/giftback-info/giftback-info.css?tag=giftback-info","src/components/giftback-form/subcomponents/giftback-info/giftback-info.tsx","src/components/giftback-form/giftback-form.css?tag=phone-form","src/components/giftback-form/subcomponents/phone-form/phone-form.tsx","src/components/giftback-form/subcomponents/pin-form/pin-form.css?tag=pin-form&encapsulation=shadow","src/components/giftback-form/giftback-form.css?tag=pin-form&encapsulation=shadow","src/components/giftback-form/subcomponents/pin-form/pin-form.tsx"],"sourcesContent":["<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\r\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path d=\"M12 17.75C12.4142 17.75 12.75 17.4142 12.75 17V11C12.75 10.5858 12.4142 10.25 12 10.25C11.5858 10.25 11.25 10.5858 11.25 11V17C11.25 17.4142 11.5858 17.75 12 17.75Z\" fill=\"#1C274C\"/>\r\n<path d=\"M12 7C12.5523 7 13 7.44772 13 8C13 8.55228 12.5523 9 12 9C11.4477 9 11 8.55228 11 8C11 7.44772 11.4477 7 12 7Z\" fill=\"#1C274C\"/>\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M1.25 12C1.25 6.06294 6.06294 1.25 12 1.25C17.9371 1.25 22.75 6.06294 22.75 12C22.75 17.9371 17.9371 22.75 12 22.75C6.06294 22.75 1.25 17.9371 1.25 12ZM12 2.75C6.89137 2.75 2.75 6.89137 2.75 12C2.75 17.1086 6.89137 21.25 12 21.25C17.1086 21.25 21.25 17.1086 21.25 12C21.25 6.89137 17.1086 2.75 12 2.75Z\" fill=\"#1C274C\"/>\r\n</svg>",".crm-tooltip-container {\n display: flex;\n\n & img {\n width: 16px;\n margin-left: 3px;\n position: relative;\n }\n}\n\n.crm-tooltip {\n position: relative;\n display: inline-block;\n}\n\n.crm-tooltip .tooltiptext {\n visibility: hidden;\n background-color: black;\n color: #fff;\n text-align: center;\n padding: 8px 12px;\n border-radius: 0px;\n position: absolute;\n z-index: 1;\n min-width: 271px;\n top: 100%;\n left: 50%;\n margin-left: -238px;\n}\n\n@container (max-width: 410px) {\n .crm-tooltip .tooltiptext {\n margin-left: -14px;\n }\n\n .crm-tooltip #crm-role-description {\n margin-left: -151px;\n }\n}\n\n@container (max-width: 250px) {\n .crm-tooltip .tooltiptext {\n margin-left: -201px;\n }\n}\n\n.crm-tooltip:hover .tooltiptext {\n visibility: visible;\n}","import { Component, h, Prop } from \"@stencil/core\";\nimport info from '../../assets/svg/info-circle-svgrepo-com.svg';\n\n\n@Component({\n tag: 'crm-tooltip',\n styleUrl: 'crm-tooltip.css'\n})\nexport class Tooltip {\n\n @Prop() text: string;\n @Prop() identity: string;\n\n render() {\n return (\n <div class=\"crm-tooltip-container crm-tooltip\">\n <img src={info} />\n <span id={this.identity} class=\"tooltiptext\">{this.text}</span>\n </div>\n );\n }\n}",":host {\n --text-color: #6D6D5F\n}\n\n.giftback-container {\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\nh3 {\n font-size: 1.2rem;\n margin-bottom: 8px;\n color: #333;\n}\n\n.container-description {\n display: flex;\n align-items: center;\n gap: 5px;\n margin: 0 0 10px 0;\n}\n\n.container-description p {\n font-size: 14px;\n font-weight: 400;\n margin: 0px;\n}\n\n\np {\n font-size: 14px;\n color: #000;\n}\n\n.value-display h2 {\n color: #6D6D5F;\n /* Verde para o valor atual */\n font-size: 1.6rem;\n margin: 16px 0;\n}\n\ninput[type='range'] {\n width: 100%;\n margin: 12px 0;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 4px;\n outline: none;\n padding: 3px 0px 3px 3px;\n}\n\n/* input[type='range']::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n border-radius: 50%;\n cursor: pointer;\n} */\n\ninput[type=\"range\"]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 20px;\n height: 20px;\n background: rgb(109, 109, 95);\n /* Cor do botão */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.options {\n margin: 0px 0;\n display: flex;\n gap: 10px;\n flex-direction: column;\n}\n\n.options label {\n display: flex;\n margin: 0px 0;\n font-size: 0.9rem;\n color: #333;\n align-items: center;\n}\n\n.options input[type='radio'] {\n margin-right: 8px;\n height: 16px;\n width: 16px;\n}\n\n.options input[type='radio'] {\n appearance: none;\n -webkit-appearance: none;\n margin-right: 8px;\n width: 16px;\n height: 16px;\n border: 2px solid #ddd;\n border-radius: 50%;\n background-color: #fff;\n cursor: pointer;\n transition: all 0.3s;\n padding: 0px;\n}\n\n.options input[type='radio']:checked {\n border-color: #000;\n background-color: #FAFAFA;\n border: 4px solid #000;\n}\n\n.info-box {\n background-color: #f9f9f9;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n padding: 8px;\n font-size: 14px;\n color: #262626;\n line-height: 20px;\n}\n\n.info-icon {\n font-size: 0.9rem;\n cursor: pointer;\n color: #888;\n}\n\nh3 {\n font-size: 1.2rem;\n margin-bottom: 8px;\n color: #333;\n}\n\n.slider-wrapper {\n position: relative;\n margin: 21px 0px 0px 0px;\n}\n\n.slider {\n width: 100%;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 2px;\n outline: none;\n}\n\n.slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n /* Azul para o slider */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.slider-value {\n position: absolute;\n top: -30px;\n /* Posição acima do slider */\n font-size: 16px;\n font-weight: 700;\n color: var(--text-color);\n /* Verde para o texto */\n transform: translateX(-50%);\n white-space: nowrap;\n /* margin-left: 23px; */\n}\n\n.options-option {\n display: flex;\n}\n\n\n/* ########################################## */\n","import { Component, Prop, State, Watch, h } from \"@stencil/core\";\nimport { IBonus } from \"../../../../dto/validate.pin.bonus\";\n\nimport i18next from '../../../../i18n/i18n'\nimport { USED_KEY } from \"../../../../utils/keys.storage\";\nimport { defineLimit, formatDateToBr } from \"../../../../utils/utils\";\nimport { IInfoStore } from \"../../../../helpers/info.config.helper\";\n\n@Component({\n tag: 'giftback-info',\n styleUrls: ['giftback-info.css']\n})\nexport class GiftbackInfo {\n @State() usedValue: number = 0;\n @State() selectedOption: string = 'none';\n\n @Prop() loading: boolean = false;\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 0,\n cartId: \"\",\n minimumPurchase: 0,\n bonusBalance: 0,\n calculatedValue: 0,\n firstValidityDate: \"\",\n totalValue: 0\n };\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n @Prop() config: IInfoStore;\n\n @State() sliderPosition: number = 0;\n @State() sliderValuePosition: number = 0;\n\n @State() loadingTime = false;\n\n @Watch(\"bonus\")\n changedBonus() {\n this.updateBonus()\n }\n\n private updateBonus() {\n this.usedValue = this.bonus.bonusBalance;\n this.buildPositionSlider(0, this.bonus.totalBonus);\n }\n\n componentWillLoad() {\n this.updateBonus();\n this.selectedOption = localStorage.getItem(USED_KEY);\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n\n // Calculando a posição do texto com base no valor do slider\n // const percentage = ((this.usedValue - parseInt(input.min)) / (parseInt(input.max) - parseInt(input.min))) * 100;\n // this.sliderPosition = percentage;\n\n this.buildPositionSlider(parseFloat(input.min), parseFloat(input.max))\n }\n\n componentDidLoad() {\n const input: any = document.getElementById(\"position_value_id\")\n\n input.value = this.bonus.bonusBalance;\n }\n\n\n private buildPositionSlider(min: number, max: number) {\n\n const percentage_init = max * 0.1;\n\n // Calculando a posição do texto com base no valor do slider\n const percentage = ((this.usedValue - min) / (max - min)) * 100;\n\n this.sliderPosition = percentage;\n this.sliderValuePosition = percentage + (this.usedValue <= percentage_init ? 10 : 0);\n }\n\n async handleOptionChange(option: string) {\n this.selectedOption = option;\n\n localStorage.setItem(USED_KEY, option);\n\n switch (this.selectedOption) {\n case 'use':\n await this.reserve(this.usedValue);\n break;\n case 'dontUse':\n await this.cancel();\n break;\n default:\n }\n }\n\n showTime() {\n const time = localStorage.getItem(\"bc:time\");\n\n const allow = localStorage.getItem(\"bc:time-allow\");\n\n if(!allow) return false;\n\n return !!time;\n }\n\n getTime() {\n const time = localStorage.getItem(\"bc:time\");\n return Number(time) || 360;\n }\n\n render() {\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n const translateDescription = i18next.t(\"giftDescription\", { amount: `${this.bonus.totalBonus.toFixed(2).replace(\".\", \",\")}`, custom_name: \"Giftback\" })\n\n const limit = defineLimit(remainingGiftback);\n\n return (\n\n <div class=\"giftback-container\">\n <div class=\"container-description\">\n <p innerHTML={translateDescription}></p>\n <crm-tooltip identity=\"crm-role-description\" text={i18next.t(\"labelUseGiftback\", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: formatDateToBr(this.bonus.firstValidityDate) })} />\n </div>\n <div class=\"slider-wrapper\">\n <div\n class=\"slider-value\"\n style={{\n left: `calc(${this.sliderValuePosition}% - 20px)`, // Ajuste para centralizar o texto\n\n }}\n >\n R$ {this.usedValue.toFixed(2).replace(\".\", \",\")}\n </div>\n <input\n id=\"position_value_id\"\n disabled\n type=\"range\"\n min=\"0\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n class=\"slider\"\n step=\"0.01\"\n onInput={(event) => this.handleSliderChange(event)}\n style={{\n background: `linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`,\n }}\n />\n </div>\n\n {\n limit.isComplete && (\n <p>\n {i18next.t(\"maxAmount\")}\n </p>\n )\n }\n\n {\n !limit.isComplete && (\n <div class=\"container-description\">\n <p>\n Adicione <strong>R$ {remainingGiftback < 0 ? \"0,00\" : remainingGiftback.toFixed(2).replace(\".\", \",\")}</strong> ao carrinho para atingir o valor\n máximo!\n </p>\n <crm-tooltip identity=\"crm-max-description\" text={i18next.t(\"labelamountPartial\")} />\n </div>\n )\n }\n\n\n <div class=\"options\">\n <div class=\"options-option\">\n <input\n disabled={this.showTime()}\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"use\"\n checked={this.selectedOption === 'use'}\n onChange={() => this.handleOptionChange('use')}\n />\n <p>Usar o meu {this.config?.giftbackTitle}</p>\n </div>\n <div class=\"options-option\">\n <input\n disabled={this.showTime()}\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"dontUse\"\n checked={this.selectedOption === 'dontUse'}\n onChange={() => this.handleOptionChange('dontUse')}\n />\n <p>Não usar o meu {this.config?.giftbackTitle}</p>\n </div>\n </div>\n\n {\n this.showTime() &&\n (\n <div class=\"info-box\">\n Após <countdown-timer initialValue={this.getTime()} downtime={() => { this.loadingTime = true }} />, você poderá alterar sua escolha de usar ou não o Giftback.\n </div>\n )\n }\n\n\n <div class=\"info-box\">\n O Giftback será aplicado na próxima etapa.\n </div>\n </div>\n );\n }\n}","* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n font-family: Roboto;\n font-size: var(--crmfont-sizebodymd);\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n font-size: 14px;\n color: var(--crm-btn);\n font-weight: 100;\n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n font-size: 16px;\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n font-size: 12px;\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n font-size: 12px;\n}","import { Component, Host, Prop, h } from \"@stencil/core\";\nimport { IInfoStore } from \"../../../../helpers/info.config.helper\";\n\n@Component({\n tag: 'phone-form',\n styleUrl: '../../giftback-form.css'\n})\nexport class PhoneForm {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() value: string;\n @Prop() loading: boolean;\n @Prop() handlerSubmit: (phone: string) => void;\n\n @Prop() config: IInfoStore;\n\n\n async handlePhone() {\n\n const phone = await this.phoneInputMask.getPhone()\n\n await this.handlerSubmit(phone);\n }\n\n\n render() {\n return (\n <Host class=\"crm-phone-form\">\n <label class=\"crm-subtitle\" >Digite o seu celular para verificar se há desconto disponível nessa compra:</label>\n <phone-input-mask initialValue={this.value} ref={ref => this.phoneInputMask = ref} />\n\n <crm-button txtBtn={this.config?.btnApplyBonusLabel || \"Avançar\"} loading={this.loading} handleClick={() => this.handlePhone() } />\n </Host>\n )\n }\n}",":host {\n display: block;\n font-family: Arial, sans-serif;\n}\n\n.form-container-pin {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.pin-container {\n display: flex;\n /* margin: 26px 0; */\n justify-content: start;\n gap: 10px;\n}\n\n.pin-container input {\n width: 100%;\n height: 48px;\n font-size: 14px;\n text-align: center;\n border: 1px solid #ccc;\n border-radius: 5px;\n}\n\nbutton {\n padding: 10px 20px;\n background-color: #ddd;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n}\n\n\n.success {\n color: green;\n margin-top: 10px;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n border-radius: 10px;\n padding: 15px;\n min-height: 30px;\n min-width: 120px;\n font-size: 20px;\n cursor: pointer;\n}\n\n.button-cancel {\n top: 50%;\n background-color: #ffffff;\n color: #1e1c1c;\n border: 1px solid gray;\n border-radius: 10px;\n padding: 10px;\n min-height: 30px;\n min-width: 120px;\n font-size: 19px;\n cursor: pointer;\n}\n\n.crm-description {\n font-size: 14px;\n width: 100%;\n display: flex;\n gap: 9px;\n}\n\n.crm-description a {\n font-weight: bold;\n cursor: pointer;\n text-decoration: underline;\n}\n\n.crm-description div {\n display: flex;\n gap: 5px;\n}","* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n font-family: Roboto;\n font-size: var(--crmfont-sizebodymd);\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n font-size: 14px;\n color: var(--crm-btn);\n font-weight: 100;\n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n font-size: 16px;\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n font-size: 12px;\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n font-size: 12px;\n}","import { Component, h, Prop, State } from '@stencil/core';\nimport { IPinSent } from '../../../../dto/pin.sent';\nimport i18next from '../../../../i18n/i18n'\nimport { IInfoStore } from '../../../../helpers/info.config.helper';\n\n@Component({\n tag: 'pin-form',\n styleUrls: ['pin-form.css', '../../giftback-form.css'],\n shadow: true,\n})\nexport class GiftbackPin {\n\n @Prop() validate: (pin: string) => void;\n @Prop() cancel: () => void;\n @Prop() resend: () => void;\n\n @Prop() sent: IPinSent;\n @Prop() loading: boolean = false;\n @Prop() phone: string;\n @Prop() config: IInfoStore;\n\n @State() pin: string[] = ['', '', '', ''];\n @State() isVerified: boolean = false;\n @State() canResend: boolean = false;\n\n componentWillLoad() {\n this.canResend = false;\n }\n\n handleInput(event: Event, index: number) {\n const input = event.target as HTMLInputElement;\n const value = input.value.slice(0, 1); // Limitar a um único dígito\n this.pin[index] = value;\n\n // Focar no próximo campo, se possível\n if (value && index < this.pin.length - 1) {\n const nextInput = input.nextElementSibling as HTMLInputElement;\n nextInput?.focus();\n }\n\n this.pin = [...this.pin];\n }\n\n validatePin() {\n this.validate(this.pin.join(\"\"))\n }\n\n verifyPin() {\n const pinCode = this.pin.join('');\n if (pinCode === '9999') {\n this.isVerified = true;\n }\n }\n\n handleTimeout() {\n this.canResend = true;\n }\n\n async handleResend() {\n await this.resend();\n\n this.canResend = false;\n this.pin = ['', '', '', '']\n }\n\n render() {\n return (\n <div class=\"crm-phone-form\">\n <label class=\"crm-subtitle\" >{i18next.t('pin-sutitle')} <strong>+55 {this.phone}</strong></label>\n <div class=\"pin-container\">\n {this.pin.map((_, index) => (\n <input\n type=\"text\"\n maxLength={1}\n value={this.pin[index]}\n onInput={(event) => this.handleInput(event, index)}\n />\n ))}\n </div>\n\n <slot></slot>\n\n <p class=\"crm-description\"> Não recebeu?\n {\n !this.canResend && <label> Reenviar em <countdown-timer initialValue={30} downtime={() => this.handleTimeout()} /> </label>\n }\n {\n this.canResend && (\n <div >\n <a onClick={() => this.handleResend()}>Reenviar</a>\n <a onClick={() => this.cancel()}>Trocar número</a>\n </div>\n )\n }\n </p>\n <crm-button txtBtn={this.config?.btnApplyBonusLabel || \"Avançar\"} loading={this.loading} handleClick={() => this.validatePin()} />\n </div >\n );\n }\n}\n"],"version":3}
|
1
|
+
{"file":"crm-tooltip.giftback-info.phone-form.pin-form.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,uBAAuB,GAAG,wvCAAwvC;;ACAxxC,MAAM,aAAa,GAAG,y3BAAy3B,CAAC;AACh5B,yBAAe,aAAa;;MCOf,OAAO;;;;;;IAKhB,MAAM;QACF,QACIA,kEAAK,KAAK,EAAC,mCAAmC,IAC1CA,kEAAK,GAAG,EAAEC,uBAAI,GAAI,EAClBD,mEAAM,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAC,aAAa,IAAE,IAAI,CAAC,IAAI,CAAQ,CAC7D,EACR;KACL;;;;ACpBL,MAAM,eAAe,GAAG,k7DAAk7D,CAAC;AAC38D,2BAAe,eAAe;;MCWjB,YAAY;;;yBACQ,CAAC;8BACI,MAAM;uBAEb,KAAK;qBACC;YAC7B,UAAU,EAAE,CAAC;YACb,MAAM,EAAE,EAAE;YACV,eAAe,EAAE,CAAC;YAClB,YAAY,EAAE,CAAC;YACf,eAAe,EAAE,CAAC;YAClB,iBAAiB,EAAE,EAAE;YACrB,UAAU,EAAE,CAAC;SAChB;;;;8BAKiC,CAAC;mCACI,CAAC;2BAEjB,KAAK;;IAG5B,YAAY;QACR,IAAI,CAAC,WAAW,EAAE,CAAA;KACrB;IAEO,WAAW;QACf,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,mBAAmB,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAA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yBAAmB,CAChD,CACT,CAEL,EACJA,yEAAY,MAAM,EAAE,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,kBAAkB,KAAI,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,GAAI,CAC/H,EACT;KACL;;;;;;;;;","names":["h","info","USED_KEY","i18next","defineLimit","formatDateToBr","giftbackFormCss","Host","index"],"sources":["src/assets/svg/info-circle-svgrepo-com.svg","src/components/tooltip/crm-tooltip.css?tag=crm-tooltip","src/components/tooltip/tooltip.tsx","src/components/giftback-form/subcomponents/giftback-info/giftback-info.css?tag=giftback-info","src/components/giftback-form/subcomponents/giftback-info/giftback-info.tsx","src/components/giftback-form/giftback-form.css?tag=phone-form","src/components/giftback-form/subcomponents/phone-form/phone-form.tsx","src/components/giftback-form/subcomponents/pin-form/pin-form.css?tag=pin-form&encapsulation=shadow","src/components/giftback-form/giftback-form.css?tag=pin-form&encapsulation=shadow","src/components/giftback-form/subcomponents/pin-form/pin-form.tsx"],"sourcesContent":["<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\r\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path d=\"M12 17.75C12.4142 17.75 12.75 17.4142 12.75 17V11C12.75 10.5858 12.4142 10.25 12 10.25C11.5858 10.25 11.25 10.5858 11.25 11V17C11.25 17.4142 11.5858 17.75 12 17.75Z\" fill=\"#1C274C\"/>\r\n<path d=\"M12 7C12.5523 7 13 7.44772 13 8C13 8.55228 12.5523 9 12 9C11.4477 9 11 8.55228 11 8C11 7.44772 11.4477 7 12 7Z\" fill=\"#1C274C\"/>\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M1.25 12C1.25 6.06294 6.06294 1.25 12 1.25C17.9371 1.25 22.75 6.06294 22.75 12C22.75 17.9371 17.9371 22.75 12 22.75C6.06294 22.75 1.25 17.9371 1.25 12ZM12 2.75C6.89137 2.75 2.75 6.89137 2.75 12C2.75 17.1086 6.89137 21.25 12 21.25C17.1086 21.25 21.25 17.1086 21.25 12C21.25 6.89137 17.1086 2.75 12 2.75Z\" fill=\"#1C274C\"/>\r\n</svg>",".crm-tooltip-container {\n display: flex;\n\n & img {\n width: 16px;\n margin-left: 3px;\n position: relative;\n }\n}\n\n.crm-tooltip {\n position: relative;\n display: inline-block;\n}\n\n.crm-tooltip .tooltiptext {\n visibility: hidden;\n background-color: black;\n color: #fff;\n text-align: center;\n padding: 8px 12px;\n border-radius: 0px;\n position: absolute;\n z-index: 1;\n min-width: 271px;\n top: 100%;\n left: 50%;\n margin-left: -238px;\n}\n\n@container (max-width: 410px) {\n .crm-tooltip .tooltiptext {\n margin-left: -14px;\n }\n\n .crm-tooltip #crm-role-description {\n margin-left: -151px;\n }\n}\n\n@container (max-width: 250px) {\n .crm-tooltip .tooltiptext {\n margin-left: -201px;\n }\n}\n\n.crm-tooltip:hover .tooltiptext {\n visibility: visible;\n}","import { Component, h, Prop } from \"@stencil/core\";\nimport info from '../../assets/svg/info-circle-svgrepo-com.svg';\n\n\n@Component({\n tag: 'crm-tooltip',\n styleUrl: 'crm-tooltip.css'\n})\nexport class Tooltip {\n\n @Prop() text: string;\n @Prop() identity: string;\n\n render() {\n return (\n <div class=\"crm-tooltip-container crm-tooltip\">\n <img src={info} />\n <span id={this.identity} class=\"tooltiptext\">{this.text}</span>\n </div>\n );\n }\n}",":host {\n --text-color: #6D6D5F\n}\n\n.giftback-container {\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\nh3 {\n font-size: 1.2rem;\n margin-bottom: 8px;\n color: #333;\n}\n\n.container-description {\n display: flex;\n align-items: center;\n gap: 5px;\n margin: 0 0 10px 0;\n}\n\n.container-description p {\n font-size: 14px;\n font-weight: 400;\n margin: 0px;\n}\n\n\np {\n font-size: 14px;\n color: #000;\n}\n\n.value-display h2 {\n color: #6D6D5F;\n /* Verde para o valor atual */\n font-size: 1.6rem;\n margin: 16px 0;\n}\n\ninput[type='range'] {\n width: 100%;\n margin: 12px 0;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 4px;\n outline: none;\n padding: 3px 0px 3px 3px;\n}\n\n/* input[type='range']::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n border-radius: 50%;\n cursor: pointer;\n} */\n\ninput[type=\"range\"]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 20px;\n height: 20px;\n background: rgb(109, 109, 95);\n /* Cor do botão */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.options {\n margin: 0px 0;\n display: flex;\n gap: 10px;\n flex-direction: column;\n}\n\n.options label {\n display: flex;\n margin: 0px 0;\n font-size: 0.9rem;\n color: #333;\n align-items: center;\n}\n\n.options input[type='radio'] {\n margin-right: 8px;\n height: 16px;\n width: 16px;\n}\n\n.options input[type='radio'] {\n appearance: none;\n -webkit-appearance: none;\n margin-right: 8px;\n width: 16px;\n height: 16px;\n border: 2px solid #ddd;\n border-radius: 50%;\n background-color: #fff;\n cursor: pointer;\n transition: all 0.3s;\n padding: 0px;\n}\n\n.options input[type='radio']:checked {\n border-color: #000;\n background-color: #FAFAFA;\n border: 4px solid #000;\n}\n\n.info-box {\n background-color: #f9f9f9;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n padding: 8px;\n font-size: 14px;\n color: #262626;\n line-height: 20px;\n}\n\n.info-icon {\n font-size: 0.9rem;\n cursor: pointer;\n color: #888;\n}\n\nh3 {\n font-size: 1.2rem;\n margin-bottom: 8px;\n color: #333;\n}\n\n.slider-wrapper {\n position: relative;\n margin: 21px 0px 0px 0px;\n}\n\n.slider {\n width: 100%;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 2px;\n outline: none;\n}\n\n.slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n /* Azul para o slider */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.slider-value {\n position: absolute;\n top: -30px;\n /* Posição acima do slider */\n font-size: 16px;\n font-weight: 700;\n color: var(--text-color);\n /* Verde para o texto */\n transform: translateX(-50%);\n white-space: nowrap;\n /* margin-left: 23px; */\n}\n\n.options-option {\n display: flex;\n}\n\n\n/* ########################################## */\n","import { Component, Prop, State, Watch, h } from \"@stencil/core\";\nimport { IBonus } from \"../../../../dto/validate.pin.bonus\";\n\nimport i18next from '../../../../i18n/i18n'\nimport { USED_KEY } from \"../../../../utils/keys.storage\";\nimport { defineLimit, formatDateToBr } from \"../../../../utils/utils\";\nimport { IInfoStore } from \"../../../../helpers/info.config.helper\";\n\n@Component({\n tag: 'giftback-info',\n styleUrls: ['giftback-info.css']\n})\nexport class GiftbackInfo {\n @State() usedValue: number = 0;\n @State() selectedOption: string = 'none';\n\n @Prop() loading: boolean = false;\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 0,\n cartId: \"\",\n minimumPurchase: 0,\n bonusBalance: 0,\n calculatedValue: 0,\n firstValidityDate: \"\",\n totalValue: 0\n };\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n @Prop() config: IInfoStore;\n\n @State() sliderPosition: number = 0;\n @State() sliderValuePosition: number = 0;\n\n @State() loadingTime = false;\n\n @Watch(\"bonus\")\n changedBonus() {\n this.updateBonus()\n }\n\n private updateBonus() {\n this.usedValue = this.bonus.bonusBalance;\n this.buildPositionSlider(0, this.bonus.totalBonus);\n }\n\n componentWillLoad() {\n this.updateBonus();\n this.selectedOption = localStorage.getItem(USED_KEY);\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n\n // Calculando a posição do texto com base no valor do slider\n // const percentage = ((this.usedValue - parseInt(input.min)) / (parseInt(input.max) - parseInt(input.min))) * 100;\n // this.sliderPosition = percentage;\n\n this.buildPositionSlider(parseFloat(input.min), parseFloat(input.max))\n }\n\n componentDidLoad() {\n const input: any = document.getElementById(\"position_value_id\")\n\n input.value = this.bonus.bonusBalance;\n }\n\n\n private buildPositionSlider(min: number, max: number) {\n\n const percentage_init = max * 0.1;\n\n // Calculando a posição do texto com base no valor do slider\n const percentage = ((this.usedValue - min) / (max - min)) * 100;\n\n this.sliderPosition = percentage;\n this.sliderValuePosition = percentage + (this.usedValue <= percentage_init ? 10 : 0);\n }\n\n async handleOptionChange(option: string) {\n this.selectedOption = option;\n\n localStorage.setItem(USED_KEY, option);\n\n localStorage.removeItem(\"bc:time-allow\")\n\n switch (this.selectedOption) {\n case 'use':\n await this.reserve(this.usedValue);\n break;\n case 'dontUse':\n await this.cancel();\n break;\n default:\n }\n }\n\n showTime() {\n const time = localStorage.getItem(\"bc:time\");\n\n const allow = localStorage.getItem(\"bc:time-allow\");\n\n if(!allow) return false;\n\n return !!time;\n }\n\n getTime() {\n const time = localStorage.getItem(\"bc:time\");\n return Number(time) || 360;\n }\n\n render() {\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n const translateDescription = i18next.t(\"giftDescription\", { amount: `${this.bonus.totalBonus.toFixed(2).replace(\".\", \",\")}`, custom_name: \"Giftback\" })\n\n const limit = defineLimit(remainingGiftback);\n\n return (\n\n <div class=\"giftback-container\">\n <div class=\"container-description\">\n <p innerHTML={translateDescription}></p>\n <crm-tooltip identity=\"crm-role-description\" text={i18next.t(\"labelUseGiftback\", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: formatDateToBr(this.bonus.firstValidityDate) })} />\n </div>\n <div class=\"slider-wrapper\">\n <div\n class=\"slider-value\"\n style={{\n left: `calc(${this.sliderValuePosition}% - 20px)`, // Ajuste para centralizar o texto\n\n }}\n >\n R$ {this.usedValue.toFixed(2).replace(\".\", \",\")}\n </div>\n <input\n id=\"position_value_id\"\n disabled\n type=\"range\"\n min=\"0\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n class=\"slider\"\n step=\"0.01\"\n onInput={(event) => this.handleSliderChange(event)}\n style={{\n background: `linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`,\n }}\n />\n </div>\n\n {\n limit.isComplete && (\n <p>\n {i18next.t(\"maxAmount\")}\n </p>\n )\n }\n\n {\n !limit.isComplete && (\n <div class=\"container-description\">\n <p>\n Adicione <strong>R$ {remainingGiftback < 0 ? \"0,00\" : remainingGiftback.toFixed(2).replace(\".\", \",\")}</strong> ao carrinho para atingir o valor\n máximo!\n </p>\n <crm-tooltip identity=\"crm-max-description\" text={i18next.t(\"labelamountPartial\")} />\n </div>\n )\n }\n\n\n <div class=\"options\">\n <div class=\"options-option\">\n <input\n disabled={this.showTime()}\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"use\"\n checked={this.selectedOption === 'use'}\n onChange={() => this.handleOptionChange('use')}\n />\n <p>Usar o meu {this.config?.giftbackTitle}</p>\n </div>\n <div class=\"options-option\">\n <input\n disabled={this.showTime()}\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"dontUse\"\n checked={this.selectedOption === 'dontUse'}\n onChange={() => this.handleOptionChange('dontUse')}\n />\n <p>Não usar o meu {this.config?.giftbackTitle}</p>\n </div>\n </div>\n\n {\n this.showTime() &&\n (\n <div class=\"info-box\">\n Após <countdown-timer initialValue={this.getTime()} downtime={() => { this.loadingTime = true }} />, você poderá alterar sua escolha de usar ou não o Giftback.\n </div>\n )\n }\n\n\n <div class=\"info-box\">\n O Giftback será aplicado na próxima etapa.\n </div>\n </div>\n );\n }\n}","* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n font-family: Roboto;\n font-size: var(--crmfont-sizebodymd);\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n font-size: 14px;\n color: var(--crm-btn);\n font-weight: 100;\n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n font-size: 16px;\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n font-size: 12px;\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n font-size: 12px;\n}","import { Component, Host, Prop, h } from \"@stencil/core\";\nimport { IInfoStore } from \"../../../../helpers/info.config.helper\";\n\n@Component({\n tag: 'phone-form',\n styleUrl: '../../giftback-form.css'\n})\nexport class PhoneForm {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() value: string;\n @Prop() loading: boolean;\n @Prop() handlerSubmit: (phone: string) => void;\n\n @Prop() config: IInfoStore;\n\n\n async handlePhone() {\n\n const phone = await this.phoneInputMask.getPhone()\n\n await this.handlerSubmit(phone);\n }\n\n\n render() {\n return (\n <Host class=\"crm-phone-form\">\n <label class=\"crm-subtitle\" >Digite o seu celular para verificar se há desconto disponível nessa compra:</label>\n <phone-input-mask initialValue={this.value} ref={ref => this.phoneInputMask = ref} />\n\n <crm-button txtBtn={this.config?.btnApplyBonusLabel || \"Avançar\"} loading={this.loading} handleClick={() => this.handlePhone() } />\n </Host>\n )\n }\n}",":host {\n display: block;\n font-family: Arial, sans-serif;\n}\n\n.form-container-pin {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.pin-container {\n display: flex;\n /* margin: 26px 0; */\n justify-content: start;\n gap: 10px;\n}\n\n.pin-container input {\n width: 100%;\n height: 48px;\n font-size: 14px;\n text-align: center;\n border: 1px solid #ccc;\n border-radius: 5px;\n}\n\nbutton {\n padding: 10px 20px;\n background-color: #ddd;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n}\n\n\n.success {\n color: green;\n margin-top: 10px;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n border-radius: 10px;\n padding: 15px;\n min-height: 30px;\n min-width: 120px;\n font-size: 20px;\n cursor: pointer;\n}\n\n.button-cancel {\n top: 50%;\n background-color: #ffffff;\n color: #1e1c1c;\n border: 1px solid gray;\n border-radius: 10px;\n padding: 10px;\n min-height: 30px;\n min-width: 120px;\n font-size: 19px;\n cursor: pointer;\n}\n\n.crm-description {\n font-size: 14px;\n width: 100%;\n display: flex;\n gap: 9px;\n}\n\n.crm-description a {\n font-weight: bold;\n cursor: pointer;\n text-decoration: underline;\n}\n\n.crm-description div {\n display: flex;\n gap: 5px;\n}","* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n font-family: Roboto;\n font-size: var(--crmfont-sizebodymd);\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n font-size: 14px;\n color: var(--crm-btn);\n font-weight: 100;\n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n font-size: 16px;\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n font-size: 12px;\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n font-size: 12px;\n}","import { Component, h, Prop, State } from '@stencil/core';\nimport { IPinSent } from '../../../../dto/pin.sent';\nimport i18next from '../../../../i18n/i18n'\nimport { IInfoStore } from '../../../../helpers/info.config.helper';\n\n@Component({\n tag: 'pin-form',\n styleUrls: ['pin-form.css', '../../giftback-form.css'],\n shadow: true,\n})\nexport class GiftbackPin {\n\n @Prop() validate: (pin: string) => void;\n @Prop() cancel: () => void;\n @Prop() resend: () => void;\n\n @Prop() sent: IPinSent;\n @Prop() loading: boolean = false;\n @Prop() phone: string;\n @Prop() config: IInfoStore;\n\n @State() pin: string[] = ['', '', '', ''];\n @State() isVerified: boolean = false;\n @State() canResend: boolean = false;\n\n componentWillLoad() {\n this.canResend = false;\n }\n\n handleInput(event: Event, index: number) {\n const input = event.target as HTMLInputElement;\n const value = input.value.slice(0, 1); // Limitar a um único dígito\n this.pin[index] = value;\n\n // Focar no próximo campo, se possível\n if (value && index < this.pin.length - 1) {\n const nextInput = input.nextElementSibling as HTMLInputElement;\n nextInput?.focus();\n }\n\n this.pin = [...this.pin];\n }\n\n validatePin() {\n this.validate(this.pin.join(\"\"))\n }\n\n verifyPin() {\n const pinCode = this.pin.join('');\n if (pinCode === '9999') {\n this.isVerified = true;\n }\n }\n\n handleTimeout() {\n this.canResend = true;\n }\n\n async handleResend() {\n await this.resend();\n\n this.canResend = false;\n this.pin = ['', '', '', '']\n }\n\n render() {\n return (\n <div class=\"crm-phone-form\">\n <label class=\"crm-subtitle\" >{i18next.t('pin-sutitle')} <strong>+55 {this.phone}</strong></label>\n <div class=\"pin-container\">\n {this.pin.map((_, index) => (\n <input\n type=\"text\"\n maxLength={1}\n value={this.pin[index]}\n onInput={(event) => this.handleInput(event, index)}\n />\n ))}\n </div>\n\n <slot></slot>\n\n <p class=\"crm-description\"> Não recebeu?\n {\n !this.canResend && <label> Reenviar em <countdown-timer initialValue={30} downtime={() => this.handleTimeout()} /> </label>\n }\n {\n this.canResend && (\n <div >\n <a onClick={() => this.handleResend()}>Reenviar</a>\n <a onClick={() => this.cancel()}>Trocar número</a>\n </div>\n )\n }\n </p>\n <crm-button txtBtn={this.config?.btnApplyBonusLabel || \"Avançar\"} loading={this.loading} handleClick={() => this.validatePin()} />\n </div >\n );\n }\n}\n"],"version":3}
|
@@ -3753,7 +3753,7 @@ axios.default = axios;
|
|
3753
3753
|
// this module should only have a default export
|
3754
3754
|
const axios$1 = axios;
|
3755
3755
|
|
3756
|
-
const CRM_BONUS_API_URL = "https://wake
|
3756
|
+
const CRM_BONUS_API_URL = "https://wake.crmbonus.com/api"; //"http://localhost:3000/api";// "https://crmbonus-wake-hub-staging-5daedbc4e22b.herokuapp.com/api" //"https://crmbonus-service-staging-d15ba5377115.herokuapp.com"; //"https://typically-workable-perch.ngrok-free.app"; // "http://localhost:3500";
|
3757
3757
|
|
3758
3758
|
class CrmBonusService {
|
3759
3759
|
constructor() {
|
@@ -3862,8 +3862,8 @@ class CrmBonusService {
|
|
3862
3862
|
localStorage.setItem(cartId, "0");
|
3863
3863
|
localStorage.removeItem(keys_storage.USED_KEY);
|
3864
3864
|
}
|
3865
|
-
async getInfoCart() {
|
3866
|
-
const response = await this.axiosInstance.get(
|
3865
|
+
async getInfoCart(checkoutBase) {
|
3866
|
+
const response = await this.axiosInstance.get(`${checkoutBase}/api/carrinho`);
|
3867
3867
|
return response.data;
|
3868
3868
|
}
|
3869
3869
|
}
|
@@ -3871,4 +3871,4 @@ CrmBonusService._instance = null;
|
|
3871
3871
|
|
3872
3872
|
exports.CrmBonusService = CrmBonusService;
|
3873
3873
|
|
3874
|
-
//# sourceMappingURL=crmbonus.service-
|
3874
|
+
//# sourceMappingURL=crmbonus.service-30fd8ffa.js.map
|