crmbonus-component-wake 2.0.124 → 2.0.125
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/{cart.helper-b00f45cb.js → cart.helper-d4d8d619.js} +4 -1
- package/dist/cjs/cart.helper-d4d8d619.js.map +1 -0
- package/dist/cjs/crm-bonus-note.cjs.entry.js +1 -1
- package/dist/cjs/crm-bonus.cjs.entry.js +1 -1
- package/dist/cjs/pedido-finalizado.cjs.entry.js +1 -1
- package/dist/collection/helpers/cart.helper.js +3 -0
- package/dist/collection/helpers/cart.helper.js.map +1 -1
- package/dist/components/crm-bonus-note.js +1 -1
- package/dist/components/crm-bonus.js +1 -1
- package/dist/components/{p-7e185d50.js → p-abbfbc98.js} +4 -1
- package/dist/components/p-abbfbc98.js.map +1 -0
- 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-6284e4d5.entry.js → p-4fa63df0.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-0d21498d.entry.js → p-a33f7c24.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-7e185d50.js → p-abbfbc98.js} +2 -2
- package/dist/crmbonus-component-wake/p-abbfbc98.js.map +1 -0
- package/dist/crmbonus-component-wake/{p-20d3b5d4.entry.js → p-fad20959.entry.js} +2 -2
- package/dist/esm/{cart.helper-60f1bd2c.js → cart.helper-30a40560.js} +4 -1
- package/dist/esm/cart.helper-30a40560.js.map +1 -0
- package/dist/esm/crm-bonus-note.entry.js +1 -1
- package/dist/esm/crm-bonus.entry.js +1 -1
- package/dist/esm/pedido-finalizado.entry.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/cart.helper-b00f45cb.js.map +0 -1
- package/dist/components/p-7e185d50.js.map +0 -1
- package/dist/crmbonus-component-wake/p-7e185d50.js.map +0 -1
- package/dist/esm/cart.helper-60f1bd2c.js.map +0 -1
- /package/dist/crmbonus-component-wake/{p-6284e4d5.entry.js.map → p-4fa63df0.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-0d21498d.entry.js.map → p-a33f7c24.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-20d3b5d4.entry.js.map → p-fad20959.entry.js.map} +0 -0
@@ -65,10 +65,13 @@ const buildUrlBase = () => {
|
|
65
65
|
if (url.includes('fbits')) {
|
66
66
|
return url;
|
67
67
|
}
|
68
|
+
if (url.includes("www.")) {
|
69
|
+
return url.replace("www", "checkout");
|
70
|
+
}
|
68
71
|
return `${window.location.protocol}//checkout.${window.location.host}`;
|
69
72
|
};
|
70
73
|
|
71
74
|
exports.CartWake = CartWake;
|
72
75
|
exports.getCart = getCart;
|
73
76
|
|
74
|
-
//# sourceMappingURL=cart.helper-
|
77
|
+
//# sourceMappingURL=cart.helper-d4d8d619.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"cart.helper-d4d8d619.js","mappings":";;;;MAEa,QAAQ;IAQjB,YAAY,IAAI;;QAJhB,aAAQ,GAAmB,EAAE,CAAC;QAK1B,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,MAAA,IAAI,CAAC,SAAS,0CAAE,EAAE,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QACzB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;KACvD;IAEO,cAAc,CAAC,WAAW,GAAG,EAAE;QACnC,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAE9C,IAAG,CAAC,KAAK,EAAE;YACP,O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C,CAAC;AAC9B,EAAC;AAED,MAAM,YAAY,GAAG;IAEjB,MAAM,GAAG,GAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;IAEpC,IAAG,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;QAC1B,OAAOC,mCAAkB,CAAC;KAC7B;IAED,IAAG,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;QACzB,OAAO,GAAG,CAAC;KACd;IAED,IAAG,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QACtB,OAAO,GAAG,CAAC;KACd;IAED,IAAG,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACrB,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;KACxC;IAED,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,cAAc,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;AAE3E,CAAC;;;;;","names":["CrmBonusService","CHECKOUT_CART_WAKE"],"sources":["src/objectvalues/cart.wake.ts","src/helpers/cart.helper.ts"],"sourcesContent":["import { IProductWake, IStore, IUser } from \"../dto/validate.pin.bonus\";\n\nexport class CartWake {\n id: string;\n middlewareId: string;\n orderId: number;\n products: IProductWake[] = [];\n user: IUser;\n store: IStore;\n\n constructor(cart) {\n this.id = cart.Metadados.id || cart.Id;\n this.middlewareId = cart.Metadados?.id;\n this.orderId = cart.PedidoId;\n this.buildUserInfo(cart);\n this.buildStoreInfo(cart);\n this.products = this.buildStoreCart( cart.Produtos);\n }\n\n private buildStoreCart(newProducts = []) {\n const cache = localStorage.getItem(\"bc:cart\");\n\n if(!cache) {\n return this.saveStore(newProducts)\n \n }\n \n const cacheProducts:IProductWake[] = JSON.parse(cache);\n\n if(newProducts.length !== cacheProducts.length) {\n return this.saveStore(newProducts);\n }\n\n for (const p of newProducts) {\n const [cp] = cacheProducts.filter(cpp => cpp.ProdutoVarianteId == p.ProdutoVarianteId);\n\n if(cp) {\n cp.Quantidade != p.Quantidade;\n\n return newProducts;\n }\n }\n\n return cacheProducts;\n\n }\n\n\n private saveStore(newProducts) {\n localStorage.setItem(\"bc:cart\", JSON.stringify(newProducts));\n\n return newProducts;\n }\n\n private buildUserInfo(cart) {\n this.user = {\n id: cart.Usuario ? cart.Usuario.Id : null\n }\n }\n\n private buildStoreInfo(cart) {\n this.store = {\n name: cart.Loja?.Nome\n }\n }\n}","import { CHECKOUT_CART_WAKE } from \"../../env\";\nimport { CartWake } from \"../objectvalues/cart.wake\";\nimport { CrmBonusService } from \"../services/crmbonus.service\";\n\nconst crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\nexport const getCart = async (): Promise<CartWake> => {\n const baseUrl = buildUrlBase(); // window.location.origin; //\"https://bycoders.fbits.store\" //window.location.origin;\n \n console.log('[URL STORE]: ', baseUrl)\n\n const cart = await crmBonusService.getInfoCart(baseUrl);\n\n return new CartWake(cart);\n}\n\nconst buildUrlBase = () => {\n\n const url = window.location.origin; //\"https://bycoders.checkout.fbits.store\" //\n\n if(url.includes('localhost')) {\n return CHECKOUT_CART_WAKE;\n }\n\n if(url.includes('checkout')) {\n return url;\n }\n\n if(url.includes('fbits')) {\n return url;\n }\n\n if(url.includes(\"www.\")) {\n return url.replace(\"www\", \"checkout\")\n }\n\n return `${window.location.protocol}//checkout.${window.location.host}`;\n\n}"],"version":3}
|
@@ -6,7 +6,7 @@ const index = require('./index-d11684bd.js');
|
|
6
6
|
const info_config_helper = require('./info.config.helper-c5d9f781.js');
|
7
7
|
const keys_storage = require('./keys.storage-de7744aa.js');
|
8
8
|
const i18n = require('./i18n-f2a6f60e.js');
|
9
|
-
const cart_helper = require('./cart.helper-
|
9
|
+
const cart_helper = require('./cart.helper-d4d8d619.js');
|
10
10
|
require('./crmbonus.service-9067d00d.js');
|
11
11
|
|
12
12
|
const moneyDollarsSvgrepoComSvg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNv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
7
7
|
const index$1 = require('./index-6054ed44.js');
|
8
8
|
const i18n = require('./i18n-f2a6f60e.js');
|
9
|
-
const cart_helper = require('./cart.helper-
|
9
|
+
const cart_helper = require('./cart.helper-d4d8d619.js');
|
10
10
|
const keys_storage = require('./keys.storage-de7744aa.js');
|
11
11
|
|
12
12
|
var AjustesTipoEnum;
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-d11684bd.js');
|
6
6
|
const crmbonus_service = require('./crmbonus.service-9067d00d.js');
|
7
|
-
const cart_helper = require('./cart.helper-
|
7
|
+
const cart_helper = require('./cart.helper-d4d8d619.js');
|
8
8
|
require('./keys.storage-de7744aa.js');
|
9
9
|
|
10
10
|
const Pedido = class {
|
@@ -19,6 +19,9 @@ const buildUrlBase = () => {
|
|
19
19
|
if (url.includes('fbits')) {
|
20
20
|
return url;
|
21
21
|
}
|
22
|
+
if (url.includes("www.")) {
|
23
|
+
return url.replace("www", "checkout");
|
24
|
+
}
|
22
25
|
return `${window.location.protocol}//checkout.${window.location.host}`;
|
23
26
|
};
|
24
27
|
//# sourceMappingURL=cart.helper.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cart.helper.js","sourceRoot":"","sources":["../../../src/helpers/cart.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,MAAM,eAAe,GAAoB,eAAe,CAAC,WAAW,EAAE,CAAC;AAEvE,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,IAAuB,EAAE;IACjD,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC,CAAC,qFAAqF;IAErH,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,CAAA;IAErC,MAAM,IAAI,GAAG,MAAM,eAAe,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAExD,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,GAAG,EAAE;IAEtB,MAAM,GAAG,GAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,4CAA4C;IAEjF,IAAG,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QAC3B,OAAO,kBAAkB,CAAC;IAC9B,CAAC;IAED,IAAG,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAC1B,OAAO,GAAG,CAAC;IACf,CAAC;IAED,IAAG,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACvB,OAAO,GAAG,CAAC;IACf,CAAC;IAED,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,cAAc,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;AAE3E,CAAC,CAAA","sourcesContent":["import { CHECKOUT_CART_WAKE } from \"../../env\";\nimport { CartWake } from \"../objectvalues/cart.wake\";\nimport { CrmBonusService } from \"../services/crmbonus.service\";\n\nconst crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\nexport const getCart = async (): Promise<CartWake> => {\n const baseUrl = buildUrlBase(); // window.location.origin; //\"https://bycoders.fbits.store\" //window.location.origin;\n \n console.log('[URL STORE]: ', baseUrl)\n\n const cart = await crmBonusService.getInfoCart(baseUrl);\n\n return new CartWake(cart);\n}\n\nconst buildUrlBase = () => {\n\n const url = window.location.origin; //\"https://bycoders.checkout.fbits.store\" //\n\n if(url.includes('localhost')) {\n return CHECKOUT_CART_WAKE;\n }\n\n if(url.includes('checkout')) {\n return url;\n }\n\n if(url.includes('fbits')) {\n return url;\n }\n\n return `${window.location.protocol}//checkout.${window.location.host}`;\n\n}"]}
|
1
|
+
{"version":3,"file":"cart.helper.js","sourceRoot":"","s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Content":["import { CHECKOUT_CART_WAKE } from \"../../env\";\nimport { CartWake } from \"../objectvalues/cart.wake\";\nimport { CrmBonusService } from \"../services/crmbonus.service\";\n\nconst crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\nexport const getCart = async (): Promise<CartWake> => {\n const baseUrl = buildUrlBase(); // window.location.origin; //\"https://bycoders.fbits.store\" //window.location.origin;\n \n console.log('[URL STORE]: ', baseUrl)\n\n const cart = await crmBonusService.getInfoCart(baseUrl);\n\n return new CartWake(cart);\n}\n\nconst buildUrlBase = () => {\n\n const url = window.location.origin; //\"https://bycoders.checkout.fbits.store\" //\n\n if(url.includes('localhost')) {\n return CHECKOUT_CART_WAKE;\n }\n\n if(url.includes('checkout')) {\n return url;\n }\n\n if(url.includes('fbits')) {\n return url;\n }\n\n if(url.includes(\"www.\")) {\n return url.replace(\"www\", \"checkout\")\n }\n\n return `${window.location.protocol}//checkout.${window.location.host}`;\n\n}"]}
|
@@ -2,7 +2,7 @@ import { p as proxyCustomElement, H, h } from './p-3e84f78c.js';
|
|
2
2
|
import { g as getInfoCustomization } from './p-75ba7b9a.js';
|
3
3
|
import { g as getKeyReserveByCartId } from './p-f9aeffc1.js';
|
4
4
|
import { i as instance } from './p-e8c19a64.js';
|
5
|
-
import { C as CartWake, g as getCart } from './p-
|
5
|
+
import { C as CartWake, g as getCart } from './p-abbfbc98.js';
|
6
6
|
import { d as defineCustomElement$4 } from './p-2b3b8d6b.js';
|
7
7
|
import { d as defineCustomElement$3 } from './p-47f9da55.js';
|
8
8
|
import { d as defineCustomElement$2 } from './p-fe9c3966.js';
|
@@ -2,7 +2,7 @@ import { p as proxyCustomElement, H, h } from './p-3e84f78c.js';
|
|
2
2
|
import { C as CrmBonusService } from './p-6eda79c3.js';
|
3
3
|
import { S as StepFormEnum } from './p-7cfea8fe.js';
|
4
4
|
import { i as instance } from './p-e8c19a64.js';
|
5
|
-
import { g as getCart, C as CartWake } from './p-
|
5
|
+
import { g as getCart, C as CartWake } from './p-abbfbc98.js';
|
6
6
|
import { U as USED_KEY } from './p-f9aeffc1.js';
|
7
7
|
import { d as defineCustomElement$b } from './p-2b3b8d6b.js';
|
8
8
|
import { d as defineCustomElement$a } from './p-47f9da55.js';
|
@@ -63,9 +63,12 @@ const buildUrlBase = () => {
|
|
63
63
|
if (url.includes('fbits')) {
|
64
64
|
return url;
|
65
65
|
}
|
66
|
+
if (url.includes("www.")) {
|
67
|
+
return url.replace("www", "checkout");
|
68
|
+
}
|
66
69
|
return `${window.location.protocol}//checkout.${window.location.host}`;
|
67
70
|
};
|
68
71
|
|
69
72
|
export { CartWake as C, getCart as g };
|
70
73
|
|
71
|
-
//# sourceMappingURL=p-
|
74
|
+
//# sourceMappingURL=p-abbfbc98.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"p-abbfbc98.js","mappings":";;MAEa,QAAQ;IAQjB,YAAY,IAAI;;QAJhB,aAAQ,GAAmB,EAAE,CAAC;QAK1B,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,MAAA,IAAI,CAAC,SAAS,0CAAE,EAAE,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QACzB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;KACvD;IAEO,cAAc,CAAC,WAAW,GAAG,EAAE;QACnC,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAE9C,IAAG,CAAC,KAAK,EAAE;YACP,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;SAErC;QAED,MAAM,aAAa,GAAkB,IAAI,CAAC,KAAK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AAM,CAAC;IAEpC,IAAG,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;QAC1B,OAAO,kBAAkB,CAAC;KAC7B;IAED,IAAG,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;QACzB,OAAO,GAAG,CAAC;KACd;IAED,IAAG,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QACtB,OAAO,GAAG,CAAC;KACd;IAED,IAAG,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACrB,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;KACxC;IAED,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,cAAc,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;AAE3E,CAAC;;;;","names":[],"sources":["src/objectvalues/cart.wake.ts","src/helpers/cart.helper.ts"],"sourcesContent":["import { IProductWake, IStore, IUser } from \"../dto/validate.pin.bonus\";\n\nexport class CartWake {\n id: string;\n middlewareId: string;\n orderId: number;\n products: IProductWake[] = [];\n user: IUser;\n store: IStore;\n\n constructor(cart) {\n this.id = cart.Metadados.id || cart.Id;\n this.middlewareId = cart.Metadados?.id;\n this.orderId = cart.PedidoId;\n this.buildUserInfo(cart);\n this.buildStoreInfo(cart);\n this.products = this.buildStoreCart( cart.Produtos);\n }\n\n private buildStoreCart(newProducts = []) {\n const cache = localStorage.getItem(\"bc:cart\");\n\n if(!cache) {\n return this.saveStore(newProducts)\n \n }\n \n const cacheProducts:IProductWake[] = JSON.parse(cache);\n\n if(newProducts.length !== cacheProducts.length) {\n return this.saveStore(newProducts);\n }\n\n for (const p of newProducts) {\n const [cp] = cacheProducts.filter(cpp => cpp.ProdutoVarianteId == p.ProdutoVarianteId);\n\n if(cp) {\n cp.Quantidade != p.Quantidade;\n\n return newProducts;\n }\n }\n\n return cacheProducts;\n\n }\n\n\n private saveStore(newProducts) {\n localStorage.setItem(\"bc:cart\", JSON.stringify(newProducts));\n\n return newProducts;\n }\n\n private buildUserInfo(cart) {\n this.user = {\n id: cart.Usuario ? cart.Usuario.Id : null\n }\n }\n\n private buildStoreInfo(cart) {\n this.store = {\n name: cart.Loja?.Nome\n }\n }\n}","import { CHECKOUT_CART_WAKE } from \"../../env\";\nimport { CartWake } from \"../objectvalues/cart.wake\";\nimport { CrmBonusService } from \"../services/crmbonus.service\";\n\nconst crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\nexport const getCart = async (): Promise<CartWake> => {\n const baseUrl = buildUrlBase(); // window.location.origin; //\"https://bycoders.fbits.store\" //window.location.origin;\n \n console.log('[URL STORE]: ', baseUrl)\n\n const cart = await crmBonusService.getInfoCart(baseUrl);\n\n return new CartWake(cart);\n}\n\nconst buildUrlBase = () => {\n\n const url = window.location.origin; //\"https://bycoders.checkout.fbits.store\" //\n\n if(url.includes('localhost')) {\n return CHECKOUT_CART_WAKE;\n }\n\n if(url.includes('checkout')) {\n return url;\n }\n\n if(url.includes('fbits')) {\n return url;\n }\n\n if(url.includes(\"www.\")) {\n return url.replace(\"www\", \"checkout\")\n }\n\n return `${window.location.protocol}//checkout.${window.location.host}`;\n\n}"],"version":3}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { p as proxyCustomElement, H, h } from './p-3e84f78c.js';
|
2
2
|
import { C as CrmBonusService } from './p-6eda79c3.js';
|
3
|
-
import { C as CartWake, g as getCart } from './p-
|
3
|
+
import { C as CartWake, g as getCart } from './p-abbfbc98.js';
|
4
4
|
|
5
5
|
const Pedido = /*@__PURE__*/ proxyCustomElement(class Pedido extends H {
|
6
6
|
constructor() {
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{p as e,b as n}from"./p-3d6152b1.js";export{s as setNonce}from"./p-3d6152b1.js";import{g as a}from"./p-e1255160.js";var o=()=>{const n=import.meta.url;const a={};if(n!==""){a.resourcesUrl=new URL(".",n).href}return e(a)};o().then((async e=>{await a();return n([["p-
|
1
|
+
import{p as e,b as n}from"./p-3d6152b1.js";export{s as setNonce}from"./p-3d6152b1.js";import{g as a}from"./p-e1255160.js";var o=()=>{const n=import.meta.url;const a={};if(n!==""){a.resourcesUrl=new URL(".",n).href}return e(a)};o().then((async e=>{await a();return n([["p-4fa63df0",[[2,"crm-bonus",{cart:[8],showModal:[32],cartWake:[32],customer:[32],loading:[32],message:[32],phone:[32],canCancel:[32],amountCancel:[32],sent:[32],session:[32],loading_reprocess:[32],resetBonus:[64],setloading:[64],reprocess:[64]}]]],["p-c23f3a07",[[1,"crm-bonus-form",{storeName:[8,"storename"],cartId:[8,"cart-id"],products:[16],customer:[16],sent:[16],stepNext:[2,"step-next"],phone:[2],loadingModal:[4,"loading-modal"],saveStore:[16],cancel:[16],handleCustomerName:[16],loading:[32],step:[32],message:[32],bonus:[32],setStep:[64]}]]],["p-a33f7c24",[[0,"crm-bonus-note",{cart:[8],cartWake:[32],url:[32],config:[32],bonus:[32],showEdit:[32]}]]],["p-74206c91",[[0,"phone-cancel-input",{sendPin:[16],loading:[4],value:[1]}]]],["p-03b77c41",[[0,"phone-input",{sendPin:[16],loading:[4],value:[1]}]]],["p-885fc30e",[[1,"app-modal",{isOpen:[516,"is-open"],modalTitle:[1,"modal-title"]}]]],["p-fad20959",[[0,"pedido-finalizado",{cart:[8]}]]],["p-620ec1a3",[[1,"phone-input-mask",{initialValue:[1,"initial-value"],disabled:[4],phone:[32],message:[32],getPhone:[64]}]]],["p-be3ddacc",[[1,"loading-spinner",{size:[1],color:[1]}]]],["p-90716188",[[0,"crm-button",{txtBtn:[1,"txt-btn"],loading:[4],handleClick:[16]}],[1,"countdown-timer",{downtime:[16],initialValue:[2,"initial-value"],seconds:[32]}]]],["p-7b7fb354",[[0,"phone-form",{value:[1],loading:[4],handlerSubmit:[16],config:[16]}],[1,"pin-form",{validate:[16],cancel:[16],resend:[16],sent:[16],loading:[4],phone:[1],config:[16],pin:[32],isVerified:[32],canResend:[32]}],[0,"giftback-info",{loading:[4],bonus:[16],reserve:[16],cancel:[16],config:[16],usedValue:[32],selectedOption:[32],sliderPosition:[32],sliderValuePosition:[32],loadingTime:[32]},null,{bonus:["changedBonus"]}],[0,"crm-tooltip",{text:[1],identity:[1]}]]],["p-7cdb2c4a",[[0,"crm-giftback-form",{storeName:[8,"storename"],cartId:[8,"cart-id"],products:[16],customer:[16],loadProducts:[16],value:[32],loading:[32],message:[32],phone:[32],pinInfo:[32],step:[32],bonus:[32],sucess:[32],error:[32],config:[32],hasApplyBonus:[32],setStep:[64],processBonus:[64]}],[4,"loading-container",{loading:[4]}]]],["p-b7a8f915",[[1,"giftback-pin",{sent:[16],validate:[16],cancel:[16],loading:[4],pin:[32],isVerified:[32]}],[1,"giftback-progress",{loading:[4],bonus:[16],reserve:[16],cancel:[16],usedValue:[32]}],[0,"name-input",{value:[1],loading:[4],applyName:[16],cancel:[16],newValue:[32],message:[32]}],[1,"giftback-finish"]]]],e)}));
|
2
2
|
//# sourceMappingURL=crmbonus-component-wake.esm.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as t,h as s}from"./p-3d6152b1.js";import{C as i}from"./p-6eda79c3.js";import{S as o}from"./p-7cfea8fe.js";import{i as e}from"./p-e8c19a64.js";import{g as n,C as a}from"./p-
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as t,h as s}from"./p-3d6152b1.js";import{C as i}from"./p-6eda79c3.js";import{S as o}from"./p-7cfea8fe.js";import{i as e}from"./p-e8c19a64.js";import{g as n,C as a}from"./p-abbfbc98.js";import{U as r}from"./p-f9aeffc1.js";var c;(function(t){t["P"]="Promocao"})(c||(c={}));function h(t=[]){const s=[];for(const i of t){let t=l(i.Ajustes);s.push({sku:i.SKU,value:i.PrecoPor*i.Quantidade,productVariantId:i.ProdutoVarianteId.toString(),quantity:i.Quantidade,discount:t*-1})}return s}function l(t=[]){let s=0;for(const i of t){if(i.Tipo===c.P){s+=i.Valor}}return s}const d=".container-button.sc-crm-bonus{cursor:pointer;padding:5px 5px 5px 14px}.section-crm.sc-crm-bonus{border:1px solid #dbd4d4;text-align:-webkit-center;margin-bottom:20px}.section-cart-crm.sc-crm-bonus{margin-top:10px}.section-cart-crm.sc-crm-bonus p.sc-crm-bonus{padding:0;margin:0px 0px 0px 15px}.button.sc-crm-bonus{top:50%;background-color:#6c6c7e;color:#fff;border:none;padding:15px;min-height:30px;min-width:120px;font-size:20px;cursor:pointer;margin-left:10px;height:70px}.form-container.sc-crm-bonus{width:97%;display:flex;justify-content:space-around}.btn.sc-crm-bonus{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:0px}.form-container.sc-crm-bonus .btnCrm.sc-crm-bonus{background:#00162e;border-color:#00162e;width:30%;color:#fff}.message-alert.sc-crm-bonus{font-family:sans-serif;color:#df4d4d;margin-top:5px}";const u=d;const f=class{constructor(s){t(this,s);this.crmBonusService=i.getInstance();this.cart=undefined;this.showModal=false;this.cartWake=undefined;this.customer={birthDate:"",document:"",name:"",phone:""};this.loading=false;this.message=undefined;this.phone=undefined;this.canCancel=false;this.amountCancel=undefined;this.sent=undefined;this.session=undefined;this.loading_reprocess=false}async resetBonus(){console.log("[START RESET BONUS]!!!!!");try{await this.crmBonusRef.processBonus(this.buildProducts(),true);console.log("[BONUS RESETADO]!!!!!")}catch(t){this.loading=false;console.log("[error ao reprocessar bonous]");await this.crmBonusRef.setStep(o.STEP_PHONE)}finally{this.loading=false}}async setloading(){this.loading_reprocess=!this.loading_reprocess}async reprocess(){this.loading_reprocess=true;try{const t=localStorage.getItem(r);if(!t)return;this.cartWake=await n();await this.resetBonus()}catch(t){console.debug("[watchProducts]",t.message)}finally{this.loading_reprocess=false}}async componentWillLoad(){e.changeLanguage(e.language);await this.handleLoad();await this.loadSession();await this.loadConfigStore()}async loadConfigStore(){await this.crmBonusService.getCustomization(this.cartWake.store.name)}async handleLoad(){try{this.cartWake=this.cart?new a(JSON.parse(this.cart)):await n();if(this.cartWake.user.id){this.customer=await this.crmBonusService.getCustomer(this.cartWake.user.id,this.cartWake.store.name);console.log("customer",this.customer)}const t=localStorage.getItem(this.cartWake.id);if(t){this.canCancel=true;this.amountCancel=t}await this.buildAndGetProducts(this.cartWake.products)}catch(t){console.log("info customer")}}async loadSession(){this.session=await this.crmBonusService.getToken(this.cartWake.store.name);setTimeout((()=>{this.loadSession()}),15e5)}async buildAndGetProducts(t){const s=`bc-products:${this.cartWake.id}`;const i=JSON.stringify(t);localStorage.setItem(s,i);const o=JSON.parse(localStorage.getItem(s));const e=[];for(const s of t){const[t]=o.filter((t=>t.ProdutoVarianteId==s.ProdutoVarianteId));const[i={Valor:0}]=t.Ajustes.filter((t=>t.Tipo==="Formula"));if(t){e.push(Object.assign(Object.assign({},s),{PrecoPor:t.PrecoPor+i.Valor*-1,Quantidade:t.Quantidade,Ajustes:t.Ajustes}))}else{e.push(s)}}this.cartWake.products=e}async sendPin(t){var s,i;this.loading=true;this.message="";try{const s=t.replace(/\D/g,"");this.phone=Number(s);this.sent=await this.crmBonusService.sendPin(this.phone,this.customer.name,this.cartWake.store.name);await this.crmBonusRef.setStep(o.STEP_PIN);this.showModal=true}catch(t){this.message=(i=(s=t===null||t===void 0?void 0:t.response)===null||s===void 0?void 0:s.data)===null||i===void 0?void 0:i.message}finally{this.loading=false}}async sendPinName(t){var s,i;this.loading=true;this.message="";try{this.customer.name=t;this.sent=await this.crmBonusService.sendPin(this.phone,this.customer.name,this.cartWake.store.name);await this.crmBonusRef.setStep(o.STEP_PIN);this.showModal=true}catch(t){this.message=(i=(s=t===null||t===void 0?void 0:t.response)===null||s===void 0?void 0:s.data)===null||i===void 0?void 0:i.message}finally{this.loading=false}}buildProducts(){return h(this.cartWake.products)}handleCloseModal(){this.showModal=false}save(t){localStorage.setItem(this.cartWake.id,t.toString());this.canCancel=true;this.amountCancel=t.toString()}async cancel(){this.message="";this.loading=true;try{await this.crmBonusService.cancel(this.cartWake.id);this.canCancel=false;localStorage.removeItem(this.cartWake.id)}catch(t){this.message="Não consegui cancelar o bônus, tente novamente!"}finally{this.loading=false}}async handleSendPin(t){this.message="";if(!t){this.message="Informe seu telefone";return}this.customer.phone=t;const s=t.replace(/\D/g,"");this.phone=Number(s);if(this.customer.name){return this.sendPin(t)}await this.crmBonusRef.setStep(o.STEP_NAME);this.showModal=true}render(){return s("loading-container",{key:"6b39082e04d7cdcc88f689912b267e6bee379452",loading:this.loading_reprocess},s("crm-giftback-form",{key:"9cb2b61470810eb3de370f2ab9fb3b50d59bff81",style:{position:"relative"},ref:t=>this.crmBonusRef=t,storeName:this.cartWake.store.name,products:this.buildProducts(),cartId:this.cartWake.id,customer:this.customer,loadProducts:()=>this.buildProducts()}))}static get assetsDirs(){return["assets"]}};f.style=u;export{f as crm_bonus};
|
2
|
+
//# sourceMappingURL=p-4fa63df0.entry.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as n,h as e}from"./p-3d6152b1.js";import{g as t}from"./p-75ba7b9a.js";import{g as i}from"./p-f9aeffc1.js";import{i as a}from"./p-e8c19a64.js";import{C as c,g as o}from"./p-abbfbc98.js";import"./p-6eda79c3.js";const d="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIiLz4KPHBhdGggZD0iTTE1IDkuOTQ3MjhDMTQuNSA5LjMgMTMuOCA4LjUgMTIgOC41QzEwLjIgOC41IDkgOS41MTM5MyA5IDkuOTQ3MjhDOSAxMC4zODA2IDkuMDY3ODYgMTAuOTI3NyAxMCAxMS41QzEwLjc1MjIgMTEuOTYxOCAxMi42Njg0IDEyLjA0MzkgMTMuNSAxMi41QzE0LjY3OSAxMy4xNDY3IDE0Ljg0OTcgMTMuODIwMiAxNC44NDk3IDE0LjA1MjJDMTQuODQ5NyAxNC42ODM3IDEzLjQxNzUgMTUuNDg1MiAxMiAxNS41QzEwLjUzNiAxNS41MTUzIDkuNSAxNC43IDkgMTQuMDUyMiIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNMTIgN1YxNyIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPg==";function s(){if(localStorage.getItem("bc:time-allow")){return}const n=localStorage.getItem("bc:time");if(!n){localStorage.setItem("bc:time","360");localStorage.setItem("bc:time-allow","true");return}}const r=".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}";const l=r;const b=class{constructor(e){n(this,e);this.cart=undefined;this.cartWake=undefined;this.url=undefined;this.config=undefined;this.bonus=undefined;this.showEdit=false}async componentWillLoad(){await this.upadateCheckToFreteAndGetUrl();this.startTime()}async upadateCheckToFreteAndGetUrl(){this.cartWake=this.cart?new c(JSON.parse(this.cart)):await o();console.log("upadateCheckToFreteAndGetUrl",this.cartWake);this.config=t(this.cartWake.store.name);const n=document.getElementsByName("forma-envio");n.forEach((n=>{n.checked=false}));this.url=window.location.origin}handleHide(){const n=localStorage.getItem(this.cartWake.id);return!!n}getAmount(){const n=localStorage.getItem(this.cartWake.id);return n?Number(n).toFixed(2).replace(".",",")||"0,00":"0,00"}async backCart(){window.location.href=this.url}startTime(){if(!localStorage.getItem("bc:time-allow")){localStorage.removeItem("bc:time")}s()}hasBonus(){const n=localStorage.getItem(i(this.cartWake.id));const e={hasBonus:false,requestBonus:false};if(n){this.bonus=JSON.parse(n);e.hasBonus=this.bonus.hasBonus;e.requestBonus=true}return e}getTime(){const n=localStorage.getItem("bc:time");return n?Number(n):0}render(){var n;const t=((n=this.config)===null||n===void 0?void 0:n.giftbackTitle)||"Giftback";const i=this.hasBonus();return e("div",{key:"4617de820196995c8d4576ca28ce3b36a13ccec2"},e("div",{key:"2ea9c4d26914b2e279a36fa893da8057964c1240",class:"note-container"},e("div",{key:"72fe2cb3cb7ac7d0b0687fdd612b44944415deb8",class:"note-header"},e("p",{key:"89d4eaf0cab5ec289f99c25ee0d2bb016cf3704a",class:"note-title"},e("img",{key:"b774851ed3f9b75fcf786c27602ce974835f68e9",src:d,width:23}),this.config.giftbackTitle),i.hasBonus&&e("div",{key:"86dcc60b26bbbbb503aab29d3d88f8b7bd5b84b2"},this.showEdit&&e("p",{key:"45a3b79566f90f8410054c63fce6d0859de5e150",class:"back-cart",onClick:()=>this.backCart()},a.t("edit")),!this.showEdit&&e("countdown-timer",{key:"e6fd69643fb5c0c5e44559309168509edb68a534",initialValue:this.getTime(),downtime:()=>{this.showEdit=true}}))),i.hasBonus&&e("p",{key:"82d141d6b2ccb8c0885756c5d5704e2aa8a6c635",class:"note-description-2"},a.t("withApplyBonus",{giftbackname:t})," ",e("strong",{key:"5993965e6ce5954730773c882a1437920537e1b7"},"R$ ",this.getAmount(),".")),i.requestBonus&&!i.hasBonus&&e("p",{key:"afcbb9fe6fb17064eacd1386c08c3509e673733c",class:"note-description-not"},a.t("noBonus",{giftbackname:t})),!i.requestBonus&&e("div",{key:"586036e3f5d205ed803902274da176f7eb230256",class:"description"},e("p",{key:"5a0fa22781830ffa826a753bdd8e8c851075d1ec",class:"note-description-not"},a.t("backCart")),e("crm-button",{key:"1c5061ab7cdd4a985727df6e915067a67ad463fc",txtBtn:"VOLTAR AO CARRINHO",handleClick:()=>this.backCart()}))))}};b.style=l;export{b as crm_bonus_note};
|
2
|
+
//# sourceMappingURL=p-a33f7c24.entry.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{C as t,a as o}from"./p-6eda79c3.js";class r{constructor(t){var o;this.products=[];this.id=t.Metadados.id||t.Id;this.middlewareId=(o=t.Metadados)===null||o===void 0?void 0:o.id;this.orderId=t.PedidoId;this.buildUserInfo(t);this.buildStoreInfo(t);this.products=this.buildStoreCart(t.Produtos)}buildStoreCart(t=[]){const o=localStorage.getItem("bc:cart");if(!o){return this.saveStore(t)}const r=JSON.parse(o);if(t.length!==r.length){return this.saveStore(t)}for(const o of t){const[s]=r.filter((t=>t.ProdutoVarianteId==o.ProdutoVarianteId));if(s){return t}}return r}saveStore(t){localStorage.setItem("bc:cart",JSON.stringify(t));return t}buildUserInfo(t){this.user={id:t.Usuario?t.Usuario.Id:null}}buildStoreInfo(t){var o;this.store={name:(o=t.Loja)===null||o===void 0?void 0:o.Nome}}}const s=t.getInstance();const n=async()=>{const t=i();console.log("[URL STORE]: ",t);const o=await s.getInfoCart(t);return new r(o)};const i=()=>{const t=window.location.origin;if(t.includes("localhost")){return o}if(t.includes("checkout")){return t}if(t.includes("fbits")){return t}return`${window.location.protocol}//checkout.${window.location.host}`};export{r as C,n as g};
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{C as t,a as o}from"./p-6eda79c3.js";class r{constructor(t){var o;this.products=[];this.id=t.Metadados.id||t.Id;this.middlewareId=(o=t.Metadados)===null||o===void 0?void 0:o.id;this.orderId=t.PedidoId;this.buildUserInfo(t);this.buildStoreInfo(t);this.products=this.buildStoreCart(t.Produtos)}buildStoreCart(t=[]){const o=localStorage.getItem("bc:cart");if(!o){return this.saveStore(t)}const r=JSON.parse(o);if(t.length!==r.length){return this.saveStore(t)}for(const o of t){const[s]=r.filter((t=>t.ProdutoVarianteId==o.ProdutoVarianteId));if(s){return t}}return r}saveStore(t){localStorage.setItem("bc:cart",JSON.stringify(t));return t}buildUserInfo(t){this.user={id:t.Usuario?t.Usuario.Id:null}}buildStoreInfo(t){var o;this.store={name:(o=t.Loja)===null||o===void 0?void 0:o.Nome}}}const s=t.getInstance();const n=async()=>{const t=i();console.log("[URL STORE]: ",t);const o=await s.getInfoCart(t);return new r(o)};const i=()=>{const t=window.location.origin;if(t.includes("localhost")){return o}if(t.includes("checkout")){return t}if(t.includes("fbits")){return t}if(t.includes("www.")){return t.replace("www","checkout")}return`${window.location.protocol}//checkout.${window.location.host}`};export{r as C,n as g};
|
2
|
+
//# sourceMappingURL=p-abbfbc98.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["CartWake","constructor","cart","this","products","id","Metadados","Id","middlewareId","_a","orderId","PedidoId","buildUserInfo","buildStoreInfo","buildStoreCart","Produtos","newProducts","cache","localStorage","getItem","saveStore","cacheProducts","JSON","parse","length","p","cp","filter","cpp","ProdutoVarianteId","setItem","stringify","user","Usuario","store","name","Loja","Nome","crmBonusService","CrmBonusService","getInstance","getCart","async","baseUrl","buildUrlBase","console","log","getInfoCart","url","window","location","origin","includes","CHECKOUT_CART_WAKE","replace","protocol","host"],"sources":["src/objectvalues/cart.wake.ts","src/helpers/cart.helper.ts"],"sourcesContent":["import { IProductWake, IStore, IUser } from \"../dto/validate.pin.bonus\";\n\nexport class CartWake {\n id: string;\n middlewareId: string;\n orderId: number;\n products: IProductWake[] = [];\n user: IUser;\n store: IStore;\n\n constructor(cart) {\n this.id = cart.Metadados.id || cart.Id;\n this.middlewareId = cart.Metadados?.id;\n this.orderId = cart.PedidoId;\n this.buildUserInfo(cart);\n this.buildStoreInfo(cart);\n this.products = this.buildStoreCart( cart.Produtos);\n }\n\n private buildStoreCart(newProducts = []) {\n const cache = localStorage.getItem(\"bc:cart\");\n\n if(!cache) {\n return this.saveStore(newProducts)\n \n }\n \n const cacheProducts:IProductWake[] = JSON.parse(cache);\n\n if(newProducts.length !== cacheProducts.length) {\n return this.saveStore(newProducts);\n }\n\n for (const p of newProducts) {\n const [cp] = cacheProducts.filter(cpp => cpp.ProdutoVarianteId == p.ProdutoVarianteId);\n\n if(cp) {\n cp.Quantidade != p.Quantidade;\n\n return newProducts;\n }\n }\n\n return cacheProducts;\n\n }\n\n\n private saveStore(newProducts) {\n localStorage.setItem(\"bc:cart\", JSON.stringify(newProducts));\n\n return newProducts;\n }\n\n private buildUserInfo(cart) {\n this.user = {\n id: cart.Usuario ? cart.Usuario.Id : null\n }\n }\n\n private buildStoreInfo(cart) {\n this.store = {\n name: cart.Loja?.Nome\n }\n }\n}","import { CHECKOUT_CART_WAKE } from \"../../env\";\nimport { CartWake } from \"../objectvalues/cart.wake\";\nimport { CrmBonusService } from \"../services/crmbonus.service\";\n\nconst crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\nexport const getCart = async (): Promise<CartWake> => {\n const baseUrl = buildUrlBase(); // window.location.origin; //\"https://bycoders.fbits.store\" //window.location.origin;\n \n console.log('[URL STORE]: ', baseUrl)\n\n const cart = await crmBonusService.getInfoCart(baseUrl);\n\n return new CartWake(cart);\n}\n\nconst buildUrlBase = () => {\n\n const url = window.location.origin; //\"https://bycoders.checkout.fbits.store\" //\n\n if(url.includes('localhost')) {\n return CHECKOUT_CART_WAKE;\n }\n\n if(url.includes('checkout')) {\n return url;\n }\n\n if(url.includes('fbits')) {\n return url;\n }\n\n if(url.includes(\"www.\")) {\n return url.replace(\"www\", \"checkout\")\n }\n\n return `${window.location.protocol}//checkout.${window.location.host}`;\n\n}"],"mappings":"iDAEaA,EAQT,WAAAC,CAAYC,G,MAJZC,KAAAC,SAA2B,GAKvBD,KAAKE,GAAKH,EAAKI,UAAUD,IAAMH,EAAKK,GACpCJ,KAAKK,cAAeC,EAAAP,EAAKI,aAAS,MAAAG,SAAA,SAAAA,EAAEJ,GACpCF,KAAKO,QAAUR,EAAKS,SACpBR,KAAKS,cAAcV,GACnBC,KAAKU,eAAeX,GACpBC,KAAKC,SAAWD,KAAKW,eAAgBZ,EAAKa,S,CAGtC,cAAAD,CAAeE,EAAc,IACjC,MAAMC,EAAQC,aAAaC,QAAQ,WAEnC,IAAIF,EAAO,CACP,OAAOd,KAAKiB,UAAUJ,E,CAI1B,MAAMK,EAA+BC,KAAKC,MAAMN,GAEhD,GAAGD,EAAYQ,SAAWH,EAAcG,OAAQ,CAC5C,OAAOrB,KAAKiB,UAAUJ,E,CAG1B,IAAK,MAAMS,KAAKT,EAAa,CACzB,MAAOU,GAAML,EAAcM,QAAOC,GAAOA,EAAIC,mBAAqBJ,EAAEI,oBAEpE,GAAGH,EAAI,CAGH,OAAOV,C,EAIf,OAAOK,C,CAKH,SAAAD,CAAUJ,GACdE,aAAaY,QAAQ,UAAWR,KAAKS,UAAUf,IAE/C,OAAOA,C,CAGH,aAAAJ,CAAcV,GAClBC,KAAK6B,KAAO,CACR3B,GAAIH,EAAK+B,QAAU/B,EAAK+B,QAAQ1B,GAAK,K,CAIrC,cAAAM,CAAeX,G,MACnBC,KAAK+B,MAAQ,CACTC,MAAM1B,EAAAP,EAAKkC,QAAI,MAAA3B,SAAA,SAAAA,EAAE4B,K,EC1D7B,MAAMC,EAAmCC,EAAgBC,c,MAE5CC,EAAUC,UACnB,MAAMC,EAAUC,IAEhBC,QAAQC,IAAI,gBAAiBH,GAE7B,MAAMzC,QAAaoC,EAAgBS,YAAYJ,GAE/C,OAAO,IAAI3C,EAASE,EAAK,EAG7B,MAAM0C,EAAe,KAEjB,MAAMI,EAAOC,OAAOC,SAASC,OAE7B,GAAGH,EAAII,SAAS,aAAc,CAC1B,OAAOC,C,CAGX,GAAGL,EAAII,SAAS,YAAa,CACzB,OAAOJ,C,CAGX,GAAGA,EAAII,SAAS,SAAU,CACtB,OAAOJ,C,CAGX,GAAGA,EAAII,SAAS,QAAS,CACrB,OAAOJ,EAAIM,QAAQ,MAAO,W,CAG9B,MAAO,GAAGL,OAAOC,SAASK,sBAAsBN,OAAOC,SAASM,MAAM,S","ignoreList":[]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as a,h as t}from"./p-3d6152b1.js";import{C as o}from"./p-6eda79c3.js";import{C as r,g as s}from"./p-
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as a,h as t}from"./p-3d6152b1.js";import{C as o}from"./p-6eda79c3.js";import{C as r,g as s}from"./p-abbfbc98.js";import"./p-f9aeffc1.js";const c=class{constructor(t){a(this,t);this.cart=undefined}async componentWillLoad(){await this.handleOrder()}async handleOrder(){console.log("this.cart",this.cart);const a=this.cart?new r(JSON.parse(this.cart)):await s();if(a.id&&a.orderId){o.getInstance().updateOrder({cartId:a.id,orderId:a.orderId,cartIdCrm:a.middlewareId});const t=`bc-products:${a.id}`;localStorage.removeItem(t);localStorage.removeItem(a.id)}}render(){return t("div",{key:"d79a815efc708a2d818fa6adf22464a45e7fa546"})}};export{c as pedido_finalizado};
|
2
|
+
//# sourceMappingURL=p-fad20959.entry.js.map
|
@@ -63,9 +63,12 @@ const buildUrlBase = () => {
|
|
63
63
|
if (url.includes('fbits')) {
|
64
64
|
return url;
|
65
65
|
}
|
66
|
+
if (url.includes("www.")) {
|
67
|
+
return url.replace("www", "checkout");
|
68
|
+
}
|
66
69
|
return `${window.location.protocol}//checkout.${window.location.host}`;
|
67
70
|
};
|
68
71
|
|
69
72
|
export { CartWake as C, getCart as g };
|
70
73
|
|
71
|
-
//# sourceMappingURL=cart.helper-
|
74
|
+
//# sourceMappingURL=cart.helper-30a40560.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"cart.helper-30a40560.js","mappings":";;MAEa,QAAQ;IAQjB,YAAY,IAAI;;QAJhB,aAAQ,GAAmB,EAAE,CAAC;QAK1B,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,MAAA,IAAI,CAAC,SAAS,0CAAE,EAAE,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QACzB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;KACvD;IAEO,cAAc,CAAC,WAAW,GAAG,EAAE;QACnC,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAE9C,IAAG,CAAC,KAAK,EAAE;YACP,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,CAAC;AAC9B,EAAC;AAED,MAAM,YAAY,GAAG;IAEjB,MAAM,GAAG,GAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;IAEpC,IAAG,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;QAC1B,OAAO,kBAAkB,CAAC;KAC7B;IAED,IAAG,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;QACzB,OAAO,GAAG,CAAC;KACd;IAED,IAAG,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QACtB,OAAO,GAAG,CAAC;KACd;IAED,IAAG,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACrB,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;KACxC;IAED,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,cAAc,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;AAE3E,CAAC;;;;","names":[],"sources":["src/objectvalues/cart.wake.ts","src/helpers/cart.helper.ts"],"sourcesContent":["import { IProductWake, IStore, IUser } from \"../dto/validate.pin.bonus\";\n\nexport class CartWake {\n id: string;\n middlewareId: string;\n orderId: number;\n products: IProductWake[] = [];\n user: IUser;\n store: IStore;\n\n constructor(cart) {\n this.id = cart.Metadados.id || cart.Id;\n this.middlewareId = cart.Metadados?.id;\n this.orderId = cart.PedidoId;\n this.buildUserInfo(cart);\n this.buildStoreInfo(cart);\n this.products = this.buildStoreCart( cart.Produtos);\n }\n\n private buildStoreCart(newProducts = []) {\n const cache = localStorage.getItem(\"bc:cart\");\n\n if(!cache) {\n return this.saveStore(newProducts)\n \n }\n \n const cacheProducts:IProductWake[] = JSON.parse(cache);\n\n if(newProducts.length !== cacheProducts.length) {\n return this.saveStore(newProducts);\n }\n\n for (const p of newProducts) {\n const [cp] = cacheProducts.filter(cpp => cpp.ProdutoVarianteId == p.ProdutoVarianteId);\n\n if(cp) {\n cp.Quantidade != p.Quantidade;\n\n return newProducts;\n }\n }\n\n return cacheProducts;\n\n }\n\n\n private saveStore(newProducts) {\n localStorage.setItem(\"bc:cart\", JSON.stringify(newProducts));\n\n return newProducts;\n }\n\n private buildUserInfo(cart) {\n this.user = {\n id: cart.Usuario ? cart.Usuario.Id : null\n }\n }\n\n private buildStoreInfo(cart) {\n this.store = {\n name: cart.Loja?.Nome\n }\n }\n}","import { CHECKOUT_CART_WAKE } from \"../../env\";\nimport { CartWake } from \"../objectvalues/cart.wake\";\nimport { CrmBonusService } from \"../services/crmbonus.service\";\n\nconst crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\nexport const getCart = async (): Promise<CartWake> => {\n const baseUrl = buildUrlBase(); // window.location.origin; //\"https://bycoders.fbits.store\" //window.location.origin;\n \n console.log('[URL STORE]: ', baseUrl)\n\n const cart = await crmBonusService.getInfoCart(baseUrl);\n\n return new CartWake(cart);\n}\n\nconst buildUrlBase = () => {\n\n const url = window.location.origin; //\"https://bycoders.checkout.fbits.store\" //\n\n if(url.includes('localhost')) {\n return CHECKOUT_CART_WAKE;\n }\n\n if(url.includes('checkout')) {\n return url;\n }\n\n if(url.includes('fbits')) {\n return url;\n }\n\n if(url.includes(\"www.\")) {\n return url.replace(\"www\", \"checkout\")\n }\n\n return `${window.location.protocol}//checkout.${window.location.host}`;\n\n}"],"version":3}
|
@@ -2,7 +2,7 @@ import { r as registerInstance, h } from './index-e8724c8f.js';
|
|
2
2
|
import { g as getInfoCustomization } from './info.config.helper-42d9ddf9.js';
|
3
3
|
import { g as getKeyReserveByCartId } from './keys.storage-8c76fcd7.js';
|
4
4
|
import { i as instance } from './i18n-e8150dff.js';
|
5
|
-
import { C as CartWake, g as getCart } from './cart.helper-
|
5
|
+
import { C as CartWake, g as getCart } from './cart.helper-30a40560.js';
|
6
6
|
import './crmbonus.service-42fbd7fa.js';
|
7
7
|
|
8
8
|
const moneyDollarsSvgrepoComSvg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4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from './crmbonus.service-42fbd7fa.js';
|
3
3
|
import { S as StepFormEnum } from './index-5b567099.js';
|
4
4
|
import { i as instance } from './i18n-e8150dff.js';
|
5
|
-
import { g as getCart, C as CartWake } from './cart.helper-
|
5
|
+
import { g as getCart, C as CartWake } from './cart.helper-30a40560.js';
|
6
6
|
import { U as USED_KEY } from './keys.storage-8c76fcd7.js';
|
7
7
|
|
8
8
|
var AjustesTipoEnum;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, h } from './index-e8724c8f.js';
|
2
2
|
import { C as CrmBonusService } from './crmbonus.service-42fbd7fa.js';
|
3
|
-
import { C as CartWake, g as getCart } from './cart.helper-
|
3
|
+
import { C as CartWake, g as getCart } from './cart.helper-30a40560.js';
|
4
4
|
import './keys.storage-8c76fcd7.js';
|
5
5
|
|
6
6
|
const Pedido = class {
|
package/package.json
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"cart.helper-b00f45cb.js","mappings":";;;;MAEa,QAAQ;IAQjB,YAAY,IAAI;;QAJhB,aAAQ,GAAmB,EAAE,CAAC;QAK1B,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,MAAA,IAAI,CAAC,SAAS,0CAAE,EAAE,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QACzB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;KACvD;IAEO,cAAc,CAAC,WAAW,GAAG,EAAE;QACnC,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAE9C,IAAG,CAAC,KAAK,EAAE;YACP,OAAO,I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C;AAC9B,EAAC;AAED,MAAM,YAAY,GAAG;IAEjB,MAAM,GAAG,GAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;IAEpC,IAAG,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;QAC1B,OAAOC,mCAAkB,CAAC;KAC7B;IAED,IAAG,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;QACzB,OAAO,GAAG,CAAC;KACd;IAED,IAAG,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QACtB,OAAO,GAAG,CAAC;KACd;IAED,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,cAAc,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;AAE3E,CAAC;;;;;","names":["CrmBonusService","CHECKOUT_CART_WAKE"],"sources":["src/objectvalues/cart.wake.ts","src/helpers/cart.helper.ts"],"sourcesContent":["import { IProductWake, IStore, IUser } from \"../dto/validate.pin.bonus\";\n\nexport class CartWake {\n id: string;\n middlewareId: string;\n orderId: number;\n products: IProductWake[] = [];\n user: IUser;\n store: IStore;\n\n constructor(cart) {\n this.id = cart.Metadados.id || cart.Id;\n this.middlewareId = cart.Metadados?.id;\n this.orderId = cart.PedidoId;\n this.buildUserInfo(cart);\n this.buildStoreInfo(cart);\n this.products = this.buildStoreCart( cart.Produtos);\n }\n\n private buildStoreCart(newProducts = []) {\n const cache = localStorage.getItem(\"bc:cart\");\n\n if(!cache) {\n return this.saveStore(newProducts)\n \n }\n \n const cacheProducts:IProductWake[] = JSON.parse(cache);\n\n if(newProducts.length !== cacheProducts.length) {\n return this.saveStore(newProducts);\n }\n\n for (const p of newProducts) {\n const [cp] = cacheProducts.filter(cpp => cpp.ProdutoVarianteId == p.ProdutoVarianteId);\n\n if(cp) {\n cp.Quantidade != p.Quantidade;\n\n return newProducts;\n }\n }\n\n return cacheProducts;\n\n }\n\n\n private saveStore(newProducts) {\n localStorage.setItem(\"bc:cart\", JSON.stringify(newProducts));\n\n return newProducts;\n }\n\n private buildUserInfo(cart) {\n this.user = {\n id: cart.Usuario ? cart.Usuario.Id : null\n }\n }\n\n private buildStoreInfo(cart) {\n this.store = {\n name: cart.Loja?.Nome\n }\n }\n}","import { CHECKOUT_CART_WAKE } from \"../../env\";\nimport { CartWake } from \"../objectvalues/cart.wake\";\nimport { CrmBonusService } from \"../services/crmbonus.service\";\n\nconst crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\nexport const getCart = async (): Promise<CartWake> => {\n const baseUrl = buildUrlBase(); // window.location.origin; //\"https://bycoders.fbits.store\" //window.location.origin;\n \n console.log('[URL STORE]: ', baseUrl)\n\n const cart = await crmBonusService.getInfoCart(baseUrl);\n\n return new CartWake(cart);\n}\n\nconst buildUrlBase = () => {\n\n const url = window.location.origin; //\"https://bycoders.checkout.fbits.store\" //\n\n if(url.includes('localhost')) {\n return CHECKOUT_CART_WAKE;\n }\n\n if(url.includes('checkout')) {\n return url;\n }\n\n if(url.includes('fbits')) {\n return url;\n }\n\n return `${window.location.protocol}//checkout.${window.location.host}`;\n\n}"],"version":3}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"p-7e185d50.js","mappings":";;MAEa,QAAQ;IAQjB,YAAY,IAAI;;QAJhB,aAAQ,GAAmB,EAAE,CAAC;QAK1B,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,MAAA,IAAI,CAAC,SAAS,0CAAE,EAAE,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QACzB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;KACvD;IAEO,cAAc,CA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AC,CAAA;IAErC,MAAM,IAAI,GAAG,MAAM,eAAe,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAExD,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC9B,EAAC;AAED,MAAM,YAAY,GAAG;IAEjB,MAAM,GAAG,GAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;IAEpC,IAAG,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;QAC1B,OAAO,kBAAkB,CAAC;KAC7B;IAED,IAAG,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;QACzB,OAAO,GAAG,CAAC;KACd;IAED,IAAG,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QACtB,OAAO,GAAG,CAAC;KACd;IAED,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,cAAc,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;AAE3E,CAAC;;;;","names":[],"sources":["src/objectvalues/cart.wake.ts","src/helpers/cart.helper.ts"],"sourcesContent":["import { IProductWake, IStore, IUser } from \"../dto/validate.pin.bonus\";\n\nexport class CartWake {\n id: string;\n middlewareId: string;\n orderId: number;\n products: IProductWake[] = [];\n user: IUser;\n store: IStore;\n\n constructor(cart) {\n this.id = cart.Metadados.id || cart.Id;\n this.middlewareId = cart.Metadados?.id;\n this.orderId = cart.PedidoId;\n this.buildUserInfo(cart);\n this.buildStoreInfo(cart);\n this.products = this.buildStoreCart( cart.Produtos);\n }\n\n private buildStoreCart(newProducts = []) {\n const cache = localStorage.getItem(\"bc:cart\");\n\n if(!cache) {\n return this.saveStore(newProducts)\n \n }\n \n const cacheProducts:IProductWake[] = JSON.parse(cache);\n\n if(newProducts.length !== cacheProducts.length) {\n return this.saveStore(newProducts);\n }\n\n for (const p of newProducts) {\n const [cp] = cacheProducts.filter(cpp => cpp.ProdutoVarianteId == p.ProdutoVarianteId);\n\n if(cp) {\n cp.Quantidade != p.Quantidade;\n\n return newProducts;\n }\n }\n\n return cacheProducts;\n\n }\n\n\n private saveStore(newProducts) {\n localStorage.setItem(\"bc:cart\", JSON.stringify(newProducts));\n\n return newProducts;\n }\n\n private buildUserInfo(cart) {\n this.user = {\n id: cart.Usuario ? cart.Usuario.Id : null\n }\n }\n\n private buildStoreInfo(cart) {\n this.store = {\n name: cart.Loja?.Nome\n }\n }\n}","import { CHECKOUT_CART_WAKE } from \"../../env\";\nimport { CartWake } from \"../objectvalues/cart.wake\";\nimport { CrmBonusService } from \"../services/crmbonus.service\";\n\nconst crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\nexport const getCart = async (): Promise<CartWake> => {\n const baseUrl = buildUrlBase(); // window.location.origin; //\"https://bycoders.fbits.store\" //window.location.origin;\n \n console.log('[URL STORE]: ', baseUrl)\n\n const cart = await crmBonusService.getInfoCart(baseUrl);\n\n return new CartWake(cart);\n}\n\nconst buildUrlBase = () => {\n\n const url = window.location.origin; //\"https://bycoders.checkout.fbits.store\" //\n\n if(url.includes('localhost')) {\n return CHECKOUT_CART_WAKE;\n }\n\n if(url.includes('checkout')) {\n return url;\n }\n\n if(url.includes('fbits')) {\n return url;\n }\n\n return `${window.location.protocol}//checkout.${window.location.host}`;\n\n}"],"version":3}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["CartWake","constructor","cart","this","products","id","Metadados","Id","middlewareId","_a","orderId","PedidoId","buildUserInfo","buildStoreInfo","buildStoreCart","Produtos","newProducts","cache","localStorage","getItem","saveStore","cacheProducts","JSON","parse","length","p","cp","filter","cpp","ProdutoVarianteId","setItem","stringify","user","Usuario","store","name","Loja","Nome","crmBonusService","CrmBonusService","getInstance","getCart","async","baseUrl","buildUrlBase","console","log","getInfoCart","url","window","location","origin","includes","CHECKOUT_CART_WAKE","protocol","host"],"sources":["src/objectvalues/cart.wake.ts","src/helpers/cart.helper.ts"],"sourcesContent":["import { IProductWake, IStore, IUser } from \"../dto/validate.pin.bonus\";\n\nexport class CartWake {\n id: string;\n middlewareId: string;\n orderId: number;\n products: IProductWake[] = [];\n user: IUser;\n store: IStore;\n\n constructor(cart) {\n this.id = cart.Metadados.id || cart.Id;\n this.middlewareId = cart.Metadados?.id;\n this.orderId = cart.PedidoId;\n this.buildUserInfo(cart);\n this.buildStoreInfo(cart);\n this.products = this.buildStoreCart( cart.Produtos);\n }\n\n private buildStoreCart(newProducts = []) {\n const cache = localStorage.getItem(\"bc:cart\");\n\n if(!cache) {\n return this.saveStore(newProducts)\n \n }\n \n const cacheProducts:IProductWake[] = JSON.parse(cache);\n\n if(newProducts.length !== cacheProducts.length) {\n return this.saveStore(newProducts);\n }\n\n for (const p of newProducts) {\n const [cp] = cacheProducts.filter(cpp => cpp.ProdutoVarianteId == p.ProdutoVarianteId);\n\n if(cp) {\n cp.Quantidade != p.Quantidade;\n\n return newProducts;\n }\n }\n\n return cacheProducts;\n\n }\n\n\n private saveStore(newProducts) {\n localStorage.setItem(\"bc:cart\", JSON.stringify(newProducts));\n\n return newProducts;\n }\n\n private buildUserInfo(cart) {\n this.user = {\n id: cart.Usuario ? cart.Usuario.Id : null\n }\n }\n\n private buildStoreInfo(cart) {\n this.store = {\n name: cart.Loja?.Nome\n }\n }\n}","import { CHECKOUT_CART_WAKE } from \"../../env\";\nimport { CartWake } from \"../objectvalues/cart.wake\";\nimport { CrmBonusService } from \"../services/crmbonus.service\";\n\nconst crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\nexport const getCart = async (): Promise<CartWake> => {\n const baseUrl = buildUrlBase(); // window.location.origin; //\"https://bycoders.fbits.store\" //window.location.origin;\n \n console.log('[URL STORE]: ', baseUrl)\n\n const cart = await crmBonusService.getInfoCart(baseUrl);\n\n return new CartWake(cart);\n}\n\nconst buildUrlBase = () => {\n\n const url = window.location.origin; //\"https://bycoders.checkout.fbits.store\" //\n\n if(url.includes('localhost')) {\n return CHECKOUT_CART_WAKE;\n }\n\n if(url.includes('checkout')) {\n return url;\n }\n\n if(url.includes('fbits'))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G,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QACtB,OAAO,GAAG,CAAC;KACd;IAED,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,cAAc,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;AAE3E,CAAC;;;;","names":[],"sources":["src/objectvalues/cart.wake.ts","src/helpers/cart.helper.ts"],"sourcesContent":["import { IProductWake, IStore, IUser } from \"../dto/validate.pin.bonus\";\n\nexport class CartWake {\n id: string;\n middlewareId: string;\n orderId: number;\n products: IProductWake[] = [];\n user: IUser;\n store: IStore;\n\n constructor(cart) {\n this.id = cart.Metadados.id || cart.Id;\n this.middlewareId = cart.Metadados?.id;\n this.orderId = cart.PedidoId;\n this.buildUserInfo(cart);\n this.buildStoreInfo(cart);\n this.products = this.buildStoreCart( cart.Produtos);\n }\n\n private buildStoreCart(newProducts = []) {\n const cache = localStorage.getItem(\"bc:cart\");\n\n if(!cache) {\n return this.saveStore(newProducts)\n \n }\n \n const cacheProducts:IProductWake[] = JSON.parse(cache);\n\n if(newProducts.length !== cacheProducts.length) {\n return this.saveStore(newProducts);\n }\n\n for (const p of newProducts) {\n const [cp] = cacheProducts.filter(cpp => cpp.ProdutoVarianteId == p.ProdutoVarianteId);\n\n if(cp) {\n cp.Quantidade != p.Quantidade;\n\n return newProducts;\n }\n }\n\n return cacheProducts;\n\n }\n\n\n private saveStore(newProducts) {\n localStorage.setItem(\"bc:cart\", JSON.stringify(newProducts));\n\n return newProducts;\n }\n\n private buildUserInfo(cart) {\n this.user = {\n id: cart.Usuario ? cart.Usuario.Id : null\n }\n }\n\n private buildStoreInfo(cart) {\n this.store = {\n name: cart.Loja?.Nome\n }\n }\n}","import { CHECKOUT_CART_WAKE } from \"../../env\";\nimport { CartWake } from \"../objectvalues/cart.wake\";\nimport { CrmBonusService } from \"../services/crmbonus.service\";\n\nconst crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\nexport const getCart = async (): Promise<CartWake> => {\n const baseUrl = buildUrlBase(); // window.location.origin; //\"https://bycoders.fbits.store\" //window.location.origin;\n \n console.log('[URL STORE]: ', baseUrl)\n\n const cart = await crmBonusService.getInfoCart(baseUrl);\n\n return new CartWake(cart);\n}\n\nconst buildUrlBase = () => {\n\n const url = window.location.origin; //\"https://bycoders.checkout.fbits.store\" //\n\n if(url.includes('localhost')) {\n return CHECKOUT_CART_WAKE;\n }\n\n if(url.includes('checkout')) {\n return url;\n }\n\n if(url.includes('fbits')) {\n return url;\n }\n\n return `${window.location.protocol}//checkout.${window.location.host}`;\n\n}"],"version":3}
|
File without changes
|
File without changes
|
File without changes
|