crmbonus-component-wake 2.1.23-local → 2.1.23-ngrok
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/{build.payload.helper-72ef7c5c.js → build.payload.helper-409e6cc9.js} +14 -2
- package/dist/cjs/build.payload.helper-409e6cc9.js.map +1 -0
- package/dist/cjs/{cart.helper-7b7f630d.js → cart.helper-df86b04b.js} +4 -2
- package/dist/cjs/cart.helper-df86b04b.js.map +1 -0
- package/dist/cjs/{countdown-timer.cjs.entry.js → countdown-timer_2.cjs.entry.js} +18 -1
- package/dist/cjs/countdown-timer_2.cjs.entry.js.map +1 -0
- package/dist/cjs/crm-bonus-form.cjs.entry.js +1 -1
- package/dist/cjs/crm-bonus-note.cjs.entry.js +7 -13
- package/dist/cjs/crm-bonus-note.cjs.entry.js.map +1 -1
- package/dist/cjs/crm-bonus-tray.cjs.entry.js +1 -1
- package/dist/cjs/crm-bonus.cjs.entry.js +24 -7
- package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -1
- package/dist/cjs/crm-giftback-form.cjs.entry.js +11 -8
- package/dist/cjs/crm-giftback-form.cjs.entry.js.map +1 -1
- package/dist/cjs/crm-tooltip_4.cjs.entry.js +3 -3
- package/dist/cjs/crmbonus-component-wake.cjs.js +1 -1
- package/dist/cjs/{crmbonus.service-d4b81327.js → crmbonus.service-2df67338.js} +19 -12
- package/dist/cjs/crmbonus.service-2df67338.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pedido-finalizado.cjs.entry.js +3 -3
- package/dist/cjs/phone-input-mask.cjs.entry.js +1 -1
- package/dist/collection/components/crm-bonus/crm-bonus.js +21 -4
- package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -1
- package/dist/collection/components/giftback-form/giftback-form.js +11 -7
- package/dist/collection/components/giftback-form/giftback-form.js.map +1 -1
- package/dist/collection/components/note/crm-bonus-note.js +4 -10
- package/dist/collection/components/note/crm-bonus-note.js.map +1 -1
- package/dist/collection/components/pedido/pedido.js +1 -1
- package/dist/collection/components/phone/phone-input-mask.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js +1 -1
- package/dist/collection/dto/validate.pin.bonus.js +2 -0
- package/dist/collection/dto/validate.pin.bonus.js.map +1 -1
- package/dist/collection/helpers/build.payload.helper.js +11 -1
- package/dist/collection/helpers/build.payload.helper.js.map +1 -1
- package/dist/collection/helpers/cart.helper.js +2 -0
- package/dist/collection/helpers/cart.helper.js.map +1 -1
- package/dist/collection/services/crmbonus.service.js +18 -11
- package/dist/collection/services/crmbonus.service.js.map +1 -1
- package/dist/collection/tray-ecommerce/crm-bonus-tray.js +1 -1
- package/dist/components/crm-bonus-form.js +1 -1
- package/dist/components/crm-bonus-note.js +8 -20
- package/dist/components/crm-bonus-note.js.map +1 -1
- package/dist/components/crm-bonus-tray.js +1 -1
- package/dist/components/crm-bonus.js +29 -12
- package/dist/components/crm-bonus.js.map +1 -1
- package/dist/components/crm-giftback-form.js +1 -1
- package/dist/components/crm-tooltip.js +1 -1
- package/dist/components/giftback-info.js +1 -1
- package/dist/components/{p-bf39a925.js → p-0a33e90f.js} +2 -2
- package/dist/components/{p-bf39a925.js.map → p-0a33e90f.js.map} +1 -1
- package/dist/{esm/build.payload.helper-09dcb309.js → components/p-1bc79b08.js} +14 -2
- package/dist/components/p-1bc79b08.js.map +1 -0
- package/dist/components/{p-983941ec.js → p-36601e2d.js} +17 -13
- package/dist/components/p-36601e2d.js.map +1 -0
- package/dist/components/{p-4734b509.js → p-417d9c1e.js} +4 -4
- package/dist/components/{p-4734b509.js.map → p-417d9c1e.js.map} +1 -1
- package/dist/components/{p-8c9686ed.js → p-ab662b24.js} +2 -2
- package/dist/components/{p-8c9686ed.js.map → p-ab662b24.js.map} +1 -1
- package/dist/components/{p-6b783d44.js → p-c2ecfee1.js} +19 -12
- package/dist/components/p-c2ecfee1.js.map +1 -0
- package/dist/components/{p-0a4cc53e.js → p-e068510c.js} +2 -2
- package/dist/components/{p-0a4cc53e.js.map → p-e068510c.js.map} +1 -1
- package/dist/components/{p-239cdde1.js → p-e68d4e85.js} +4 -2
- package/dist/components/p-e68d4e85.js.map +1 -0
- package/dist/components/pedido-finalizado.js +3 -3
- package/dist/components/phone-cancel-input.js +1 -1
- package/dist/components/phone-form.js +1 -1
- package/dist/components/phone-input-mask.js +1 -1
- package/dist/components/phone-input.js +1 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/p-1bc79b08.js +2 -0
- package/dist/crmbonus-component-wake/p-1bc79b08.js.map +1 -0
- package/dist/crmbonus-component-wake/p-568072fe.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-70dc125d.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-a3d2a4f7.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-a3d2a4f7.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/{p-17d31505.entry.js → p-b5e9a5ea.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-33065276.entry.js → p-bfebfea7.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-6b783d44.js → p-c2ecfee1.js} +2 -2
- package/dist/crmbonus-component-wake/p-c2ecfee1.js.map +1 -0
- package/dist/crmbonus-component-wake/p-cc0bc5a5.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-cc0bc5a5.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-d65808f6.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-d7c09321.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-d7c09321.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-e5d8700b.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-e5d8700b.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-e68d4e85.js +2 -0
- package/dist/crmbonus-component-wake/{p-239cdde1.js.map → p-e68d4e85.js.map} +1 -1
- package/dist/{components/p-0bc27e39.js → esm/build.payload.helper-96f9c8b8.js} +14 -2
- package/dist/esm/build.payload.helper-96f9c8b8.js.map +1 -0
- package/dist/esm/{cart.helper-4d1bf8e2.js → cart.helper-9c847c16.js} +4 -2
- package/dist/esm/cart.helper-9c847c16.js.map +1 -0
- package/dist/esm/{countdown-timer.entry.js → countdown-timer_2.entry.js} +18 -2
- package/dist/esm/countdown-timer_2.entry.js.map +1 -0
- package/dist/esm/crm-bonus-form.entry.js +1 -1
- package/dist/esm/crm-bonus-note.entry.js +7 -13
- package/dist/esm/crm-bonus-note.entry.js.map +1 -1
- package/dist/esm/crm-bonus-tray.entry.js +1 -1
- package/dist/esm/crm-bonus.entry.js +24 -7
- package/dist/esm/crm-bonus.entry.js.map +1 -1
- package/dist/esm/crm-giftback-form.entry.js +11 -8
- package/dist/esm/crm-giftback-form.entry.js.map +1 -1
- package/dist/esm/crm-tooltip_4.entry.js +3 -3
- package/dist/esm/crmbonus-component-wake.js +1 -1
- package/dist/esm/{crmbonus.service-aafcb1ec.js → crmbonus.service-3ab820ba.js} +19 -12
- package/dist/esm/crmbonus.service-3ab820ba.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pedido-finalizado.entry.js +3 -3
- package/dist/esm/phone-input-mask.entry.js +1 -1
- package/dist/types/components/crm-bonus/crm-bonus.d.ts +1 -0
- package/dist/types/components/giftback-form/giftback-form.d.ts +1 -0
- package/dist/types/components/note/crm-bonus-note.d.ts +0 -1
- package/dist/types/dto/validate.pin.bonus.d.ts +3 -1
- package/package.json +1 -1
- package/dist/cjs/build.payload.helper-72ef7c5c.js.map +0 -1
- package/dist/cjs/cart.helper-7b7f630d.js.map +0 -1
- package/dist/cjs/countdown-timer.cjs.entry.js.map +0 -1
- package/dist/cjs/crm-button.cjs.entry.js +0 -25
- package/dist/cjs/crm-button.cjs.entry.js.map +0 -1
- package/dist/cjs/crmbonus.service-d4b81327.js.map +0 -1
- package/dist/components/p-0bc27e39.js.map +0 -1
- package/dist/components/p-239cdde1.js.map +0 -1
- package/dist/components/p-6b783d44.js.map +0 -1
- package/dist/components/p-983941ec.js.map +0 -1
- package/dist/crmbonus-component-wake/p-0bc27e39.js +0 -2
- package/dist/crmbonus-component-wake/p-0bc27e39.js.map +0 -1
- package/dist/crmbonus-component-wake/p-239cdde1.js +0 -2
- package/dist/crmbonus-component-wake/p-2c9c622a.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-2c9c622a.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-697779f2.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-697779f2.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-6b783d44.js.map +0 -1
- package/dist/crmbonus-component-wake/p-9c1704c1.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-9d0e6eb3.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-aa0d168f.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-b476cb6c.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-b476cb6c.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-b6ed20eb.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-b6ed20eb.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-bbea7258.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-bbea7258.entry.js.map +0 -1
- package/dist/esm/build.payload.helper-09dcb309.js.map +0 -1
- package/dist/esm/cart.helper-4d1bf8e2.js.map +0 -1
- package/dist/esm/countdown-timer.entry.js.map +0 -1
- package/dist/esm/crm-button.entry.js +0 -21
- package/dist/esm/crm-button.entry.js.map +0 -1
- package/dist/esm/crmbonus.service-aafcb1ec.js.map +0 -1
- /package/dist/crmbonus-component-wake/{p-aa0d168f.entry.js.map → p-568072fe.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-9d0e6eb3.entry.js.map → p-70dc125d.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-17d31505.entry.js.map → p-b5e9a5ea.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-33065276.entry.js.map → p-bfebfea7.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-9c1704c1.entry.js.map → p-d65808f6.entry.js.map} +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
import { C as CrmBonusService, a as CHECKOUT_CART_WAKE } from './p-
|
1
|
+
import { C as CrmBonusService, a as CHECKOUT_CART_WAKE } from './p-c2ecfee1.js';
|
2
2
|
|
3
3
|
class CartWake {
|
4
4
|
constructor(cart) {
|
@@ -85,11 +85,13 @@ const getInfoBonusByCartIdAndStoreName = async (cartId, storeName) => {
|
|
85
85
|
return ReservedInfoDTO.of(info);
|
86
86
|
};
|
87
87
|
const persisteMetadata = async (storeName, cartId, metadata = {}) => {
|
88
|
+
console.log('[bc:salvando metadados]');
|
88
89
|
await crmBonusService.patchInfoBonus({
|
89
90
|
storeName,
|
90
91
|
cartId,
|
91
92
|
metadata
|
92
93
|
});
|
94
|
+
console.log('[bc:salvo metadados]');
|
93
95
|
};
|
94
96
|
const buildUrlBase = () => {
|
95
97
|
const url = window.location.origin; //"https://bycoders.checkout.fbits.store" //
|
@@ -110,4 +112,4 @@ const buildUrlBase = () => {
|
|
110
112
|
|
111
113
|
export { CartWake as C, getInfoBonusByCartIdAndStoreName as a, getCart as g, persisteMetadata as p };
|
112
114
|
|
113
|
-
//# sourceMappingURL=p-
|
115
|
+
//# sourceMappingURL=p-e68d4e85.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"p-e68d4e85.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,CAAC,KAAK,CAAC,CAAC;QAEvD,IAAG,WAAW,CAAC,MAAM,KAAK,aAAa,CAAC,MAAM,EAAE;YAC5C,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;SACtC;QAED,KAAK,MAAM,CAAC,IAAI,WAAW,EAAE;YACzB,MAAM,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,iBAAiB,IAAI,CAAC,CAAC,iBAAiB,CAAC,CAAC;YAEvF,IAAG,EAAE,EAAE;gBAGH,OAAO,WAAW,CAAC;aACtB;SACJ;QAED,OAAO,aAAa,CAAC;KAExB;IAGO,SAAS,CAAC,WAAW;QACzB,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;QAE7D,OAAO,WAAW,CAAC;KACtB;IAEO,aAAa,CAAC,IAAI;QACtB,IAAI,CAAC,IAAI,GAAG;YACR,EAAE,EAAE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI;SAC5C,CAAA;KACJ;IAEO,cAAc,CAAC,IAAI;;QACvB,IAAI,CAAC,KAAK,GAAG;YACT,IAAI,EAAE,MAAA,IAAI,CAAC,IAAI,0CAAE,IAAI;SACxB,CAAA;KACJ;;;MChEQ,eAAe;IAmBjB,OAAO,EAAE,CAAC,OAAY;QACzB,MAAM,IAAI,GAAG,IAAI,eAAe,EAAE,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAC/C,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC3C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QACjD,OAAO,IAAI,CAAC;KACf;IAEM,SAAS;;QACZ,MAAM,SAAS,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,0CAAE,SAAS,CAAC;QAC5C,IAAG,CAAC,SAAS;YAAE,OAAO,IAAI,CAAC;QAE3B,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE3B,MAAM,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;QAEnC,MAAM,WAAW,GAAG,MAAM,IAAI,IAAI,GAAG,EAAE,CAAC,CAAC;QAEzC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;QAExC,OAAO,WAAW,GAAG,CAAC,CAAC;KAE1B;;;AC3CL,MAAM,eAAe,GAAoB,eAAe,CAAC,WAAW,EAAE,CAAC;MAE1D,OAAO,GAAG;IACnB,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;IAE/B,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,EAAC;MAEY,gCAAgC,GAAG,OAAO,MAAM,EAAE,SAAS;IACpE,MAAM,IAAI,GAAG,MAAM,eAAe,CAAC,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IAElE,OAAO,eAAe,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AACpC,EAAC;MAEY,gBAAgB,GAAG,OAAO,SAAiB,EAAE,MAAc,EAAE,QAAQ,GAAG,EAAE;IACnF,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACvC,MAAM,eAAe,CAAC,cAAc,CAAC;QACjC,SAAS;QACT,MAAM;QACN,QAAQ;KACX,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;AACxC,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/dto/reserved-info.dto.ts","src/helpers/cart.helper.ts"],"sourcesContent":["import { IProductWake, IStore, IUser } from \"../dto/validate.pin.bonus\";\r\n\r\nexport class CartWake {\r\n id: string;\r\n middlewareId: string;\r\n orderId: number;\r\n products: IProductWake[] = [];\r\n user: IUser;\r\n store: IStore;\r\n\r\n constructor(cart) {\r\n this.id = cart.Metadados.id || cart.Id;\r\n this.middlewareId = cart.Metadados?.id;\r\n this.orderId = cart.PedidoId;\r\n this.buildUserInfo(cart);\r\n this.buildStoreInfo(cart);\r\n this.products = this.buildStoreCart( cart.Produtos);\r\n }\r\n\r\n private buildStoreCart(newProducts = []) {\r\n const cache = localStorage.getItem(\"bc:cart\");\r\n\r\n if(!cache) {\r\n return this.saveStore(newProducts)\r\n \r\n }\r\n \r\n const cacheProducts:IProductWake[] = JSON.parse(cache);\r\n\r\n if(newProducts.length !== cacheProducts.length) {\r\n return this.saveStore(newProducts);\r\n }\r\n\r\n for (const p of newProducts) {\r\n const [cp] = cacheProducts.filter(cpp => cpp.ProdutoVarianteId == p.ProdutoVarianteId);\r\n\r\n if(cp) {\r\n cp.Quantidade != p.Quantidade;\r\n\r\n return newProducts;\r\n }\r\n }\r\n\r\n return cacheProducts;\r\n\r\n }\r\n\r\n\r\n private saveStore(newProducts) {\r\n localStorage.setItem(\"bc:cart\", JSON.stringify(newProducts));\r\n\r\n return newProducts;\r\n }\r\n\r\n private buildUserInfo(cart) {\r\n this.user = {\r\n id: cart.Usuario ? cart.Usuario.Id : null\r\n }\r\n }\r\n\r\n private buildStoreInfo(cart) {\r\n this.store = {\r\n name: cart.Loja?.Nome\r\n }\r\n }\r\n}","export class ReservedInfoDTO {\r\n bonusBalance: string;\r\n bonusIds: string;\r\n calculatedValue: string;\r\n cartId: string;\r\n metadata: {\r\n url: string,\r\n createdAt: number;\r\n storeId?: string;\r\n userId?: string;\r\n cellphone?: number;\r\n }\r\n orderId: string;\r\n status: number;\r\n totalDiscount: string;\r\n totalValue: string;\r\n isBonusProcessed?: boolean;\r\n\r\n\r\n public static of(payload: any) {\r\n const info = new ReservedInfoDTO();\r\n info.bonusBalance = payload.bonusBalance;\r\n info.bonusIds = payload.bonusIds;\r\n info.calculatedValue = payload.calculatedValue;\r\n info.cartId = payload.cartId;\r\n info.metadata = payload.metadata;\r\n info.orderId = payload.orderId;\r\n info.status = payload.status;\r\n info.totalDiscount = payload.totalDiscount;\r\n info.totalValue = payload.totalValue;\r\n info.isBonusProcessed = payload.isBonusProcessed;\r\n return info;\r\n }\r\n\r\n public isExpired(): boolean {\r\n const createdAt = this?.metadata?.createdAt;\r\n if(!createdAt) return true; \r\n \r\n const current = Date.now();\r\n\r\n const diffms = current - createdAt;\r\n\r\n const diffMinutes = diffms / (1000 * 60);\r\n\r\n console.log('diffMinutes', diffMinutes);\r\n\r\n return diffMinutes > 6;\r\n\r\n }\r\n\r\n}","import { CHECKOUT_CART_WAKE } from \"../../env\";\r\nimport { CartWake } from \"../objectvalues/cart.wake\";\r\nimport { CrmBonusService } from \"../services/crmbonus.service\";\r\nimport { ReservedInfoDTO } from '../dto/reserved-info.dto'\r\n\r\nconst crmBonusService: CrmBonusService = CrmBonusService.getInstance();\r\n\r\nexport const getCart = async (): Promise<CartWake> => {\r\n const baseUrl = buildUrlBase(); // window.location.origin; //\"https://bycoders.fbits.store\" //window.location.origin;\r\n \r\n console.log('[URL STORE]: ', baseUrl)\r\n\r\n const cart = await crmBonusService.getInfoCart(baseUrl);\r\n\r\n return new CartWake(cart);\r\n}\r\n\r\nexport const getInfoBonusByCartIdAndStoreName = async (cartId, storeName) => {\r\n const info = await crmBonusService.getInfoBonus(cartId, storeName)\r\n\r\n return ReservedInfoDTO.of(info);\r\n}\r\n\r\nexport const persisteMetadata = async (storeName: string, cartId: string, metadata = {}) => {\r\n console.log('[bc:salvando metadados]');\r\n await crmBonusService.patchInfoBonus({\r\n storeName,\r\n cartId,\r\n metadata\r\n });\r\n console.log('[bc:salvo metadados]');\r\n}\r\n\r\nconst buildUrlBase = () => {\r\n\r\n const url = window.location.origin; //\"https://bycoders.checkout.fbits.store\" //\r\n\r\n if(url.includes('localhost')) {\r\n return CHECKOUT_CART_WAKE;\r\n }\r\n\r\n if(url.includes('checkout')) {\r\n return url;\r\n }\r\n\r\n if(url.includes('fbits')) {\r\n return url;\r\n }\r\n\r\n if(url.includes(\"www.\")) {\r\n return url.replace(\"www\", \"checkout\")\r\n }\r\n\r\n return `${window.location.protocol}//checkout.${window.location.host}`;\r\n\r\n}"],"version":3}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { p as proxyCustomElement, H, h } from './p-9d950d25.js';
|
2
|
-
import { C as CrmBonusService } from './p-
|
3
|
-
import { C as CartWake, g as getCart } from './p-
|
2
|
+
import { C as CrmBonusService } from './p-c2ecfee1.js';
|
3
|
+
import { C as CartWake, g as getCart } from './p-e68d4e85.js';
|
4
4
|
|
5
5
|
const Pedido = /*@__PURE__*/ proxyCustomElement(class Pedido extends H {
|
6
6
|
constructor() {
|
@@ -25,7 +25,7 @@ const Pedido = /*@__PURE__*/ proxyCustomElement(class Pedido extends H {
|
|
25
25
|
}
|
26
26
|
}
|
27
27
|
render() {
|
28
|
-
return (h("div", { key: '
|
28
|
+
return (h("div", { key: '2c842ca66602b461296e7070bd57edda194338e4' }));
|
29
29
|
}
|
30
30
|
}, [0, "pedido-finalizado", {
|
31
31
|
"cart": [8]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { p as proxyCustomElement, H, h } from './p-9d950d25.js';
|
2
2
|
import { d as defineCustomElement$3 } from './p-e31b6c28.js';
|
3
|
-
import { d as defineCustomElement$2 } from './p-
|
3
|
+
import { d as defineCustomElement$2 } from './p-e068510c.js';
|
4
4
|
|
5
5
|
const PhoneCancelInput$1 = /*@__PURE__*/ proxyCustomElement(class PhoneCancelInput extends H {
|
6
6
|
constructor() {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { p as proxyCustomElement, H, h } from './p-9d950d25.js';
|
2
2
|
import { d as defineCustomElement$3 } from './p-e31b6c28.js';
|
3
|
-
import { d as defineCustomElement$2 } from './p-
|
3
|
+
import { d as defineCustomElement$2 } from './p-e068510c.js';
|
4
4
|
|
5
5
|
const PhoneInput$1 = /*@__PURE__*/ proxyCustomElement(class PhoneInput extends H {
|
6
6
|
constructor() {
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{p as e,b as n}from"./p-8c362346.js";export{s as setNonce}from"./p-8c362346.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-8c362346.js";export{s as setNonce}from"./p-8c362346.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-d7c09321",[[1,"crm-bonus",{cart:[8],canhidden:[4],showModal:[32],cartWake:[32],customer:[32],loading:[32],message:[32],phone:[32],canCancel:[32],amountCancel:[32],sent:[32],session:[32],loading_reprocess:[32],styles:[32],reservedInfo:[32],resetBonus:[64],setloading:[64],reprocess:[64]}]]],["p-d65808f6",[[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-6d5bd437",[[1,"phone-cancel-input",{sendPin:[16],loading:[4],value:[1]}]]],["p-74335744",[[1,"phone-input",{sendPin:[16],loading:[4],value:[1]}]]],["p-a3d2a4f7",[[0,"crm-bonus-note",{cart:[8],cartWake:[32],url:[32],config:[32],bonus:[32],showEdit:[32],styles:[32],infoBonus:[32],loading:[32],info:[32]}]]],["p-2bd29eae",[[1,"app-modal",{isOpen:[516,"is-open"],modalTitle:[1,"modal-title"]}]]],["p-39abc114",[[1,"countdown-timer-v2",{downtime:[16],reload:[4],dates:[16],seconds:[32],minutes:[32]}]]],["p-568072fe",[[0,"crm-bonus-tray"]]],["p-70dc125d",[[0,"pedido-finalizado",{cart:[8]}]]],["p-9a32f685",[[1,"loading-spinner",{size:[1],color:[1]}]]],["p-cc0bc5a5",[[0,"crm-giftback-form",{storeName:[8,"storename"],cartId:[8,"cart-id"],products:[16],customer:[16],loadProducts:[16],loadAll:[16],customStyles:[8,"custom-styles"],reservedInfo:[16],value:[32],loading:[32],message:[32],phone:[32],pinInfo:[32],step:[32],bonus:[32],sucess:[32],error:[32],config:[32],hasApplyBonus:[32],loadingAllComponent:[32],setStep:[64],processBonus:[64]}]]],["p-427c86db",[[4,"loading-container",{loading:[4]}]]],["p-b9baad26",[[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]}],[1,"name-input",{value:[1],loading:[4],applyName:[16],cancel:[16],newValue:[32],message:[32]}],[1,"giftback-finish"]]],["p-b5e9a5ea",[[1,"phone-input-mask",{initialValue:[1,"initial-value"],disabled:[4],phone:[32],message:[32],getPhone:[64]}]]],["p-e5d8700b",[[0,"crm-button",{txtBtn:[1,"txt-btn"],loading:[4],handleClick:[16]}],[0,"countdown-timer",{downtime:[16],dataCriacao:[1,"data-criacao"],minutos:[2],segundos:[2],tempoRestante:[32]}]]],["p-bfebfea7",[[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",{cartId:[8,"cart-id"],loading:[4],bonus:[16],reserve:[16],cancel:[16],config:[16],infoBonus:[16],storeName:[1,"store-name"],usedValue:[32],selectedOption:[32],sliderPosition:[32],sliderValuePosition:[32],loadingTime:[32]},null,{bonus:["changedBonus"]}],[0,"crm-tooltip",{text:[1],identity:[1]}]]]],e)}));
|
2
2
|
//# sourceMappingURL=crmbonus-component-wake.esm.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","async","options","globalScripts","bootstrapLazy","cart","canhidden","showModal","cartWake","customer","loading","message","phone","canCancel","amountCancel","sent","session","loading_reprocess","styles","reservedInfo","resetBonus","setloading","reprocess","storeName","cartId","products","stepNext","loadingModal","saveStore","cancel","handleCustomerName","step","bonus","setStep","
|
1
|
+
{"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","async","options","globalScripts","bootstrapLazy","cart","canhidden","showModal","cartWake","customer","loading","message","phone","canCancel","amountCancel","sent","session","loading_reprocess","styles","reservedInfo","resetBonus","setloading","reprocess","storeName","cartId","products","stepNext","loadingModal","saveStore","cancel","handleCustomerName","step","bonus","setStep","sendPin","value","config","showEdit","infoBonus","info","isOpen","modalTitle","downtime","reload","dates","seconds","minutes","size","color","loadProducts","loadAll","customStyles","pinInfo","sucess","error","hasApplyBonus","loadingAllComponent","processBonus","validate","pin","isVerified","reserve","usedValue","applyName","newValue","initialValue","disabled","getPhone","txtBtn","handleClick","dataCriacao","minutos","segundos","tempoRestante","handlerSubmit","resend","canResend","selectedOption","sliderPosition","sliderValuePosition","loadingTime","text","identity"],"sources":["node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.22.2 | MIT Licensed | https://stenciljs.com\n */\n\n// src/client/client-patch-browser.ts\nimport { BUILD, NAMESPACE } from \"@stencil/core/internal/app-data\";\nimport { consoleDevInfo, doc, H, promiseResolve } from \"@stencil/core\";\nvar patchBrowser = () => {\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo(\"Running in development mode.\");\n }\n if (BUILD.cloneNodeFix) {\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts ? Array.from(doc.querySelectorAll(\"script\")).find(\n (s) => new RegExp(`/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) || s.getAttribute(\"data-stencil-namespace\") === NAMESPACE\n ) : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})[\"data-opts\"] || {} : {};\n if (importMeta !== \"\") {\n opts.resourcesUrl = new URL(\".\", importMeta).href;\n }\n return promiseResolve(opts);\n};\nvar patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function(deep) {\n if (this.nodeName === \"TEMPLATE\") {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport {\n patchBrowser\n};\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(async (options) => {\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"0HAOA,IAAIA,EAAe,KAUjB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACrBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACjD,CACE,OAAOC,EAAeJ,EAAK,EClB7BH,IAAeQ,MAAKC,MAAOC,UACnBC,IACN,OAAOC,EAAc,+BAA8B,CAAAC,KAAS,IAAAC,UAAA,IAAAC,UAAA,KAAAC,SAAA,KAAAC,SAAA,KAAAC,QAAA,KAAAC,QAAA,KAAAC,MAAA,KAAAC,UAAA,KAAAC,aAAA,KAAAC,KAAA,KAAAC,QAAA,KAAAC,kBAAA,KAAAC,OAAA,KAAAC,aAAA,KAAAC,WAAA,KAAAC,WAAA,KAAAC,UAAA,6CAAAC,UAAA,gBAAAC,OAAA,cAAAC,SAAA,KAAAhB,SAAA,KAAAM,KAAA,KAAAW,SAAA,gBAAAd,MAAA,IAAAe,aAAA,oBAAAC,UAAA,KAAAC,OAAA,KAAAC,mBAAA,KAAApB,QAAA,KAAAqB,KAAA,KAAApB,QAAA,KAAAqB,MAAA,KAAAC,QAAA,iDAAAC,QAAA,KAAAxB,QAAA,IAAAyB,MAAA,yCAAAD,QAAA,KAAAxB,QAAA,IAAAyB,MAAA,4CAAA9B,KAAA,IAAAG,SAAA,KAAAd,IAAA,KAAA0C,OAAA,KAAAJ,MAAA,KAAAK,SAAA,KAAAnB,OAAA,KAAAoB,UAAA,KAAA5B,QAAA,KAAA6B,KAAA,wCAAAC,OAAA,gBAAAC,WAAA,8DAAAC,SAAA,KAAAC,OAAA,IAAAC,MAAA,KAAAC,QAAA,KAAAC,QAAA,sFAAAzC,KAAA,6CAAA0C,KAAA,IAAAC,MAAA,+CAAAzB,UAAA,gBAAAC,OAAA,cAAAC,SAAA,KAAAhB,SAAA,KAAAwC,aAAA,KAAAC,QAAA,KAAAC,aAAA,oBAAAhC,aAAA,KAAAgB,MAAA,KAAAzB,QAAA,KAAAC,QAAA,KAAAC,MAAA,KAAAwC,QAAA,KAAArB,KAAA,KAAAC,MAAA,KAAAqB,OAAA,KAAAC,MAAA,KAAAlB,OAAA,KAAAmB,cAAA,KAAAC,oBAAA,KAAAvB,QAAA,KAAAwB,aAAA,gDAAA/C,QAAA,0CAAAK,KAAA,KAAA2C,SAAA,KAAA7B,OAAA,KAAAnB,QAAA,IAAAiD,IAAA,KAAAC,WAAA,+BAAAlD,QAAA,IAAAsB,MAAA,KAAA6B,QAAA,KAAAhC,OAAA,KAAAiC,UAAA,wBAAA3B,MAAA,IAAAzB,QAAA,IAAAqD,UAAA,KAAAlC,OAAA,KAAAmC,SAAA,KAAArD,QAAA,qEAAAsD,aAAA,oBAAAC,SAAA,IAAAtD,MAAA,KAAAD,QAAA,KAAAwD,SAAA,yCAAAC,OAAA,cAAA1D,QAAA,IAAA2D,YAAA,6BAAA3B,SAAA,KAAA4B,YAAA,mBAAAC,QAAA,IAAAC,SAAA,IAAAC,cAAA,yCAAAtC,MAAA,IAAAzB,QAAA,IAAAgE,cAAA,KAAAtC,OAAA,sBAAAsB,SAAA,KAAA7B,OAAA,KAAA8C,OAAA,KAAA5D,KAAA,KAAAL,QAAA,IAAAE,MAAA,IAAAwB,OAAA,KAAAuB,IAAA,KAAAC,WAAA,KAAAgB,UAAA,2BAAApD,OAAA,cAAAd,QAAA,IAAAsB,MAAA,KAAA6B,QAAA,KAAAhC,OAAA,KAAAO,OAAA,KAAAE,UAAA,KAAAf,UAAA,iBAAAuC,UAAA,KAAAe,eAAA,KAAAC,eAAA,KAAAC,oBAAA,KAAAC,YAAA,YAAAhD,MAAA,qCAAAiD,KAAA,IAAAC,SAAA,SAAAhF,EAAA","ignoreList":[]}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
var o;(function(o){o["P"]="Promocao";o["CC"]="ContaCorrente";o["PP"]="PromocaoProduto";o["F"]="Formula"})(o||(o={}));function t(o=[]){const t=[];for(const c of o){let o=r(c.Ajustes);let f=n(c.Ajustes);var u=c.PrecoPor*c.Quantidade+f;var a=o*-1;t.push({sku:c.SKU,value:u,productVariantId:c.ProdutoVarianteId.toString(),quantity:c.Quantidade,discount:u<a?u:a})}return t}function r(t=[]){let r=0;for(const n of t){if([o.P,o.CC].includes(n.Tipo)){r+=n.Valor}}return r}function n(t=[]){let r=0;for(const n of t){if([o.F].includes(n.Tipo)){r+=n.Valor*-1}}return r}export{t as b};
|
2
|
+
//# sourceMappingURL=p-1bc79b08.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["AjustesTipoEnum","buildProductsByWake","productsWake","products","pw","discounts","getDiscount","Ajustes","discounts_formula","getDiscountFormula","value","PrecoPor","Quantidade","discounts_value","push","sku","SKU","productVariantId","ProdutoVarianteId","toString","quantity","discount","ajustes","P","CC","includes","Tipo","Valor","F"],"sources":["src/dto/validate.pin.bonus.ts","src/helpers/build.payload.helper.ts"],"sourcesContent":["export interface IProduct {\r\n productVariantId: string;\r\n sku: string;\r\n value: number;\r\n quantity: number;\r\n discount: number;\r\n}\r\n\r\nexport enum AjustesTipoEnum {\r\n P = \"Promocao\",\r\n CC = \"ContaCorrente\",\r\n PP = \"PromocaoProduto\",\r\n F = \"Formula\"\r\n}\r\n\r\nexport interface IAjustes {\r\n Tipo: AjustesTipoEnum;\r\n Valor: number;\r\n}\r\n\r\nexport interface IUser {\r\n id: number;\r\n}\r\n\r\nexport interface IStore {\r\n name: string;\r\n}\r\n\r\nexport interface IProductWake {\r\n ProdutoVarianteId: number;\r\n SKU: string;\r\n PrecoPor: number;\r\n Quantidade: number;\r\n Ajustes: IAjustes[];\r\n}\r\n\r\nexport interface ICustomer {\r\n birthDate: string;\r\n document: string;\r\n name: string;\r\n phone: string;\r\n}\r\n\r\nexport interface IProccesPinBonusDto {\r\n storeName: string;\r\n name: string;\r\n checkoutId: string;\r\n checkoutProducts: Array<IProduct>;\r\n storeId: string;\r\n userId: string;\r\n cellphone: number;\r\n pin: string;\r\n\r\n}\r\n\r\nexport interface IBonus {\r\n hasBonus: boolean;\r\n bonusBalance: number;\r\n totalBonus: number;\r\n minimumPurchase: number;\r\n bonusIds: string;\r\n firstValidityDate: string\r\n history: [\r\n {\r\n validityStart: string;\r\n validityEnd: string;\r\n value: number\r\n },\r\n {\r\n validityStart: string;\r\n validityEnd: string\r\n value: number\r\n }\r\n ]\r\n storeId: number;\r\n userId: number;\r\n cartId: string\r\n calculatedValue: number;\r\n totalValue: number\r\n}\r\n\r\n\r\nexport interface IReserveDTO {\r\n storeName: string;\r\n cartId: string;\r\n grossValue: number;\r\n redeemedBonus: number;\r\n ticket: string;\r\n storeId: string;\r\n userId: number;\r\n}","import { AjustesTipoEnum, IAjustes, IProduct, IProductWake } from \"../dto/validate.pin.bonus\";\r\n\r\nexport function buildProductsByWake(productsWake: Array<IProductWake> = []): Array<IProduct> {\r\n\r\n const products: Array<IProduct> = [];\r\n\r\n for ( const pw of productsWake ) {\r\n let discounts = getDiscount(pw.Ajustes)\r\n let discounts_formula = getDiscountFormula(pw.Ajustes);\r\n\r\n var value = (pw.PrecoPor * pw.Quantidade) + discounts_formula;\r\n\r\n var discounts_value = (discounts * -1)\r\n\r\n products.push(\r\n {\r\n sku: pw.SKU,\r\n value: value,\r\n productVariantId: pw.ProdutoVarianteId.toString(),\r\n quantity: pw.Quantidade,\r\n discount: value < discounts_value ? value : discounts_value,\r\n }\r\n )\r\n }\r\n\r\n return products;\r\n}\r\n\r\nfunction getDiscount(ajustes: IAjustes[] = []) {\r\n \r\n let discounts = 0;\r\n \r\n for(const discount of ajustes) {\r\n if([AjustesTipoEnum.P, AjustesTipoEnum.CC].includes(discount.Tipo)) {\r\n discounts += discount.Valor;\r\n }\r\n }\r\n\r\n return discounts;\r\n}\r\n\r\nfunction getDiscountFormula(ajustes: IAjustes[] = []) {\r\n \r\n let discounts = 0;\r\n \r\n for(const discount of ajustes) {\r\n if([AjustesTipoEnum.F].includes(discount.Tipo)) {\r\n discounts += (discount.Valor * -1);\r\n }\r\n }\r\n\r\n return discounts;\r\n}"],"mappings":"AAQA,IAAYA,GAAZ,SAAYA,GACRA,EAAA,gBACAA,EAAA,sBACAA,EAAA,wBACAA,EAAA,cACH,EALD,CAAYA,MAAe,K,SCNXC,EAAoBC,EAAoC,IAEpE,MAAMC,EAA4B,GAElC,IAAM,MAAMC,KAAMF,EAAe,CAC7B,IAAIG,EAAYC,EAAYF,EAAGG,SAC/B,IAAIC,EAAoBC,EAAmBL,EAAGG,SAE9C,IAAIG,EAASN,EAAGO,SAAWP,EAAGQ,WAAcJ,EAE5C,IAAIK,EAAmBR,GAAa,EAEpCF,EAASW,KACL,CACIC,IAAKX,EAAGY,IACRN,MAAOA,EACPO,iBAAkBb,EAAGc,kBAAkBC,WACvCC,SAAUhB,EAAGQ,WACbS,SAAUX,EAAQG,EAAkBH,EAAQG,G,CAKxD,OAAOV,CACX,CAEA,SAASG,EAAYgB,EAAsB,IAEvC,IAAIjB,EAAY,EAEhB,IAAI,MAAMgB,KAAYC,EAAS,CAC3B,GAAG,CAACtB,EAAgBuB,EAAGvB,EAAgBwB,IAAIC,SAASJ,EAASK,MAAO,CAChErB,GAAagB,EAASM,K,EAI9B,OAAOtB,CACX,CAEA,SAASI,EAAmBa,EAAsB,IAE9C,IAAIjB,EAAY,EAEhB,IAAI,MAAMgB,KAAYC,EAAS,CAC3B,GAAG,CAACtB,EAAgB4B,GAAGH,SAASJ,EAASK,MAAO,CAC5CrB,GAAcgB,EAASM,OAAS,C,EAIxC,OAAOtB,CACX,Q","ignoreList":[]}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{r as a,h as r}from"./p-8c362346.js";import{C as e}from"./p-c2ecfee1.js";import{C as o,g as t}from"./p-e68d4e85.js";const s=class{constructor(r){a(this,r);this.cart=undefined}async componentWillLoad(){await this.handleOrder()}async handleOrder(){const a=this.cart?new o(JSON.parse(this.cart)):await t();if(a.id&&a.orderId){e.getInstance().updateOrder({cartId:a.id,orderId:a.orderId,cartIdCrm:a.middlewareId});const r=`bc-products:${a.id}`;localStorage.removeItem(r);localStorage.removeItem(a.id)}}render(){return r("div",{key:"2c842ca66602b461296e7070bd57edda194338e4"})}};export{s as pedido_finalizado};
|
2
|
+
//# sourceMappingURL=p-70dc125d.entry.js.map
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{r as n,h as e}from"./p-8c362346.js";import{g as t}from"./p-1b441909.js";import{C as i,g as o}from"./p-c2ecfee1.js";import{i as a}from"./p-c53241bf.js";import{C as r,g as s,a as c}from"./p-e68d4e85.js";import{d}from"./p-ecc51430.js";import{b as l}from"./p-1bc79b08.js";const g="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPg0KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjEwIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMiIvPg0KPHBhdGggZD0iTTE1IDkuOTQ3MjhDMTQuNSA5LjMgMTMuOCA4LjUgMTIgOC41QzEwLjIgOC41IDkgOS41MTM5MyA5IDkuOTQ3MjhDOSAxMC4zODA2IDkuMDY3ODYgMTAuOTI3NyAxMCAxMS41QzEwLjc1MjIgMTEuOTYxOCAxMi42Njg0IDEyLjA0MzkgMTMuNSAxMi41QzE0LjY3OSAxMy4xNDY3IDE0Ljg0OTcgMTMuODIwMiAxNC44NDk3IDE0LjA1MjJDMTQuODQ5NyAxNC42ODM3IDEzLjQxNzUgMTUuNDg1MiAxMiAxNS41QzEwLjUzNiAxNS41MTUzIDkuNSAxNC43IDkgMTQuMDUyMiIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPg0KPHBhdGggZD0iTTEyIDdWMTciIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPg0KPC9zdmc+";function f(){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 b=".note-container {\r\n border: 1px solid #dddddd;\r\n padding: 0 15px 15px;\r\n margin: 0 0 26px 0px;\r\n display: flex;\r\n flex-direction: column;\r\n gap: 13px;\r\n\r\n\r\n & .description {\r\n display: flex;\r\n flex-direction: column;\r\n gap: 13px;\r\n }\r\n}\r\n\r\n.note-container hr {\r\n border: 1px solid #CCC;\r\n}\r\n\r\n.note-container .back-cart {\r\n display: flex;\r\n text-align: center;\r\n}\r\n\r\n.note-header {\r\n display: flex;\r\n align-items: baseline;\r\n justify-content: space-between;\r\n}\r\n\r\n.note-title {\r\n font-weight: 700;\r\n text-align: left;\r\n display: flex;\r\n gap: 6px;\r\n align-items: center;\r\n margin-top: 11px;\r\n color: #000;\r\n}\r\n\r\n.note-description {\r\n color: #6d6d5f;\r\n padding: 0;\r\n margin: 0 auto;\r\n}\r\n\r\n.back-cart {\r\n /* font-size: .9em; */\r\n color: #27272A;\r\n text-decoration: none;\r\n cursor: pointer;\r\n margin-top: 11px;\r\n}\r\n\r\n.note-description-2 {\r\n color: var(--crm-scheme-fg-main-inverse, #262626);\r\n /* font-size: var(--crm-font-size-body-lg, 16px); */\r\n font-style: normal;\r\n font-weight: var(--crm-font-weight-body-bold, 400);\r\n line-height: var(--crm-line-height-body-md, 20px);\r\n letter-spacing: var(--crm-letter-spacing-title-md, 0px);\r\n margin-top: 11px;\r\n color: #000;\r\n}\r\n\r\n.note-description-not {\r\n /* font-size: 16px; */\r\n}";const h=b;const u=class{constructor(e){n(this,e);this.crmBonusService=i.getInstance();this.cart=undefined;this.cartWake=undefined;this.url=undefined;this.config=undefined;this.bonus=undefined;this.showEdit=false;this.styles=d;this.infoBonus=undefined;this.loading=false;this.info=undefined}async componentWillLoad(){console.log("[CRM-BONUS-NOTE] componentWillLoad");await this.upadateCheckToFreteAndGetUrl()}async upadateCheckToFreteAndGetUrl(){var n,e,i;this.cartWake=this.cart?new r(JSON.parse(this.cart)):await s();const a=o(this.cartWake.id);try{const t=await c(this.cartWake.id,this.cartWake.store.name);if(t.bonusBalance){localStorage.setItem(this.cartWake.id,t.bonusBalance);localStorage.setItem(a,JSON.stringify({hasBonus:true}))}if(t.isBonusProcessed){this.startTime()}if((n=t===null||t===void 0?void 0:t.metadata)===null||n===void 0?void 0:n.url){this.url=(e=t===null||t===void 0?void 0:t.metadata)===null||e===void 0?void 0:e.url}this.infoBonus={storeId:t===null||t===void 0?void 0:t.metadata.storeId,userId:t===null||t===void 0?void 0:t.metadata.userId,cellphone:(i=t===null||t===void 0?void 0:t.metadata)===null||i===void 0?void 0:i.cellphone};console.log("info",t);this.info=t}catch(n){localStorage.removeItem(a);localStorage.removeItem(this.cartWake.id)}this.config=t(this.cartWake.store.name);if(this.config.keepStoreFrontStyle){this.styles=null}const d=document.getElementsByName("forma-envio");d.forEach((n=>{n.checked=false}))}async processBonus(){var n,e;this.loading=true;try{const t=await s();console.log("[cart-note]",t);const i=l(t.products);const o={pin:"2018",cellphone:this.infoBonus.cellphone,storeId:(n=this.infoBonus)===null||n===void 0?void 0:n.storeId.toString(),userId:(e=this.infoBonus)===null||e===void 0?void 0:e.userId.toString(),checkoutId:this.cartWake.id,checkoutProducts:i,name:"",storeName:this.cartWake.store.name};this.bonus=await this.crmBonusService.validatePinBonus(o)}catch(n){console.error("Error processing bonus:",n)}finally{this.loading=false;await this.upadateCheckToFreteAndGetUrl()}}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")}f()}hasBonus(){const n=localStorage.getItem(o(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();const o=document.getElementById("btn-contaCorrente-nao");if(o){o.addEventListener("change",(async()=>{console.log("O rádio foi selecionado! NÃO");setTimeout((async()=>{await this.processBonus()}),4e3)}))}const r=document.getElementById("btn-contaCorrente-sim");if(r){r.addEventListener("change",(async()=>{console.log("O rádio foi selecionado! SIM");setTimeout((async()=>{await this.processBonus()}),4e3)}))}return e("loading-container",{key:"4a1ae1a0024c591abd8d281bdf98064147a791ae",loading:this.loading},e("div",{key:"8119bf347d8677c1794b13913b1e3fadc7a3d373",class:"note-container",style:this.styles},e("div",{key:"0d1b2fedc01da88d5ab768cdafeb2474dc60cda0",class:"note-header"},e("p",{key:"1a1e6c741d5ca9272afbb0fc6bf94fd291029e48",class:"note-title"},e("img",{key:"0c957b65dce439ea0e4eb58bffe8b4da0c7e11e2",src:g,width:23}),this.config.giftbackTitle),i.hasBonus&&e("div",{key:"128028e06b2fd8fd8eaddf71ebd449458ffed35e"},this.showEdit&&e("p",{key:"8dba62a02ff00c5d545a225e855728ae61dffa57",class:"back-cart",onClick:()=>this.backCart()},a.t("edit")))),i.hasBonus&&e("p",{key:"e5c5aff658ebb4557b9ae9755ae13e887857ed96",class:"note-description-2"},a.t("withApplyBonus",{giftbackname:t})," ",e("strong",{key:"98006717e11f5ecd88ac0048dadcb1979ae89c45"},"R$ ",this.getAmount(),".")),i.requestBonus&&!i.hasBonus&&e("p",{key:"728e9abb6dedb522d28b09db64f55a22cdc50fa3",class:"note-description-not"},a.t("noBonus",{giftbackname:t})),!i.requestBonus&&e("div",{key:"7854623248ed56cac9022d4897b6c526f7f6a49a",class:"description"},e("p",{key:"43cb9fc68afb764d1f702d57a096426438a2f671",class:"note-description-not"},a.t("noBonus",{giftbackname:t})))))}};u.style=h;export{u as crm_bonus_note};
|
2
|
+
//# sourceMappingURL=p-a3d2a4f7.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["moneyDollarsSvgrepoComSvg","setTime","localStorage","getItem","time","setItem","crmBonusNoteCss","CrmBonusNoteStyle0","CrmBonusNote","this","crmBonusService","CrmBonusService","getInstance","defaultStyles","componentWillLoad","console","log","upadateCheckToFreteAndGetUrl","cartWake","cart","CartWake","JSON","parse","getCart","key","getKeyReserveByCartId","id","info","getInfoBonusByCartIdAndStoreName","store","name","bonusBalance","stringify","hasBonus","isBonusProcessed","startTime","_a","metadata","url","_b","infoBonus","storeId","userId","cellphone","_c","error","removeItem","config","getInfoCustomization","keepStoreFrontStyle","styles","envios","document","getElementsByName","forEach","envio","checked","processBonus","loading","products","buildProductsByWake","payload","pin","toString","checkoutId","checkoutProducts","storeName","bonus","validatePinBonus","handleHide","amount","getAmount","Number","toFixed","replace","backCart","window","location","href","_bonus","requestBonus","getTime","render","giftbackname","giftbackTitle","infobonus","inputContaCorrenteNo","getElementById","addEventListener","async","setTimeout","inputContaCorrenteYes","h","class","style","src","money","width","showEdit","onClick","i18next","t"],"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 -->\r\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"#000000\" stroke-width=\"2\"/>\r\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\"/>\r\n<path d=\"M12 7V17\" stroke=\"#000000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n</svg>","export function setTime() {\r\n\r\n if(localStorage.getItem(\"bc:time-allow\")) {\r\n return\r\n }\r\n\r\n const time = localStorage.getItem(\"bc:time\");\r\n\r\n if(!time) {\r\n localStorage.setItem(\"bc:time\", \"360\");\r\n localStorage.setItem(\"bc:time-allow\", \"true\");\r\n return\r\n } \r\n}",".note-container {\r\n border: 1px solid #dddddd;\r\n padding: 0 15px 15px;\r\n margin: 0 0 26px 0px;\r\n display: flex;\r\n flex-direction: column;\r\n gap: 13px;\r\n\r\n\r\n & .description {\r\n display: flex;\r\n flex-direction: column;\r\n gap: 13px;\r\n }\r\n}\r\n\r\n.note-container hr {\r\n border: 1px solid #CCC;\r\n}\r\n\r\n.note-container .back-cart {\r\n display: flex;\r\n text-align: center;\r\n}\r\n\r\n.note-header {\r\n display: flex;\r\n align-items: baseline;\r\n justify-content: space-between;\r\n}\r\n\r\n.note-title {\r\n font-weight: 700;\r\n text-align: left;\r\n display: flex;\r\n gap: 6px;\r\n align-items: center;\r\n margin-top: 11px;\r\n color: #000;\r\n}\r\n\r\n.note-description {\r\n color: #6d6d5f;\r\n padding: 0;\r\n margin: 0 auto;\r\n}\r\n\r\n.back-cart {\r\n /* font-size: .9em; */\r\n color: #27272A;\r\n text-decoration: none;\r\n cursor: pointer;\r\n margin-top: 11px;\r\n}\r\n\r\n.note-description-2 {\r\n color: var(--crm-scheme-fg-main-inverse, #262626);\r\n /* font-size: var(--crm-font-size-body-lg, 16px); */\r\n font-style: normal;\r\n font-weight: var(--crm-font-weight-body-bold, 400);\r\n line-height: var(--crm-line-height-body-md, 20px);\r\n letter-spacing: var(--crm-letter-spacing-title-md, 0px);\r\n margin-top: 11px;\r\n color: #000;\r\n}\r\n\r\n.note-description-not {\r\n /* font-size: 16px; */\r\n}","import { Component, Prop, State, h } from \"@stencil/core\";\r\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\r\n\r\nimport money from '../../assets/svg/money-dollars-svgrepo-com.svg'\r\nimport { getKeyReserveByCartId } from \"../../utils/keys.storage\";\r\nimport i18next from \"../../i18n/i18n\"\r\nimport { IBonus, ReservedInfoDTO } from \"../../components\";\r\nimport { setTime } from \"../../helpers/time.helper\";\r\nimport { CartWake } from \"../../objectvalues/cart.wake\";\r\nimport { getCart, getInfoBonusByCartIdAndStoreName } from \"../../helpers/cart.helper\";\r\nimport { defaultStyles } from \"../../contants\";\r\nimport { IProccesPinBonusDto } from \"../../dto/validate.pin.bonus\";\r\nimport { buildProductsByWake } from \"../../helpers/build.payload.helper\";\r\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\r\n\r\n@Component({\r\n tag: 'crm-bonus-note',\r\n styleUrl: 'crm-bonus-note.css'\r\n})\r\nexport class CrmBonusNote {\r\n\r\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\r\n\r\n @Prop() cart;\r\n\r\n @State() cartWake: CartWake;\r\n @State() url: string;\r\n @State() config: IInfoStore;\r\n @State() bonus: IBonus;\r\n @State() showEdit: boolean = false;\r\n\r\n @State() styles = defaultStyles;\r\n @State() infoBonus: {\r\n storeId: string,\r\n userId: string,\r\n cellphone: number\r\n }\r\n\r\n @State() loading: boolean = false;\r\n @State() info: ReservedInfoDTO;\r\n\r\n async componentWillLoad() {\r\n console.log(\"[CRM-BONUS-NOTE] componentWillLoad\");\r\n await this.upadateCheckToFreteAndGetUrl();\r\n }\r\n\r\n async upadateCheckToFreteAndGetUrl() {\r\n\r\n this.cartWake = this.cart ? new CartWake(JSON.parse(this.cart)) : await getCart();\r\n\r\n const key = getKeyReserveByCartId(this.cartWake.id);\r\n try {\r\n const info = await getInfoBonusByCartIdAndStoreName(this.cartWake.id, this.cartWake.store.name);\r\n\r\n if (info.bonusBalance) {\r\n localStorage.setItem(this.cartWake.id, info.bonusBalance);\r\n localStorage.setItem(key, JSON.stringify({\r\n hasBonus: true,\r\n }));\r\n }\r\n\r\n if (info.isBonusProcessed) {\r\n this.startTime();\r\n }\r\n\r\n if (info?.metadata?.url) {\r\n this.url = info?.metadata?.url;\r\n }\r\n\r\n this.infoBonus = {\r\n storeId: info?.metadata.storeId,\r\n userId: info?.metadata.userId,\r\n cellphone: info?.metadata?.cellphone,\r\n }\r\n\r\n console.log('info', info);\r\n\r\n this.info = info;\r\n } catch (error) {\r\n localStorage.removeItem(key);\r\n localStorage.removeItem(this.cartWake.id);\r\n }\r\n\r\n this.config = getInfoCustomization(this.cartWake.store.name);\r\n\r\n if (this.config.keepStoreFrontStyle) {\r\n this.styles = null;\r\n }\r\n\r\n const envios = document.getElementsByName('forma-envio');\r\n envios.forEach((envio: any) => {\r\n envio.checked = false;\r\n });\r\n\r\n }\r\n\r\n async processBonus() {\r\n this.loading = true;\r\n try {\r\n const cart = await getCart();\r\n\r\n console.log('[cart-note]', cart);\r\n\r\n const products = buildProductsByWake(cart.products);\r\n\r\n const payload: IProccesPinBonusDto = {\r\n pin: \"2018\",\r\n cellphone: this.infoBonus.cellphone,\r\n storeId: this.infoBonus?.storeId.toString(),\r\n userId: this.infoBonus?.userId.toString(),\r\n checkoutId: this.cartWake.id,\r\n checkoutProducts: products,\r\n name: \"\",\r\n storeName: this.cartWake.store.name\r\n }\r\n\r\n this.bonus = await this.crmBonusService.validatePinBonus(payload);\r\n } catch (error) {\r\n console.error('Error processing bonus:', error);\r\n } finally {\r\n this.loading = false;\r\n\r\n await this.upadateCheckToFreteAndGetUrl();\r\n }\r\n\r\n }\r\n\r\n handleHide() {\r\n const amount = localStorage.getItem(this.cartWake.id);\r\n return !!amount;\r\n }\r\n\r\n getAmount() {\r\n const amount = localStorage.getItem(this.cartWake.id);\r\n\r\n return amount ? Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\" : \"0,00\";\r\n }\r\n\r\n async backCart() {\r\n window.location.href = this.url;\r\n }\r\n\r\n\r\n private startTime() {\r\n\r\n if (!localStorage.getItem(\"bc:time-allow\")) {\r\n localStorage.removeItem(\"bc:time\")\r\n }\r\n\r\n setTime();\r\n }\r\n\r\n hasBonus() {\r\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartWake.id));\r\n\r\n const info = {\r\n hasBonus: false,\r\n requestBonus: false\r\n }\r\n\r\n if (_bonus) {\r\n this.bonus = JSON.parse(_bonus);\r\n info.hasBonus = this.bonus.hasBonus;\r\n info.requestBonus = true;\r\n }\r\n\r\n return info;\r\n }\r\n\r\n getTime() {\r\n const time = localStorage.getItem(\"bc:time\")\r\n\r\n return time ? Number(time) : 0;\r\n }\r\n\r\n render() {\r\n\r\n const giftbackname = this.config?.giftbackTitle || \"Giftback\";\r\n\r\n const infobonus = this.hasBonus();\r\n\r\n const inputContaCorrenteNo = document.getElementById('btn-contaCorrente-nao');\r\n\r\n if (inputContaCorrenteNo) {\r\n inputContaCorrenteNo.addEventListener('change', async () => {\r\n console.log('O rádio foi selecionado! NÃO');\r\n\r\n setTimeout(async () => {\r\n await this.processBonus();\r\n }, 4000);\r\n });\r\n }\r\n\r\n const inputContaCorrenteYes = document.getElementById('btn-contaCorrente-sim');\r\n\r\n if (inputContaCorrenteYes) {\r\n inputContaCorrenteYes.addEventListener('change', async () => {\r\n console.log('O rádio foi selecionado! SIM');\r\n setTimeout(async () => {\r\n await this.processBonus();\r\n }, 4000);\r\n });\r\n }\r\n\r\n return (\r\n <loading-container loading={this.loading} >\r\n <div class=\"note-container\" style={this.styles}>\r\n <div class=\"note-header\">\r\n\r\n <p class=\"note-title\">\r\n <img src={money} width={23} />\r\n {this.config.giftbackTitle}\r\n </p>\r\n {\r\n infobonus.hasBonus && (\r\n <div>\r\n {this.showEdit && (\r\n <p class=\"back-cart\" onClick={() => this.backCart()}>\r\n {i18next.t(\"edit\")}\r\n </p>\r\n )}\r\n </div>\r\n )\r\n }\r\n </div>\r\n\r\n {\r\n infobonus.hasBonus &&\r\n (\r\n <p class=\"note-description-2\">\r\n {i18next.t(\"withApplyBonus\", { giftbackname: giftbackname })} <strong>R$ {this.getAmount()}.</strong>\r\n </p>\r\n )\r\n }\r\n\r\n {\r\n (infobonus.requestBonus && !infobonus.hasBonus) &&\r\n (\r\n <p class=\"note-description-not\">\r\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\r\n </p>\r\n )\r\n }\r\n\r\n {\r\n !infobonus.requestBonus &&\r\n (\r\n <div class=\"description\">\r\n <p class=\"note-description-not\">\r\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\r\n </p>\r\n </div>\r\n )\r\n }\r\n </div>\r\n </loading-container>\r\n )\r\n }\r\n}"],"mappings":"mRAAA,MAAMA,EAA4B,ihC,SCAlBC,IAEZ,GAAGC,aAAaC,QAAQ,iBAAkB,CACtC,M,CAGJ,MAAMC,EAAOF,aAAaC,QAAQ,WAElC,IAAIC,EAAM,CACNF,aAAaG,QAAQ,UAAW,OAChCH,aAAaG,QAAQ,gBAAiB,QACtC,M,CAER,CCbA,MAAMC,EAAkB,y9CACxB,MAAAC,EAAeD,E,MCkBFE,EAAY,M,yBAEbC,KAAAC,gBAAmCC,EAAgBC,c,wHAQ9B,M,YAEXC,E,sCAOU,M,oBAG5B,uBAAMC,GACFC,QAAQC,IAAI,4CACNP,KAAKQ,8B,CAGf,kCAAMA,G,UAEFR,KAAKS,SAAWT,KAAKU,KAAO,IAAIC,EAASC,KAAKC,MAAMb,KAAKU,aAAeI,IAExE,MAAMC,EAAMC,EAAsBhB,KAAKS,SAASQ,IAChD,IACI,MAAMC,QAAaC,EAAiCnB,KAAKS,SAASQ,GAAIjB,KAAKS,SAASW,MAAMC,MAE1F,GAAIH,EAAKI,aAAc,CACnB7B,aAAaG,QAAQI,KAAKS,SAASQ,GAAIC,EAAKI,cAC5C7B,aAAaG,QAAQmB,EAAKH,KAAKW,UAAU,CACrCC,SAAU,O,CAIlB,GAAIN,EAAKO,iBAAkB,CACvBzB,KAAK0B,W,CAGT,IAAIC,EAAAT,IAAI,MAAJA,SAAI,SAAJA,EAAMU,YAAQ,MAAAD,SAAA,SAAAA,EAAEE,IAAK,CACrB7B,KAAK6B,KAAMC,EAAAZ,IAAI,MAAJA,SAAI,SAAJA,EAAMU,YAAQ,MAAAE,SAAA,SAAAA,EAAED,G,CAG/B7B,KAAK+B,UAAY,CACbC,QAASd,IAAI,MAAJA,SAAI,SAAJA,EAAMU,SAASI,QACxBC,OAAQf,IAAI,MAAJA,SAAI,SAAJA,EAAMU,SAASK,OACvBC,WAAWC,EAAAjB,IAAI,MAAJA,SAAI,SAAJA,EAAMU,YAAQ,MAAAO,SAAA,SAAAA,EAAED,WAG/B5B,QAAQC,IAAI,OAAQW,GAEpBlB,KAAKkB,KAAOA,C,CACd,MAAOkB,GACL3C,aAAa4C,WAAWtB,GACxBtB,aAAa4C,WAAWrC,KAAKS,SAASQ,G,CAG1CjB,KAAKsC,OAASC,EAAqBvC,KAAKS,SAASW,MAAMC,MAEvD,GAAIrB,KAAKsC,OAAOE,oBAAqB,CACjCxC,KAAKyC,OAAS,I,CAGlB,MAAMC,EAASC,SAASC,kBAAkB,eAC1CF,EAAOG,SAASC,IACZA,EAAMC,QAAU,KAAK,G,CAK7B,kBAAMC,G,QACFhD,KAAKiD,QAAU,KACf,IACI,MAAMvC,QAAaI,IAEnBR,QAAQC,IAAI,cAAeG,GAE3B,MAAMwC,EAAWC,EAAoBzC,EAAKwC,UAE1C,MAAME,EAA+B,CACjCC,IAAK,OACLnB,UAAWlC,KAAK+B,UAAUG,UAC1BF,SAASL,EAAA3B,KAAK+B,aAAS,MAAAJ,SAAA,SAAAA,EAAEK,QAAQsB,WACjCrB,QAAQH,EAAA9B,KAAK+B,aAAS,MAAAD,SAAA,SAAAA,EAAEG,OAAOqB,WAC/BC,WAAYvD,KAAKS,SAASQ,GAC1BuC,iBAAkBN,EAClB7B,KAAM,GACNoC,UAAWzD,KAAKS,SAASW,MAAMC,MAGnCrB,KAAK0D,YAAc1D,KAAKC,gBAAgB0D,iBAAiBP,E,CAC3D,MAAOhB,GACL9B,QAAQ8B,MAAM,0BAA2BA,E,SAEzCpC,KAAKiD,QAAU,YAETjD,KAAKQ,8B,EAKnB,UAAAoD,GACI,MAAMC,EAASpE,aAAaC,QAAQM,KAAKS,SAASQ,IAClD,QAAS4C,C,CAGb,SAAAC,GACI,MAAMD,EAASpE,aAAaC,QAAQM,KAAKS,SAASQ,IAElD,OAAO4C,EAASE,OAAOF,GAAQG,QAAQ,GAAGC,QAAQ,IAAK,MAAQ,OAAS,M,CAG5E,cAAMC,GACFC,OAAOC,SAASC,KAAOrE,KAAK6B,G,CAIxB,SAAAH,GAEJ,IAAKjC,aAAaC,QAAQ,iBAAkB,CACxCD,aAAa4C,WAAW,U,CAG5B7C,G,CAGJ,QAAAgC,GACI,MAAM8C,EAAS7E,aAAaC,QAAQsB,EAAsBhB,KAAKS,SAASQ,KAExE,MAAMC,EAAO,CACTM,SAAU,MACV+C,aAAc,OAGlB,GAAID,EAAQ,CACRtE,KAAK0D,MAAQ9C,KAAKC,MAAMyD,GACxBpD,EAAKM,SAAWxB,KAAK0D,MAAMlC,SAC3BN,EAAKqD,aAAe,I,CAGxB,OAAOrD,C,CAGX,OAAAsD,GACI,MAAM7E,EAAOF,aAAaC,QAAQ,WAElC,OAAOC,EAAOoE,OAAOpE,GAAQ,C,CAGjC,MAAA8E,G,MAEI,MAAMC,IAAe/C,EAAA3B,KAAKsC,UAAM,MAAAX,SAAA,SAAAA,EAAEgD,gBAAiB,WAEnD,MAAMC,EAAY5E,KAAKwB,WAEvB,MAAMqD,EAAuBlC,SAASmC,eAAe,yBAErD,GAAID,EAAsB,CACtBA,EAAqBE,iBAAiB,UAAUC,UAC5C1E,QAAQC,IAAI,gCAEZ0E,YAAWD,gBACDhF,KAAKgD,cAAc,GAC1B,IAAK,G,CAIhB,MAAMkC,EAAwBvC,SAASmC,eAAe,yBAEtD,GAAII,EAAuB,CACvBA,EAAsBH,iBAAiB,UAAUC,UAC7C1E,QAAQC,IAAI,gCACZ0E,YAAWD,gBACDhF,KAAKgD,cAAc,GAC1B,IAAK,G,CAIhB,OACImC,EAAA,qBAAApE,IAAA,2CAAmBkC,QAASjD,KAAKiD,SAC7BkC,EAAA,OAAApE,IAAA,2CAAKqE,MAAM,iBAAiBC,MAAOrF,KAAKyC,QACpC0C,EAAA,OAAApE,IAAA,2CAAKqE,MAAM,eAEPD,EAAA,KAAApE,IAAA,2CAAGqE,MAAM,cACLD,EAAA,OAAApE,IAAA,2CAAKuE,IAAKC,EAAOC,MAAO,KACvBxF,KAAKsC,OAAOqC,eAGbC,EAAUpD,UACN2D,EAAA,OAAApE,IAAA,4CACKf,KAAKyF,UACFN,EAAA,KAAApE,IAAA,2CAAGqE,MAAM,YAAYM,QAAS,IAAM1F,KAAKkE,YACpCyB,EAAQC,EAAE,WAS/BhB,EAAUpD,UAEN2D,EAAA,KAAApE,IAAA,2CAAGqE,MAAM,sBACJO,EAAQC,EAAE,iBAAkB,CAAElB,aAAcA,IAAe,IAAES,EAAA,UAAApE,IAAA,kDAAYf,KAAK8D,YAAW,MAMjGc,EAAUL,eAAiBK,EAAUpD,UAElC2D,EAAA,KAAApE,IAAA,2CAAGqE,MAAM,wBACJO,EAAQC,EAAE,UAAW,CAAElB,aAAcA,MAM7CE,EAAUL,cAEPY,EAAA,OAAApE,IAAA,2CAAKqE,MAAM,eACPD,EAAA,KAAApE,IAAA,2CAAGqE,MAAM,wBACJO,EAAQC,EAAE,UAAW,CAAElB,aAAcA,O","ignoreList":[]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as o,h as e}from"./p-8c362346.js";import{M as t}from"./p-ecc51430.js";const s="*{margin:0;padding:0;box-sizing:border-box}.phone{display:block;width:100%;height:24px;padding:6px 12px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:0px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);-webkit-transition:border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s}.phone-input-form{width:100%;height:48px;padding:13px 16px 13px 16px;border:1px solid #CCCCCC;}.crm-erro-msg{color:#E11D48;font-weight:500;margin-top:11px}";const i=s;const n=class{constructor(e){o(this,e);this.phone="";this.message="";this.initialValue=undefined;this.disabled=undefined}componentWillLoad(){this.phone=this.initialValue}formatPhone(o){const e=o.replace(/\D/g,"");const t=e.match(/^(\d{0,2})(\d{0,5})(\d{0,4})$/);if(!t)return o;const s=t[1]?`(${t[1]}`:"";const i=t[2]?`) ${t[2]}`:"";const n=t[3]?` ${t[3]}`:"";return`${s}${i}${n}`}handleInput(o){const e=o.target;this.phone=this.formatPhone(e.value);if(!this.validatePhoneNumber(e.value)){this.message=t}else{this.message=""}console.log("phone",this.phone)}validatePhoneNumber(o){if(o.length<15){return true}const e=/^\(\d{2}\) \d{5} \d{4}$/;return e.test(o)}async getPhone(){return this.phone}render(){return e("div",{key:"
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as o,h as e}from"./p-8c362346.js";import{M as t}from"./p-ecc51430.js";const s="*{margin:0;padding:0;box-sizing:border-box}.phone{display:block;width:100%;height:24px;padding:6px 12px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:0px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);-webkit-transition:border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s}.phone-input-form{width:100%;height:48px;padding:13px 16px 13px 16px;border:1px solid #CCCCCC;}.crm-erro-msg{color:#E11D48;font-weight:500;margin-top:11px}";const i=s;const n=class{constructor(e){o(this,e);this.phone="";this.message="";this.initialValue=undefined;this.disabled=undefined}componentWillLoad(){this.phone=this.initialValue}formatPhone(o){const e=o.replace(/\D/g,"");const t=e.match(/^(\d{0,2})(\d{0,5})(\d{0,4})$/);if(!t)return o;const s=t[1]?`(${t[1]}`:"";const i=t[2]?`) ${t[2]}`:"";const n=t[3]?` ${t[3]}`:"";return`${s}${i}${n}`}handleInput(o){const e=o.target;this.phone=this.formatPhone(e.value);if(!this.validatePhoneNumber(e.value)){this.message=t}else{this.message=""}console.log("phone",this.phone)}validatePhoneNumber(o){if(o.length<15){return true}const e=/^\(\d{2}\) \d{5} \d{4}$/;return e.test(o)}async getPhone(){return this.phone}render(){return e("div",{key:"f617fe62408f795a8965b05a74818facd556369c"},e("input",{key:"8e4aba618b13bbdb59cb24685f7b48c84e150e8c",disabled:this.disabled,id:"phone",type:"text",class:"phone-input-form",value:this.phone,onInput:o=>this.handleInput(o),placeholder:"(99) 99999 9999"}),e("p",{key:"a30740d818178f1bc715cb87d3dadd15f38de02c",class:"crm-erro-msg"},this.message))}};n.style=i;export{n as phone_input_mask};
|
2
|
+
//# sourceMappingURL=p-b5e9a5ea.entry.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as e,h as i,H as t}from"./p-8c362346.js";import{i as n}from"./p-c53241bf.js";import{U as o}from"./p-6b783d44.js";import{d as a,a as r}from"./p-af3ba015.js";import{p as d}from"./p-239cdde1.js";const c="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPg0KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0xMiAxNy43NUMxMi40MTQyIDE3Ljc1IDEyLjc1IDE3LjQxNDIgMTIuNzUgMTdWMTFDMTIuNzUgMTAuNTg1OCAxMi40MTQyIDEwLjI1IDEyIDEwLjI1QzExLjU4NTggMTAuMjUgMTEuMjUgMTAuNTg1OCAxMS4yNSAxMVYxN0MxMS4yNSAxNy40MTQyIDExLjU4NTggMTcuNzUgMTIgMTcuNzVaIiBmaWxsPSIjMUMyNzRDIi8+DQo8cGF0aCBkPSJNMTIgN0MxMi41NTIzIDcgMTMgNy40NDc3MiAxMyA4QzEzIDguNTUyMjggMTIuNTUyMyA5IDEyIDlDMTEuNDQ3NyA5IDExIDguNTUyMjggMTEgOEMxMSA3LjQ0NzcyIDExLjQ0NzcgNyAxMiA3WiIgZmlsbD0iIzFDMjc0QyIvPg0KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xLjI1IDEyQzEuMjUgNi4wNjI5NCA2LjA2Mjk0IDEuMjUgMTIgMS4yNUMxNy45MzcxIDEuMjUgMjIuNzUgNi4wNjI5NCAyMi43NSAxMkMyMi43NSAxNy45MzcxIDE3LjkzNzEgMjIuNzUgMTIgMjIuNzVDNi4wNjI5NCAyMi43NSAxLjI1IDE3LjkzNzEgMS4yNSAxMlpNMTIgMi43NUM2Ljg5MTM3IDIuNzUgMi43NSA2Ljg5MTM3IDIuNzUgMTJDMi43NSAxNy4xMDg2IDYuODkxMzcgMjEuMjUgMTIgMjEuMjVDMTcuMTA4NiAyMS4yNSAyMS4yNSAxNy4xMDg2IDIxLjI1IDEyQzIxLjI1IDYuODkxMzcgMTcuMTA4NiAyLjc1IDEyIDIuNzVaIiBmaWxsPSIjMUMyNzRDIi8+DQo8L3N2Zz4=";const s=".crm-tooltip-container {\r\n display: flex;\r\n\r\n & img {\r\n width: 16px;\r\n margin-left: 3px;\r\n position: relative;\r\n }\r\n}\r\n\r\n.crm-tooltip {\r\n position: relative;\r\n display: inline-block;\r\n}\r\n\r\n.crm-tooltip .tooltiptext {\r\n visibility: hidden;\r\n background-color: black;\r\n color: #fff;\r\n text-align: center;\r\n padding: 8px 12px;\r\n border-radius: 0px;\r\n position: absolute;\r\n z-index: 1;\r\n min-width: 271px;\r\n top: 100%;\r\n left: 50%;\r\n margin-left: -238px;\r\n}\r\n\r\n@container (max-width: 410px) {\r\n .crm-tooltip .tooltiptext {\r\n margin-left: -14px;\r\n }\r\n\r\n .crm-tooltip #crm-role-description {\r\n margin-left: -151px;\r\n }\r\n}\r\n\r\n@container (max-width: 250px) {\r\n .crm-tooltip .tooltiptext {\r\n margin-left: -201px;\r\n }\r\n}\r\n\r\n.crm-tooltip:hover .tooltiptext {\r\n visibility: visible;\r\n}";const l=s;const p=class{constructor(i){e(this,i);this.text=undefined;this.identity=undefined}render(){return i("div",{key:"a7cd8299397c2efe618bfada43a6c6dc7ba7d016",class:"crm-tooltip-container crm-tooltip"},i("img",{key:"053e069c05c12fa1f9af68e49e67b4f38ce63671",src:c}),i("span",{key:"3be415d01107f3250720a0c4fb13ba2cde5d4585",id:this.identity,class:"tooltiptext"},this.text))}};p.style=l;const h=":host{--text-color:#6D6D5F}.giftback-container{display:flex;flex-direction:column;gap:14px}h3{margin-bottom:8px;color:#333}.container-description{display:flex;align-items:center;gap:5px;margin:0 0 10px 0}.container-description p{font-weight:400;margin:0px}p{color:#000}.value-display h2{color:#6D6D5F;margin:16px 0}input[type='range']{width:100%;margin:12px 0;-webkit-appearance:none;background:#ddd;height:4px;border-radius:4px;outline:none;padding:3px 0px 3px 3px}input[type=\"range\"]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:rgb(109, 109, 95);border-radius:50%;cursor:pointer}.options{margin:0px 0;display:flex;gap:10px;flex-direction:column}.options label{display:flex;margin:0px 0;color:#333;align-items:center}.options input[type='radio']{margin-right:8px;height:16px;width:16px}.options input[type='radio']{appearance:none;-webkit-appearance:none;margin-right:8px;width:16px;height:16px;border:2px solid #ddd;border-radius:50%;background-color:#fff;cursor:pointer;transition:all 0.3s;padding:0px}.options input[type='radio']:checked{border-color:#000;background-color:#FAFAFA;border:4px solid #000}.info-box{background-color:#f9f9f9;border:1px solid #e0e0e0;border-radius:4px;padding:8px;color:#262626;line-height:20px}.info-icon{cursor:pointer;color:#888}h3{margin-bottom:8px;color:#333}.slider-wrapper{position:relative;margin:21px 0px 0px 0px}.slider{width:100%;-webkit-appearance:none;background:#ddd;height:4px;border-radius:2px;outline:none}.slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;background:var(--text-color);border-radius:50%;cursor:pointer}.slider-value{position:absolute;top:-30px;font-weight:700;color:var(--text-color);transform:translateX(-50%);white-space:nowrap;}.options-option{display:flex}";const f=h;const b=class{constructor(i){e(this,i);this.usedValue=0;this.selectedOption="none";this.cartId=undefined;this.loading=false;this.bonus={totalBonus:0,cartId:"",minimumPurchase:0,bonusBalance:0,calculatedValue:0,firstValidityDate:"",totalValue:0};this.reserve=undefined;this.cancel=undefined;this.config=undefined;this.infoBonus=undefined;this.storeName=undefined;this.sliderPosition=0;this.sliderValuePosition=0;this.loadingTime=false}changedBonus(){this.updateBonus()}updateBonus(){this.usedValue=this.bonus.bonusBalance;this.buildPositionSlider(0,this.bonus.totalBonus)}componentWillLoad(){this.updateBonus();this.selectedOption=localStorage.getItem(o)}handleSliderChange(e){const i=e.target;this.usedValue=parseFloat(i.value);this.buildPositionSlider(parseFloat(i.min),parseFloat(i.max))}componentDidLoad(){var e;if(this.bonus){this._refIinputRange.value=(e=this.bonus)===null||e===void 0?void 0:e.bonusBalance.toString()}}buildPositionSlider(e,i){const t=i*.1;const n=(this.usedValue-e)/(i-e)*100;this.sliderPosition=n;this.sliderValuePosition=n+(this.usedValue<=t?10:0)}async handleOptionChange(e){this.selectedOption=e;localStorage.setItem(o,e);await d(this.storeName,this.cartId,Object.assign(Object.assign({},this.infoBonus.metadata),{createdAt:null}));switch(this.selectedOption){case"use":await this.reserve(this.usedValue);break;case"dontUse":await this.cancel();break}}showTime(){if(!this.infoBonus)return false;return!this.infoBonus.isExpired()}getTime(){var e,i;const t=new Date((i=(e=this.infoBonus)===null||e===void 0?void 0:e.metadata)===null||i===void 0?void 0:i.createdAt);const n=new Date(t);n.setMinutes(n.getMinutes()+6);return{createdAt:t,expiration:n}}async downtime(){await d(this.storeName,this.bonus.cartId,{createdAt:null})}render(){var e,t,o,d,c,s,l;console.log("this.bonus",this.bonus);const p=this.bonus.minimumPurchase-this.bonus.totalValue;const h=n.t("giftDescription",{amount:`${(t=(e=this.bonus)===null||e===void 0?void 0:e.totalBonus)===null||t===void 0?void 0:t.toFixed(2).replace(".",",")}`,custom_name:"Giftback"});const f=a(p);return i("div",{key:"4bcf846d00500653eea2e11d0926c7bb2f9862ee",class:"giftback-container"},i("div",{key:"75b1eb41e2fa9ecdb9f1fb5fe3214def7900395e",class:"container-description"},i("p",{key:"a839e4e5b909d92d34afe95dec6af7bbf07f7784",innerHTML:h}),i("crm-tooltip",{key:"f3a3532fb2d0c3c93e66c50440633806bec274f3",identity:"crm-role-description",text:n.t("labelUseGiftback",{minimumPurchase:this.bonus.minimumPurchase,expírationDate:r(this.bonus.firstValidityDate)})})),i("div",{key:"018e1958421a91978cbc334e1ebbd1c352d2bbcb",class:"slider-wrapper"},i("div",{key:"a58ea697eb799cc8e3f4c99cb65004d438438436",class:"slider-value",style:{left:`calc(${this.sliderValuePosition}% - 20px)`}},"R$ ",this.usedValue.toFixed(2).replace(".",",")),i("input",{key:"936a6089a5c1d3bb298ab6169a2e6c0e574f13ff",ref:e=>this._refIinputRange=e,id:"position_value_id",disabled:true,type:"range",min:"0",max:this.bonus.totalBonus,value:this.usedValue,class:"slider",step:"0.01",onInput:e=>this.handleSliderChange(e),style:{background:`linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`}})),f.isComplete&&i("p",{key:"c733ef48f2053407cf475a40a31c2f512f992af5"},n.t("maxAmount")),!f.isComplete&&i("div",{key:"b23c04f456137bd5292ad6d0d15f867ef4e1937b",class:"container-description"},i("p",{key:"5403eec3e8cf43be02c8919afd970415f403436a"},"Adicione ",i("strong",{key:"63ced7e61548d9dff756d42718cc021cb1c6579e"},"R$ ",p<0?"0,00":p.toFixed(2).replace(".",","))," ao carrinho para atingir o valor máximo!"),i("crm-tooltip",{key:"0e50390c5a360ddd5fac57f3893c8eb868a59d2e",identity:"crm-max-description",text:n.t("labelamountPartial")})),i("div",{key:"8944a38e460336d365ee86d6b5432ff117259def",class:"options"},i("div",{key:"6b45b9405f12960a86c2bf8530c8faee6bb794c6",class:"options-option"},i("input",{key:"3784f03b368795b91ec851e88faf74ab0c7554e1",disabled:this.showTime(),type:"radio",name:"giftbackOption",value:"use",checked:this.selectedOption==="use",onChange:()=>this.handleOptionChange("use")}),i("p",{key:"6ae30cd09b4dcdeb585c4367b86f2acc87cc6351"},"Usar o meu ",(o=this.config)===null||o===void 0?void 0:o.giftbackTitle)),i("div",{key:"707b374efa9edade67eed23256c37b977ae0b25e",class:"options-option"},i("input",{key:"86e742c7a57ff8834ca6e55f0df86440f1dd4aeb",disabled:this.showTime(),type:"radio",name:"giftbackOption",value:"dontUse",checked:this.selectedOption==="dontUse",onChange:()=>this.handleOptionChange("dontUse")}),i("p",{key:"20c90534b653987dbbea48feb5eaa9c117a3ac63"},"Não usar o meu ",(d=this.config)===null||d===void 0?void 0:d.giftbackTitle))),this.showTime()&&i("div",{key:"48beb877bc0e65735e1502d5d8529309bb2bb0e3",class:"info-box"},"Após ",i("countdown-timer",{key:"e25188ba2355f191cb2388e4b1af18d06a98bef3",dataCriacao:new Date((s=(c=this.infoBonus)===null||c===void 0?void 0:c.metadata)===null||s===void 0?void 0:s.createdAt).toString(),downtime:()=>{window.location.reload()}}),", você poderá alterar sua escolha de usar ou não o Giftback."),!((l=this===null||this===void 0?void 0:this.infoBonus)===null||l===void 0?void 0:l.isBonusProcessed)&&i("div",{key:"c206125aac6e9f66087744bfc4aece6310f982cd",class:"info-box"},"O Giftback será aplicado na próxima etapa."))}static get watchers(){return{bonus:["changedBonus"]}}};b.style=f;const g="*{margin:0;padding:0;box-sizing:border-box}:host{--crmfont-sizebodymd:14px;--crmline-heightbodymd:20px;--crmletter-spacingtitle-md:0px}.container-message{font-weight:400;line-height:var(--crmline-heightbodymd);letter-spacing:var(--crmletter-spacingtitle-md);text-align:left;text-underline-position:from-font;text-decoration-skip-ink:none}.crm-container-form{display:flex;flex-direction:column;justify-content:space-around;height:auto;padding:20px 24px 20px 24px;border:1px solid #CCCC;writing-mode:horizontal-tb;gap:16px;border-top:1px solid #ccc !important;border-bottom:1px solid #ccc !important}.crm-phone-form{display:flex;flex-direction:column;height:100%;gap:16px}.crm-subtitle{font-size:.875rem;line-height:1.25rem}.crm-title{font-weight:700;line-height:20px;color:#262626;}.crm-message-info{color:#619013;font-weight:500;}.crm-message-error{color:#E11D48;font-weight:500;}";const u=g;const x=class{constructor(i){e(this,i);this.value=undefined;this.loading=undefined;this.handlerSubmit=undefined;this.config=undefined}async handlePhone(){const e=await this.phoneInputMask.getPhone();await this.handlerSubmit(e)}render(){var e;return i(t,{key:"5f92b6c62da3cdf6de3c302488d81876fa52de1d",class:"crm-phone-form"},i("p",{key:"d5ea282e1945c55fb7212e7842e34aeab526248e",class:"crm-subtitle"},"Digite o seu celular para verificar se há desconto disponível nessa compra:"),i("phone-input-mask",{key:"9584729c3396af7f3e70ef375174bfd33b9779d8",initialValue:this.value,ref:e=>this.phoneInputMask=e}),i("crm-button",{key:"7cea0bc45f4e7967b8a0404a51d960ebd00334b9",txtBtn:((e=this.config)===null||e===void 0?void 0:e.btnApplyBonusLabel)||"Avançar",loading:this.loading,handleClick:()=>this.handlePhone()}))}};x.style=u;const m=":host{display:block}.form-container-pin{display:flex;flex-direction:column;align-items:center}.pin-container{display:flex;justify-content:start;gap:10px}.pin-container input{width:100%;height:48px;text-align:center;border:1px solid #ccc;border-radius:5px}button{padding:10px 20px;background-color:#ddd;border:none;border-radius:5px;cursor:pointer}.success{color:green;margin-top:10px}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;border-radius:10px;padding:15px;min-height:30px;min-width:120px;cursor:pointer}.button-cancel{top:50%;background-color:#ffffff;color:#1e1c1c;border:1px solid gray;border-radius:10px;padding:10px;min-height:30px;min-width:120px;cursor:pointer}.crm-description{width:100%;display:flex;gap:9px;flex-wrap:wrap}.crm-description a{font-weight:bold;cursor:pointer;text-decoration:underline}.crm-description div{display:flex;gap:5px}";const y=m;const k="*{margin:0;padding:0;box-sizing:border-box}:host{--crmfont-sizebodymd:14px;--crmline-heightbodymd:20px;--crmletter-spacingtitle-md:0px}.container-message{font-weight:400;line-height:var(--crmline-heightbodymd);letter-spacing:var(--crmletter-spacingtitle-md);text-align:left;text-underline-position:from-font;text-decoration-skip-ink:none}.crm-container-form{display:flex;flex-direction:column;justify-content:space-around;height:auto;padding:20px 24px 20px 24px;border:1px solid #CCCC;writing-mode:horizontal-tb;gap:16px;border-top:1px solid #ccc !important;border-bottom:1px solid #ccc !important}.crm-phone-form{display:flex;flex-direction:column;height:100%;gap:16px}.crm-subtitle{font-size:.875rem;line-height:1.25rem}.crm-title{font-weight:700;line-height:20px;color:#262626;}.crm-message-info{color:#619013;font-weight:500;}.crm-message-error{color:#E11D48;font-weight:500;}";const M=k;const I=class{constructor(i){e(this,i);this.validate=undefined;this.cancel=undefined;this.resend=undefined;this.sent=undefined;this.loading=false;this.phone=undefined;this.config=undefined;this.pin=["","","",""];this.isVerified=false;this.canResend=false}componentWillLoad(){this.canResend=false}handleInput(e,i){const t=e.target;const n=t.value.slice(0,1);this.pin[i]=n;if(n&&i<this.pin.length-1){const e=t.nextElementSibling;e===null||e===void 0?void 0:e.focus()}this.pin=[...this.pin]}validatePin(){localStorage.removeItem("bc:resend");this.validate(this.pin.join(""))}verifyPin(){const e=this.pin.join("");if(e==="9999"){this.isVerified=true}}handleTimeout(){localStorage.removeItem("bc:resend");this.canResend=true}async handleResend(){await this.resend();this.canResend=false;this.pin=["","","",""];localStorage.removeItem("bc:resend")}buildTime(){const e=localStorage.getItem("bc:resend");if(e){return e}const i=new Date;i.setSeconds(i.getSeconds()+30);localStorage.setItem("bc:resend",i.toString());return i.toString()}render(){var e;return i("div",{key:"6a62eca90116a8f120ed997e8db8ede58f2f0521",class:"crm-phone-form"},i("label",{key:"163b391876b598e8a170196f3c53a77c38f67d91",class:"crm-subtitle"},n.t("pin-sutitle")," ",i("strong",{key:"3d0e5616b335c5c1a122b18ab54fd275f0eb1cbf"},"+55 ",this.phone)),i("div",{key:"09fb7e7f22c6e54d6e01e91398c14f94aa40606a",class:"pin-container"},this.pin.map(((e,t)=>i("input",{type:"text",maxLength:1,value:this.pin[t],onInput:e=>this.handleInput(e,t)})))),i("slot",{key:"4375d20d7d691e2e439dfe25a3df00aeb73a7d2a"}),i("p",{key:"53b3e46d111809d87436a7a593a91ea9aafd46d0",class:"crm-description"}," Não recebeu?",!this.canResend&&i("label",{key:"bc71ebe6c29f831123e12ba7dff408be93465101"}," Reenviar em",i("countdown-timer",{key:"d7e831b7deb76172c7064eee7ad1c407a5f492d7",minutos:0,segundos:30,dataCriacao:this.buildTime(),downtime:()=>this.handleTimeout()})," "),this.canResend&&i("div",{key:"33d6c68c2959820053bb670df0d3be40484be5d6"},i("a",{key:"28de82c465773793dd291ee92f3ed39a62ac3cb4",onClick:()=>this.handleResend()},"Reenviar"),i("a",{key:"0883846b1a87fc0a73233c92b4da7698d7df7fbd",onClick:()=>this.cancel()},"Trocar número"))),i("crm-button",{key:"8749dba1ff171c83830646007d7f5823a7c33c1f",txtBtn:((e=this.config)===null||e===void 0?void 0:e.btnApplyBonusLabel)||"Avançar",loading:this.loading,handleClick:()=>this.validatePin()}))}};I.style=y+M;export{p as crm_tooltip,b as giftback_info,x as phone_form,I as pin_form};
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as e,h as i,H as t}from"./p-8c362346.js";import{i as n}from"./p-c53241bf.js";import{U as o}from"./p-c2ecfee1.js";import{d as a,a as r}from"./p-af3ba015.js";import{p as d}from"./p-e68d4e85.js";const c="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPg0KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0xMiAxNy43NUMxMi40MTQyIDE3Ljc1IDEyLjc1IDE3LjQxNDIgMTIuNzUgMTdWMTFDMTIuNzUgMTAuNTg1OCAxMi40MTQyIDEwLjI1IDEyIDEwLjI1QzExLjU4NTggMTAuMjUgMTEuMjUgMTAuNTg1OCAxMS4yNSAxMVYxN0MxMS4yNSAxNy40MTQyIDExLjU4NTggMTcuNzUgMTIgMTcuNzVaIiBmaWxsPSIjMUMyNzRDIi8+DQo8cGF0aCBkPSJNMTIgN0MxMi41NTIzIDcgMTMgNy40NDc3MiAxMyA4QzEzIDguNTUyMjggMTIuNTUyMyA5IDEyIDlDMTEuNDQ3NyA5IDExIDguNTUyMjggMTEgOEMxMSA3LjQ0NzcyIDExLjQ0NzcgNyAxMiA3WiIgZmlsbD0iIzFDMjc0QyIvPg0KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xLjI1IDEyQzEuMjUgNi4wNjI5NCA2LjA2Mjk0IDEuMjUgMTIgMS4yNUMxNy45MzcxIDEuMjUgMjIuNzUgNi4wNjI5NCAyMi43NSAxMkMyMi43NSAxNy45MzcxIDE3LjkzNzEgMjIuNzUgMTIgMjIuNzVDNi4wNjI5NCAyMi43NSAxLjI1IDE3LjkzNzEgMS4yNSAxMlpNMTIgMi43NUM2Ljg5MTM3IDIuNzUgMi43NSA2Ljg5MTM3IDIuNzUgMTJDMi43NSAxNy4xMDg2IDYuODkxMzcgMjEuMjUgMTIgMjEuMjVDMTcuMTA4NiAyMS4yNSAyMS4yNSAxNy4xMDg2IDIxLjI1IDEyQzIxLjI1IDYuODkxMzcgMTcuMTA4NiAyLjc1IDEyIDIuNzVaIiBmaWxsPSIjMUMyNzRDIi8+DQo8L3N2Zz4=";const s=".crm-tooltip-container {\r\n display: flex;\r\n\r\n & img {\r\n width: 16px;\r\n margin-left: 3px;\r\n position: relative;\r\n }\r\n}\r\n\r\n.crm-tooltip {\r\n position: relative;\r\n display: inline-block;\r\n}\r\n\r\n.crm-tooltip .tooltiptext {\r\n visibility: hidden;\r\n background-color: black;\r\n color: #fff;\r\n text-align: center;\r\n padding: 8px 12px;\r\n border-radius: 0px;\r\n position: absolute;\r\n z-index: 1;\r\n min-width: 271px;\r\n top: 100%;\r\n left: 50%;\r\n margin-left: -238px;\r\n}\r\n\r\n@container (max-width: 410px) {\r\n .crm-tooltip .tooltiptext {\r\n margin-left: -14px;\r\n }\r\n\r\n .crm-tooltip #crm-role-description {\r\n margin-left: -151px;\r\n }\r\n}\r\n\r\n@container (max-width: 250px) {\r\n .crm-tooltip .tooltiptext {\r\n margin-left: -201px;\r\n }\r\n}\r\n\r\n.crm-tooltip:hover .tooltiptext {\r\n visibility: visible;\r\n}";const l=s;const p=class{constructor(i){e(this,i);this.text=undefined;this.identity=undefined}render(){return i("div",{key:"61f4dc809d2fdba6851a4678f73f7d38d54a48ed",class:"crm-tooltip-container crm-tooltip"},i("img",{key:"7d47a752d22df6c6b28a11558adc8f1b2a8de873",src:c}),i("span",{key:"a21e76673ab8ebc0816c7bf9d37474a0d78dd646",id:this.identity,class:"tooltiptext"},this.text))}};p.style=l;const h=":host{--text-color:#6D6D5F}.giftback-container{display:flex;flex-direction:column;gap:14px}h3{margin-bottom:8px;color:#333}.container-description{display:flex;align-items:center;gap:5px;margin:0 0 10px 0}.container-description p{font-weight:400;margin:0px}p{color:#000}.value-display h2{color:#6D6D5F;margin:16px 0}input[type='range']{width:100%;margin:12px 0;-webkit-appearance:none;background:#ddd;height:4px;border-radius:4px;outline:none;padding:3px 0px 3px 3px}input[type=\"range\"]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:rgb(109, 109, 95);border-radius:50%;cursor:pointer}.options{margin:0px 0;display:flex;gap:10px;flex-direction:column}.options label{display:flex;margin:0px 0;color:#333;align-items:center}.options input[type='radio']{margin-right:8px;height:16px;width:16px}.options input[type='radio']{appearance:none;-webkit-appearance:none;margin-right:8px;width:16px;height:16px;border:2px solid #ddd;border-radius:50%;background-color:#fff;cursor:pointer;transition:all 0.3s;padding:0px}.options input[type='radio']:checked{border-color:#000;background-color:#FAFAFA;border:4px solid #000}.info-box{background-color:#f9f9f9;border:1px solid #e0e0e0;border-radius:4px;padding:8px;color:#262626;line-height:20px}.info-icon{cursor:pointer;color:#888}h3{margin-bottom:8px;color:#333}.slider-wrapper{position:relative;margin:21px 0px 0px 0px}.slider{width:100%;-webkit-appearance:none;background:#ddd;height:4px;border-radius:2px;outline:none}.slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;background:var(--text-color);border-radius:50%;cursor:pointer}.slider-value{position:absolute;top:-30px;font-weight:700;color:var(--text-color);transform:translateX(-50%);white-space:nowrap;}.options-option{display:flex}";const f=h;const b=class{constructor(i){e(this,i);this.usedValue=0;this.selectedOption="none";this.cartId=undefined;this.loading=false;this.bonus={totalBonus:0,cartId:"",minimumPurchase:0,bonusBalance:0,calculatedValue:0,firstValidityDate:"",totalValue:0};this.reserve=undefined;this.cancel=undefined;this.config=undefined;this.infoBonus=undefined;this.storeName=undefined;this.sliderPosition=0;this.sliderValuePosition=0;this.loadingTime=false}changedBonus(){this.updateBonus()}updateBonus(){this.usedValue=this.bonus.bonusBalance;this.buildPositionSlider(0,this.bonus.totalBonus)}componentWillLoad(){this.updateBonus();this.selectedOption=localStorage.getItem(o)}handleSliderChange(e){const i=e.target;this.usedValue=parseFloat(i.value);this.buildPositionSlider(parseFloat(i.min),parseFloat(i.max))}componentDidLoad(){var e;if(this.bonus){this._refIinputRange.value=(e=this.bonus)===null||e===void 0?void 0:e.bonusBalance.toString()}}buildPositionSlider(e,i){const t=i*.1;const n=(this.usedValue-e)/(i-e)*100;this.sliderPosition=n;this.sliderValuePosition=n+(this.usedValue<=t?10:0)}async handleOptionChange(e){this.selectedOption=e;localStorage.setItem(o,e);await d(this.storeName,this.cartId,Object.assign(Object.assign({},this.infoBonus.metadata),{createdAt:null}));switch(this.selectedOption){case"use":await this.reserve(this.usedValue);break;case"dontUse":await this.cancel();break}}showTime(){if(!this.infoBonus)return false;return!this.infoBonus.isExpired()}getTime(){var e,i;const t=new Date((i=(e=this.infoBonus)===null||e===void 0?void 0:e.metadata)===null||i===void 0?void 0:i.createdAt);const n=new Date(t);n.setMinutes(n.getMinutes()+6);return{createdAt:t,expiration:n}}async downtime(){await d(this.storeName,this.bonus.cartId,{createdAt:null})}render(){var e,t,o,d,c,s,l;console.log("this.bonus",this.bonus);const p=this.bonus.minimumPurchase-this.bonus.totalValue;const h=n.t("giftDescription",{amount:`${(t=(e=this.bonus)===null||e===void 0?void 0:e.totalBonus)===null||t===void 0?void 0:t.toFixed(2).replace(".",",")}`,custom_name:"Giftback"});const f=a(p);return i("div",{key:"4bcf846d00500653eea2e11d0926c7bb2f9862ee",class:"giftback-container"},i("div",{key:"75b1eb41e2fa9ecdb9f1fb5fe3214def7900395e",class:"container-description"},i("p",{key:"a839e4e5b909d92d34afe95dec6af7bbf07f7784",innerHTML:h}),i("crm-tooltip",{key:"f3a3532fb2d0c3c93e66c50440633806bec274f3",identity:"crm-role-description",text:n.t("labelUseGiftback",{minimumPurchase:this.bonus.minimumPurchase,expírationDate:r(this.bonus.firstValidityDate)})})),i("div",{key:"018e1958421a91978cbc334e1ebbd1c352d2bbcb",class:"slider-wrapper"},i("div",{key:"a58ea697eb799cc8e3f4c99cb65004d438438436",class:"slider-value",style:{left:`calc(${this.sliderValuePosition}% - 20px)`}},"R$ ",this.usedValue.toFixed(2).replace(".",",")),i("input",{key:"936a6089a5c1d3bb298ab6169a2e6c0e574f13ff",ref:e=>this._refIinputRange=e,id:"position_value_id",disabled:true,type:"range",min:"0",max:this.bonus.totalBonus,value:this.usedValue,class:"slider",step:"0.01",onInput:e=>this.handleSliderChange(e),style:{background:`linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`}})),f.isComplete&&i("p",{key:"c733ef48f2053407cf475a40a31c2f512f992af5"},n.t("maxAmount")),!f.isComplete&&i("div",{key:"b23c04f456137bd5292ad6d0d15f867ef4e1937b",class:"container-description"},i("p",{key:"5403eec3e8cf43be02c8919afd970415f403436a"},"Adicione ",i("strong",{key:"63ced7e61548d9dff756d42718cc021cb1c6579e"},"R$ ",p<0?"0,00":p.toFixed(2).replace(".",","))," ao carrinho para atingir o valor máximo!"),i("crm-tooltip",{key:"0e50390c5a360ddd5fac57f3893c8eb868a59d2e",identity:"crm-max-description",text:n.t("labelamountPartial")})),i("div",{key:"8944a38e460336d365ee86d6b5432ff117259def",class:"options"},i("div",{key:"6b45b9405f12960a86c2bf8530c8faee6bb794c6",class:"options-option"},i("input",{key:"3784f03b368795b91ec851e88faf74ab0c7554e1",disabled:this.showTime(),type:"radio",name:"giftbackOption",value:"use",checked:this.selectedOption==="use",onChange:()=>this.handleOptionChange("use")}),i("p",{key:"6ae30cd09b4dcdeb585c4367b86f2acc87cc6351"},"Usar o meu ",(o=this.config)===null||o===void 0?void 0:o.giftbackTitle)),i("div",{key:"707b374efa9edade67eed23256c37b977ae0b25e",class:"options-option"},i("input",{key:"86e742c7a57ff8834ca6e55f0df86440f1dd4aeb",disabled:this.showTime(),type:"radio",name:"giftbackOption",value:"dontUse",checked:this.selectedOption==="dontUse",onChange:()=>this.handleOptionChange("dontUse")}),i("p",{key:"20c90534b653987dbbea48feb5eaa9c117a3ac63"},"Não usar o meu ",(d=this.config)===null||d===void 0?void 0:d.giftbackTitle))),this.showTime()&&i("div",{key:"48beb877bc0e65735e1502d5d8529309bb2bb0e3",class:"info-box"},"Após ",i("countdown-timer",{key:"e25188ba2355f191cb2388e4b1af18d06a98bef3",dataCriacao:new Date((s=(c=this.infoBonus)===null||c===void 0?void 0:c.metadata)===null||s===void 0?void 0:s.createdAt).toString(),downtime:()=>{window.location.reload()}}),", você poderá alterar sua escolha de usar ou não o Giftback."),!((l=this===null||this===void 0?void 0:this.infoBonus)===null||l===void 0?void 0:l.isBonusProcessed)&&i("div",{key:"c206125aac6e9f66087744bfc4aece6310f982cd",class:"info-box"},"O Giftback será aplicado na próxima etapa."))}static get watchers(){return{bonus:["changedBonus"]}}};b.style=f;const g="*{margin:0;padding:0;box-sizing:border-box}:host{--crmfont-sizebodymd:14px;--crmline-heightbodymd:20px;--crmletter-spacingtitle-md:0px}.container-message{font-weight:400;line-height:var(--crmline-heightbodymd);letter-spacing:var(--crmletter-spacingtitle-md);text-align:left;text-underline-position:from-font;text-decoration-skip-ink:none}.crm-container-form{display:flex;flex-direction:column;justify-content:space-around;height:auto;padding:20px 24px 20px 24px;border:1px solid #CCCC;writing-mode:horizontal-tb;gap:16px;border-top:1px solid #ccc !important;border-bottom:1px solid #ccc !important}.crm-phone-form{display:flex;flex-direction:column;height:100%;gap:16px}.crm-subtitle{font-size:.875rem;line-height:1.25rem}.crm-title{font-weight:700;line-height:20px;color:#262626;}.crm-message-info{color:#619013;font-weight:500;}.crm-message-error{color:#E11D48;font-weight:500;}";const u=g;const x=class{constructor(i){e(this,i);this.value=undefined;this.loading=undefined;this.handlerSubmit=undefined;this.config=undefined}async handlePhone(){const e=await this.phoneInputMask.getPhone();await this.handlerSubmit(e)}render(){var e;return i(t,{key:"5f92b6c62da3cdf6de3c302488d81876fa52de1d",class:"crm-phone-form"},i("p",{key:"d5ea282e1945c55fb7212e7842e34aeab526248e",class:"crm-subtitle"},"Digite o seu celular para verificar se há desconto disponível nessa compra:"),i("phone-input-mask",{key:"9584729c3396af7f3e70ef375174bfd33b9779d8",initialValue:this.value,ref:e=>this.phoneInputMask=e}),i("crm-button",{key:"7cea0bc45f4e7967b8a0404a51d960ebd00334b9",txtBtn:((e=this.config)===null||e===void 0?void 0:e.btnApplyBonusLabel)||"Avançar",loading:this.loading,handleClick:()=>this.handlePhone()}))}};x.style=u;const m=":host{display:block}.form-container-pin{display:flex;flex-direction:column;align-items:center}.pin-container{display:flex;justify-content:start;gap:10px}.pin-container input{width:100%;height:48px;text-align:center;border:1px solid #ccc;border-radius:5px}button{padding:10px 20px;background-color:#ddd;border:none;border-radius:5px;cursor:pointer}.success{color:green;margin-top:10px}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;border-radius:10px;padding:15px;min-height:30px;min-width:120px;cursor:pointer}.button-cancel{top:50%;background-color:#ffffff;color:#1e1c1c;border:1px solid gray;border-radius:10px;padding:10px;min-height:30px;min-width:120px;cursor:pointer}.crm-description{width:100%;display:flex;gap:9px;flex-wrap:wrap}.crm-description a{font-weight:bold;cursor:pointer;text-decoration:underline}.crm-description div{display:flex;gap:5px}";const y=m;const k="*{margin:0;padding:0;box-sizing:border-box}:host{--crmfont-sizebodymd:14px;--crmline-heightbodymd:20px;--crmletter-spacingtitle-md:0px}.container-message{font-weight:400;line-height:var(--crmline-heightbodymd);letter-spacing:var(--crmletter-spacingtitle-md);text-align:left;text-underline-position:from-font;text-decoration-skip-ink:none}.crm-container-form{display:flex;flex-direction:column;justify-content:space-around;height:auto;padding:20px 24px 20px 24px;border:1px solid #CCCC;writing-mode:horizontal-tb;gap:16px;border-top:1px solid #ccc !important;border-bottom:1px solid #ccc !important}.crm-phone-form{display:flex;flex-direction:column;height:100%;gap:16px}.crm-subtitle{font-size:.875rem;line-height:1.25rem}.crm-title{font-weight:700;line-height:20px;color:#262626;}.crm-message-info{color:#619013;font-weight:500;}.crm-message-error{color:#E11D48;font-weight:500;}";const M=k;const I=class{constructor(i){e(this,i);this.validate=undefined;this.cancel=undefined;this.resend=undefined;this.sent=undefined;this.loading=false;this.phone=undefined;this.config=undefined;this.pin=["","","",""];this.isVerified=false;this.canResend=false}componentWillLoad(){this.canResend=false}handleInput(e,i){const t=e.target;const n=t.value.slice(0,1);this.pin[i]=n;if(n&&i<this.pin.length-1){const e=t.nextElementSibling;e===null||e===void 0?void 0:e.focus()}this.pin=[...this.pin]}validatePin(){localStorage.removeItem("bc:resend");this.validate(this.pin.join(""))}verifyPin(){const e=this.pin.join("");if(e==="9999"){this.isVerified=true}}handleTimeout(){localStorage.removeItem("bc:resend");this.canResend=true}async handleResend(){await this.resend();this.canResend=false;this.pin=["","","",""];localStorage.removeItem("bc:resend")}buildTime(){const e=localStorage.getItem("bc:resend");if(e){return e}const i=new Date;i.setSeconds(i.getSeconds()+30);localStorage.setItem("bc:resend",i.toString());return i.toString()}render(){var e;return i("div",{key:"6a62eca90116a8f120ed997e8db8ede58f2f0521",class:"crm-phone-form"},i("label",{key:"163b391876b598e8a170196f3c53a77c38f67d91",class:"crm-subtitle"},n.t("pin-sutitle")," ",i("strong",{key:"3d0e5616b335c5c1a122b18ab54fd275f0eb1cbf"},"+55 ",this.phone)),i("div",{key:"09fb7e7f22c6e54d6e01e91398c14f94aa40606a",class:"pin-container"},this.pin.map(((e,t)=>i("input",{type:"text",maxLength:1,value:this.pin[t],onInput:e=>this.handleInput(e,t)})))),i("slot",{key:"4375d20d7d691e2e439dfe25a3df00aeb73a7d2a"}),i("p",{key:"53b3e46d111809d87436a7a593a91ea9aafd46d0",class:"crm-description"}," Não recebeu?",!this.canResend&&i("label",{key:"bc71ebe6c29f831123e12ba7dff408be93465101"}," Reenviar em",i("countdown-timer",{key:"d7e831b7deb76172c7064eee7ad1c407a5f492d7",minutos:0,segundos:30,dataCriacao:this.buildTime(),downtime:()=>this.handleTimeout()})," "),this.canResend&&i("div",{key:"33d6c68c2959820053bb670df0d3be40484be5d6"},i("a",{key:"28de82c465773793dd291ee92f3ed39a62ac3cb4",onClick:()=>this.handleResend()},"Reenviar"),i("a",{key:"0883846b1a87fc0a73233c92b4da7698d7df7fbd",onClick:()=>this.cancel()},"Trocar número"))),i("crm-button",{key:"8749dba1ff171c83830646007d7f5823a7c33c1f",txtBtn:((e=this.config)===null||e===void 0?void 0:e.btnApplyBonusLabel)||"Avançar",loading:this.loading,handleClick:()=>this.validatePin()}))}};I.style=y+M;export{p as crm_tooltip,b as giftback_info,x as phone_form,I as pin_form};
|
2
|
+
//# sourceMappingURL=p-bfebfea7.entry.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
function t(t,e){return function n(){return t.apply(e,arguments)}}const{toString:e}=Object.prototype;const{getPrototypeOf:n}=Object;const o=(t=>n=>{const o=e.call(n);return t[o]||(t[o]=o.slice(8,-1).toLowerCase())})(Object.create(null));const r=t=>{t=t.toLowerCase();return e=>o(e)===t};const s=t=>e=>typeof e===t;const{isArray:i}=Array;const c=s("undefined");function a(t){return t!==null&&!c(t)&&t.constructor!==null&&!c(t.constructor)&&d(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const u=r("ArrayBuffer");function l(t){let e;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){e=ArrayBuffer.isView(t)}else{e=t&&t.buffer&&u(t.buffer)}return e}const f=s("string");const d=s("function");const h=s("number");const p=t=>t!==null&&typeof t==="object";const m=t=>t===true||t===false;const w=t=>{if(o(t)!=="object"){return false}const e=n(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};const y=r("Date");const b=r("File");const g=r("Blob");const R=r("FileList");const O=t=>p(t)&&d(t.pipe);const S=t=>{let e;return t&&(typeof FormData==="function"&&t instanceof FormData||d(t.append)&&((e=o(t))==="formdata"||e==="object"&&d(t.toString)&&t.toString()==="[object FormData]"))};const E=r("URLSearchParams");const[T,A,j,C]=["ReadableStream","Request","Response","Headers"].map(r);const N=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function v(t,e,{allOwnKeys:n=false}={}){if(t===null||typeof t==="undefined"){return}let o;let r;if(typeof t!=="object"){t=[t]}if(i(t)){for(o=0,r=t.length;o<r;o++){e.call(null,t[o],o,t)}}else{const r=n?Object.getOwnPropertyNames(t):Object.keys(t);const s=r.length;let i;for(o=0;o<s;o++){i=r[o];e.call(null,t[i],i,t)}}}function x(t,e){e=e.toLowerCase();const n=Object.keys(t);let o=n.length;let r;while(o-- >0){r=n[o];if(e===r.toLowerCase()){return r}}return null}const B=(()=>{if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global})();const P=t=>!c(t)&&t!==B;function D(){const{caseless:t}=P(this)&&this||{};const e={};const n=(n,o)=>{const r=t&&x(e,o)||o;if(w(e[r])&&w(n)){e[r]=D(e[r],n)}else if(w(n)){e[r]=D({},n)}else if(i(n)){e[r]=n.slice()}else{e[r]=n}};for(let t=0,e=arguments.length;t<e;t++){arguments[t]&&v(arguments[t],n)}return e}const F=(e,n,o,{allOwnKeys:r}={})=>{v(n,((n,r)=>{if(o&&d(n)){e[r]=t(n,o)}else{e[r]=n}}),{allOwnKeys:r});return e};const U=t=>{if(t.charCodeAt(0)===65279){t=t.slice(1)}return t};const _=(t,e,n,o)=>{t.prototype=Object.create(e.prototype,o);t.prototype.constructor=t;Object.defineProperty(t,"super",{value:e.prototype});n&&Object.assign(t.prototype,n)};const k=(t,e,o,r)=>{let s;let i;let c;const a={};e=e||{};if(t==null)return e;do{s=Object.getOwnPropertyNames(t);i=s.length;while(i-- >0){c=s[i];if((!r||r(c,t,e))&&!a[c]){e[c]=t[c];a[c]=true}}t=o!==false&&n(t)}while(t&&(!o||o(t,e))&&t!==Object.prototype);return e};const q=(t,e,n)=>{t=String(t);if(n===undefined||n>t.length){n=t.length}n-=e.length;const o=t.indexOf(e,n);return o!==-1&&o===n};const I=t=>{if(!t)return null;if(i(t))return t;let e=t.length;if(!h(e))return null;const n=new Array(e);while(e-- >0){n[e]=t[e]}return n};const L=(t=>e=>t&&e instanceof t)(typeof Uint8Array!=="undefined"&&n(Uint8Array));const $=(t,e)=>{const n=t&&t[Symbol.iterator];const o=n.call(t);let r;while((r=o.next())&&!r.done){const n=r.value;e.call(t,n[0],n[1])}};const z=(t,e)=>{let n;const o=[];while((n=t.exec(e))!==null){o.push(n)}return o};const M=r("HTMLFormElement");const H=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function t(e,n,o){return n.toUpperCase()+o}));const J=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype);const K=r("RegExp");const V=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t);const o={};v(n,((n,r)=>{let s;if((s=e(n,r,t))!==false){o[r]=s||n}}));Object.defineProperties(t,o)};const W=t=>{V(t,((e,n)=>{if(d(t)&&["arguments","caller","callee"].indexOf(n)!==-1){return false}const o=t[n];if(!d(o))return;e.enumerable=false;if("writable"in e){e.writable=false;return}if(!e.set){e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}}}))};const G=(t,e)=>{const n={};const o=t=>{t.forEach((t=>{n[t]=true}))};i(t)?o(t):o(String(t).split(e));return n};const X=()=>{};const Y=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;const Z="abcdefghijklmnopqrstuvwxyz";const Q="0123456789";const tt={DIGIT:Q,ALPHA:Z,ALPHA_DIGIT:Z+Z.toUpperCase()+Q};const et=(t=16,e=tt.ALPHA_DIGIT)=>{let n="";const{length:o}=e;while(t--){n+=e[Math.random()*o|0]}return n};function nt(t){return!!(t&&d(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const ot=t=>{const e=new Array(10);const n=(t,o)=>{if(p(t)){if(e.indexOf(t)>=0){return}if(!("toJSON"in t)){e[o]=t;const r=i(t)?[]:{};v(t,((t,e)=>{const s=n(t,o+1);!c(s)&&(r[e]=s)}));e[o]=undefined;return r}}return t};return n(t,0)};const rt=r("AsyncFunction");const st=t=>t&&(p(t)||d(t))&&d(t.then)&&d(t.catch);const it=((t,e)=>{if(t){return setImmediate}return e?((t,e)=>{B.addEventListener("message",(({source:n,data:o})=>{if(n===B&&o===t){e.length&&e.shift()()}}),false);return n=>{e.push(n);B.postMessage(t,"*")}})(`axios@${Math.random()}`,[]):t=>setTimeout(t)})(typeof setImmediate==="function",d(B.postMessage));const ct=typeof queueMicrotask!=="undefined"?queueMicrotask.bind(B):typeof process!=="undefined"&&process.nextTick||it;const at={isArray:i,isArrayBuffer:u,isBuffer:a,isFormData:S,isArrayBufferView:l,isString:f,isNumber:h,isBoolean:m,isObject:p,isPlainObject:w,isReadableStream:T,isRequest:A,isResponse:j,isHeaders:C,isUndefined:c,isDate:y,isFile:b,isBlob:g,isRegExp:K,isFunction:d,isStream:O,isURLSearchParams:E,isTypedArray:L,isFileList:R,forEach:v,merge:D,extend:F,trim:N,stripBOM:U,inherits:_,toFlatObject:k,kindOf:o,kindOfTest:r,endsWith:q,toArray:I,forEachEntry:$,matchAll:z,isHTMLForm:M,hasOwnProperty:J,hasOwnProp:J,reduceDescriptors:V,freezeMethods:W,toObjectSet:G,toCamelCase:H,noop:X,toFiniteNumber:Y,findKey:x,global:B,isContextDefined:P,ALPHABET:tt,generateString:et,isSpecCompliantForm:nt,toJSONObject:ot,isAsyncFn:rt,isThenable:st,setImmediate:it,asap:ct};function ut(t,e,n,o,r){Error.call(this);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=(new Error).stack}this.message=t;this.name="AxiosError";e&&(this.code=e);n&&(this.config=n);o&&(this.request=o);if(r){this.response=r;this.status=r.status?r.status:null}}at.inherits(ut,Error,{toJSON:function t(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:at.toJSONObject(this.config),code:this.code,status:this.status}}});const lt=ut.prototype;const ft={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{ft[t]={value:t}}));Object.defineProperties(ut,ft);Object.defineProperty(lt,"isAxiosError",{value:true});ut.from=(t,e,n,o,r,s)=>{const i=Object.create(lt);at.toFlatObject(t,i,(function t(e){return e!==Error.prototype}),(t=>t!=="isAxiosError"));ut.call(i,t.message,e,n,o,r);i.cause=t;i.name=t.name;s&&Object.assign(i,s);return i};const dt=null;function ht(t){return at.isPlainObject(t)||at.isArray(t)}function pt(t){return at.endsWith(t,"[]")?t.slice(0,-2):t}function mt(t,e,n){if(!t)return e;return t.concat(e).map((function t(e,o){e=pt(e);return!n&&o?"["+e+"]":e})).join(n?".":"")}function wt(t){return at.isArray(t)&&!t.some(ht)}const yt=at.toFlatObject(at,{},null,(function t(e){return/^is[A-Z]/.test(e)}));function bt(t,e,n){if(!at.isObject(t)){throw new TypeError("target must be an object")}e=e||new FormData;n=at.toFlatObject(n,{metaTokens:true,dots:false,indexes:false},false,(function t(e,n){return!at.isUndefined(n[e])}));const o=n.metaTokens;const r=n.visitor||l;const s=n.dots;const i=n.indexes;const c=n.Blob||typeof Blob!=="undefined"&&Blob;const a=c&&at.isSpecCompliantForm(e);if(!at.isFunction(r)){throw new TypeError("visitor must be a function")}function u(t){if(t===null)return"";if(at.isDate(t)){return t.toISOString()}if(!a&&at.isBlob(t)){throw new ut("Blob is not supported. Use a Buffer instead.")}if(at.isArrayBuffer(t)||at.isTypedArray(t)){return a&&typeof Blob==="function"?new Blob([t]):Buffer.from(t)}return t}function l(t,n,r){let c=t;if(t&&!r&&typeof t==="object"){if(at.endsWith(n,"{}")){n=o?n:n.slice(0,-2);t=JSON.stringify(t)}else if(at.isArray(t)&&wt(t)||(at.isFileList(t)||at.endsWith(n,"[]"))&&(c=at.toArray(t))){n=pt(n);c.forEach((function t(o,r){!(at.isUndefined(o)||o===null)&&e.append(i===true?mt([n],r,s):i===null?n:n+"[]",u(o))}));return false}}if(ht(t)){return true}e.append(mt(r,n,s),u(t));return false}const f=[];const d=Object.assign(yt,{defaultVisitor:l,convertValue:u,isVisitable:ht});function h(t,n){if(at.isUndefined(t))return;if(f.indexOf(t)!==-1){throw Error("Circular reference detected in "+n.join("."))}f.push(t);at.forEach(t,(function t(o,s){const i=!(at.isUndefined(o)||o===null)&&r.call(e,o,at.isString(s)?s.trim():s,n,d);if(i===true){h(o,n?n.concat(s):[s])}}));f.pop()}if(!at.isObject(t)){throw new TypeError("data must be an object")}h(t);return e}function gt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function t(n){return e[n]}))}function Rt(t,e){this._pairs=[];t&&bt(t,this,e)}const Ot=Rt.prototype;Ot.append=function t(e,n){this._pairs.push([e,n])};Ot.toString=function t(e){const n=e?function(t){return e.call(this,t,gt)}:gt;return this._pairs.map((function t(e){return n(e[0])+"="+n(e[1])}),"").join("&")};function St(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Et(t,e,n){if(!e){return t}const o=n&&n.encode||St;const r=n&&n.serialize;let s;if(r){s=r(e,n)}else{s=at.isURLSearchParams(e)?e.toString():new Rt(e,n).toString(o)}if(s){const e=t.indexOf("#");if(e!==-1){t=t.slice(0,e)}t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Tt{constructor(){this.handlers=[]}use(t,e,n){this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:false,runWhen:n?n.runWhen:null});return this.handlers.length-1}eject(t){if(this.handlers[t]){this.handlers[t]=null}}clear(){if(this.handlers){this.handlers=[]}}forEach(t){at.forEach(this.handlers,(function e(n){if(n!==null){t(n)}}))}}const At=Tt;const jt={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};const Ct=typeof URLSearchParams!=="undefined"?URLSearchParams:Rt;const Nt=typeof FormData!=="undefined"?FormData:null;const vt=typeof Blob!=="undefined"?Blob:null;const xt={isBrowser:true,classes:{URLSearchParams:Ct,FormData:Nt,Blob:vt},protocols:["http","https","file","blob","url","data"]};const Bt=typeof window!=="undefined"&&typeof document!=="undefined";const Pt=typeof navigator==="object"&&navigator||undefined;const Dt=Bt&&(!Pt||["ReactNative","NativeScript","NS"].indexOf(Pt.product)<0);const Ft=(()=>typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function")();const Ut=Bt&&window.location.href||"http://localhost";const _t=Object.freeze({__proto__:null,hasBrowserEnv:Bt,hasStandardBrowserWebWorkerEnv:Ft,hasStandardBrowserEnv:Dt,navigator:Pt,origin:Ut});const kt={..._t,...xt};function qt(t,e){return bt(t,new kt.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,o){if(kt.isNode&&at.isBuffer(t)){this.append(e,t.toString("base64"));return false}return o.defaultVisitor.apply(this,arguments)}},e))}function It(t){return at.matchAll(/\w+|\[(\w*)]/g,t).map((t=>t[0]==="[]"?"":t[1]||t[0]))}function Lt(t){const e={};const n=Object.keys(t);let o;const r=n.length;let s;for(o=0;o<r;o++){s=n[o];e[s]=t[s]}return e}function $t(t){function e(t,n,o,r){let s=t[r++];if(s==="__proto__")return true;const i=Number.isFinite(+s);const c=r>=t.length;s=!s&&at.isArray(o)?o.length:s;if(c){if(at.hasOwnProp(o,s)){o[s]=[o[s],n]}else{o[s]=n}return!i}if(!o[s]||!at.isObject(o[s])){o[s]=[]}const a=e(t,n,o[s],r);if(a&&at.isArray(o[s])){o[s]=Lt(o[s])}return!i}if(at.isFormData(t)&&at.isFunction(t.entries)){const n={};at.forEachEntry(t,((t,o)=>{e(It(t),o,n,0)}));return n}return null}function zt(t,e,n){if(at.isString(t)){try{(e||JSON.parse)(t);return at.trim(t)}catch(t){if(t.name!=="SyntaxError"){throw t}}}return(n||JSON.stringify)(t)}const Mt={transitional:jt,adapter:["xhr","http","fetch"],transformRequest:[function t(e,n){const o=n.getContentType()||"";const r=o.indexOf("application/json")>-1;const s=at.isObject(e);if(s&&at.isHTMLForm(e)){e=new FormData(e)}const i=at.isFormData(e);if(i){return r?JSON.stringify($t(e)):e}if(at.isArrayBuffer(e)||at.isBuffer(e)||at.isStream(e)||at.isFile(e)||at.isBlob(e)||at.isReadableStream(e)){return e}if(at.isArrayBufferView(e)){return e.buffer}if(at.isURLSearchParams(e)){n.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return e.toString()}let c;if(s){if(o.indexOf("application/x-www-form-urlencoded")>-1){return qt(e,this.formSerializer).toString()}if((c=at.isFileList(e))||o.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return bt(c?{"files[]":e}:e,t&&new t,this.formSerializer)}}if(s||r){n.setContentType("application/json",false);return zt(e)}return e}],transformResponse:[function t(e){const n=this.transitional||Mt.transitional;const o=n&&n.forcedJSONParsing;const r=this.responseType==="json";if(at.isResponse(e)||at.isReadableStream(e)){return e}if(e&&at.isString(e)&&(o&&!this.responseType||r)){const t=n&&n.silentJSONParsing;const o=!t&&r;try{return JSON.parse(e)}catch(t){if(o){if(t.name==="SyntaxError"){throw ut.from(t,ut.ERR_BAD_RESPONSE,this,null,this.response)}throw t}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:kt.classes.FormData,Blob:kt.classes.Blob},validateStatus:function t(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":undefined}}};at.forEach(["delete","get","head","post","put","patch"],(t=>{Mt.headers[t]={}}));const Ht=Mt;const Jt=at.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Kt=t=>{const e={};let n;let o;let r;t&&t.split("\n").forEach((function t(s){r=s.indexOf(":");n=s.substring(0,r).trim().toLowerCase();o=s.substring(r+1).trim();if(!n||e[n]&&Jt[n]){return}if(n==="set-cookie"){if(e[n]){e[n].push(o)}else{e[n]=[o]}}else{e[n]=e[n]?e[n]+", "+o:o}}));return e};const Vt=Symbol("internals");function Wt(t){return t&&String(t).trim().toLowerCase()}function Gt(t){if(t===false||t==null){return t}return at.isArray(t)?t.map(Gt):String(t)}function Xt(t){const e=Object.create(null);const n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;while(o=n.exec(t)){e[o[1]]=o[2]}return e}const Yt=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Zt(t,e,n,o,r){if(at.isFunction(o)){return o.call(this,e,n)}if(r){e=n}if(!at.isString(e))return;if(at.isString(o)){return e.indexOf(o)!==-1}if(at.isRegExp(o)){return o.test(e)}}function Qt(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}function te(t,e){const n=at.toCamelCase(" "+e);["get","set","has"].forEach((o=>{Object.defineProperty(t,o+n,{value:function(t,n,r){return this[o].call(this,e,t,n,r)},configurable:true})}))}class ee{constructor(t){t&&this.set(t)}set(t,e,n){const o=this;function r(t,e,n){const r=Wt(e);if(!r){throw new Error("header name must be a non-empty string")}const s=at.findKey(o,r);if(!s||o[s]===undefined||n===true||n===undefined&&o[s]!==false){o[s||e]=Gt(t)}}const s=(t,e)=>at.forEach(t,((t,n)=>r(t,n,e)));if(at.isPlainObject(t)||t instanceof this.constructor){s(t,e)}else if(at.isString(t)&&(t=t.trim())&&!Yt(t)){s(Kt(t),e)}else if(at.isHeaders(t)){for(const[e,o]of t.entries()){r(o,e,n)}}else{t!=null&&r(e,t,n)}return this}get(t,e){t=Wt(t);if(t){const n=at.findKey(this,t);if(n){const t=this[n];if(!e){return t}if(e===true){return Xt(t)}if(at.isFunction(e)){return e.call(this,t,n)}if(at.isRegExp(e)){return e.exec(t)}throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){t=Wt(t);if(t){const n=at.findKey(this,t);return!!(n&&this[n]!==undefined&&(!e||Zt(this,this[n],n,e)))}return false}delete(t,e){const n=this;let o=false;function r(t){t=Wt(t);if(t){const r=at.findKey(n,t);if(r&&(!e||Zt(n,n[r],r,e))){delete n[r];o=true}}}if(at.isArray(t)){t.forEach(r)}else{r(t)}return o}clear(t){const e=Object.keys(this);let n=e.length;let o=false;while(n--){const r=e[n];if(!t||Zt(this,this[r],r,t,true)){delete this[r];o=true}}return o}normalize(t){const e=this;const n={};at.forEach(this,((o,r)=>{const s=at.findKey(n,r);if(s){e[s]=Gt(o);delete e[r];return}const i=t?Qt(r):String(r).trim();if(i!==r){delete e[r]}e[i]=Gt(o);n[i]=true}));return this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);at.forEach(this,((n,o)=>{n!=null&&n!==false&&(e[o]=t&&at.isArray(n)?n.join(", "):n)}));return e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);e.forEach((t=>n.set(t)));return n}static accessor(t){const e=this[Vt]=this[Vt]={accessors:{}};const n=e.accessors;const o=this.prototype;function r(t){const e=Wt(t);if(!n[e]){te(o,t);n[e]=true}}at.isArray(t)?t.forEach(r):r(t);return this}}ee.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);at.reduceDescriptors(ee.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}}));at.freezeMethods(ee);const ne=ee;function oe(t,e){const n=this||Ht;const o=e||n;const r=ne.from(o.headers);let s=o.data;at.forEach(t,(function t(o){s=o.call(n,s,r.normalize(),e?e.status:undefined)}));r.normalize();return s}function re(t){return!!(t&&t.__CANCEL__)}function se(t,e,n){ut.call(this,t==null?"canceled":t,ut.ERR_CANCELED,e,n);this.name="CanceledError"}at.inherits(se,ut,{__CANCEL__:true});function ie(t,e,n){const o=n.config.validateStatus;if(!n.status||!o||o(n.status)){t(n)}else{e(new ut("Request failed with status code "+n.status,[ut.ERR_BAD_REQUEST,ut.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}}function ce(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ae(t,e){t=t||10;const n=new Array(t);const o=new Array(t);let r=0;let s=0;let i;e=e!==undefined?e:1e3;return function c(a){const u=Date.now();const l=o[s];if(!i){i=u}n[r]=a;o[r]=u;let f=s;let d=0;while(f!==r){d+=n[f++];f=f%t}r=(r+1)%t;if(r===s){s=(s+1)%t}if(u-i<e){return}const h=l&&u-l;return h?Math.round(d*1e3/h):undefined}}function ue(t,e){let n=0;let o=1e3/e;let r;let s;const i=(e,o=Date.now())=>{n=o;r=null;if(s){clearTimeout(s);s=null}t.apply(null,e)};const c=(...t)=>{const e=Date.now();const c=e-n;if(c>=o){i(t,e)}else{r=t;if(!s){s=setTimeout((()=>{s=null;i(r)}),o-c)}}};const a=()=>r&&i(r);return[c,a]}const le=(t,e,n=3)=>{let o=0;const r=ae(50,250);return ue((n=>{const s=n.loaded;const i=n.lengthComputable?n.total:undefined;const c=s-o;const a=r(c);const u=s<=i;o=s;const l={loaded:s,total:i,progress:i?s/i:undefined,bytes:c,rate:a?a:undefined,estimated:a&&i&&u?(i-s)/a:undefined,event:n,lengthComputable:i!=null,[e?"download":"upload"]:true};t(l)}),n)};const fe=(t,e)=>{const n=t!=null;return[o=>e[0]({lengthComputable:n,total:t,loaded:o}),e[1]]};const de=t=>(...e)=>at.asap((()=>t(...e)));const he=kt.hasStandardBrowserEnv?function t(){const e=kt.navigator&&/(msie|trident)/i.test(kt.navigator.userAgent);const n=document.createElement("a");let o;function r(t){let o=t;if(e){n.setAttribute("href",o);o=n.href}n.setAttribute("href",o);return{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}o=r(window.location.href);return function t(e){const n=at.isString(e)?r(e):e;return n.protocol===o.protocol&&n.host===o.host}}():function t(){return function t(){return true}}();const pe=kt.hasStandardBrowserEnv?{write(t,e,n,o,r,s){const i=[t+"="+encodeURIComponent(e)];at.isNumber(n)&&i.push("expires="+new Date(n).toGMTString());at.isString(o)&&i.push("path="+o);at.isString(r)&&i.push("domain="+r);s===true&&i.push("secure");document.cookie=i.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function me(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function we(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ye(t,e){if(t&&!me(e)){return we(t,e)}return e}const be=t=>t instanceof ne?{...t}:t;function ge(t,e){e=e||{};const n={};function o(t,e,n){if(at.isPlainObject(t)&&at.isPlainObject(e)){return at.merge.call({caseless:n},t,e)}else if(at.isPlainObject(e)){return at.merge({},e)}else if(at.isArray(e)){return e.slice()}return e}function r(t,e,n){if(!at.isUndefined(e)){return o(t,e,n)}else if(!at.isUndefined(t)){return o(undefined,t,n)}}function s(t,e){if(!at.isUndefined(e)){return o(undefined,e)}}function i(t,e){if(!at.isUndefined(e)){return o(undefined,e)}else if(!at.isUndefined(t)){return o(undefined,t)}}function c(n,r,s){if(s in e){return o(n,r)}else if(s in t){return o(undefined,n)}}const a={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(t,e)=>r(be(t),be(e),true)};at.forEach(Object.keys(Object.assign({},t,e)),(function o(s){const i=a[s]||r;const u=i(t[s],e[s],s);at.isUndefined(u)&&i!==c||(n[s]=u)}));return n}const Re=t=>{const e=ge({},t);let{data:n,withXSRFToken:o,xsrfHeaderName:r,xsrfCookieName:s,headers:i,auth:c}=e;e.headers=i=ne.from(i);e.url=Et(ye(e.baseURL,e.url),t.params,t.paramsSerializer);if(c){i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")))}let a;if(at.isFormData(n)){if(kt.hasStandardBrowserEnv||kt.hasStandardBrowserWebWorkerEnv){i.setContentType(undefined)}else if((a=i.getContentType())!==false){const[t,...e]=a?a.split(";").map((t=>t.trim())).filter(Boolean):[];i.setContentType([t||"multipart/form-data",...e].join("; "))}}if(kt.hasStandardBrowserEnv){o&&at.isFunction(o)&&(o=o(e));if(o||o!==false&&he(e.url)){const t=r&&s&&pe.read(s);if(t){i.set(r,t)}}}return e};const Oe=typeof XMLHttpRequest!=="undefined";const Se=Oe&&function(t){return new Promise((function e(n,o){const r=Re(t);let s=r.data;const i=ne.from(r.headers).normalize();let{responseType:c,onUploadProgress:a,onDownloadProgress:u}=r;let l;let f,d;let h,p;function m(){h&&h();p&&p();r.cancelToken&&r.cancelToken.unsubscribe(l);r.signal&&r.signal.removeEventListener("abort",l)}let w=new XMLHttpRequest;w.open(r.method.toUpperCase(),r.url,true);w.timeout=r.timeout;function y(){if(!w){return}const e=ne.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders());const r=!c||c==="text"||c==="json"?w.responseText:w.response;const s={data:r,status:w.status,statusText:w.statusText,headers:e,config:t,request:w};ie((function t(e){n(e);m()}),(function t(e){o(e);m()}),s);w=null}if("onloadend"in w){w.onloadend=y}else{w.onreadystatechange=function t(){if(!w||w.readyState!==4){return}if(w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)){return}setTimeout(y)}}w.onabort=function e(){if(!w){return}o(new ut("Request aborted",ut.ECONNABORTED,t,w));w=null};w.onerror=function e(){o(new ut("Network Error",ut.ERR_NETWORK,t,w));w=null};w.ontimeout=function e(){let n=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const s=r.transitional||jt;if(r.timeoutErrorMessage){n=r.timeoutErrorMessage}o(new ut(n,s.clarifyTimeoutError?ut.ETIMEDOUT:ut.ECONNABORTED,t,w));w=null};s===undefined&&i.setContentType(null);if("setRequestHeader"in w){at.forEach(i.toJSON(),(function t(e,n){w.setRequestHeader(n,e)}))}if(!at.isUndefined(r.withCredentials)){w.withCredentials=!!r.withCredentials}if(c&&c!=="json"){w.responseType=r.responseType}if(u){[d,p]=le(u,true);w.addEventListener("progress",d)}if(a&&w.upload){[f,h]=le(a);w.upload.addEventListener("progress",f);w.upload.addEventListener("loadend",h)}if(r.cancelToken||r.signal){l=e=>{if(!w){return}o(!e||e.type?new se(null,t,w):e);w.abort();w=null};r.cancelToken&&r.cancelToken.subscribe(l);if(r.signal){r.signal.aborted?l():r.signal.addEventListener("abort",l)}}const b=ce(r.url);if(b&&kt.protocols.indexOf(b)===-1){o(new ut("Unsupported protocol "+b+":",ut.ERR_BAD_REQUEST,t));return}w.send(s||null)}))};const Ee=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let n=new AbortController;let o;const r=function(t){if(!o){o=true;i();const e=t instanceof Error?t:this.reason;n.abort(e instanceof ut?e:new se(e instanceof Error?e.message:e))}};let s=e&&setTimeout((()=>{s=null;r(new ut(`timeout ${e} of ms exceeded`,ut.ETIMEDOUT))}),e);const i=()=>{if(t){s&&clearTimeout(s);s=null;t.forEach((t=>{t.unsubscribe?t.unsubscribe(r):t.removeEventListener("abort",r)}));t=null}};t.forEach((t=>t.addEventListener("abort",r)));const{signal:c}=n;c.unsubscribe=()=>at.asap(i);return c}};const Te=Ee;const Ae=function*(t,e){let n=t.byteLength;if(!e||n<e){yield t;return}let o=0;let r;while(o<n){r=o+e;yield t.slice(o,r);o=r}};const je=async function*(t,e){for await(const n of Ce(t)){yield*Ae(n,e)}};const Ce=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t){break}yield n}}finally{await e.cancel()}};const Ne=(t,e,n,o)=>{const r=je(t,e);let s=0;let i;let c=t=>{if(!i){i=true;o&&o(t)}};return new ReadableStream({async pull(t){try{const{done:e,value:o}=await r.next();if(e){c();t.close();return}let i=o.byteLength;if(n){let t=s+=i;n(t)}t.enqueue(new Uint8Array(o))}catch(t){c(t);throw t}},cancel(t){c(t);return r.return()}},{highWaterMark:2})};const ve=typeof fetch==="function"&&typeof Request==="function"&&typeof Response==="function";const xe=ve&&typeof ReadableStream==="function";const Be=ve&&(typeof TextEncoder==="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer()));const Pe=(t,...e)=>{try{return!!t(...e)}catch(t){return false}};const De=xe&&Pe((()=>{let t=false;const e=new Request(kt.origin,{body:new ReadableStream,method:"POST",get duplex(){t=true;return"half"}}).headers.has("Content-Type");return t&&!e}));const Fe=64*1024;const Ue=xe&&Pe((()=>at.isReadableStream(new Response("").body)));const _e={stream:Ue&&(t=>t.body)};ve&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!_e[e]&&(_e[e]=at.isFunction(t[e])?t=>t[e]():(t,n)=>{throw new ut(`Response type '${e}' is not supported`,ut.ERR_NOT_SUPPORT,n)})}))})(new Response);const ke=async t=>{if(t==null){return 0}if(at.isBlob(t)){return t.size}if(at.isSpecCompliantForm(t)){const e=new Request(kt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}if(at.isArrayBufferView(t)||at.isArrayBuffer(t)){return t.byteLength}if(at.isURLSearchParams(t)){t=t+""}if(at.isString(t)){return(await Be(t)).byteLength}};const qe=async(t,e)=>{const n=at.toFiniteNumber(t.getContentLength());return n==null?ke(e):n};const Ie=ve&&(async t=>{let{url:e,method:n,data:o,signal:r,cancelToken:s,timeout:i,onDownloadProgress:c,onUploadProgress:a,responseType:u,headers:l,withCredentials:f="same-origin",fetchOptions:d}=Re(t);u=u?(u+"").toLowerCase():"text";let h=Te([r,s&&s.toAbortSignal()],i);let p;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let w;try{if(a&&De&&n!=="get"&&n!=="head"&&(w=await qe(l,o))!==0){let t=new Request(e,{method:"POST",body:o,duplex:"half"});let n;if(at.isFormData(o)&&(n=t.headers.get("content-type"))){l.setContentType(n)}if(t.body){const[e,n]=fe(w,le(de(a)));o=Ne(t.body,Fe,e,n)}}if(!at.isString(f)){f=f?"include":"omit"}const r="credentials"in Request.prototype;p=new Request(e,{...d,signal:h,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:o,duplex:"half",credentials:r?f:undefined});let s=await fetch(p);const i=Ue&&(u==="stream"||u==="response");if(Ue&&(c||i&&m)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=s[e]}));const e=at.toFiniteNumber(s.headers.get("content-length"));const[n,o]=c&&fe(e,le(de(c),true))||[];s=new Response(Ne(s.body,Fe,n,(()=>{o&&o();m&&m()})),t)}u=u||"text";let y=await _e[at.findKey(_e,u)||"text"](s,t);!i&&m&&m();return await new Promise(((e,n)=>{ie(e,n,{data:y,headers:ne.from(s.headers),status:s.status,statusText:s.statusText,config:t,request:p})}))}catch(e){m&&m();if(e&&e.name==="TypeError"&&/fetch/i.test(e.message)){throw Object.assign(new ut("Network Error",ut.ERR_NETWORK,t,p),{cause:e.cause||e})}throw ut.from(e,e&&e.code,t,p)}});const Le={http:dt,xhr:Se,fetch:Ie};at.forEach(Le,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const $e=t=>`- ${t}`;const ze=t=>at.isFunction(t)||t===null||t===false;const Me={getAdapter:t=>{t=at.isArray(t)?t:[t];const{length:e}=t;let n;let o;const r={};for(let s=0;s<e;s++){n=t[s];let e;o=n;if(!ze(n)){o=Le[(e=String(n)).toLowerCase()];if(o===undefined){throw new ut(`Unknown adapter '${e}'`)}}if(o){break}r[e||"#"+s]=o}if(!o){const t=Object.entries(r).map((([t,e])=>`adapter ${t} `+(e===false?"is not supported by the environment":"is not available in the build")));let n=e?t.length>1?"since :\n"+t.map($e).join("\n"):" "+$e(t[0]):"as no adapter specified";throw new ut(`There is no suitable adapter to dispatch the request `+n,"ERR_NOT_SUPPORT")}return o},adapters:Le};function He(t){if(t.cancelToken){t.cancelToken.throwIfRequested()}if(t.signal&&t.signal.aborted){throw new se(null,t)}}function Je(t){He(t);t.headers=ne.from(t.headers);t.data=oe.call(t,t.transformRequest);if(["post","put","patch"].indexOf(t.method)!==-1){t.headers.setContentType("application/x-www-form-urlencoded",false)}const e=Me.getAdapter(t.adapter||Ht.adapter);return e(t).then((function e(n){He(t);n.data=oe.call(t,t.transformResponse,n);n.headers=ne.from(n.headers);return n}),(function e(n){if(!re(n)){He(t);if(n&&n.response){n.response.data=oe.call(t,t.transformResponse,n.response);n.response.headers=ne.from(n.response.headers)}}return Promise.reject(n)}))}const Ke="1.7.7";const Ve={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Ve[t]=function n(o){return typeof o===t||"a"+(e<1?"n ":" ")+t}}));const We={};Ve.transitional=function t(e,n,o){function r(t,e){return"[Axios v"+Ke+"] Transitional option '"+t+"'"+e+(o?". "+o:"")}return(t,o,s)=>{if(e===false){throw new ut(r(o," has been removed"+(n?" in "+n:"")),ut.ERR_DEPRECATED)}if(n&&!We[o]){We[o]=true;console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))}return e?e(t,o,s):true}};function Ge(t,e,n){if(typeof t!=="object"){throw new ut("options must be an object",ut.ERR_BAD_OPTION_VALUE)}const o=Object.keys(t);let r=o.length;while(r-- >0){const s=o[r];const i=e[s];if(i){const e=t[s];const n=e===undefined||i(e,s,t);if(n!==true){throw new ut("option "+s+" must be "+n,ut.ERR_BAD_OPTION_VALUE)}continue}if(n!==true){throw new ut("Unknown option "+s,ut.ERR_BAD_OPTION)}}}const Xe={assertOptions:Ge,validators:Ve};const Ye=Xe.validators;class Ze{constructor(t){this.defaults=t;this.interceptors={request:new At,response:new At}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const n=e.stack?e.stack.replace(/^.+\n/,""):"";try{if(!t.stack){t.stack=n}else if(n&&!String(t.stack).endsWith(n.replace(/^.+\n.+\n/,""))){t.stack+="\n"+n}}catch(t){}}throw t}}_request(t,e){if(typeof t==="string"){e=e||{};e.url=t}else{e=t||{}}e=ge(this.defaults,e);const{transitional:n,paramsSerializer:o,headers:r}=e;if(n!==undefined){Xe.assertOptions(n,{silentJSONParsing:Ye.transitional(Ye.boolean),forcedJSONParsing:Ye.transitional(Ye.boolean),clarifyTimeoutError:Ye.transitional(Ye.boolean)},false)}if(o!=null){if(at.isFunction(o)){e.paramsSerializer={serialize:o}}else{Xe.assertOptions(o,{encode:Ye.function,serialize:Ye.function},true)}}e.method=(e.method||this.defaults.method||"get").toLowerCase();let s=r&&at.merge(r.common,r[e.method]);r&&at.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete r[t]}));e.headers=ne.concat(s,r);const i=[];let c=true;this.interceptors.request.forEach((function t(n){if(typeof n.runWhen==="function"&&n.runWhen(e)===false){return}c=c&&n.synchronous;i.unshift(n.fulfilled,n.rejected)}));const a=[];this.interceptors.response.forEach((function t(e){a.push(e.fulfilled,e.rejected)}));let u;let l=0;let f;if(!c){const t=[Je.bind(this),undefined];t.unshift.apply(t,i);t.push.apply(t,a);f=t.length;u=Promise.resolve(e);while(l<f){u=u.then(t[l++],t[l++])}return u}f=i.length;let d=e;l=0;while(l<f){const t=i[l++];const e=i[l++];try{d=t(d)}catch(t){e.call(this,t);break}}try{u=Je.call(this,d)}catch(t){return Promise.reject(t)}l=0;f=a.length;while(l<f){u=u.then(a[l++],a[l++])}return u}getUri(t){t=ge(this.defaults,t);const e=ye(t.baseURL,t.url);return Et(e,t.params,t.paramsSerializer)}}at.forEach(["delete","get","head","options"],(function t(e){Ze.prototype[e]=function(t,n){return this.request(ge(n||{},{method:e,url:t,data:(n||{}).data}))}}));at.forEach(["post","put","patch"],(function t(e){function n(t){return function n(o,r,s){return this.request(ge(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}Ze.prototype[e]=n();Ze.prototype[e+"Form"]=n(true)}));const Qe=Ze;class tn{constructor(t){if(typeof t!=="function"){throw new TypeError("executor must be a function.")}let e;this.promise=new Promise((function t(n){e=n}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;while(e-- >0){n._listeners[e](t)}n._listeners=null}));this.promise.then=t=>{let e;const o=new Promise((t=>{n.subscribe(t);e=t})).then(t);o.cancel=function t(){n.unsubscribe(e)};return o};t((function t(o,r,s){if(n.reason){return}n.reason=new se(o,r,s);e(n.reason)}))}throwIfRequested(){if(this.reason){throw this.reason}}subscribe(t){if(this.reason){t(this.reason);return}if(this._listeners){this._listeners.push(t)}else{this._listeners=[t]}}unsubscribe(t){if(!this._listeners){return}const e=this._listeners.indexOf(t);if(e!==-1){this._listeners.splice(e,1)}}toAbortSignal(){const t=new AbortController;const e=e=>{t.abort(e)};this.subscribe(e);t.signal.unsubscribe=()=>this.unsubscribe(e);return t.signal}static source(){let t;const e=new tn((function e(n){t=n}));return{token:e,cancel:t}}}const en=tn;function nn(t){return function e(n){return t.apply(null,n)}}function on(t){return at.isObject(t)&&t.isAxiosError===true}const rn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(rn).forEach((([t,e])=>{rn[e]=t}));const sn=rn;function cn(e){const n=new Qe(e);const o=t(Qe.prototype.request,n);at.extend(o,Qe.prototype,n,{allOwnKeys:true});at.extend(o,n,null,{allOwnKeys:true});o.create=function t(n){return cn(ge(e,n))};return o}const an=cn(Ht);an.Axios=Qe;an.CanceledError=se;an.CancelToken=en;an.isCancel=re;an.VERSION=Ke;an.toFormData=bt;an.AxiosError=ut;an.Cancel=an.CanceledError;an.all=function t(e){return Promise.all(e)};an.spread=nn;an.isAxiosError=on;an.mergeConfig=ge;an.AxiosHeaders=ne;an.formToJSON=t=>$t(at.isHTMLForm(t)?new FormData(t):t);an.getAdapter=Me.getAdapter;an.HttpStatusCode=sn;an.default=an;const un=an;const ln="https://typically-workable-perch.ngrok-free.app/api";const fn="http://localhost:3001";const dn=t=>`bc:reserve${t}`;const hn="@BYCODERS_KEY";const pn="bc:used";const mn=t=>`bc:${t}`;class wn{constructor(){this.axiosInstance=un.create({baseURL:ln,headers:{"Content-Type":"application/json",accept:"application/json"}})}static getInstance(){if(this._instance){return this._instance}this._instance=new wn;return this._instance}async getCustomer(t,e){var n,o;const r={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const s=await this.axiosInstance.get(`/store/${e}/customer/${t}`,{headers:r});this.token=(n=s===null||s===void 0?void 0:s.data)===null||n===void 0?void 0:n.token;return(o=s===null||s===void 0?void 0:s.data)===null||o===void 0?void 0:o.customer}async updateOrder(t){const e=localStorage.getItem("@BYCODERS_KEY");const n={"Content-Type":"application/json",Authorization:`Bearer ${e}`};await this.axiosInstance.patch(`/checkouts/${t.cartId}/updateOrder`,{orderId:t.orderId,externalId:t.cartIdCrm},{headers:n});localStorage.removeItem("@BYCODERS_KEY");localStorage.removeItem(pn);localStorage.removeItem(dn(t.cartId))}async sendPin(t,e,n){const o={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const r=await this.axiosInstance.post("/crmbonus/send-pin",{cellphone:t,name:e,storeName:n},{headers:o});return{storeId:r.data.storeId,userId:r.data.userId}}async validatePinBonus(t){const e={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const n=await this.axiosInstance.post("/crmbonus/process-pin-bonus",t,{headers:e});return n.data}async reserve(t){const e={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const n=await this.axiosInstance.post("/crmbonus/redeem-bonus",t,{headers:e});return n.data}async cancel(t){const e={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const n=await this.axiosInstance.post("/crmbonus/cancel-apply-bonus",{ticket:t},{headers:e});return n.data}async getToken(t){var e,n;const o=await this.axiosInstance.post("/wake/requestToken",{storeName:t});this.token=(e=o===null||o===void 0?void 0:o.data)===null||e===void 0?void 0:e.token;localStorage.setItem(hn,this.token);return(n=o===null||o===void 0?void 0:o.data)===null||n===void 0?void 0:n.token}async getCustomization(t){const e={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const n=await this.axiosInstance.get(`/stores/${t}/customizations`,{headers:e});localStorage.setItem(mn(t),JSON.stringify(n.data));console.log("getCustomization",n);return n.data}async cancelBonus(t,e){const n=localStorage.getItem(hn);const o={"Content-Type":"application/json",Authorization:`Bearer ${n}`};await this.axiosInstance.post(`/crmbonus/cancel-bonus`,{cartId:t,usedBonus:true,storeName:e},{headers:o});localStorage.setItem(t,"0");localStorage.removeItem(pn)}async getInfoBonus(t,e){await this.getToken(e);const n={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const o=await this.axiosInstance.get(`/crmbonus/order-info/${e}/${t}`,{headers:n});return o.data}async patchInfoBonus(t){await this.getToken(t.storeName);const e={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};await this.axiosInstance.patch(`/checkouts/${t.cartId}`,{metadata:t.metadata},{headers:e})}async getInfoCart(t){const e=await fetch(`${t}/api/carrinho`,{credentials:"include"}).then((t=>t.json()));return e}}wn._instance=null;export{wn as C,pn as U,fn as a,dn as g};
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
function t(t,e){return function n(){return t.apply(e,arguments)}}const{toString:e}=Object.prototype;const{getPrototypeOf:n}=Object;const o=(t=>n=>{const o=e.call(n);return t[o]||(t[o]=o.slice(8,-1).toLowerCase())})(Object.create(null));const r=t=>{t=t.toLowerCase();return e=>o(e)===t};const s=t=>e=>typeof e===t;const{isArray:i}=Array;const c=s("undefined");function a(t){return t!==null&&!c(t)&&t.constructor!==null&&!c(t.constructor)&&d(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const u=r("ArrayBuffer");function l(t){let e;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){e=ArrayBuffer.isView(t)}else{e=t&&t.buffer&&u(t.buffer)}return e}const f=s("string");const d=s("function");const h=s("number");const p=t=>t!==null&&typeof t==="object";const m=t=>t===true||t===false;const w=t=>{if(o(t)!=="object"){return false}const e=n(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};const y=r("Date");const b=r("File");const g=r("Blob");const R=r("FileList");const S=t=>p(t)&&d(t.pipe);const O=t=>{let e;return t&&(typeof FormData==="function"&&t instanceof FormData||d(t.append)&&((e=o(t))==="formdata"||e==="object"&&d(t.toString)&&t.toString()==="[object FormData]"))};const E=r("URLSearchParams");const[T,A,j,v]=["ReadableStream","Request","Response","Headers"].map(r);const C=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function N(t,e,{allOwnKeys:n=false}={}){if(t===null||typeof t==="undefined"){return}let o;let r;if(typeof t!=="object"){t=[t]}if(i(t)){for(o=0,r=t.length;o<r;o++){e.call(null,t[o],o,t)}}else{const r=n?Object.getOwnPropertyNames(t):Object.keys(t);const s=r.length;let i;for(o=0;o<s;o++){i=r[o];e.call(null,t[i],i,t)}}}function x(t,e){e=e.toLowerCase();const n=Object.keys(t);let o=n.length;let r;while(o-- >0){r=n[o];if(e===r.toLowerCase()){return r}}return null}const B=(()=>{if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global})();const P=t=>!c(t)&&t!==B;function D(){const{caseless:t}=P(this)&&this||{};const e={};const n=(n,o)=>{const r=t&&x(e,o)||o;if(w(e[r])&&w(n)){e[r]=D(e[r],n)}else if(w(n)){e[r]=D({},n)}else if(i(n)){e[r]=n.slice()}else{e[r]=n}};for(let t=0,e=arguments.length;t<e;t++){arguments[t]&&N(arguments[t],n)}return e}const F=(e,n,o,{allOwnKeys:r}={})=>{N(n,((n,r)=>{if(o&&d(n)){e[r]=t(n,o)}else{e[r]=n}}),{allOwnKeys:r});return e};const U=t=>{if(t.charCodeAt(0)===65279){t=t.slice(1)}return t};const _=(t,e,n,o)=>{t.prototype=Object.create(e.prototype,o);t.prototype.constructor=t;Object.defineProperty(t,"super",{value:e.prototype});n&&Object.assign(t.prototype,n)};const k=(t,e,o,r)=>{let s;let i;let c;const a={};e=e||{};if(t==null)return e;do{s=Object.getOwnPropertyNames(t);i=s.length;while(i-- >0){c=s[i];if((!r||r(c,t,e))&&!a[c]){e[c]=t[c];a[c]=true}}t=o!==false&&n(t)}while(t&&(!o||o(t,e))&&t!==Object.prototype);return e};const q=(t,e,n)=>{t=String(t);if(n===undefined||n>t.length){n=t.length}n-=e.length;const o=t.indexOf(e,n);return o!==-1&&o===n};const I=t=>{if(!t)return null;if(i(t))return t;let e=t.length;if(!h(e))return null;const n=new Array(e);while(e-- >0){n[e]=t[e]}return n};const L=(t=>e=>t&&e instanceof t)(typeof Uint8Array!=="undefined"&&n(Uint8Array));const $=(t,e)=>{const n=t&&t[Symbol.iterator];const o=n.call(t);let r;while((r=o.next())&&!r.done){const n=r.value;e.call(t,n[0],n[1])}};const z=(t,e)=>{let n;const o=[];while((n=t.exec(e))!==null){o.push(n)}return o};const M=r("HTMLFormElement");const H=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function t(e,n,o){return n.toUpperCase()+o}));const J=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype);const K=r("RegExp");const Y=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t);const o={};N(n,((n,r)=>{let s;if((s=e(n,r,t))!==false){o[r]=s||n}}));Object.defineProperties(t,o)};const V=t=>{Y(t,((e,n)=>{if(d(t)&&["arguments","caller","callee"].indexOf(n)!==-1){return false}const o=t[n];if(!d(o))return;e.enumerable=false;if("writable"in e){e.writable=false;return}if(!e.set){e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}}}))};const W=(t,e)=>{const n={};const o=t=>{t.forEach((t=>{n[t]=true}))};i(t)?o(t):o(String(t).split(e));return n};const G=()=>{};const X=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;const Z="abcdefghijklmnopqrstuvwxyz";const Q="0123456789";const tt={DIGIT:Q,ALPHA:Z,ALPHA_DIGIT:Z+Z.toUpperCase()+Q};const et=(t=16,e=tt.ALPHA_DIGIT)=>{let n="";const{length:o}=e;while(t--){n+=e[Math.random()*o|0]}return n};function nt(t){return!!(t&&d(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const ot=t=>{const e=new Array(10);const n=(t,o)=>{if(p(t)){if(e.indexOf(t)>=0){return}if(!("toJSON"in t)){e[o]=t;const r=i(t)?[]:{};N(t,((t,e)=>{const s=n(t,o+1);!c(s)&&(r[e]=s)}));e[o]=undefined;return r}}return t};return n(t,0)};const rt=r("AsyncFunction");const st=t=>t&&(p(t)||d(t))&&d(t.then)&&d(t.catch);const it=((t,e)=>{if(t){return setImmediate}return e?((t,e)=>{B.addEventListener("message",(({source:n,data:o})=>{if(n===B&&o===t){e.length&&e.shift()()}}),false);return n=>{e.push(n);B.postMessage(t,"*")}})(`axios@${Math.random()}`,[]):t=>setTimeout(t)})(typeof setImmediate==="function",d(B.postMessage));const ct=typeof queueMicrotask!=="undefined"?queueMicrotask.bind(B):typeof process!=="undefined"&&process.nextTick||it;const at={isArray:i,isArrayBuffer:u,isBuffer:a,isFormData:O,isArrayBufferView:l,isString:f,isNumber:h,isBoolean:m,isObject:p,isPlainObject:w,isReadableStream:T,isRequest:A,isResponse:j,isHeaders:v,isUndefined:c,isDate:y,isFile:b,isBlob:g,isRegExp:K,isFunction:d,isStream:S,isURLSearchParams:E,isTypedArray:L,isFileList:R,forEach:N,merge:D,extend:F,trim:C,stripBOM:U,inherits:_,toFlatObject:k,kindOf:o,kindOfTest:r,endsWith:q,toArray:I,forEachEntry:$,matchAll:z,isHTMLForm:M,hasOwnProperty:J,hasOwnProp:J,reduceDescriptors:Y,freezeMethods:V,toObjectSet:W,toCamelCase:H,noop:G,toFiniteNumber:X,findKey:x,global:B,isContextDefined:P,ALPHABET:tt,generateString:et,isSpecCompliantForm:nt,toJSONObject:ot,isAsyncFn:rt,isThenable:st,setImmediate:it,asap:ct};function ut(t,e,n,o,r){Error.call(this);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=(new Error).stack}this.message=t;this.name="AxiosError";e&&(this.code=e);n&&(this.config=n);o&&(this.request=o);if(r){this.response=r;this.status=r.status?r.status:null}}at.inherits(ut,Error,{toJSON:function t(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:at.toJSONObject(this.config),code:this.code,status:this.status}}});const lt=ut.prototype;const ft={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{ft[t]={value:t}}));Object.defineProperties(ut,ft);Object.defineProperty(lt,"isAxiosError",{value:true});ut.from=(t,e,n,o,r,s)=>{const i=Object.create(lt);at.toFlatObject(t,i,(function t(e){return e!==Error.prototype}),(t=>t!=="isAxiosError"));ut.call(i,t.message,e,n,o,r);i.cause=t;i.name=t.name;s&&Object.assign(i,s);return i};const dt=null;function ht(t){return at.isPlainObject(t)||at.isArray(t)}function pt(t){return at.endsWith(t,"[]")?t.slice(0,-2):t}function mt(t,e,n){if(!t)return e;return t.concat(e).map((function t(e,o){e=pt(e);return!n&&o?"["+e+"]":e})).join(n?".":"")}function wt(t){return at.isArray(t)&&!t.some(ht)}const yt=at.toFlatObject(at,{},null,(function t(e){return/^is[A-Z]/.test(e)}));function bt(t,e,n){if(!at.isObject(t)){throw new TypeError("target must be an object")}e=e||new FormData;n=at.toFlatObject(n,{metaTokens:true,dots:false,indexes:false},false,(function t(e,n){return!at.isUndefined(n[e])}));const o=n.metaTokens;const r=n.visitor||l;const s=n.dots;const i=n.indexes;const c=n.Blob||typeof Blob!=="undefined"&&Blob;const a=c&&at.isSpecCompliantForm(e);if(!at.isFunction(r)){throw new TypeError("visitor must be a function")}function u(t){if(t===null)return"";if(at.isDate(t)){return t.toISOString()}if(!a&&at.isBlob(t)){throw new ut("Blob is not supported. Use a Buffer instead.")}if(at.isArrayBuffer(t)||at.isTypedArray(t)){return a&&typeof Blob==="function"?new Blob([t]):Buffer.from(t)}return t}function l(t,n,r){let c=t;if(t&&!r&&typeof t==="object"){if(at.endsWith(n,"{}")){n=o?n:n.slice(0,-2);t=JSON.stringify(t)}else if(at.isArray(t)&&wt(t)||(at.isFileList(t)||at.endsWith(n,"[]"))&&(c=at.toArray(t))){n=pt(n);c.forEach((function t(o,r){!(at.isUndefined(o)||o===null)&&e.append(i===true?mt([n],r,s):i===null?n:n+"[]",u(o))}));return false}}if(ht(t)){return true}e.append(mt(r,n,s),u(t));return false}const f=[];const d=Object.assign(yt,{defaultVisitor:l,convertValue:u,isVisitable:ht});function h(t,n){if(at.isUndefined(t))return;if(f.indexOf(t)!==-1){throw Error("Circular reference detected in "+n.join("."))}f.push(t);at.forEach(t,(function t(o,s){const i=!(at.isUndefined(o)||o===null)&&r.call(e,o,at.isString(s)?s.trim():s,n,d);if(i===true){h(o,n?n.concat(s):[s])}}));f.pop()}if(!at.isObject(t)){throw new TypeError("data must be an object")}h(t);return e}function gt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function t(n){return e[n]}))}function Rt(t,e){this._pairs=[];t&&bt(t,this,e)}const St=Rt.prototype;St.append=function t(e,n){this._pairs.push([e,n])};St.toString=function t(e){const n=e?function(t){return e.call(this,t,gt)}:gt;return this._pairs.map((function t(e){return n(e[0])+"="+n(e[1])}),"").join("&")};function Ot(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Et(t,e,n){if(!e){return t}const o=n&&n.encode||Ot;const r=n&&n.serialize;let s;if(r){s=r(e,n)}else{s=at.isURLSearchParams(e)?e.toString():new Rt(e,n).toString(o)}if(s){const e=t.indexOf("#");if(e!==-1){t=t.slice(0,e)}t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Tt{constructor(){this.handlers=[]}use(t,e,n){this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:false,runWhen:n?n.runWhen:null});return this.handlers.length-1}eject(t){if(this.handlers[t]){this.handlers[t]=null}}clear(){if(this.handlers){this.handlers=[]}}forEach(t){at.forEach(this.handlers,(function e(n){if(n!==null){t(n)}}))}}const At=Tt;const jt={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};const vt=typeof URLSearchParams!=="undefined"?URLSearchParams:Rt;const Ct=typeof FormData!=="undefined"?FormData:null;const Nt=typeof Blob!=="undefined"?Blob:null;const xt={isBrowser:true,classes:{URLSearchParams:vt,FormData:Ct,Blob:Nt},protocols:["http","https","file","blob","url","data"]};const Bt=typeof window!=="undefined"&&typeof document!=="undefined";const Pt=typeof navigator==="object"&&navigator||undefined;const Dt=Bt&&(!Pt||["ReactNative","NativeScript","NS"].indexOf(Pt.product)<0);const Ft=(()=>typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function")();const Ut=Bt&&window.location.href||"http://localhost";const _t=Object.freeze({__proto__:null,hasBrowserEnv:Bt,hasStandardBrowserWebWorkerEnv:Ft,hasStandardBrowserEnv:Dt,navigator:Pt,origin:Ut});const kt={..._t,...xt};function qt(t,e){return bt(t,new kt.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,o){if(kt.isNode&&at.isBuffer(t)){this.append(e,t.toString("base64"));return false}return o.defaultVisitor.apply(this,arguments)}},e))}function It(t){return at.matchAll(/\w+|\[(\w*)]/g,t).map((t=>t[0]==="[]"?"":t[1]||t[0]))}function Lt(t){const e={};const n=Object.keys(t);let o;const r=n.length;let s;for(o=0;o<r;o++){s=n[o];e[s]=t[s]}return e}function $t(t){function e(t,n,o,r){let s=t[r++];if(s==="__proto__")return true;const i=Number.isFinite(+s);const c=r>=t.length;s=!s&&at.isArray(o)?o.length:s;if(c){if(at.hasOwnProp(o,s)){o[s]=[o[s],n]}else{o[s]=n}return!i}if(!o[s]||!at.isObject(o[s])){o[s]=[]}const a=e(t,n,o[s],r);if(a&&at.isArray(o[s])){o[s]=Lt(o[s])}return!i}if(at.isFormData(t)&&at.isFunction(t.entries)){const n={};at.forEachEntry(t,((t,o)=>{e(It(t),o,n,0)}));return n}return null}function zt(t,e,n){if(at.isString(t)){try{(e||JSON.parse)(t);return at.trim(t)}catch(t){if(t.name!=="SyntaxError"){throw t}}}return(n||JSON.stringify)(t)}const Mt={transitional:jt,adapter:["xhr","http","fetch"],transformRequest:[function t(e,n){const o=n.getContentType()||"";const r=o.indexOf("application/json")>-1;const s=at.isObject(e);if(s&&at.isHTMLForm(e)){e=new FormData(e)}const i=at.isFormData(e);if(i){return r?JSON.stringify($t(e)):e}if(at.isArrayBuffer(e)||at.isBuffer(e)||at.isStream(e)||at.isFile(e)||at.isBlob(e)||at.isReadableStream(e)){return e}if(at.isArrayBufferView(e)){return e.buffer}if(at.isURLSearchParams(e)){n.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return e.toString()}let c;if(s){if(o.indexOf("application/x-www-form-urlencoded")>-1){return qt(e,this.formSerializer).toString()}if((c=at.isFileList(e))||o.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return bt(c?{"files[]":e}:e,t&&new t,this.formSerializer)}}if(s||r){n.setContentType("application/json",false);return zt(e)}return e}],transformResponse:[function t(e){const n=this.transitional||Mt.transitional;const o=n&&n.forcedJSONParsing;const r=this.responseType==="json";if(at.isResponse(e)||at.isReadableStream(e)){return e}if(e&&at.isString(e)&&(o&&!this.responseType||r)){const t=n&&n.silentJSONParsing;const o=!t&&r;try{return JSON.parse(e)}catch(t){if(o){if(t.name==="SyntaxError"){throw ut.from(t,ut.ERR_BAD_RESPONSE,this,null,this.response)}throw t}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:kt.classes.FormData,Blob:kt.classes.Blob},validateStatus:function t(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":undefined}}};at.forEach(["delete","get","head","post","put","patch"],(t=>{Mt.headers[t]={}}));const Ht=Mt;const Jt=at.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Kt=t=>{const e={};let n;let o;let r;t&&t.split("\n").forEach((function t(s){r=s.indexOf(":");n=s.substring(0,r).trim().toLowerCase();o=s.substring(r+1).trim();if(!n||e[n]&&Jt[n]){return}if(n==="set-cookie"){if(e[n]){e[n].push(o)}else{e[n]=[o]}}else{e[n]=e[n]?e[n]+", "+o:o}}));return e};const Yt=Symbol("internals");function Vt(t){return t&&String(t).trim().toLowerCase()}function Wt(t){if(t===false||t==null){return t}return at.isArray(t)?t.map(Wt):String(t)}function Gt(t){const e=Object.create(null);const n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;while(o=n.exec(t)){e[o[1]]=o[2]}return e}const Xt=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Zt(t,e,n,o,r){if(at.isFunction(o)){return o.call(this,e,n)}if(r){e=n}if(!at.isString(e))return;if(at.isString(o)){return e.indexOf(o)!==-1}if(at.isRegExp(o)){return o.test(e)}}function Qt(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}function te(t,e){const n=at.toCamelCase(" "+e);["get","set","has"].forEach((o=>{Object.defineProperty(t,o+n,{value:function(t,n,r){return this[o].call(this,e,t,n,r)},configurable:true})}))}class ee{constructor(t){t&&this.set(t)}set(t,e,n){const o=this;function r(t,e,n){const r=Vt(e);if(!r){throw new Error("header name must be a non-empty string")}const s=at.findKey(o,r);if(!s||o[s]===undefined||n===true||n===undefined&&o[s]!==false){o[s||e]=Wt(t)}}const s=(t,e)=>at.forEach(t,((t,n)=>r(t,n,e)));if(at.isPlainObject(t)||t instanceof this.constructor){s(t,e)}else if(at.isString(t)&&(t=t.trim())&&!Xt(t)){s(Kt(t),e)}else if(at.isHeaders(t)){for(const[e,o]of t.entries()){r(o,e,n)}}else{t!=null&&r(e,t,n)}return this}get(t,e){t=Vt(t);if(t){const n=at.findKey(this,t);if(n){const t=this[n];if(!e){return t}if(e===true){return Gt(t)}if(at.isFunction(e)){return e.call(this,t,n)}if(at.isRegExp(e)){return e.exec(t)}throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){t=Vt(t);if(t){const n=at.findKey(this,t);return!!(n&&this[n]!==undefined&&(!e||Zt(this,this[n],n,e)))}return false}delete(t,e){const n=this;let o=false;function r(t){t=Vt(t);if(t){const r=at.findKey(n,t);if(r&&(!e||Zt(n,n[r],r,e))){delete n[r];o=true}}}if(at.isArray(t)){t.forEach(r)}else{r(t)}return o}clear(t){const e=Object.keys(this);let n=e.length;let o=false;while(n--){const r=e[n];if(!t||Zt(this,this[r],r,t,true)){delete this[r];o=true}}return o}normalize(t){const e=this;const n={};at.forEach(this,((o,r)=>{const s=at.findKey(n,r);if(s){e[s]=Wt(o);delete e[r];return}const i=t?Qt(r):String(r).trim();if(i!==r){delete e[r]}e[i]=Wt(o);n[i]=true}));return this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);at.forEach(this,((n,o)=>{n!=null&&n!==false&&(e[o]=t&&at.isArray(n)?n.join(", "):n)}));return e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);e.forEach((t=>n.set(t)));return n}static accessor(t){const e=this[Yt]=this[Yt]={accessors:{}};const n=e.accessors;const o=this.prototype;function r(t){const e=Vt(t);if(!n[e]){te(o,t);n[e]=true}}at.isArray(t)?t.forEach(r):r(t);return this}}ee.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);at.reduceDescriptors(ee.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}}));at.freezeMethods(ee);const ne=ee;function oe(t,e){const n=this||Ht;const o=e||n;const r=ne.from(o.headers);let s=o.data;at.forEach(t,(function t(o){s=o.call(n,s,r.normalize(),e?e.status:undefined)}));r.normalize();return s}function re(t){return!!(t&&t.__CANCEL__)}function se(t,e,n){ut.call(this,t==null?"canceled":t,ut.ERR_CANCELED,e,n);this.name="CanceledError"}at.inherits(se,ut,{__CANCEL__:true});function ie(t,e,n){const o=n.config.validateStatus;if(!n.status||!o||o(n.status)){t(n)}else{e(new ut("Request failed with status code "+n.status,[ut.ERR_BAD_REQUEST,ut.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}}function ce(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ae(t,e){t=t||10;const n=new Array(t);const o=new Array(t);let r=0;let s=0;let i;e=e!==undefined?e:1e3;return function c(a){const u=Date.now();const l=o[s];if(!i){i=u}n[r]=a;o[r]=u;let f=s;let d=0;while(f!==r){d+=n[f++];f=f%t}r=(r+1)%t;if(r===s){s=(s+1)%t}if(u-i<e){return}const h=l&&u-l;return h?Math.round(d*1e3/h):undefined}}function ue(t,e){let n=0;let o=1e3/e;let r;let s;const i=(e,o=Date.now())=>{n=o;r=null;if(s){clearTimeout(s);s=null}t.apply(null,e)};const c=(...t)=>{const e=Date.now();const c=e-n;if(c>=o){i(t,e)}else{r=t;if(!s){s=setTimeout((()=>{s=null;i(r)}),o-c)}}};const a=()=>r&&i(r);return[c,a]}const le=(t,e,n=3)=>{let o=0;const r=ae(50,250);return ue((n=>{const s=n.loaded;const i=n.lengthComputable?n.total:undefined;const c=s-o;const a=r(c);const u=s<=i;o=s;const l={loaded:s,total:i,progress:i?s/i:undefined,bytes:c,rate:a?a:undefined,estimated:a&&i&&u?(i-s)/a:undefined,event:n,lengthComputable:i!=null,[e?"download":"upload"]:true};t(l)}),n)};const fe=(t,e)=>{const n=t!=null;return[o=>e[0]({lengthComputable:n,total:t,loaded:o}),e[1]]};const de=t=>(...e)=>at.asap((()=>t(...e)));const he=kt.hasStandardBrowserEnv?function t(){const e=kt.navigator&&/(msie|trident)/i.test(kt.navigator.userAgent);const n=document.createElement("a");let o;function r(t){let o=t;if(e){n.setAttribute("href",o);o=n.href}n.setAttribute("href",o);return{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}o=r(window.location.href);return function t(e){const n=at.isString(e)?r(e):e;return n.protocol===o.protocol&&n.host===o.host}}():function t(){return function t(){return true}}();const pe=kt.hasStandardBrowserEnv?{write(t,e,n,o,r,s){const i=[t+"="+encodeURIComponent(e)];at.isNumber(n)&&i.push("expires="+new Date(n).toGMTString());at.isString(o)&&i.push("path="+o);at.isString(r)&&i.push("domain="+r);s===true&&i.push("secure");document.cookie=i.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function me(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function we(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ye(t,e){if(t&&!me(e)){return we(t,e)}return e}const be=t=>t instanceof ne?{...t}:t;function ge(t,e){e=e||{};const n={};function o(t,e,n){if(at.isPlainObject(t)&&at.isPlainObject(e)){return at.merge.call({caseless:n},t,e)}else if(at.isPlainObject(e)){return at.merge({},e)}else if(at.isArray(e)){return e.slice()}return e}function r(t,e,n){if(!at.isUndefined(e)){return o(t,e,n)}else if(!at.isUndefined(t)){return o(undefined,t,n)}}function s(t,e){if(!at.isUndefined(e)){return o(undefined,e)}}function i(t,e){if(!at.isUndefined(e)){return o(undefined,e)}else if(!at.isUndefined(t)){return o(undefined,t)}}function c(n,r,s){if(s in e){return o(n,r)}else if(s in t){return o(undefined,n)}}const a={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(t,e)=>r(be(t),be(e),true)};at.forEach(Object.keys(Object.assign({},t,e)),(function o(s){const i=a[s]||r;const u=i(t[s],e[s],s);at.isUndefined(u)&&i!==c||(n[s]=u)}));return n}const Re=t=>{const e=ge({},t);let{data:n,withXSRFToken:o,xsrfHeaderName:r,xsrfCookieName:s,headers:i,auth:c}=e;e.headers=i=ne.from(i);e.url=Et(ye(e.baseURL,e.url),t.params,t.paramsSerializer);if(c){i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")))}let a;if(at.isFormData(n)){if(kt.hasStandardBrowserEnv||kt.hasStandardBrowserWebWorkerEnv){i.setContentType(undefined)}else if((a=i.getContentType())!==false){const[t,...e]=a?a.split(";").map((t=>t.trim())).filter(Boolean):[];i.setContentType([t||"multipart/form-data",...e].join("; "))}}if(kt.hasStandardBrowserEnv){o&&at.isFunction(o)&&(o=o(e));if(o||o!==false&&he(e.url)){const t=r&&s&&pe.read(s);if(t){i.set(r,t)}}}return e};const Se=typeof XMLHttpRequest!=="undefined";const Oe=Se&&function(t){return new Promise((function e(n,o){const r=Re(t);let s=r.data;const i=ne.from(r.headers).normalize();let{responseType:c,onUploadProgress:a,onDownloadProgress:u}=r;let l;let f,d;let h,p;function m(){h&&h();p&&p();r.cancelToken&&r.cancelToken.unsubscribe(l);r.signal&&r.signal.removeEventListener("abort",l)}let w=new XMLHttpRequest;w.open(r.method.toUpperCase(),r.url,true);w.timeout=r.timeout;function y(){if(!w){return}const e=ne.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders());const r=!c||c==="text"||c==="json"?w.responseText:w.response;const s={data:r,status:w.status,statusText:w.statusText,headers:e,config:t,request:w};ie((function t(e){n(e);m()}),(function t(e){o(e);m()}),s);w=null}if("onloadend"in w){w.onloadend=y}else{w.onreadystatechange=function t(){if(!w||w.readyState!==4){return}if(w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)){return}setTimeout(y)}}w.onabort=function e(){if(!w){return}o(new ut("Request aborted",ut.ECONNABORTED,t,w));w=null};w.onerror=function e(){o(new ut("Network Error",ut.ERR_NETWORK,t,w));w=null};w.ontimeout=function e(){let n=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const s=r.transitional||jt;if(r.timeoutErrorMessage){n=r.timeoutErrorMessage}o(new ut(n,s.clarifyTimeoutError?ut.ETIMEDOUT:ut.ECONNABORTED,t,w));w=null};s===undefined&&i.setContentType(null);if("setRequestHeader"in w){at.forEach(i.toJSON(),(function t(e,n){w.setRequestHeader(n,e)}))}if(!at.isUndefined(r.withCredentials)){w.withCredentials=!!r.withCredentials}if(c&&c!=="json"){w.responseType=r.responseType}if(u){[d,p]=le(u,true);w.addEventListener("progress",d)}if(a&&w.upload){[f,h]=le(a);w.upload.addEventListener("progress",f);w.upload.addEventListener("loadend",h)}if(r.cancelToken||r.signal){l=e=>{if(!w){return}o(!e||e.type?new se(null,t,w):e);w.abort();w=null};r.cancelToken&&r.cancelToken.subscribe(l);if(r.signal){r.signal.aborted?l():r.signal.addEventListener("abort",l)}}const b=ce(r.url);if(b&&kt.protocols.indexOf(b)===-1){o(new ut("Unsupported protocol "+b+":",ut.ERR_BAD_REQUEST,t));return}w.send(s||null)}))};const Ee=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let n=new AbortController;let o;const r=function(t){if(!o){o=true;i();const e=t instanceof Error?t:this.reason;n.abort(e instanceof ut?e:new se(e instanceof Error?e.message:e))}};let s=e&&setTimeout((()=>{s=null;r(new ut(`timeout ${e} of ms exceeded`,ut.ETIMEDOUT))}),e);const i=()=>{if(t){s&&clearTimeout(s);s=null;t.forEach((t=>{t.unsubscribe?t.unsubscribe(r):t.removeEventListener("abort",r)}));t=null}};t.forEach((t=>t.addEventListener("abort",r)));const{signal:c}=n;c.unsubscribe=()=>at.asap(i);return c}};const Te=Ee;const Ae=function*(t,e){let n=t.byteLength;if(!e||n<e){yield t;return}let o=0;let r;while(o<n){r=o+e;yield t.slice(o,r);o=r}};const je=async function*(t,e){for await(const n of ve(t)){yield*Ae(n,e)}};const ve=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t){break}yield n}}finally{await e.cancel()}};const Ce=(t,e,n,o)=>{const r=je(t,e);let s=0;let i;let c=t=>{if(!i){i=true;o&&o(t)}};return new ReadableStream({async pull(t){try{const{done:e,value:o}=await r.next();if(e){c();t.close();return}let i=o.byteLength;if(n){let t=s+=i;n(t)}t.enqueue(new Uint8Array(o))}catch(t){c(t);throw t}},cancel(t){c(t);return r.return()}},{highWaterMark:2})};const Ne=typeof fetch==="function"&&typeof Request==="function"&&typeof Response==="function";const xe=Ne&&typeof ReadableStream==="function";const Be=Ne&&(typeof TextEncoder==="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer()));const Pe=(t,...e)=>{try{return!!t(...e)}catch(t){return false}};const De=xe&&Pe((()=>{let t=false;const e=new Request(kt.origin,{body:new ReadableStream,method:"POST",get duplex(){t=true;return"half"}}).headers.has("Content-Type");return t&&!e}));const Fe=64*1024;const Ue=xe&&Pe((()=>at.isReadableStream(new Response("").body)));const _e={stream:Ue&&(t=>t.body)};Ne&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!_e[e]&&(_e[e]=at.isFunction(t[e])?t=>t[e]():(t,n)=>{throw new ut(`Response type '${e}' is not supported`,ut.ERR_NOT_SUPPORT,n)})}))})(new Response);const ke=async t=>{if(t==null){return 0}if(at.isBlob(t)){return t.size}if(at.isSpecCompliantForm(t)){const e=new Request(kt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}if(at.isArrayBufferView(t)||at.isArrayBuffer(t)){return t.byteLength}if(at.isURLSearchParams(t)){t=t+""}if(at.isString(t)){return(await Be(t)).byteLength}};const qe=async(t,e)=>{const n=at.toFiniteNumber(t.getContentLength());return n==null?ke(e):n};const Ie=Ne&&(async t=>{let{url:e,method:n,data:o,signal:r,cancelToken:s,timeout:i,onDownloadProgress:c,onUploadProgress:a,responseType:u,headers:l,withCredentials:f="same-origin",fetchOptions:d}=Re(t);u=u?(u+"").toLowerCase():"text";let h=Te([r,s&&s.toAbortSignal()],i);let p;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let w;try{if(a&&De&&n!=="get"&&n!=="head"&&(w=await qe(l,o))!==0){let t=new Request(e,{method:"POST",body:o,duplex:"half"});let n;if(at.isFormData(o)&&(n=t.headers.get("content-type"))){l.setContentType(n)}if(t.body){const[e,n]=fe(w,le(de(a)));o=Ce(t.body,Fe,e,n)}}if(!at.isString(f)){f=f?"include":"omit"}const r="credentials"in Request.prototype;p=new Request(e,{...d,signal:h,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:o,duplex:"half",credentials:r?f:undefined});let s=await fetch(p);const i=Ue&&(u==="stream"||u==="response");if(Ue&&(c||i&&m)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=s[e]}));const e=at.toFiniteNumber(s.headers.get("content-length"));const[n,o]=c&&fe(e,le(de(c),true))||[];s=new Response(Ce(s.body,Fe,n,(()=>{o&&o();m&&m()})),t)}u=u||"text";let y=await _e[at.findKey(_e,u)||"text"](s,t);!i&&m&&m();return await new Promise(((e,n)=>{ie(e,n,{data:y,headers:ne.from(s.headers),status:s.status,statusText:s.statusText,config:t,request:p})}))}catch(e){m&&m();if(e&&e.name==="TypeError"&&/fetch/i.test(e.message)){throw Object.assign(new ut("Network Error",ut.ERR_NETWORK,t,p),{cause:e.cause||e})}throw ut.from(e,e&&e.code,t,p)}});const Le={http:dt,xhr:Oe,fetch:Ie};at.forEach(Le,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const $e=t=>`- ${t}`;const ze=t=>at.isFunction(t)||t===null||t===false;const Me={getAdapter:t=>{t=at.isArray(t)?t:[t];const{length:e}=t;let n;let o;const r={};for(let s=0;s<e;s++){n=t[s];let e;o=n;if(!ze(n)){o=Le[(e=String(n)).toLowerCase()];if(o===undefined){throw new ut(`Unknown adapter '${e}'`)}}if(o){break}r[e||"#"+s]=o}if(!o){const t=Object.entries(r).map((([t,e])=>`adapter ${t} `+(e===false?"is not supported by the environment":"is not available in the build")));let n=e?t.length>1?"since :\n"+t.map($e).join("\n"):" "+$e(t[0]):"as no adapter specified";throw new ut(`There is no suitable adapter to dispatch the request `+n,"ERR_NOT_SUPPORT")}return o},adapters:Le};function He(t){if(t.cancelToken){t.cancelToken.throwIfRequested()}if(t.signal&&t.signal.aborted){throw new se(null,t)}}function Je(t){He(t);t.headers=ne.from(t.headers);t.data=oe.call(t,t.transformRequest);if(["post","put","patch"].indexOf(t.method)!==-1){t.headers.setContentType("application/x-www-form-urlencoded",false)}const e=Me.getAdapter(t.adapter||Ht.adapter);return e(t).then((function e(n){He(t);n.data=oe.call(t,t.transformResponse,n);n.headers=ne.from(n.headers);return n}),(function e(n){if(!re(n)){He(t);if(n&&n.response){n.response.data=oe.call(t,t.transformResponse,n.response);n.response.headers=ne.from(n.response.headers)}}return Promise.reject(n)}))}const Ke="1.7.7";const Ye={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Ye[t]=function n(o){return typeof o===t||"a"+(e<1?"n ":" ")+t}}));const Ve={};Ye.transitional=function t(e,n,o){function r(t,e){return"[Axios v"+Ke+"] Transitional option '"+t+"'"+e+(o?". "+o:"")}return(t,o,s)=>{if(e===false){throw new ut(r(o," has been removed"+(n?" in "+n:"")),ut.ERR_DEPRECATED)}if(n&&!Ve[o]){Ve[o]=true;console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))}return e?e(t,o,s):true}};function We(t,e,n){if(typeof t!=="object"){throw new ut("options must be an object",ut.ERR_BAD_OPTION_VALUE)}const o=Object.keys(t);let r=o.length;while(r-- >0){const s=o[r];const i=e[s];if(i){const e=t[s];const n=e===undefined||i(e,s,t);if(n!==true){throw new ut("option "+s+" must be "+n,ut.ERR_BAD_OPTION_VALUE)}continue}if(n!==true){throw new ut("Unknown option "+s,ut.ERR_BAD_OPTION)}}}const Ge={assertOptions:We,validators:Ye};const Xe=Ge.validators;class Ze{constructor(t){this.defaults=t;this.interceptors={request:new At,response:new At}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const n=e.stack?e.stack.replace(/^.+\n/,""):"";try{if(!t.stack){t.stack=n}else if(n&&!String(t.stack).endsWith(n.replace(/^.+\n.+\n/,""))){t.stack+="\n"+n}}catch(t){}}throw t}}_request(t,e){if(typeof t==="string"){e=e||{};e.url=t}else{e=t||{}}e=ge(this.defaults,e);const{transitional:n,paramsSerializer:o,headers:r}=e;if(n!==undefined){Ge.assertOptions(n,{silentJSONParsing:Xe.transitional(Xe.boolean),forcedJSONParsing:Xe.transitional(Xe.boolean),clarifyTimeoutError:Xe.transitional(Xe.boolean)},false)}if(o!=null){if(at.isFunction(o)){e.paramsSerializer={serialize:o}}else{Ge.assertOptions(o,{encode:Xe.function,serialize:Xe.function},true)}}e.method=(e.method||this.defaults.method||"get").toLowerCase();let s=r&&at.merge(r.common,r[e.method]);r&&at.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete r[t]}));e.headers=ne.concat(s,r);const i=[];let c=true;this.interceptors.request.forEach((function t(n){if(typeof n.runWhen==="function"&&n.runWhen(e)===false){return}c=c&&n.synchronous;i.unshift(n.fulfilled,n.rejected)}));const a=[];this.interceptors.response.forEach((function t(e){a.push(e.fulfilled,e.rejected)}));let u;let l=0;let f;if(!c){const t=[Je.bind(this),undefined];t.unshift.apply(t,i);t.push.apply(t,a);f=t.length;u=Promise.resolve(e);while(l<f){u=u.then(t[l++],t[l++])}return u}f=i.length;let d=e;l=0;while(l<f){const t=i[l++];const e=i[l++];try{d=t(d)}catch(t){e.call(this,t);break}}try{u=Je.call(this,d)}catch(t){return Promise.reject(t)}l=0;f=a.length;while(l<f){u=u.then(a[l++],a[l++])}return u}getUri(t){t=ge(this.defaults,t);const e=ye(t.baseURL,t.url);return Et(e,t.params,t.paramsSerializer)}}at.forEach(["delete","get","head","options"],(function t(e){Ze.prototype[e]=function(t,n){return this.request(ge(n||{},{method:e,url:t,data:(n||{}).data}))}}));at.forEach(["post","put","patch"],(function t(e){function n(t){return function n(o,r,s){return this.request(ge(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}Ze.prototype[e]=n();Ze.prototype[e+"Form"]=n(true)}));const Qe=Ze;class tn{constructor(t){if(typeof t!=="function"){throw new TypeError("executor must be a function.")}let e;this.promise=new Promise((function t(n){e=n}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;while(e-- >0){n._listeners[e](t)}n._listeners=null}));this.promise.then=t=>{let e;const o=new Promise((t=>{n.subscribe(t);e=t})).then(t);o.cancel=function t(){n.unsubscribe(e)};return o};t((function t(o,r,s){if(n.reason){return}n.reason=new se(o,r,s);e(n.reason)}))}throwIfRequested(){if(this.reason){throw this.reason}}subscribe(t){if(this.reason){t(this.reason);return}if(this._listeners){this._listeners.push(t)}else{this._listeners=[t]}}unsubscribe(t){if(!this._listeners){return}const e=this._listeners.indexOf(t);if(e!==-1){this._listeners.splice(e,1)}}toAbortSignal(){const t=new AbortController;const e=e=>{t.abort(e)};this.subscribe(e);t.signal.unsubscribe=()=>this.unsubscribe(e);return t.signal}static source(){let t;const e=new tn((function e(n){t=n}));return{token:e,cancel:t}}}const en=tn;function nn(t){return function e(n){return t.apply(null,n)}}function on(t){return at.isObject(t)&&t.isAxiosError===true}const rn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(rn).forEach((([t,e])=>{rn[e]=t}));const sn=rn;function cn(e){const n=new Qe(e);const o=t(Qe.prototype.request,n);at.extend(o,Qe.prototype,n,{allOwnKeys:true});at.extend(o,n,null,{allOwnKeys:true});o.create=function t(n){return cn(ge(e,n))};return o}const an=cn(Ht);an.Axios=Qe;an.CanceledError=se;an.CancelToken=en;an.isCancel=re;an.VERSION=Ke;an.toFormData=bt;an.AxiosError=ut;an.Cancel=an.CanceledError;an.all=function t(e){return Promise.all(e)};an.spread=nn;an.isAxiosError=on;an.mergeConfig=ge;an.AxiosHeaders=ne;an.formToJSON=t=>$t(at.isHTMLForm(t)?new FormData(t):t);an.getAdapter=Me.getAdapter;an.HttpStatusCode=sn;an.default=an;const un=an;const ln="https://typically-workable-perch.ngrok-free.app/api";const fn="http://localhost:3001";const dn=t=>`bc:reserve${t}`;const hn="@BYCODERS_KEY";const pn="bc:used";const mn=t=>`bc:${t}`;class wn{constructor(){this.axiosInstance=un.create({baseURL:ln,headers:{"Content-Type":"application/json",accept:"application/json"}})}static getInstance(){if(this._instance){return this._instance}this._instance=new wn;return this._instance}async getCustomer(t,e){var n,o,r,s;const i=localStorage.getItem("@BYCODERS_KEY");const c={"Content-Type":"application/json",Authorization:`Bearer ${i}`};const a=await this.axiosInstance.get(`/store/${e}/customer/${t}`,{headers:c});if((n=a===null||a===void 0?void 0:a.data)===null||n===void 0?void 0:n.token){this.token=(o=a===null||a===void 0?void 0:a.data)===null||o===void 0?void 0:o.token;localStorage.setItem("@BYCODERS_KEY",(r=a===null||a===void 0?void 0:a.data)===null||r===void 0?void 0:r.token)}return(s=a===null||a===void 0?void 0:a.data)===null||s===void 0?void 0:s.customer}async updateOrder(t){const e=localStorage.getItem("@BYCODERS_KEY");const n={"Content-Type":"application/json",Authorization:`Bearer ${e}`};await this.axiosInstance.patch(`/checkouts/${t.cartId}/updateOrder`,{orderId:t.orderId,externalId:t.cartIdCrm},{headers:n});localStorage.removeItem("@BYCODERS_KEY");localStorage.removeItem(pn);localStorage.removeItem(dn(t.cartId))}async sendPin(t,e,n){const o=localStorage.getItem(hn);const r={"Content-Type":"application/json",Authorization:`Bearer ${o}`};const s=await this.axiosInstance.post("/crmbonus/send-pin",{cellphone:t,name:e,storeName:n},{headers:r});return{storeId:s.data.storeId,userId:s.data.userId}}async validatePinBonus(t){const e=localStorage.getItem(hn);const n={"Content-Type":"application/json",Authorization:`Bearer ${e}`};const o=await this.axiosInstance.post("/crmbonus/process-pin-bonus",t,{headers:n});return o.data}async reserve(t){const e={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const n=await this.axiosInstance.post("/crmbonus/redeem-bonus",t,{headers:e});return n.data}async cancel(t){const e=localStorage.getItem(hn);const n={"Content-Type":"application/json",Authorization:`Bearer ${e}`};const o=await this.axiosInstance.post("/crmbonus/cancel-apply-bonus",{ticket:t},{headers:n});return o.data}async getToken(t){var e,n;const o=await this.axiosInstance.post("/wake/requestToken",{storeName:t});this.token=(e=o===null||o===void 0?void 0:o.data)===null||e===void 0?void 0:e.token;localStorage.setItem(hn,this.token);return(n=o===null||o===void 0?void 0:o.data)===null||n===void 0?void 0:n.token}async getCustomization(t){const e={"Content-Type":"application/json",Authorization:`Bearer ${this.token}`};const n=await this.axiosInstance.get(`/stores/${t}/customizations`,{headers:e});localStorage.setItem(mn(t),JSON.stringify(n.data));console.log("getCustomization",n);return n.data}async cancelBonus(t,e){const n=localStorage.getItem(hn);const o={"Content-Type":"application/json",Authorization:`Bearer ${n}`};await this.axiosInstance.post(`/crmbonus/cancel-bonus`,{cartId:t,usedBonus:true,storeName:e},{headers:o});localStorage.setItem(t,"0");localStorage.removeItem(pn)}async getInfoBonus(t,e){const n=localStorage.getItem(hn);const o={"Content-Type":"application/json",Authorization:`Bearer ${n}`};const r=await this.axiosInstance.get(`/crmbonus/order-info/${e}/${t}`,{headers:o});return r.data}async patchInfoBonus(t){const e=localStorage.getItem(hn);const n={"Content-Type":"application/json",Authorization:`Bearer ${e}`};await this.axiosInstance.patch(`/checkouts/${t.cartId}`,{metadata:t.metadata},{headers:n})}async getInfoCart(t){const e=await fetch(`${t}/api/carrinho`,{credentials:"include"}).then((t=>t.json()));return e}}wn._instance=null;export{wn as C,pn as U,fn as a,dn as g};
|
2
|
+
//# sourceMappingURL=p-c2ecfee1.js.map
|