crmbonus-component-wake 2.0.94 → 2.0.96
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/countdown-timer_5.cjs.entry.js +9 -9
- package/dist/cjs/countdown-timer_5.cjs.entry.js.map +1 -1
- package/dist/cjs/crm-bonus-form.cjs.entry.js +1 -1
- package/dist/cjs/crm-bonus.cjs.entry.js +9 -6
- package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -1
- package/dist/cjs/crm-giftback-form_2.cjs.entry.js +1 -1
- package/dist/cjs/{crmbonus.service-5a89216e.js → crmbonus.service-b31b7396.js} +5 -1
- package/dist/cjs/crmbonus.service-b31b7396.js.map +1 -0
- package/dist/cjs/pedido-finalizado.cjs.entry.js +1 -1
- package/dist/collection/components/crm-bonus/crm-bonus.js +8 -5
- package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -1
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js +10 -10
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js.map +1 -1
- package/dist/collection/services/crmbonus.service.js +4 -0
- package/dist/collection/services/crmbonus.service.js.map +1 -1
- package/dist/components/crm-bonus-form.js +1 -1
- package/dist/components/crm-bonus.js +11 -8
- package/dist/components/crm-bonus.js.map +1 -1
- package/dist/components/crm-giftback-form.js +1 -1
- package/dist/components/giftback-info.js +1 -1
- package/dist/components/{p-9c859043.js → p-c44e2f02.js} +5 -1
- package/dist/components/p-c44e2f02.js.map +1 -0
- package/dist/components/{p-922d2846.js → p-cb164cb2.js} +3 -3
- package/dist/components/{p-922d2846.js.map → p-cb164cb2.js.map} +1 -1
- package/dist/components/{p-ba4b7d0d.js → p-f9381072.js} +10 -10
- package/dist/components/p-f9381072.js.map +1 -0
- package/dist/components/pedido-finalizado.js +1 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
- package/dist/crmbonus-component-wake/{p-5941788b.entry.js → p-10f6923a.entry.js} +2 -2
- package/dist/crmbonus-component-wake/p-5f8b033a.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-5f8b033a.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/{p-d0462c81.entry.js → p-a5a145b8.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-9c859043.js → p-c44e2f02.js} +2 -2
- package/dist/crmbonus-component-wake/p-c44e2f02.js.map +1 -0
- package/dist/crmbonus-component-wake/{p-1e41bdcf.entry.js → p-d0d83758.entry.js} +2 -2
- package/dist/crmbonus-component-wake/p-d0d83758.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/{p-f25a70b6.entry.js → p-e37a10a1.entry.js} +2 -2
- package/dist/esm/countdown-timer_5.entry.js +9 -9
- package/dist/esm/countdown-timer_5.entry.js.map +1 -1
- package/dist/esm/crm-bonus-form.entry.js +1 -1
- package/dist/esm/crm-bonus.entry.js +9 -6
- package/dist/esm/crm-bonus.entry.js.map +1 -1
- package/dist/esm/crm-giftback-form_2.entry.js +1 -1
- package/dist/esm/{crmbonus.service-abc38398.js → crmbonus.service-774ebe83.js} +5 -1
- package/dist/esm/crmbonus.service-774ebe83.js.map +1 -0
- package/dist/esm/pedido-finalizado.entry.js +1 -1
- package/dist/types/services/crmbonus.service.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/crmbonus.service-5a89216e.js.map +0 -1
- package/dist/components/p-9c859043.js.map +0 -1
- package/dist/components/p-ba4b7d0d.js.map +0 -1
- package/dist/crmbonus-component-wake/p-17cc918d.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-17cc918d.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-1e41bdcf.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-9c859043.js.map +0 -1
- package/dist/esm/crmbonus.service-abc38398.js.map +0 -1
- /package/dist/crmbonus-component-wake/{p-5941788b.entry.js.map → p-10f6923a.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-d0462c81.entry.js.map → p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m-giftback-form","src/components/giftback-form/giftback-form.tsx"],"sourcesContent":["* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n font-family: Roboto;\n font-size: var(--crmfont-sizebodymd);\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n font-size: 14px;\n color: var(--crm-btn);\n font-weight: 100;\n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n font-size: 16px;\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n font-size: 12px;\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n font-size: 12px;\n}","import { Component, Method, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { StatusGiftBackProcess, StepFormEnum } from \"../../contants\";\nimport { IPinSent } from '../../dto/pin.sent'\nimport { IBonus, ICustomer, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport i18next from \"../../i18n/i18n\"\nimport { USED_KEY, getKeyReserveByCartId } from \"../../utils/keys.storage\";\n\n@Component({\n tag: 'crm-giftback-form',\n styleUrl: 'giftback-form.css'\n})\nexport class CrmBonus {\n // private phoneInputMask: HTMLPhoneFormElement;\n\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n @Prop() customer: ICustomer;\n @Prop() loadProducts: () => void;\n\n @State() value: string;\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: string;\n @State() pinInfo: IPinSent;\n @State() step: StepFormEnum = StepFormEnum.STEP_PHONE;\n @State() bonus: IBonus;\n\n @State() sucess: string = \"\";\n @State() error: string = \"\";\n @State() config: IInfoStore;\n\n @State() hasApplyBonus = false;\n\n\n @Method()\n async setStep(step: StepFormEnum) {\n this.step = step\n }\n\n @Method()\n async processBonus(products: IProduct[] = [], hasNewProduct = false) {\n this.sucess = \"\";\n\n console.log('processBonus', [])\n if (hasNewProduct) {\n this.products = products;\n }\n\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n if (_bonus) {\n\n const bonus = JSON.parse(_bonus)\n\n this.bonus = bonus;\n\n this.phone = bonus.phone;\n this.pinInfo = {\n storeId: bonus.storeId,\n userId: bonus.userId\n }\n \n await this.validateBonus(\"2018\");\n //this.step = StepFormEnum.STEP_RESERVE;\n\n }\n\n\n }\n\n async handleSendPin(phone: string) {\n\n this.message = \"\"\n if (!phone) {\n this.message = \"Informe seu telefone\";\n return;\n }\n\n this.phone = phone;\n\n this.sendPin()\n }\n\n async componentWillLoad() {\n this.sucess = \"\";\n this.error = \"\"\n this.config = getInfoCustomization(this.storeName);\n\n const phoneAgain = this.getPhoneNumberAgain();\n\n console.log('phoneAgain', phoneAgain)\n\n if(phoneAgain) {\n this.step = StepFormEnum.STEP_PHONE;\n return\n } \n\n await this.processBonus();\n\n }\n\n getPhoneNumberAgain() {\n const consulta_bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n if(!consulta_bonus) return false;\n\n const bonus = JSON.parse(consulta_bonus);\n\n return !bonus.hasBonus;\n }\n\n private convertStringToNumber(): number {\n const _phone = this.phone.replace(/\\D/g, '');\n return Number(_phone);\n }\n\n public async sendPin() {\n this.loading = true;\n this.message = \"\";\n this.sucess = \"\";\n this.error = \"\"\n\n try {\n\n const _phone = this.convertStringToNumber()\n\n this.pinInfo = await this.crmBonusService.sendPin(_phone, this.customer?.name, this.storeName);\n\n if (localStorage.getItem(`bc:${this.phone}`)) {\n await this.validateBonus(\"2018\");\n this.step = StepFormEnum.STEP_RESERVE;\n } else {\n this.step = StepFormEnum.STEP_PIN;\n }\n\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n changePhone() {\n this.sucess = \"\";\n this.error = \"\"\n this.step = StepFormEnum.STEP_PHONE;\n }\n\n public async validateBonus(pin: string) {\n\n console.log('this.phone', this.phone)\n\n this.loadProducts();\n\n const used_or_no = localStorage.getItem(USED_KEY);\n\n if (used_or_no == \"dontUse\") {\n this.step = StepFormEnum.STEP_RESERVE;\n return\n }\n\n this.loading = true;\n this.sucess = \"\";\n this.error = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.convertStringToNumber(),\n storeId: this.pinInfo.storeId.toString(),\n userId: this.pinInfo.userId.toString(),\n checkoutId: this.cartId,\n checkoutProducts: this.products,\n name: this.customer?.name,\n storeName: this.storeName\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload);\n\n if (!this.bonus.hasBonus) {\n\n localStorage.setItem(getKeyReserveByCartId(this.cartId), JSON.stringify({ ...this.bonus, phone: this.phone }));\n\n this.loading = false;\n this.step = StepFormEnum.STEP_NO_BONUS;\n return\n }\n\n this.sucess = \"Código validado com sucesso!\";\n localStorage.setItem(getKeyReserveByCartId(this.cartId), JSON.stringify({ ...this.bonus, phone: this.phone }));\n localStorage.setItem(`bc:${this.phone}`, StatusGiftBackProcess.VALIDATE)\n\n localStorage.setItem(USED_KEY, \"use\");\n localStorage.setItem(this.cartId, this.bonus.bonusBalance.toString());\n\n this.step = StepFormEnum.STEP_RESERVE;\n\n } catch (error) {\n const _error: string = error?.response?.data?.message;\n\n if (_error.includes(\"Pin\")) {\n this.error = \"Código inválido!\"\n } else {\n this.error = _error;\n this.step = StepFormEnum.STEP_NO_BONUS;\n }\n\n\n } finally {\n this.loading = false;\n }\n }\n\n public handleCancel() {\n // this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n async cancel() {\n this.message = \"\";\n this.loading = true;\n try {\n await this.crmBonusService.cancel(this.cartId);\n\n localStorage.setItem(USED_KEY, \"dontUse\");\n this.save(0)\n } catch (error) {\n this.message = \"Não consegui cancelar o bônus, tente novamente!\"\n } finally {\n this.loading = false;\n }\n }\n\n public async reserveApply(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.reserve(amount);\n this.save(amount);\n\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n\n this.step = StepFormEnum.STEP_NO_BONUS;\n localStorage.removeItem(this.cartId);\n } finally {\n this.loading = false;\n }\n }\n\n save(amount: number) {\n localStorage.setItem(this.cartId, amount.toString());\n }\n\n public async reserve(amount: number) {\n\n await this.crmBonusService.reserve({\n redeemedBonus: amount,\n cartId: this.cartId,\n ticket: this.cartId,\n grossValue: Number(this.bonus.totalValue),\n storeName: this.storeName,\n storeId: this.bonus.storeId.toString(),\n userId: this.bonus.userId\n });\n }\n\n render() {\n return (\n <div class=\"crm-container-form fbits-responsive-carrinho-desconto\" >\n\n {/* <loading-container /> */}\n\n <label class=\"crm-title\">{this.config.giftbackTitle}</label>\n\n {this.step === StepFormEnum.STEP_PHONE &&\n <phone-form\n value={this.customer.phone}\n config={this.config}\n loading={this.loading}\n handlerSubmit={(phone) => this.handleSendPin(phone)}\n />}\n {\n this.step === StepFormEnum.STEP_PIN &&\n <pin-form\n config={this.config}\n phone={this.phone}\n cancel={() => this.changePhone()}\n resend={() => this.sendPin()}\n validate={(data) => this.validateBonus(data)}\n loading={this.loading}\n >\n {this.sucess && <p class=\"crm-message-info\">{this.sucess}</p>}\n {this.error && <p class=\"crm-message-error\">{this.error}</p>}\n\n </pin-form>\n }\n\n {\n this.step === StepFormEnum.STEP_RESERVE &&\n <giftback-info\n loading={this.loading}\n cancel={() => this.handleCancel()}\n bonus={this.bonus}\n reserve={() => this.processBonus()}\n />\n }\n\n {\n this.step === StepFormEnum.STEP_NO_BONUS &&\n (\n <div class=\"container-message\">\n {i18next.t(\"noGiftback\", { storename: this.config.giftbackTitle })}\n </div>\n )\n\n }\n </div>\n )\n }\n}"],"version":3}
|
1
|
+
{"file":"p-cb164cb2.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,i+BAAi+B,CAAC;AAC1/B,8BAAe,eAAe;;MCajB,QAAQ;;;;;QAGX,oBAAe,GAAoB,eAAe,CAAC,WAAW,EAAE,CAAC;;;;;;;uBAS7C,KAAK;;;;oBAIH,YAAY,CAAC,UAAU;;sBAG3B,EAAE;qBACH,EAAE;;6BAGF,KAAK;;IAI9B,MAAM,OAAO,CAAC,IAAkB;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;KACjB;IAGD,MAAM,YAAY,CAAC,WAAuB,EAAE,EAAE,aAAa,GAAG,KAAK;QACjE,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QAEjB,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;QAC/B,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;SAC1B;QAED,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAExE,IAAI,MAAM,EAAE;YAEV,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;YAEhC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YAEnB,IAAI,CAAC,KAA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AC3BA,QAAO,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAC9D,CACP,CAGC,EACP;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18next"],"sources":["src/components/giftback-form/giftback-form.css?tag=crm-giftback-form","src/components/giftback-form/giftback-form.tsx"],"sourcesContent":["* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n font-family: Roboto;\n font-size: var(--crmfont-sizebodymd);\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n font-size: 14px;\n color: var(--crm-btn);\n font-weight: 100;\n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n font-size: 16px;\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n font-size: 12px;\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n font-size: 12px;\n}","import { Component, Method, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { StatusGiftBackProcess, StepFormEnum } from \"../../contants\";\nimport { IPinSent } from '../../dto/pin.sent'\nimport { IBonus, ICustomer, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport i18next from \"../../i18n/i18n\"\nimport { USED_KEY, getKeyReserveByCartId } from \"../../utils/keys.storage\";\n\n@Component({\n tag: 'crm-giftback-form',\n styleUrl: 'giftback-form.css'\n})\nexport class CrmBonus {\n // private phoneInputMask: HTMLPhoneFormElement;\n\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n @Prop() customer: ICustomer;\n @Prop() loadProducts: () => void;\n\n @State() value: string;\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: string;\n @State() pinInfo: IPinSent;\n @State() step: StepFormEnum = StepFormEnum.STEP_PHONE;\n @State() bonus: IBonus;\n\n @State() sucess: string = \"\";\n @State() error: string = \"\";\n @State() config: IInfoStore;\n\n @State() hasApplyBonus = false;\n\n\n @Method()\n async setStep(step: StepFormEnum) {\n this.step = step\n }\n\n @Method()\n async processBonus(products: IProduct[] = [], hasNewProduct = false) {\n this.sucess = \"\";\n\n console.log('processBonus', [])\n if (hasNewProduct) {\n this.products = products;\n }\n\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n if (_bonus) {\n\n const bonus = JSON.parse(_bonus)\n\n this.bonus = bonus;\n\n this.phone = bonus.phone;\n this.pinInfo = {\n storeId: bonus.storeId,\n userId: bonus.userId\n }\n \n await this.validateBonus(\"2018\");\n //this.step = StepFormEnum.STEP_RESERVE;\n\n }\n\n\n }\n\n async handleSendPin(phone: string) {\n\n this.message = \"\"\n if (!phone) {\n this.message = \"Informe seu telefone\";\n return;\n }\n\n this.phone = phone;\n\n this.sendPin()\n }\n\n async componentWillLoad() {\n this.sucess = \"\";\n this.error = \"\"\n this.config = getInfoCustomization(this.storeName);\n\n const phoneAgain = this.getPhoneNumberAgain();\n\n console.log('phoneAgain', phoneAgain)\n\n if(phoneAgain) {\n this.step = StepFormEnum.STEP_PHONE;\n return\n } \n\n await this.processBonus();\n\n }\n\n getPhoneNumberAgain() {\n const consulta_bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n if(!consulta_bonus) return false;\n\n const bonus = JSON.parse(consulta_bonus);\n\n return !bonus.hasBonus;\n }\n\n private convertStringToNumber(): number {\n const _phone = this.phone.replace(/\\D/g, '');\n return Number(_phone);\n }\n\n public async sendPin() {\n this.loading = true;\n this.message = \"\";\n this.sucess = \"\";\n this.error = \"\"\n\n try {\n\n const _phone = this.convertStringToNumber()\n\n this.pinInfo = await this.crmBonusService.sendPin(_phone, this.customer?.name, this.storeName);\n\n if (localStorage.getItem(`bc:${this.phone}`)) {\n await this.validateBonus(\"2018\");\n this.step = StepFormEnum.STEP_RESERVE;\n } else {\n this.step = StepFormEnum.STEP_PIN;\n }\n\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n changePhone() {\n this.sucess = \"\";\n this.error = \"\"\n this.step = StepFormEnum.STEP_PHONE;\n }\n\n public async validateBonus(pin: string) {\n\n console.log('this.phone', this.phone)\n\n this.loadProducts();\n\n const used_or_no = localStorage.getItem(USED_KEY);\n\n if (used_or_no == \"dontUse\") {\n this.step = StepFormEnum.STEP_RESERVE;\n return\n }\n\n this.loading = true;\n this.sucess = \"\";\n this.error = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.convertStringToNumber(),\n storeId: this.pinInfo.storeId.toString(),\n userId: this.pinInfo.userId.toString(),\n checkoutId: this.cartId,\n checkoutProducts: this.products,\n name: this.customer?.name,\n storeName: this.storeName\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload);\n\n if (!this.bonus.hasBonus) {\n\n localStorage.setItem(getKeyReserveByCartId(this.cartId), JSON.stringify({ ...this.bonus, phone: this.phone }));\n\n this.loading = false;\n this.step = StepFormEnum.STEP_NO_BONUS;\n return\n }\n\n this.sucess = \"Código validado com sucesso!\";\n localStorage.setItem(getKeyReserveByCartId(this.cartId), JSON.stringify({ ...this.bonus, phone: this.phone }));\n localStorage.setItem(`bc:${this.phone}`, StatusGiftBackProcess.VALIDATE)\n\n localStorage.setItem(USED_KEY, \"use\");\n localStorage.setItem(this.cartId, this.bonus.bonusBalance.toString());\n\n this.step = StepFormEnum.STEP_RESERVE;\n\n } catch (error) {\n const _error: string = error?.response?.data?.message;\n\n if (_error.includes(\"Pin\")) {\n this.error = \"Código inválido!\"\n } else {\n this.error = _error;\n this.step = StepFormEnum.STEP_NO_BONUS;\n }\n\n\n } finally {\n this.loading = false;\n }\n }\n\n public handleCancel() {\n // this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n async cancel() {\n this.message = \"\";\n this.loading = true;\n try {\n await this.crmBonusService.cancel(this.cartId);\n\n localStorage.setItem(USED_KEY, \"dontUse\");\n this.save(0)\n } catch (error) {\n this.message = \"Não consegui cancelar o bônus, tente novamente!\"\n } finally {\n this.loading = false;\n }\n }\n\n public async reserveApply(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.reserve(amount);\n this.save(amount);\n\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n\n this.step = StepFormEnum.STEP_NO_BONUS;\n localStorage.removeItem(this.cartId);\n } finally {\n this.loading = false;\n }\n }\n\n save(amount: number) {\n localStorage.setItem(this.cartId, amount.toString());\n }\n\n public async reserve(amount: number) {\n\n await this.crmBonusService.reserve({\n redeemedBonus: amount,\n cartId: this.cartId,\n ticket: this.cartId,\n grossValue: Number(this.bonus.totalValue),\n storeName: this.storeName,\n storeId: this.bonus.storeId.toString(),\n userId: this.bonus.userId\n });\n }\n\n render() {\n return (\n <div class=\"crm-container-form fbits-responsive-carrinho-desconto\" >\n\n {/* <loading-container /> */}\n\n <label class=\"crm-title\">{this.config.giftbackTitle}</label>\n\n {this.step === StepFormEnum.STEP_PHONE &&\n <phone-form\n value={this.customer.phone}\n config={this.config}\n loading={this.loading}\n handlerSubmit={(phone) => this.handleSendPin(phone)}\n />}\n {\n this.step === StepFormEnum.STEP_PIN &&\n <pin-form\n config={this.config}\n phone={this.phone}\n cancel={() => this.changePhone()}\n resend={() => this.sendPin()}\n validate={(data) => this.validateBonus(data)}\n loading={this.loading}\n >\n {this.sucess && <p class=\"crm-message-info\">{this.sucess}</p>}\n {this.error && <p class=\"crm-message-error\">{this.error}</p>}\n\n </pin-form>\n }\n\n {\n this.step === StepFormEnum.STEP_RESERVE &&\n <giftback-info\n loading={this.loading}\n cancel={() => this.handleCancel()}\n bonus={this.bonus}\n reserve={() => this.processBonus()}\n />\n }\n\n {\n this.step === StepFormEnum.STEP_NO_BONUS &&\n (\n <div class=\"container-message\">\n {i18next.t(\"noGiftback\", { storename: this.config.giftbackTitle })}\n </div>\n )\n\n }\n </div>\n )\n }\n}"],"version":3}
|
@@ -15,17 +15,17 @@ const GiftbackInfo = /*@__PURE__*/ proxyCustomElement(class GiftbackInfo extends
|
|
15
15
|
this.selectedOption = 'none';
|
16
16
|
this.loading = false;
|
17
17
|
this.bonus = {
|
18
|
-
totalBonus:
|
18
|
+
totalBonus: 0,
|
19
19
|
cartId: "",
|
20
|
-
minimumPurchase:
|
21
|
-
bonusBalance:
|
22
|
-
calculatedValue:
|
20
|
+
minimumPurchase: 0,
|
21
|
+
bonusBalance: 0,
|
22
|
+
calculatedValue: 0,
|
23
23
|
firstValidityDate: "",
|
24
|
-
totalValue:
|
24
|
+
totalValue: 0
|
25
25
|
};
|
26
26
|
this.reserve = undefined;
|
27
27
|
this.cancel = undefined;
|
28
|
-
this.sliderPosition =
|
28
|
+
this.sliderPosition = 0;
|
29
29
|
}
|
30
30
|
changedBonus() {
|
31
31
|
this.updateBonus();
|
@@ -71,11 +71,11 @@ const GiftbackInfo = /*@__PURE__*/ proxyCustomElement(class GiftbackInfo extends
|
|
71
71
|
const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;
|
72
72
|
const translateDescription = instance.t("giftDescription", { amount: `${this.bonus.totalBonus.toFixed(2).replace(".", ",")}`, custom_name: "Giftback" });
|
73
73
|
const limit = defineLimit(remainingGiftback);
|
74
|
-
return (h("div", { key: '
|
74
|
+
return (h("div", { key: '06bd5fda8f1b1dff75d27133fb27a222ea79475d', class: "giftback-container" }, h("div", { key: 'e770facaaf3c938dda000885ef42fe30f4b88eaf', class: "container-description" }, h("p", { key: '7d7aa390bb8f2c7a1973b38f0071522e7943af47', innerHTML: translateDescription }), h("crm-tooltip", { key: 'f209c195a0fcd7c4bec0b6227549ba139c41f637', identity: "crm-role-description", text: instance.t("labelUseGiftback", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: formatDateToBr(this.bonus.firstValidityDate) }) })), h("div", { key: '6160a64dd8a3eea3b1f554349c2d6d0fc7113641', class: "slider-wrapper" }, h("div", { key: 'e3ca74f1b47613bd0b05339bd2856a942172cb0f', class: "slider-value", style: {
|
75
75
|
left: `calc(${this.sliderPosition}% - 20px)`, // Ajuste para centralizar o texto
|
76
|
-
} }, "R$ ", this.usedValue.toFixed(2).replace(".", ",")), h("input", { key: '
|
76
|
+
} }, "R$ ", this.usedValue.toFixed(2).replace(".", ",")), h("input", { key: 'e748d506d25076173a1da4ae02a4869969228e16', id: "position_value_id", disabled: true, type: "range", min: "0", max: this.bonus.totalBonus, value: this.usedValue, class: "slider", step: "0.01", onInput: (event) => this.handleSliderChange(event), style: {
|
77
77
|
background: `linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`,
|
78
|
-
} })), limit.isComplete && (h("p", { key: '
|
78
|
+
} })), limit.isComplete && (h("p", { key: '49b1525e9e04c7fc08db78a9c999540fdd0df6ea' }, instance.t("maxAmount"))), !limit.isComplete && (h("div", { key: '771cdc242af285229b6d23fd9738627f2e419385', class: "container-description" }, h("p", { key: '43dca214826cb8dc2a292400c5b02f40e7ce620a' }, "Adicione ", h("strong", { key: '3ffbe7777e5e3be5283012de568eddfe3ff1b23d' }, "R$ ", remainingGiftback < 0 ? "0,00" : remainingGiftback.toFixed(2).replace(".", ",")), " ao carrinho para atingir o valor m\u00E1ximo! ", h("crm-tooltip", { key: '71bae07de4470c5f9234e74a632713803cda2d7e', identity: "crm-max-description", text: instance.t("labelamountPartial") })))), h("div", { key: '23c5cbcea13c5cad47384815b6277fced7529f84', class: "options" }, h("div", { key: '5212788f1c1c258324ba83057c60fd0ecb76e29c', class: "options-option" }, h("input", { key: '14bf5fceb36b5b9db660e5e067e1ed9c89d31b81', type: "radio", name: "giftbackOption", value: "use", checked: this.selectedOption === 'use', onChange: () => this.handleOptionChange('use') }), h("p", { key: '487dc829efdca6754c967fcc85c58cb2cb7c63e1' }, "Usar o meu Giftback")), h("div", { key: 'd90651744aa5d3904b61be7d4adc1ec49e3c6676', class: "options-option" }, h("input", { key: '4ed8e68cfd86b871668e9de19d4c5420487f4e52', type: "radio", name: "giftbackOption", value: "dontUse", checked: this.selectedOption === 'dontUse', onChange: () => this.handleOptionChange('dontUse') }), h("p", { key: '344fbf40dadc0ef4e3a870e5251a1beb3b5ffd27' }, "N\u00E3o usar o meu Giftback"))), h("div", { key: '3b9a91dad6803aac48b96100c2bbded009677aa1', class: "info-box" }, "O Giftback ser\u00E1 aplicado na pr\u00F3xima etapa.")));
|
79
79
|
}
|
80
80
|
static get watchers() { return {
|
81
81
|
"bonus": ["changedBonus"]
|
@@ -114,4 +114,4 @@ defineCustomElement();
|
|
114
114
|
|
115
115
|
export { GiftbackInfo as G, defineCustomElement as d };
|
116
116
|
|
117
|
-
//# sourceMappingURL=p-
|
117
|
+
//# sourceMappingURL=p-f9381072.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"p-f9381072.js","mappings":";;;;;;AAAA,MAAM,eAAe,GAAG,k7DAAk7D,CAAC;AAC38D,2BAAe,eAAe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ACN,4DAAK,KAAK,EAAC,gBAAgB,IACvB,8DACI,IAAI,EAAC,OAAO,EACZ,IAAI,EAAC,gBAAgB,EACrB,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,IAAI,CAAC,cAAc,KAAK,SAAS,EAC1C,QAAQ,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,GACpD,EACF,2FAA8B,CAC5B,CACJ,EACN,4DAAK,KAAK,EAAC,UAAU,2DAEf,CACJ,EACR;KACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18next"],"sources":["src/components/giftback-form/subcomponents/giftback-info/giftback-info.css?tag=giftback-info","src/components/giftback-form/subcomponents/giftback-info/giftback-info.tsx"],"sourcesContent":[":host {\n --text-color: #6D6D5F\n}\n\n.giftback-container {\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\nh3 {\n font-size: 1.2rem;\n margin-bottom: 8px;\n color: #333;\n}\n\n.container-description {\n display: flex;\n align-items: center;\n gap: 5px;\n margin: 0 0 10px 0;\n}\n\n.container-description p {\n font-size: 14px;\n font-weight: 400;\n margin: 0px;\n}\n\n\np {\n font-size: 14px;\n color: #000;\n}\n\n.value-display h2 {\n color: #6D6D5F;\n /* Verde para o valor atual */\n font-size: 1.6rem;\n margin: 16px 0;\n}\n\ninput[type='range'] {\n width: 100%;\n margin: 12px 0;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 4px;\n outline: none;\n padding: 3px 0px 3px 3px;\n}\n\n/* input[type='range']::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n border-radius: 50%;\n cursor: pointer;\n} */\n\ninput[type=\"range\"]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 20px;\n height: 20px;\n background: rgb(109, 109, 95);\n /* Cor do botão */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.options {\n margin: 0px 0;\n display: flex;\n gap: 10px;\n flex-direction: column;\n}\n\n.options label {\n display: flex;\n margin: 0px 0;\n font-size: 0.9rem;\n color: #333;\n align-items: center;\n}\n\n.options input[type='radio'] {\n margin-right: 8px;\n height: 16px;\n width: 16px;\n}\n\n.options input[type='radio'] {\n appearance: none;\n -webkit-appearance: none;\n margin-right: 8px;\n width: 16px;\n height: 16px;\n border: 2px solid #ddd;\n border-radius: 50%;\n background-color: #fff;\n cursor: pointer;\n transition: all 0.3s;\n padding: 0px;\n}\n\n.options input[type='radio']:checked {\n border-color: #000;\n background-color: #FAFAFA;\n border: 4px solid #000;\n}\n\n.info-box {\n background-color: #f9f9f9;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n padding: 8px;\n font-size: 14px;\n color: #262626;\n line-height: 20px;\n}\n\n.info-icon {\n font-size: 0.9rem;\n cursor: pointer;\n color: #888;\n}\n\nh3 {\n font-size: 1.2rem;\n margin-bottom: 8px;\n color: #333;\n}\n\n.slider-wrapper {\n position: relative;\n margin: 21px 0px 0px 0px;\n}\n\n.slider {\n width: 100%;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 2px;\n outline: none;\n}\n\n.slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n /* Azul para o slider */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.slider-value {\n position: absolute;\n top: -30px;\n /* Posição acima do slider */\n font-size: 16px;\n font-weight: 700;\n color: var(--text-color);\n /* Verde para o texto */\n transform: translateX(-50%);\n white-space: nowrap;\n /* margin-left: 23px; */\n}\n\n.options-option {\n display: flex;\n}\n\n\n/* ########################################## */\n","import { Component, Prop, State, Watch, h } from \"@stencil/core\";\nimport { IBonus } from \"../../../../dto/validate.pin.bonus\";\n\nimport i18next from '../../../../i18n/i18n'\nimport { USED_KEY } from \"../../../../utils/keys.storage\";\nimport { defineLimit, formatDateToBr } from \"../../../../utils/utils\";\n\n@Component({\n tag: 'giftback-info',\n styleUrls: ['giftback-info.css']\n})\nexport class GiftbackInfo {\n @State() usedValue: number = 0;\n @State() selectedOption: string = 'none';\n\n @Prop() loading: boolean = false;\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 0,\n cartId: \"\",\n minimumPurchase: 0,\n bonusBalance: 0,\n calculatedValue: 0,\n firstValidityDate: \"\",\n totalValue: 0\n };\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n\n @State() sliderPosition: number = 0;\n\n @Watch(\"bonus\")\n changedBonus() {\n this.updateBonus()\n }\n\n private updateBonus() {\n this.usedValue = this.bonus.bonusBalance;\n this.buildPositionSlider(0, this.bonus.totalBonus);\n }\n\n componentWillLoad() {\n this.updateBonus();\n this.selectedOption = localStorage.getItem(USED_KEY);\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n\n // Calculando a posição do texto com base no valor do slider\n // const percentage = ((this.usedValue - parseInt(input.min)) / (parseInt(input.max) - parseInt(input.min))) * 100;\n // this.sliderPosition = percentage;\n\n this.buildPositionSlider(parseFloat(input.min), parseFloat(input.max))\n }\n\n componentDidLoad() {\n const input: any = document.getElementById(\"position_value_id\")\n\n input.value = this.bonus.bonusBalance;\n }\n\n\n private buildPositionSlider(min: number, max: number) {\n // Calculando a posição do texto com base no valor do slider\n const percentage = ((this.usedValue - min) / (max - min)) * 100;\n this.sliderPosition = percentage;\n }\n\n async handleOptionChange(option: string) {\n this.selectedOption = option;\n\n localStorage.setItem(USED_KEY, option);\n switch (this.selectedOption) {\n case 'use':\n await this.reserve(this.usedValue)\n break;\n case 'dontUse':\n await this.cancel();\n break;\n default:\n }\n }\n\n render() {\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n const translateDescription = i18next.t(\"giftDescription\", { amount: `${this.bonus.totalBonus.toFixed(2).replace(\".\", \",\")}`, custom_name: \"Giftback\" })\n\n const limit = defineLimit(remainingGiftback)\n return (\n\n <div class=\"giftback-container\">\n <div class=\"container-description\">\n <p innerHTML={translateDescription}></p>\n <crm-tooltip identity=\"crm-role-description\" text={i18next.t(\"labelUseGiftback\", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: formatDateToBr(this.bonus.firstValidityDate) })} />\n </div>\n <div class=\"slider-wrapper\">\n <div\n class=\"slider-value\"\n style={{\n left: `calc(${this.sliderPosition}% - 20px)`, // Ajuste para centralizar o texto\n\n }}\n >\n R$ {this.usedValue.toFixed(2).replace(\".\", \",\")}\n </div>\n <input\n id=\"position_value_id\"\n disabled\n type=\"range\"\n min=\"0\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n class=\"slider\"\n step=\"0.01\"\n onInput={(event) => this.handleSliderChange(event)}\n style={{\n background: `linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`,\n }}\n />\n </div>\n\n {\n limit.isComplete && (\n <p>\n {i18next.t(\"maxAmount\")}\n </p>\n )\n }\n\n {\n !limit.isComplete && (\n <div class=\"container-description\">\n <p>\n Adicione <strong>R$ {remainingGiftback < 0 ? \"0,00\" : remainingGiftback.toFixed(2).replace(\".\", \",\")}</strong> ao carrinho para atingir o valor\n máximo! <crm-tooltip identity=\"crm-max-description\" text={i18next.t(\"labelamountPartial\")} />\n </p>\n </div>\n )\n }\n\n\n <div class=\"options\">\n <div class=\"options-option\">\n <input\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"use\"\n checked={this.selectedOption === 'use'}\n onChange={() => this.handleOptionChange('use')}\n />\n <p>Usar o meu Giftback</p>\n </div>\n <div class=\"options-option\">\n <input\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"dontUse\"\n checked={this.selectedOption === 'dontUse'}\n onChange={() => this.handleOptionChange('dontUse')}\n />\n <p>Não usar o meu Giftback</p>\n </div>\n </div>\n <div class=\"info-box\">\n O Giftback será aplicado na próxima etapa.\n </div>\n </div>\n );\n }\n}"],"version":3}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { p as proxyCustomElement, H, h } from './p-3e84f78c.js';
|
2
|
-
import { C as CrmBonusService } from './p-
|
2
|
+
import { C as CrmBonusService } from './p-c44e2f02.js';
|
3
3
|
|
4
4
|
const Pedido = /*@__PURE__*/ proxyCustomElement(class Pedido extends H {
|
5
5
|
constructor() {
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{p as e,b as n}from"./p-3d6152b1.js";export{s as setNonce}from"./p-3d6152b1.js";import{g as
|
1
|
+
import{p as e,b as n}from"./p-3d6152b1.js";export{s as setNonce}from"./p-3d6152b1.js";import{g as a}from"./p-e1255160.js";var o=()=>{const n=import.meta.url;const a={};if(n!==""){a.resourcesUrl=new URL(".",n).href}return e(a)};o().then((async e=>{await a();return n([["p-d0d83758",[[2,"crm-bonus",{userId:[2,"userid"],storeName:[8,"storename"],productsInString:[1,"products"],cartId:[8,"cartid"],showModal:[32],products:[32],customer:[32],loading:[32],message:[32],phone:[32],canCancel:[32],amountCancel:[32],sent:[32],session:[32],loading_reprocess:[32],resetBonus:[64],reprocess:[64]},null,{productsInString:["watchProducts"]}]]],["p-a5a145b8",[[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-e8113d86",[[0,"crm-bonus-note",{cartId:[8,"cartid"],storename:[8],url:[32],config:[32],bonus:[32]}]]],["p-74206c91",[[0,"phone-cancel-input",{sendPin:[16],loading:[4],value:[1]}]]],["p-03b77c41",[[0,"phone-input",{sendPin:[16],loading:[4],value:[1]}]]],["p-5e62b863",[[1,"app-modal",{isOpen:[516,"is-open"],modalTitle:[1,"modal-title"]}]]],["p-10f6923a",[[0,"pedido-finalizado",{cartId:[1,"cartid"],orderId:[2,"orderid"],metadadoString:[1,"metadado"]}]]],["p-c2ff5149",[[0,"crm-button",{txtBtn:[1,"txt-btn"],loading:[4],handleClick:[16]}]]],["p-5eddbe5e",[[1,"phone-input-mask",{initialValue:[1,"initial-value"],disabled:[4],phone:[32],message:[32],getPhone:[64]}]]],["p-53c1694c",[[1,"loading-spinner",{size:[1],color:[1]}]]],["p-5f8b033a",[[0,"phone-form",{value:[1],loading:[4],handlerSubmit:[16],config:[16]}],[1,"pin-form",{validate:[16],cancel:[16],resend:[16],sent:[16],loading:[4],phone:[1],config:[16],pin:[32],isVerified:[32],canResend:[32]}],[0,"giftback-info",{loading:[4],bonus:[16],reserve:[16],cancel:[16],usedValue:[32],selectedOption:[32],sliderPosition:[32]},null,{bonus:["changedBonus"]}],[1,"countdown-timer",{downtime:[16],counter:[32]}],[0,"crm-tooltip",{text:[1],identity:[1]}]]],["p-e37a10a1",[[0,"crm-giftback-form",{storeName:[8,"storename"],cartId:[8,"cart-id"],products:[16],customer:[16],loadProducts:[16],value:[32],loading:[32],message:[32],phone:[32],pinInfo:[32],step:[32],bonus:[32],sucess:[32],error:[32],config:[32],hasApplyBonus:[32],setStep:[64],processBonus:[64]}],[4,"loading-container",{loading:[4]}]]],["p-b7a8f915",[[1,"giftback-pin",{sent:[16],validate:[16],cancel:[16],loading:[4],pin:[32],isVerified:[32]}],[1,"giftback-progress",{loading:[4],bonus:[16],reserve:[16],cancel:[16],usedValue:[32]}],[0,"name-input",{value:[1],loading:[4],applyName:[16],cancel:[16],newValue:[32],message:[32]}],[1,"giftback-finish"]]]],e)}));
|
2
2
|
//# sourceMappingURL=crmbonus-component-wake.esm.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as t,h as s}from"./p-3d6152b1.js";import{C as i}from"./p-
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as t,h as s}from"./p-3d6152b1.js";import{C as i}from"./p-c44e2f02.js";import"./p-f9aeffc1.js";const o=class{constructor(s){t(this,s);this.cartId=undefined;this.orderId=undefined;this.metadadoString=undefined}async componentWillLoad(){const t=this.metadadoString?JSON.parse(this.metadadoString):{id:null};if(this.cartId&&this.orderId){i.getInstance().updateOrder({cartId:this.cartId,orderId:this.orderId,cartIdCrm:t.id});const s=`bc-products:${this.cartId}`;localStorage.removeItem(s);localStorage.removeItem(this.cartId)}}render(){return s("div",{key:"5994a82fbeedcc73980f628f0dea243fb0172c86"})}};export{o as pedido_finalizado};
|
2
|
+
//# sourceMappingURL=p-10f6923a.entry.js.map
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{r as e,h as i,H as t}from"./p-3d6152b1.js";import{i as n}from"./p-e8c19a64.js";import{U as o}from"./p-f9aeffc1.js";import{d as a,a as c}from"./p-d3bfac80.js";const r=class{constructor(i){e(this,i);this.downtime=undefined;this.counter=30}componentWillLoad(){this.intervalId=setInterval((()=>{if(this.counter>0){this.counter--}else{clearInterval(this.intervalId);this.downtime()}}),1e3)}disconnectedCallback(){clearInterval(this.intervalId)}render(){return i("label",{key:"6313656b73bec34e3e4e5099c2bd7633e025588e"},this.counter,"s")}};const s="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPg0KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0xMiAxNy43NUMxMi40MTQyIDE3Ljc1IDEyLjc1IDE3LjQxNDIgMTIuNzUgMTdWMTFDMTIuNzUgMTAuNTg1OCAxMi40MTQyIDEwLjI1IDEyIDEwLjI1QzExLjU4NTggMTAuMjUgMTEuMjUgMTAuNTg1OCAxMS4yNSAxMVYxN0MxMS4yNSAxNy40MTQyIDExLjU4NTggMTcuNzUgMTIgMTcuNzVaIiBmaWxsPSIjMUMyNzRDIi8+DQo8cGF0aCBkPSJNMTIgN0MxMi41NTIzIDcgMTMgNy40NDc3MiAxMyA4QzEzIDguNTUyMjggMTIuNTUyMyA5IDEyIDlDMTEuNDQ3NyA5IDExIDguNTUyMjggMTEgOEMxMSA3LjQ0NzcyIDExLjQ0NzcgNyAxMiA3WiIgZmlsbD0iIzFDMjc0QyIvPg0KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xLjI1IDEyQzEuMjUgNi4wNjI5NCA2LjA2Mjk0IDEuMjUgMTIgMS4yNUMxNy45MzcxIDEuMjUgMjIuNzUgNi4wNjI5NCAyMi43NSAxMkMyMi43NSAxNy45MzcxIDE3LjkzNzEgMjIuNzUgMTIgMjIuNzVDNi4wNjI5NCAyMi43NSAxLjI1IDE3LjkzNzEgMS4yNSAxMlpNMTIgMi43NUM2Ljg5MTM3IDIuNzUgMi43NSA2Ljg5MTM3IDIuNzUgMTJDMi43NSAxNy4xMDg2IDYuODkxMzcgMjEuMjUgMTIgMjEuMjVDMTcuMTA4NiAyMS4yNSAyMS4yNSAxNy4xMDg2IDIxLjI1IDEyQzIxLjI1IDYuODkxMzcgMTcuMTA4NiAyLjc1IDEyIDIuNzVaIiBmaWxsPSIjMUMyNzRDIi8+DQo8L3N2Zz4=";const d=".crm-tooltip-container {\n display: flex;\n\n & img {\n width: 16px;\n margin-left: 3px;\n position: relative;\n }\n}\n\n.crm-tooltip {\n position: relative;\n display: inline-block;\n}\n\n.crm-tooltip .tooltiptext {\n visibility: hidden;\n background-color: black;\n color: #fff;\n text-align: center;\n padding: 8px 12px;\n border-radius: 0px;\n position: absolute;\n z-index: 1;\n min-width: 271px;\n top: 100%;\n left: 50%;\n margin-left: -238px;\n}\n\n@container (max-width: 410px) {\n .crm-tooltip .tooltiptext {\n margin-left: -14px;\n }\n\n .crm-tooltip #crm-role-description {\n margin-left: -151px;\n }\n}\n\n@container (max-width: 250px) {\n .crm-tooltip .tooltiptext {\n margin-left: -201px;\n }\n}\n\n.crm-tooltip:hover .tooltiptext {\n visibility: visible;\n}";const p=d;const l=class{constructor(i){e(this,i);this.text=undefined;this.identity=undefined}render(){return i("div",{key:"8d7de09a39f9f3412c5ee51e884a9900f65ad261",class:"crm-tooltip-container crm-tooltip"},i("img",{key:"7605616f8135d1009a4c8f6a272cedfd66f10b88",src:s}),i("span",{key:"5b7b384d39f5c6b4d733ad129bd99ba8670bde8e",id:this.identity,class:"tooltiptext"},this.text))}};l.style=p;const f=":host{--text-color:#6D6D5F}.giftback-container{display:flex;flex-direction:column;gap:14px}h3{font-size:1.2rem;margin-bottom:8px;color:#333}.container-description{display:flex;align-items:center;gap:5px;margin:0 0 10px 0}.container-description p{font-size:14px;font-weight:400;margin:0px}p{font-size:14px;color:#000}.value-display h2{color:#6D6D5F;font-size:1.6rem;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;font-size:0.9rem;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;font-size:14px;color:#262626;line-height:20px}.info-icon{font-size:0.9rem;cursor:pointer;color:#888}h3{font-size:1.2rem;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-size:16px;font-weight:700;color:var(--text-color);transform:translateX(-50%);white-space:nowrap;}.options-option{display:flex}";const b=f;const h=class{constructor(i){e(this,i);this.usedValue=0;this.selectedOption="none";this.loading=false;this.bonus={totalBonus:0,cartId:"",minimumPurchase:0,bonusBalance:0,calculatedValue:0,firstValidityDate:"",totalValue:0};this.reserve=undefined;this.cancel=undefined;this.sliderPosition=0}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(){const e=document.getElementById("position_value_id");e.value=this.bonus.bonusBalance}buildPositionSlider(e,i){const t=(this.usedValue-e)/(i-e)*100;this.sliderPosition=t}async handleOptionChange(e){this.selectedOption=e;localStorage.setItem(o,e);switch(this.selectedOption){case"use":await this.reserve(this.usedValue);break;case"dontUse":await this.cancel();break}}render(){const e=this.bonus.minimumPurchase-this.bonus.totalValue;const t=n.t("giftDescription",{amount:`${this.bonus.totalBonus.toFixed(2).replace(".",",")}`,custom_name:"Giftback"});const o=a(e);return i("div",{key:"06bd5fda8f1b1dff75d27133fb27a222ea79475d",class:"giftback-container"},i("div",{key:"e770facaaf3c938dda000885ef42fe30f4b88eaf",class:"container-description"},i("p",{key:"7d7aa390bb8f2c7a1973b38f0071522e7943af47",innerHTML:t}),i("crm-tooltip",{key:"f209c195a0fcd7c4bec0b6227549ba139c41f637",identity:"crm-role-description",text:n.t("labelUseGiftback",{minimumPurchase:this.bonus.minimumPurchase,expírationDate:c(this.bonus.firstValidityDate)})})),i("div",{key:"6160a64dd8a3eea3b1f554349c2d6d0fc7113641",class:"slider-wrapper"},i("div",{key:"e3ca74f1b47613bd0b05339bd2856a942172cb0f",class:"slider-value",style:{left:`calc(${this.sliderPosition}% - 20px)`}},"R$ ",this.usedValue.toFixed(2).replace(".",",")),i("input",{key:"e748d506d25076173a1da4ae02a4869969228e16",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}%)`}})),o.isComplete&&i("p",{key:"49b1525e9e04c7fc08db78a9c999540fdd0df6ea"},n.t("maxAmount")),!o.isComplete&&i("div",{key:"771cdc242af285229b6d23fd9738627f2e419385",class:"container-description"},i("p",{key:"43dca214826cb8dc2a292400c5b02f40e7ce620a"},"Adicione ",i("strong",{key:"3ffbe7777e5e3be5283012de568eddfe3ff1b23d"},"R$ ",e<0?"0,00":e.toFixed(2).replace(".",","))," ao carrinho para atingir o valor máximo! ",i("crm-tooltip",{key:"71bae07de4470c5f9234e74a632713803cda2d7e",identity:"crm-max-description",text:n.t("labelamountPartial")}))),i("div",{key:"23c5cbcea13c5cad47384815b6277fced7529f84",class:"options"},i("div",{key:"5212788f1c1c258324ba83057c60fd0ecb76e29c",class:"options-option"},i("input",{key:"14bf5fceb36b5b9db660e5e067e1ed9c89d31b81",type:"radio",name:"giftbackOption",value:"use",checked:this.selectedOption==="use",onChange:()=>this.handleOptionChange("use")}),i("p",{key:"487dc829efdca6754c967fcc85c58cb2cb7c63e1"},"Usar o meu Giftback")),i("div",{key:"d90651744aa5d3904b61be7d4adc1ec49e3c6676",class:"options-option"},i("input",{key:"4ed8e68cfd86b871668e9de19d4c5420487f4e52",type:"radio",name:"giftbackOption",value:"dontUse",checked:this.selectedOption==="dontUse",onChange:()=>this.handleOptionChange("dontUse")}),i("p",{key:"344fbf40dadc0ef4e3a870e5251a1beb3b5ffd27"},"Não usar o meu Giftback"))),i("div",{key:"3b9a91dad6803aac48b96100c2bbded009677aa1",class:"info-box"},"O Giftback será aplicado na próxima etapa."))}static get watchers(){return{bonus:["changedBonus"]}}};h.style=b;const x="*{margin:0;padding:0;box-sizing:border-box}:host{--crmfont-sizebodymd:14px;--crmline-heightbodymd:20px;--crmletter-spacingtitle-md:0px}.container-message{font-family:Roboto;font-size:var(--crmfont-sizebodymd);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:14px;color:var(--crm-btn);font-weight:100}.crm-title{font-weight:700;line-height:20px;color:#262626;font-size:16px}.crm-message-info{color:#619013;font-weight:500;font-size:12px}.crm-message-error{color:#E11D48;font-weight:500;font-size:12px}";const g=x;const m=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:"d41578c99f54f76083ad62b2d3e53b969f51c323",class:"crm-phone-form"},i("label",{key:"2c615b13f79cfed14b8c14b713216b5d53e05769",class:"crm-subtitle"},"Digite o seu celular para verificar se há desconto disponível nessa compra:"),i("phone-input-mask",{key:"05383570a3518ef1ae3d0085f8411662eb719486",initialValue:this.value,ref:e=>this.phoneInputMask=e}),i("crm-button",{key:"90289afc0783e5f78a8091c7f53c657721f13641",txtBtn:((e=this.config)===null||e===void 0?void 0:e.btnApplyBonusLabel)||"Avançar",loading:this.loading,handleClick:()=>this.handlePhone()}))}};m.style=g;const u=":host{display:block;font-family:Arial, sans-serif}.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;font-size:14px;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;font-size:20px;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;font-size:19px;cursor:pointer}.crm-description{font-size:14px;width:100%;display:flex;gap:9px}.crm-description a{font-weight:bold;cursor:pointer;text-decoration:underline}.crm-description div{display:flex;gap:5px}";const y=u;const k="*{margin:0;padding:0;box-sizing:border-box}:host{--crmfont-sizebodymd:14px;--crmline-heightbodymd:20px;--crmletter-spacingtitle-md:0px}.container-message{font-family:Roboto;font-size:var(--crmfont-sizebodymd);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:14px;color:var(--crm-btn);font-weight:100}.crm-title{font-weight:700;line-height:20px;color:#262626;font-size:16px}.crm-message-info{color:#619013;font-weight:500;font-size:12px}.crm-message-error{color:#E11D48;font-weight:500;font-size:12px}";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(){this.validate(this.pin.join(""))}verifyPin(){const e=this.pin.join("");if(e==="9999"){this.isVerified=true}}handleTimeout(){this.canResend=true}async handleResend(){await this.resend();this.canResend=false;this.pin=["","","",""]}render(){var e;return i("div",{key:"4feca5ebbdcba078f526bcbbb1e8f59cd9f69d2f",class:"crm-phone-form"},i("label",{key:"51653ca43a050fd67dfba6a8525bfe3791076cff",class:"crm-subtitle"},n.t("pin-sutitle")," ",i("strong",{key:"8a47e532dc3bd566d23057e675261b50c97442c8"},"+55 ",this.phone)),i("div",{key:"eb367b999bb7c491e9cc792b8ea279bff71de435",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:"377bc33633df2c82ab1970c88e20bdbd9181d525"}),i("p",{key:"96769dc2bac4842ed9e259735381f25451bbe77d",class:"crm-description"}," Não recebeu?",!this.canResend&&i("label",{key:"9c3f25a357ae41aef6c16b11598a1cbd9ea32982"}," Reenviar em ",i("countdown-timer",{key:"a7a98f65cdcf0a88df4ce2f98d8694b0cf5c974c",downtime:()=>this.handleTimeout()})," "),this.canResend&&i("div",{key:"178c9b536d81f49d10240c55edfbe7dbb02076bb"},i("a",{key:"8b07796bd9a3349cdf994ccd963fe4333466eb22",onClick:()=>this.handleResend()},"Reenviar"),i("a",{key:"59289faea47104ec3ebc9818a43dbd205fc0a2bf",onClick:()=>this.cancel()},"Trocar número"))),i("crm-button",{key:"feecbd5c1681ae1adb8bd9ca8ba01b96252f6c5c",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{r as countdown_timer,l as crm_tooltip,h as giftback_info,m as phone_form,I as pin_form};
|
2
|
+
//# sourceMappingURL=p-5f8b033a.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["CountdownTimer","componentWillLoad","this","intervalId","setInterval","counter","clearInterval","downtime","disconnectedCallback","render","h","key","infoCircleSvgrepoComSvg","crmTooltipCss","CrmTooltipStyle0","Tooltip","class","src","info","id","identity","text","giftbackInfoCss","GiftbackInfoStyle0","GiftbackInfo","totalBonus","cartId","minimumPurchase","bonusBalance","calculatedValue","firstValidityDate","totalValue","changedBonus","updateBonus","usedValue","bonus","buildPositionSlider","selectedOption","localStorage","getItem","USED_KEY","handleSliderChange","event","input","target","parseFloat","value","min","max","componentDidLoad","document","getElementById","percentage","sliderPosition","handleOptionChange","option","setItem","reserve","cancel","remainingGiftback","translateDescription","i18next","t","amount","toFixed","replace","custom_name","limit","defineLimit","innerHTML","formatDateToBr","style","left","disabled","type","step","onInput","background","isComplete","name","checked","onChange","giftbackFormCss","PhoneFormStyle0","PhoneForm","handlePhone","phone","phoneInputMask","getPhone","handlerSubmit","Host","initialValue","ref","txtBtn","_a","config","btnApplyBonusLabel","loading","handleClick","pinFormCss","PinFormStyle0","PinFormStyle1","GiftbackPin","canResend","handleInput","index","slice","pin","length","nextInput","nextElementSibling","focus","validatePin","validate","join","verifyPin","pinCode","isVerified","handleTimeout","handleResend","resend","map","_","maxLength","onClick"],"sources":["src/components/countdown-timer/countdown-timer.tsx","src/assets/svg/info-circle-svgrepo-com.svg","src/components/tooltip/crm-tooltip.css?tag=crm-tooltip","src/components/tooltip/tooltip.tsx","src/components/giftback-form/subcomponents/giftback-info/giftback-info.css?tag=giftback-info","src/components/giftback-form/subcomponents/giftback-info/giftback-info.tsx","src/components/giftback-form/giftback-form.css?tag=phone-form","src/components/giftback-form/subcomponents/phone-form/phone-form.tsx","src/components/giftback-form/subcomponents/pin-form/pin-form.css?tag=pin-form&encapsulation=shadow","src/components/giftback-form/giftback-form.css?tag=pin-form&encapsulation=shadow","src/components/giftback-form/subcomponents/pin-form/pin-form.tsx"],"sourcesContent":["import { Component, h, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'countdown-timer',\n shadow: true,\n})\nexport class CountdownTimer {\n\n @Prop() downtime: () => void;\n\n @State() counter: number = 30;\n private intervalId: NodeJS.Timer;\n\n componentWillLoad() {\n this.intervalId = setInterval(() => {\n if (this.counter > 0) {\n this.counter--;\n } else {\n clearInterval(this.intervalId);\n\n this.downtime()\n }\n }, 1000); // Intervalo de 1 segundo\n }\n\n disconnectedCallback() {\n clearInterval(this.intervalId);\n }\n\n render() {\n return (\n <label>{this.counter}s</label>\n );\n }\n}\n","<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\r\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path d=\"M12 17.75C12.4142 17.75 12.75 17.4142 12.75 17V11C12.75 10.5858 12.4142 10.25 12 10.25C11.5858 10.25 11.25 10.5858 11.25 11V17C11.25 17.4142 11.5858 17.75 12 17.75Z\" fill=\"#1C274C\"/>\r\n<path d=\"M12 7C12.5523 7 13 7.44772 13 8C13 8.55228 12.5523 9 12 9C11.4477 9 11 8.55228 11 8C11 7.44772 11.4477 7 12 7Z\" fill=\"#1C274C\"/>\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M1.25 12C1.25 6.06294 6.06294 1.25 12 1.25C17.9371 1.25 22.75 6.06294 22.75 12C22.75 17.9371 17.9371 22.75 12 22.75C6.06294 22.75 1.25 17.9371 1.25 12ZM12 2.75C6.89137 2.75 2.75 6.89137 2.75 12C2.75 17.1086 6.89137 21.25 12 21.25C17.1086 21.25 21.25 17.1086 21.25 12C21.25 6.89137 17.1086 2.75 12 2.75Z\" fill=\"#1C274C\"/>\r\n</svg>",".crm-tooltip-container {\n display: flex;\n\n & img {\n width: 16px;\n margin-left: 3px;\n position: relative;\n }\n}\n\n.crm-tooltip {\n position: relative;\n display: inline-block;\n}\n\n.crm-tooltip .tooltiptext {\n visibility: hidden;\n background-color: black;\n color: #fff;\n text-align: center;\n padding: 8px 12px;\n border-radius: 0px;\n position: absolute;\n z-index: 1;\n min-width: 271px;\n top: 100%;\n left: 50%;\n margin-left: -238px;\n}\n\n@container (max-width: 410px) {\n .crm-tooltip .tooltiptext {\n margin-left: -14px;\n }\n\n .crm-tooltip #crm-role-description {\n margin-left: -151px;\n }\n}\n\n@container (max-width: 250px) {\n .crm-tooltip .tooltiptext {\n margin-left: -201px;\n }\n}\n\n.crm-tooltip:hover .tooltiptext {\n visibility: visible;\n}","import { Component, h, Prop } from \"@stencil/core\";\nimport info from '../../assets/svg/info-circle-svgrepo-com.svg';\n\n\n@Component({\n tag: 'crm-tooltip',\n styleUrl: 'crm-tooltip.css'\n})\nexport class Tooltip {\n\n @Prop() text: string;\n @Prop() identity: string;\n\n render() {\n return (\n <div class=\"crm-tooltip-container crm-tooltip\">\n <img src={info} />\n <span id={this.identity} class=\"tooltiptext\">{this.text}</span>\n </div>\n );\n }\n}",":host {\n --text-color: #6D6D5F\n}\n\n.giftback-container {\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\nh3 {\n font-size: 1.2rem;\n margin-bottom: 8px;\n color: #333;\n}\n\n.container-description {\n display: flex;\n align-items: center;\n gap: 5px;\n margin: 0 0 10px 0;\n}\n\n.container-description p {\n font-size: 14px;\n font-weight: 400;\n margin: 0px;\n}\n\n\np {\n font-size: 14px;\n color: #000;\n}\n\n.value-display h2 {\n color: #6D6D5F;\n /* Verde para o valor atual */\n font-size: 1.6rem;\n margin: 16px 0;\n}\n\ninput[type='range'] {\n width: 100%;\n margin: 12px 0;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 4px;\n outline: none;\n padding: 3px 0px 3px 3px;\n}\n\n/* input[type='range']::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n border-radius: 50%;\n cursor: pointer;\n} */\n\ninput[type=\"range\"]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 20px;\n height: 20px;\n background: rgb(109, 109, 95);\n /* Cor do botão */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.options {\n margin: 0px 0;\n display: flex;\n gap: 10px;\n flex-direction: column;\n}\n\n.options label {\n display: flex;\n margin: 0px 0;\n font-size: 0.9rem;\n color: #333;\n align-items: center;\n}\n\n.options input[type='radio'] {\n margin-right: 8px;\n height: 16px;\n width: 16px;\n}\n\n.options input[type='radio'] {\n appearance: none;\n -webkit-appearance: none;\n margin-right: 8px;\n width: 16px;\n height: 16px;\n border: 2px solid #ddd;\n border-radius: 50%;\n background-color: #fff;\n cursor: pointer;\n transition: all 0.3s;\n padding: 0px;\n}\n\n.options input[type='radio']:checked {\n border-color: #000;\n background-color: #FAFAFA;\n border: 4px solid #000;\n}\n\n.info-box {\n background-color: #f9f9f9;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n padding: 8px;\n font-size: 14px;\n color: #262626;\n line-height: 20px;\n}\n\n.info-icon {\n font-size: 0.9rem;\n cursor: pointer;\n color: #888;\n}\n\nh3 {\n font-size: 1.2rem;\n margin-bottom: 8px;\n color: #333;\n}\n\n.slider-wrapper {\n position: relative;\n margin: 21px 0px 0px 0px;\n}\n\n.slider {\n width: 100%;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 2px;\n outline: none;\n}\n\n.slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n /* Azul para o slider */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.slider-value {\n position: absolute;\n top: -30px;\n /* Posição acima do slider */\n font-size: 16px;\n font-weight: 700;\n color: var(--text-color);\n /* Verde para o texto */\n transform: translateX(-50%);\n white-space: nowrap;\n /* margin-left: 23px; */\n}\n\n.options-option {\n display: flex;\n}\n\n\n/* ########################################## */\n","import { Component, Prop, State, Watch, h } from \"@stencil/core\";\nimport { IBonus } from \"../../../../dto/validate.pin.bonus\";\n\nimport i18next from '../../../../i18n/i18n'\nimport { USED_KEY } from \"../../../../utils/keys.storage\";\nimport { defineLimit, formatDateToBr } from \"../../../../utils/utils\";\n\n@Component({\n tag: 'giftback-info',\n styleUrls: ['giftback-info.css']\n})\nexport class GiftbackInfo {\n @State() usedValue: number = 0;\n @State() selectedOption: string = 'none';\n\n @Prop() loading: boolean = false;\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 0,\n cartId: \"\",\n minimumPurchase: 0,\n bonusBalance: 0,\n calculatedValue: 0,\n firstValidityDate: \"\",\n totalValue: 0\n };\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n\n @State() sliderPosition: number = 0;\n\n @Watch(\"bonus\")\n changedBonus() {\n this.updateBonus()\n }\n\n private updateBonus() {\n this.usedValue = this.bonus.bonusBalance;\n this.buildPositionSlider(0, this.bonus.totalBonus);\n }\n\n componentWillLoad() {\n this.updateBonus();\n this.selectedOption = localStorage.getItem(USED_KEY);\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n\n // Calculando a posição do texto com base no valor do slider\n // const percentage = ((this.usedValue - parseInt(input.min)) / (parseInt(input.max) - parseInt(input.min))) * 100;\n // this.sliderPosition = percentage;\n\n this.buildPositionSlider(parseFloat(input.min), parseFloat(input.max))\n }\n\n componentDidLoad() {\n const input: any = document.getElementById(\"position_value_id\")\n\n input.value = this.bonus.bonusBalance;\n }\n\n\n private buildPositionSlider(min: number, max: number) {\n // Calculando a posição do texto com base no valor do slider\n const percentage = ((this.usedValue - min) / (max - min)) * 100;\n this.sliderPosition = percentage;\n }\n\n async handleOptionChange(option: string) {\n this.selectedOption = option;\n\n localStorage.setItem(USED_KEY, option);\n switch (this.selectedOption) {\n case 'use':\n await this.reserve(this.usedValue)\n break;\n case 'dontUse':\n await this.cancel();\n break;\n default:\n }\n }\n\n render() {\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n const translateDescription = i18next.t(\"giftDescription\", { amount: `${this.bonus.totalBonus.toFixed(2).replace(\".\", \",\")}`, custom_name: \"Giftback\" })\n\n const limit = defineLimit(remainingGiftback)\n return (\n\n <div class=\"giftback-container\">\n <div class=\"container-description\">\n <p innerHTML={translateDescription}></p>\n <crm-tooltip identity=\"crm-role-description\" text={i18next.t(\"labelUseGiftback\", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: formatDateToBr(this.bonus.firstValidityDate) })} />\n </div>\n <div class=\"slider-wrapper\">\n <div\n class=\"slider-value\"\n style={{\n left: `calc(${this.sliderPosition}% - 20px)`, // Ajuste para centralizar o texto\n\n }}\n >\n R$ {this.usedValue.toFixed(2).replace(\".\", \",\")}\n </div>\n <input\n id=\"position_value_id\"\n disabled\n type=\"range\"\n min=\"0\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n class=\"slider\"\n step=\"0.01\"\n onInput={(event) => this.handleSliderChange(event)}\n style={{\n background: `linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`,\n }}\n />\n </div>\n\n {\n limit.isComplete && (\n <p>\n {i18next.t(\"maxAmount\")}\n </p>\n )\n }\n\n {\n !limit.isComplete && (\n <div class=\"container-description\">\n <p>\n Adicione <strong>R$ {remainingGiftback < 0 ? \"0,00\" : remainingGiftback.toFixed(2).replace(\".\", \",\")}</strong> ao carrinho para atingir o valor\n máximo! <crm-tooltip identity=\"crm-max-description\" text={i18next.t(\"labelamountPartial\")} />\n </p>\n </div>\n )\n }\n\n\n <div class=\"options\">\n <div class=\"options-option\">\n <input\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"use\"\n checked={this.selectedOption === 'use'}\n onChange={() => this.handleOptionChange('use')}\n />\n <p>Usar o meu Giftback</p>\n </div>\n <div class=\"options-option\">\n <input\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"dontUse\"\n checked={this.selectedOption === 'dontUse'}\n onChange={() => this.handleOptionChange('dontUse')}\n />\n <p>Não usar o meu Giftback</p>\n </div>\n </div>\n <div class=\"info-box\">\n O Giftback será aplicado na próxima etapa.\n </div>\n </div>\n );\n }\n}","* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n font-family: Roboto;\n font-size: var(--crmfont-sizebodymd);\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n font-size: 14px;\n color: var(--crm-btn);\n font-weight: 100;\n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n font-size: 16px;\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n font-size: 12px;\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n font-size: 12px;\n}","import { Component, Host, Prop, h } from \"@stencil/core\";\nimport { IInfoStore } from \"../../../../helpers/info.config.helper\";\n\n@Component({\n tag: 'phone-form',\n styleUrl: '../../giftback-form.css'\n})\nexport class PhoneForm {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() value: string;\n @Prop() loading: boolean;\n @Prop() handlerSubmit: (phone: string) => void;\n\n @Prop() config: IInfoStore;\n\n\n async handlePhone() {\n\n const phone = await this.phoneInputMask.getPhone()\n\n await this.handlerSubmit(phone);\n }\n\n\n render() {\n return (\n <Host class=\"crm-phone-form\">\n <label class=\"crm-subtitle\" >Digite o seu celular para verificar se há desconto disponível nessa compra:</label>\n <phone-input-mask initialValue={this.value} ref={ref => this.phoneInputMask = ref} />\n\n <crm-button txtBtn={this.config?.btnApplyBonusLabel || \"Avançar\"} loading={this.loading} handleClick={() => this.handlePhone() } />\n </Host>\n )\n }\n}",":host {\n display: block;\n font-family: Arial, sans-serif;\n}\n\n.form-container-pin {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.pin-container {\n display: flex;\n /* margin: 26px 0; */\n justify-content: start;\n gap: 10px;\n}\n\n.pin-container input {\n width: 100%;\n height: 48px;\n font-size: 14px;\n text-align: center;\n border: 1px solid #ccc;\n border-radius: 5px;\n}\n\nbutton {\n padding: 10px 20px;\n background-color: #ddd;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n}\n\n\n.success {\n color: green;\n margin-top: 10px;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n border-radius: 10px;\n padding: 15px;\n min-height: 30px;\n min-width: 120px;\n font-size: 20px;\n cursor: pointer;\n}\n\n.button-cancel {\n top: 50%;\n background-color: #ffffff;\n color: #1e1c1c;\n border: 1px solid gray;\n border-radius: 10px;\n padding: 10px;\n min-height: 30px;\n min-width: 120px;\n font-size: 19px;\n cursor: pointer;\n}\n\n.crm-description {\n font-size: 14px;\n width: 100%;\n display: flex;\n gap: 9px;\n}\n\n.crm-description a {\n font-weight: bold;\n cursor: pointer;\n text-decoration: underline;\n}\n\n.crm-description div {\n display: flex;\n gap: 5px;\n}","* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n font-family: Roboto;\n font-size: var(--crmfont-sizebodymd);\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n font-size: 14px;\n color: var(--crm-btn);\n font-weight: 100;\n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n font-size: 16px;\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n font-size: 12px;\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n font-size: 12px;\n}","import { Component, h, Prop, State } from '@stencil/core';\nimport { IPinSent } from '../../../../dto/pin.sent';\nimport i18next from '../../../../i18n/i18n'\nimport { IInfoStore } from '../../../../helpers/info.config.helper';\n\n@Component({\n tag: 'pin-form',\n styleUrls: ['pin-form.css', '../../giftback-form.css'],\n shadow: true,\n})\nexport class GiftbackPin {\n\n @Prop() validate: (pin: string) => void;\n @Prop() cancel: () => void;\n @Prop() resend: () => void;\n\n @Prop() sent: IPinSent;\n @Prop() loading: boolean = false;\n @Prop() phone: string;\n @Prop() config: IInfoStore;\n\n @State() pin: string[] = ['', '', '', ''];\n @State() isVerified: boolean = false;\n @State() canResend: boolean = false;\n\n componentWillLoad() {\n this.canResend = false;\n }\n\n handleInput(event: Event, index: number) {\n const input = event.target as HTMLInputElement;\n const value = input.value.slice(0, 1); // Limitar a um único dígito\n this.pin[index] = value;\n\n // Focar no próximo campo, se possível\n if (value && index < this.pin.length - 1) {\n const nextInput = input.nextElementSibling as HTMLInputElement;\n nextInput?.focus();\n }\n\n this.pin = [...this.pin];\n }\n\n validatePin() {\n this.validate(this.pin.join(\"\"))\n }\n\n verifyPin() {\n const pinCode = this.pin.join('');\n if (pinCode === '9999') {\n this.isVerified = true;\n }\n }\n\n handleTimeout() {\n this.canResend = true;\n }\n\n async handleResend() {\n await this.resend();\n\n this.canResend = false;\n this.pin = ['', '', '', '']\n }\n\n render() {\n return (\n <div class=\"crm-phone-form\">\n <label class=\"crm-subtitle\" >{i18next.t('pin-sutitle')} <strong>+55 {this.phone}</strong></label>\n <div class=\"pin-container\">\n {this.pin.map((_, index) => (\n <input\n type=\"text\"\n maxLength={1}\n value={this.pin[index]}\n onInput={(event) => this.handleInput(event, index)}\n />\n ))}\n </div>\n\n <slot></slot>\n\n <p class=\"crm-description\"> Não recebeu?\n {\n !this.canResend && <label> Reenviar em <countdown-timer downtime={() => this.handleTimeout()} /> </label>\n }\n {\n this.canResend && (\n <div >\n <a onClick={() => this.handleResend()}>Reenviar</a>\n <a onClick={() => this.cancel()}>Trocar número</a>\n </div>\n )\n }\n </p>\n <crm-button txtBtn={this.config?.btnApplyBonusLabel || \"Avançar\"} loading={this.loading} handleClick={() => this.validatePin()} />\n </div >\n );\n }\n}\n"],"mappings":"2KAMaA,EAAc,M,8DAII,E,CAG3B,iBAAAC,GACIC,KAAKC,WAAaC,aAAY,KAC1B,GAAIF,KAAKG,QAAU,EAAG,CAClBH,KAAKG,S,KACF,CACHC,cAAcJ,KAAKC,YAEnBD,KAAKK,U,IAEV,I,CAGP,oBAAAC,GACIF,cAAcJ,KAAKC,W,CAGvB,MAAAM,GACI,OACIC,EAAA,SAAAC,IAAA,4CAAQT,KAAKG,QAAO,I,GC/BhC,MAAMO,EAA0B,yvCCAhC,MAAMC,EAAgB,03BACtB,MAAAC,EAAeD,E,MCOFE,EAAO,M,qEAKhB,MAAAN,GACI,OACIC,EAAA,OAAAC,IAAA,2CAAKK,MAAM,q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C,IAAA,2CAAGiH,QAAS,IAAM1H,KAAKqH,gBAAc,YACrC7G,EAAA,KAAAC,IAAA,2CAAGiH,QAAS,IAAM1H,KAAKwD,UAAQ,mBAK/ChD,EAAA,cAAAC,IAAA,2CAAYkF,SAAQC,EAAA5F,KAAK6F,UAAM,MAAAD,SAAA,SAAAA,EAAEE,qBAAsB,UAAWC,QAAS/F,KAAK+F,QAASC,YAAa,IAAMhG,KAAK8G,gB","ignoreList":[]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as t,h as s,H as i}from"./p-3d6152b1.js";import{C as e}from"./p-
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as t,h as s,H as i}from"./p-3d6152b1.js";import{C as e}from"./p-c44e2f02.js";import{S as a}from"./p-24bdfca4.js";import"./p-f9aeffc1.js";const n=".form-container{width:100%;display:flex;justify-content:center;justify-content:space-around}.disabled{opacity:0.6;cursor:not-allowed}.message-error{color:#d11111;font-weight:bold;font-family:Arial;font-size:small;margin-left:16px}";const h=n;const d=class{constructor(s){t(this,s);this.crmBonusService=e.getInstance();this.storeName=undefined;this.cartId=undefined;this.products=undefined;this.customer={phone:"",birthDate:"",document:"",name:""};this.sent=undefined;this.stepNext=undefined;this.phone=undefined;this.loadingModal=undefined;this.saveStore=undefined;this.cancel=undefined;this.handleCustomerName=undefined;this.loading=false;this.step=a.STEP_NAME;this.message=undefined;this.bonus=undefined}async setStep(t){this.step=t}async validateBonus(t){var s,i;this.loading=true;this.message="";const e={pin:t,cellphone:parseInt(this.phone.toString()),storeId:this.sent.storeId.toString(),userId:this.sent.userId.toString(),checkoutId:this.cartId,checkoutProducts:this.products,name:null,storeName:this.storeName};try{this.bonus=await this.crmBonusService.validatePinBonus(e);this.step=a.STEP_RESERVE}catch(t){this.message=(i=(s=t===null||t===void 0?void 0:t.response)===null||s===void 0?void 0:s.data)===null||i===void 0?void 0:i.message}finally{this.loading=false}}async reserveApply(t){this.loading=true;this.message="";try{await this.reserve(t);this.step=a.STEP_APPLY;this.saveStore(t)}catch(t){this.message="ocorreu um error ao solicitar a aplicação do bonus! tente novamente"}finally{this.loading=false}}async reserve(t){await this.crmBonusService.reserve({redeemedBonus:t,cartId:this.cartId,ticket:this.cartId,grossValue:Number(this.bonus.totalValue),storeName:this.storeName,storeId:this.bonus.storeId.toString(),userId:this.bonus.userId})}handleCancel(){this.step=a.STEP_PHONE;this.cancel()}render(){return s(i,{key:"2d736cd603436521bf15f0ef8eaf0670ad9f6a42"},this.step==a.STEP_NAME&&s("name-input",{key:"bfa12463c1f29bb65814368790f201dcab869dd9",loading:this.loadingModal,value:this.customer.name,applyName:t=>this.handleCustomerName(t)}),this.step===a.STEP_PIN&&s("giftback-pin",{key:"3fdf1c285b5d777289b42fcfbcf80dfc92579f29",cancel:()=>this.handleCancel(),sent:this.sent,validate:t=>this.validateBonus(t),loading:this.loading}),this.step===a.STEP_RESERVE&&s("giftback-progress",{key:"f06df8cab7361a51d1b89b4f0f0a1a8ceb7a7e30",loading:this.loading,cancel:()=>this.handleCancel(),bonus:this.bonus,reserve:t=>this.reserveApply(t)}),this.step===a.STEP_APPLY&&s("giftback-finish",{key:"eaacf1438652b04cfd607e5bac81dffbe4b542bb"}),s("p",{key:"a2014780bbb5dfb23cf6165500f43c6fcca700d3",class:"message-error"},this.message))}};d.style=h;export{d as crm_bonus_form};
|
2
|
+
//# sourceMappingURL=p-a5a145b8.entry.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{U as t,g as e,B as n,a as o}from"./p-f9aeffc1.js";function r(t,e){return function n(){return t.apply(e,arguments)}}const{toString:s}=Object.prototype;const{getPrototypeOf:i}=Object;const c=(t=>e=>{const n=s.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null));const u=t=>{t=t.toLowerCase();return e=>c(e)===t};const a=t=>e=>typeof e===t;const{isArray:l}=Array;const f=a("undefined");function d(t){return t!==null&&!f(t)&&t.constructor!==null&&!f(t.constructor)&&w(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const h=u("ArrayBuffer");function p(t){let e;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){e=ArrayBuffer.isView(t)}else{e=t&&t.buffer&&h(t.buffer)}return e}const m=a("string");const w=a("function");const y=a("number");const b=t=>t!==null&&typeof t==="object";const g=t=>t===true||t===false;const R=t=>{if(c(t)!=="object"){return false}const e=i(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};const O=u("Date");const S=u("File");const E=u("Blob");const T=u("FileList");const A=t=>b(t)&&w(t.pipe);const j=t=>{let e;return t&&(typeof FormData==="function"&&t instanceof FormData||w(t.append)&&((e=c(t))==="formdata"||e==="object"&&w(t.toString)&&t.toString()==="[object FormData]"))};const N=u("URLSearchParams");const[x,v,C,P]=["ReadableStream","Request","Response","Headers"].map(u);const B=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function F(t,e,{allOwnKeys:n=false}={}){if(t===null||typeof t==="undefined"){return}let o;let r;if(typeof t!=="object"){t=[t]}if(l(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 D(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 U=(()=>{if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global})();const _=t=>!f(t)&&t!==U;function k(){const{caseless:t}=_(this)&&this||{};const e={};const n=(n,o)=>{const r=t&&D(e,o)||o;if(R(e[r])&&R(n)){e[r]=k(e[r],n)}else if(R(n)){e[r]=k({},n)}else if(l(n)){e[r]=n.slice()}else{e[r]=n}};for(let t=0,e=arguments.length;t<e;t++){arguments[t]&&F(arguments[t],n)}return e}const q=(t,e,n,{allOwnKeys:o}={})=>{F(e,((e,o)=>{if(n&&w(e)){t[o]=r(e,n)}else{t[o]=e}}),{allOwnKeys:o});return t};const L=t=>{if(t.charCodeAt(0)===65279){t=t.slice(1)}return t};const I=(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 z=(t,e,n,o)=>{let r;let s;let c;const u={};e=e||{};if(t==null)return e;do{r=Object.getOwnPropertyNames(t);s=r.length;while(s-- >0){c=r[s];if((!o||o(c,t,e))&&!u[c]){e[c]=t[c];u[c]=true}}t=n!==false&&i(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e};const M=(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 $=t=>{if(!t)return null;if(l(t))return t;let e=t.length;if(!y(e))return null;const n=new Array(e);while(e-- >0){n[e]=t[e]}return n};const H=(t=>e=>t&&e instanceof t)(typeof Uint8Array!=="undefined"&&i(Uint8Array));const J=(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 K=(t,e)=>{let n;const o=[];while((n=t.exec(e))!==null){o.push(n)}return o};const V=u("HTMLFormElement");const W=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function t(e,n,o){return n.toUpperCase()+o}));const G=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype);const X=u("RegExp");const Y=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t);const o={};F(n,((n,r)=>{let s;if((s=e(n,r,t))!==false){o[r]=s||n}}));Object.defineProperties(t,o)};const Z=t=>{Y(t,((e,n)=>{if(w(t)&&["arguments","caller","callee"].indexOf(n)!==-1){return false}const o=t[n];if(!w(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 Q=(t,e)=>{const n={};const o=t=>{t.forEach((t=>{n[t]=true}))};l(t)?o(t):o(String(t).split(e));return n};const tt=()=>{};const et=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;const nt="abcdefghijklmnopqrstuvwxyz";const ot="0123456789";const rt={DIGIT:ot,ALPHA:nt,ALPHA_DIGIT:nt+nt.toUpperCase()+ot};const st=(t=16,e=rt.ALPHA_DIGIT)=>{let n="";const{length:o}=e;while(t--){n+=e[Math.random()*o|0]}return n};function it(t){return!!(t&&w(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const ct=t=>{const e=new Array(10);const n=(t,o)=>{if(b(t)){if(e.indexOf(t)>=0){return}if(!("toJSON"in t)){e[o]=t;const r=l(t)?[]:{};F(t,((t,e)=>{const s=n(t,o+1);!f(s)&&(r[e]=s)}));e[o]=undefined;return r}}return t};return n(t,0)};const ut=u("AsyncFunction");const at=t=>t&&(b(t)||w(t))&&w(t.then)&&w(t.catch);const lt=((t,e)=>{if(t){return setImmediate}return e?((t,e)=>{U.addEventListener("message",(({source:n,data:o})=>{if(n===U&&o===t){e.length&&e.shift()()}}),false);return n=>{e.push(n);U.postMessage(t,"*")}})(`axios@${Math.random()}`,[]):t=>setTimeout(t)})(typeof setImmediate==="function",w(U.postMessage));const ft=typeof queueMicrotask!=="undefined"?queueMicrotask.bind(U):typeof process!=="undefined"&&process.nextTick||lt;const dt={isArray:l,isArrayBuffer:h,isBuffer:d,isFormData:j,isArrayBufferView:p,isString:m,isNumber:y,isBoolean:g,isObject:b,isPlainObject:R,isReadableStream:x,isRequest:v,isResponse:C,isHeaders:P,isUndefined:f,isDate:O,isFile:S,isBlob:E,isRegExp:X,isFunction:w,isStream:A,isURLSearchParams:N,isTypedArray:H,isFileList:T,forEach:F,merge:k,extend:q,trim:B,stripBOM:L,inherits:I,toFlatObject:z,kindOf:c,kindOfTest:u,endsWith:M,toArray:$,forEachEntry:J,matchAll:K,isHTMLForm:V,hasOwnProperty:G,hasOwnProp:G,reduceDescriptors:Y,freezeMethods:Z,toObjectSet:Q,toCamelCase:W,noop:tt,toFiniteNumber:et,findKey:D,global:U,isContextDefined:_,ALPHABET:rt,generateString:st,isSpecCompliantForm:it,toJSONObject:ct,isAsyncFn:ut,isThenable:at,setImmediate:lt,asap:ft};function ht(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}}dt.inherits(ht,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:dt.toJSONObject(this.config),code:this.code,status:this.status}}});const pt=ht.prototype;const mt={};["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=>{mt[t]={value:t}}));Object.defineProperties(ht,mt);Object.defineProperty(pt,"isAxiosError",{value:true});ht.from=(t,e,n,o,r,s)=>{const i=Object.create(pt);dt.toFlatObject(t,i,(function t(e){return e!==Error.prototype}),(t=>t!=="isAxiosError"));ht.call(i,t.message,e,n,o,r);i.cause=t;i.name=t.name;s&&Object.assign(i,s);return i};const wt=null;function yt(t){return dt.isPlainObject(t)||dt.isArray(t)}function bt(t){return dt.endsWith(t,"[]")?t.slice(0,-2):t}function gt(t,e,n){if(!t)return e;return t.concat(e).map((function t(e,o){e=bt(e);return!n&&o?"["+e+"]":e})).join(n?".":"")}function Rt(t){return dt.isArray(t)&&!t.some(yt)}const Ot=dt.toFlatObject(dt,{},null,(function t(e){return/^is[A-Z]/.test(e)}));function St(t,e,n){if(!dt.isObject(t)){throw new TypeError("target must be an object")}e=e||new FormData;n=dt.toFlatObject(n,{metaTokens:true,dots:false,indexes:false},false,(function t(e,n){return!dt.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 u=c&&dt.isSpecCompliantForm(e);if(!dt.isFunction(r)){throw new TypeError("visitor must be a function")}function a(t){if(t===null)return"";if(dt.isDate(t)){return t.toISOString()}if(!u&&dt.isBlob(t)){throw new ht("Blob is not supported. Use a Buffer instead.")}if(dt.isArrayBuffer(t)||dt.isTypedArray(t)){return u&&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(dt.endsWith(n,"{}")){n=o?n:n.slice(0,-2);t=JSON.stringify(t)}else if(dt.isArray(t)&&Rt(t)||(dt.isFileList(t)||dt.endsWith(n,"[]"))&&(c=dt.toArray(t))){n=bt(n);c.forEach((function t(o,r){!(dt.isUndefined(o)||o===null)&&e.append(i===true?gt([n],r,s):i===null?n:n+"[]",a(o))}));return false}}if(yt(t)){return true}e.append(gt(r,n,s),a(t));return false}const f=[];const d=Object.assign(Ot,{defaultVisitor:l,convertValue:a,isVisitable:yt});function h(t,n){if(dt.isUndefined(t))return;if(f.indexOf(t)!==-1){throw Error("Circular reference detected in "+n.join("."))}f.push(t);dt.forEach(t,(function t(o,s){const i=!(dt.isUndefined(o)||o===null)&&r.call(e,o,dt.isString(s)?s.trim():s,n,d);if(i===true){h(o,n?n.concat(s):[s])}}));f.pop()}if(!dt.isObject(t)){throw new TypeError("data must be an object")}h(t);return e}function Et(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 Tt(t,e){this._pairs=[];t&&St(t,this,e)}const At=Tt.prototype;At.append=function t(e,n){this._pairs.push([e,n])};At.toString=function t(e){const n=e?function(t){return e.call(this,t,Et)}:Et;return this._pairs.map((function t(e){return n(e[0])+"="+n(e[1])}),"").join("&")};function jt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Nt(t,e,n){if(!e){return t}const o=n&&n.encode||jt;const r=n&&n.serialize;let s;if(r){s=r(e,n)}else{s=dt.isURLSearchParams(e)?e.toString():new Tt(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 xt{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){dt.forEach(this.handlers,(function e(n){if(n!==null){t(n)}}))}}const vt=xt;const Ct={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};const Pt=typeof URLSearchParams!=="undefined"?URLSearchParams:Tt;const Bt=typeof FormData!=="undefined"?FormData:null;const Ft=typeof Blob!=="undefined"?Blob:null;const Dt={isBrowser:true,classes:{URLSearchParams:Pt,FormData:Bt,Blob:Ft},protocols:["http","https","file","blob","url","data"]};const Ut=typeof window!=="undefined"&&typeof document!=="undefined";const _t=typeof navigator==="object"&&navigator||undefined;const kt=Ut&&(!_t||["ReactNative","NativeScript","NS"].indexOf(_t.product)<0);const qt=(()=>typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function")();const Lt=Ut&&window.location.href||"http://localhost";const It=Object.freeze({__proto__:null,hasBrowserEnv:Ut,hasStandardBrowserWebWorkerEnv:qt,hasStandardBrowserEnv:kt,navigator:_t,origin:Lt});const zt={...It,...Dt};function Mt(t,e){return St(t,new zt.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,o){if(zt.isNode&&dt.isBuffer(t)){this.append(e,t.toString("base64"));return false}return o.defaultVisitor.apply(this,arguments)}},e))}function $t(t){return dt.matchAll(/\w+|\[(\w*)]/g,t).map((t=>t[0]==="[]"?"":t[1]||t[0]))}function Ht(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 Jt(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&&dt.isArray(o)?o.length:s;if(c){if(dt.hasOwnProp(o,s)){o[s]=[o[s],n]}else{o[s]=n}return!i}if(!o[s]||!dt.isObject(o[s])){o[s]=[]}const u=e(t,n,o[s],r);if(u&&dt.isArray(o[s])){o[s]=Ht(o[s])}return!i}if(dt.isFormData(t)&&dt.isFunction(t.entries)){const n={};dt.forEachEntry(t,((t,o)=>{e($t(t),o,n,0)}));return n}return null}function Kt(t,e,n){if(dt.isString(t)){try{(e||JSON.parse)(t);return dt.trim(t)}catch(t){if(t.name!=="SyntaxError"){throw t}}}return(n||JSON.stringify)(t)}const Vt={transitional:Ct,adapter:["xhr","http","fetch"],transformRequest:[function t(e,n){const o=n.getContentType()||"";const r=o.indexOf("application/json")>-1;const s=dt.isObject(e);if(s&&dt.isHTMLForm(e)){e=new FormData(e)}const i=dt.isFormData(e);if(i){return r?JSON.stringify(Jt(e)):e}if(dt.isArrayBuffer(e)||dt.isBuffer(e)||dt.isStream(e)||dt.isFile(e)||dt.isBlob(e)||dt.isReadableStream(e)){return e}if(dt.isArrayBufferView(e)){return e.buffer}if(dt.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 Mt(e,this.formSerializer).toString()}if((c=dt.isFileList(e))||o.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return St(c?{"files[]":e}:e,t&&new t,this.formSerializer)}}if(s||r){n.setContentType("application/json",false);return Kt(e)}return e}],transformResponse:[function t(e){const n=this.transitional||Vt.transitional;const o=n&&n.forcedJSONParsing;const r=this.responseType==="json";if(dt.isResponse(e)||dt.isReadableStream(e)){return e}if(e&&dt.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 ht.from(t,ht.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:zt.classes.FormData,Blob:zt.classes.Blob},validateStatus:function t(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":undefined}}};dt.forEach(["delete","get","head","post","put","patch"],(t=>{Vt.headers[t]={}}));const Wt=Vt;const Gt=dt.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 Xt=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]&&Gt[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 Zt(t){return t&&String(t).trim().toLowerCase()}function Qt(t){if(t===false||t==null){return t}return dt.isArray(t)?t.map(Qt):String(t)}function te(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 ee=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ne(t,e,n,o,r){if(dt.isFunction(o)){return o.call(this,e,n)}if(r){e=n}if(!dt.isString(e))return;if(dt.isString(o)){return e.indexOf(o)!==-1}if(dt.isRegExp(o)){return o.test(e)}}function oe(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}function re(t,e){const n=dt.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 se{constructor(t){t&&this.set(t)}set(t,e,n){const o=this;function r(t,e,n){const r=Zt(e);if(!r){throw new Error("header name must be a non-empty string")}const s=dt.findKey(o,r);if(!s||o[s]===undefined||n===true||n===undefined&&o[s]!==false){o[s||e]=Qt(t)}}const s=(t,e)=>dt.forEach(t,((t,n)=>r(t,n,e)));if(dt.isPlainObject(t)||t instanceof this.constructor){s(t,e)}else if(dt.isString(t)&&(t=t.trim())&&!ee(t)){s(Xt(t),e)}else if(dt.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=Zt(t);if(t){const n=dt.findKey(this,t);if(n){const t=this[n];if(!e){return t}if(e===true){return te(t)}if(dt.isFunction(e)){return e.call(this,t,n)}if(dt.isRegExp(e)){return e.exec(t)}throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){t=Zt(t);if(t){const n=dt.findKey(this,t);return!!(n&&this[n]!==undefined&&(!e||ne(this,this[n],n,e)))}return false}delete(t,e){const n=this;let o=false;function r(t){t=Zt(t);if(t){const r=dt.findKey(n,t);if(r&&(!e||ne(n,n[r],r,e))){delete n[r];o=true}}}if(dt.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||ne(this,this[r],r,t,true)){delete this[r];o=true}}return o}normalize(t){const e=this;const n={};dt.forEach(this,((o,r)=>{const s=dt.findKey(n,r);if(s){e[s]=Qt(o);delete e[r];return}const i=t?oe(r):String(r).trim();if(i!==r){delete e[r]}e[i]=Qt(o);n[i]=true}));return this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);dt.forEach(this,((n,o)=>{n!=null&&n!==false&&(e[o]=t&&dt.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=Zt(t);if(!n[e]){re(o,t);n[e]=true}}dt.isArray(t)?t.forEach(r):r(t);return this}}se.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);dt.reduceDescriptors(se.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}}));dt.freezeMethods(se);const ie=se;function ce(t,e){const n=this||Wt;const o=e||n;const r=ie.from(o.headers);let s=o.data;dt.forEach(t,(function t(o){s=o.call(n,s,r.normalize(),e?e.status:undefined)}));r.normalize();return s}function ue(t){return!!(t&&t.__CANCEL__)}function ae(t,e,n){ht.call(this,t==null?"canceled":t,ht.ERR_CANCELED,e,n);this.name="CanceledError"}dt.inherits(ae,ht,{__CANCEL__:true});function le(t,e,n){const o=n.config.validateStatus;if(!n.status||!o||o(n.status)){t(n)}else{e(new ht("Request failed with status code "+n.status,[ht.ERR_BAD_REQUEST,ht.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}}function fe(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function de(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(u){const a=Date.now();const l=o[s];if(!i){i=a}n[r]=u;o[r]=a;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(a-i<e){return}const h=l&&a-l;return h?Math.round(d*1e3/h):undefined}}function he(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 u=()=>r&&i(r);return[c,u]}const pe=(t,e,n=3)=>{let o=0;const r=de(50,250);return he((n=>{const s=n.loaded;const i=n.lengthComputable?n.total:undefined;const c=s-o;const u=r(c);const a=s<=i;o=s;const l={loaded:s,total:i,progress:i?s/i:undefined,bytes:c,rate:u?u:undefined,estimated:u&&i&&a?(i-s)/u:undefined,event:n,lengthComputable:i!=null,[e?"download":"upload"]:true};t(l)}),n)};const me=(t,e)=>{const n=t!=null;return[o=>e[0]({lengthComputable:n,total:t,loaded:o}),e[1]]};const we=t=>(...e)=>dt.asap((()=>t(...e)));const ye=zt.hasStandardBrowserEnv?function t(){const e=zt.navigator&&/(msie|trident)/i.test(zt.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=dt.isString(e)?r(e):e;return n.protocol===o.protocol&&n.host===o.host}}():function t(){return function t(){return true}}();const be=zt.hasStandardBrowserEnv?{write(t,e,n,o,r,s){const i=[t+"="+encodeURIComponent(e)];dt.isNumber(n)&&i.push("expires="+new Date(n).toGMTString());dt.isString(o)&&i.push("path="+o);dt.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 ge(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Re(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Oe(t,e){if(t&&!ge(e)){return Re(t,e)}return e}const Se=t=>t instanceof ie?{...t}:t;function Ee(t,e){e=e||{};const n={};function o(t,e,n){if(dt.isPlainObject(t)&&dt.isPlainObject(e)){return dt.merge.call({caseless:n},t,e)}else if(dt.isPlainObject(e)){return dt.merge({},e)}else if(dt.isArray(e)){return e.slice()}return e}function r(t,e,n){if(!dt.isUndefined(e)){return o(t,e,n)}else if(!dt.isUndefined(t)){return o(undefined,t,n)}}function s(t,e){if(!dt.isUndefined(e)){return o(undefined,e)}}function i(t,e){if(!dt.isUndefined(e)){return o(undefined,e)}else if(!dt.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 u={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(Se(t),Se(e),true)};dt.forEach(Object.keys(Object.assign({},t,e)),(function o(s){const i=u[s]||r;const a=i(t[s],e[s],s);dt.isUndefined(a)&&i!==c||(n[s]=a)}));return n}const Te=t=>{const e=Ee({},t);let{data:n,withXSRFToken:o,xsrfHeaderName:r,xsrfCookieName:s,headers:i,auth:c}=e;e.headers=i=ie.from(i);e.url=Nt(Oe(e.baseURL,e.url),t.params,t.paramsSerializer);if(c){i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")))}let u;if(dt.isFormData(n)){if(zt.hasStandardBrowserEnv||zt.hasStandardBrowserWebWorkerEnv){i.setContentType(undefined)}else if((u=i.getContentType())!==false){const[t,...e]=u?u.split(";").map((t=>t.trim())).filter(Boolean):[];i.setContentType([t||"multipart/form-data",...e].join("; "))}}if(zt.hasStandardBrowserEnv){o&&dt.isFunction(o)&&(o=o(e));if(o||o!==false&&ye(e.url)){const t=r&&s&&be.read(s);if(t){i.set(r,t)}}}return e};const Ae=typeof XMLHttpRequest!=="undefined";const je=Ae&&function(t){return new Promise((function e(n,o){const r=Te(t);let s=r.data;const i=ie.from(r.headers).normalize();let{responseType:c,onUploadProgress:u,onDownloadProgress:a}=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=ie.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};le((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 ht("Request aborted",ht.ECONNABORTED,t,w));w=null};w.onerror=function e(){o(new ht("Network Error",ht.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||Ct;if(r.timeoutErrorMessage){n=r.timeoutErrorMessage}o(new ht(n,s.clarifyTimeoutError?ht.ETIMEDOUT:ht.ECONNABORTED,t,w));w=null};s===undefined&&i.setContentType(null);if("setRequestHeader"in w){dt.forEach(i.toJSON(),(function t(e,n){w.setRequestHeader(n,e)}))}if(!dt.isUndefined(r.withCredentials)){w.withCredentials=!!r.withCredentials}if(c&&c!=="json"){w.responseType=r.responseType}if(a){[d,p]=pe(a,true);w.addEventListener("progress",d)}if(u&&w.upload){[f,h]=pe(u);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 ae(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=fe(r.url);if(b&&zt.protocols.indexOf(b)===-1){o(new ht("Unsupported protocol "+b+":",ht.ERR_BAD_REQUEST,t));return}w.send(s||null)}))};const Ne=(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 ht?e:new ae(e instanceof Error?e.message:e))}};let s=e&&setTimeout((()=>{s=null;r(new ht(`timeout ${e} of ms exceeded`,ht.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=()=>dt.asap(i);return c}};const xe=Ne;const ve=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 Ce=async function*(t,e){for await(const n of Pe(t)){yield*ve(n,e)}};const Pe=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 Be=(t,e,n,o)=>{const r=Ce(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 Fe=typeof fetch==="function"&&typeof Request==="function"&&typeof Response==="function";const De=Fe&&typeof ReadableStream==="function";const Ue=Fe&&(typeof TextEncoder==="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer()));const _e=(t,...e)=>{try{return!!t(...e)}catch(t){return false}};const ke=De&&_e((()=>{let t=false;const e=new Request(zt.origin,{body:new ReadableStream,method:"POST",get duplex(){t=true;return"half"}}).headers.has("Content-Type");return t&&!e}));const qe=64*1024;const Le=De&&_e((()=>dt.isReadableStream(new Response("").body)));const Ie={stream:Le&&(t=>t.body)};Fe&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Ie[e]&&(Ie[e]=dt.isFunction(t[e])?t=>t[e]():(t,n)=>{throw new ht(`Response type '${e}' is not supported`,ht.ERR_NOT_SUPPORT,n)})}))})(new Response);const ze=async t=>{if(t==null){return 0}if(dt.isBlob(t)){return t.size}if(dt.isSpecCompliantForm(t)){const e=new Request(zt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}if(dt.isArrayBufferView(t)||dt.isArrayBuffer(t)){return t.byteLength}if(dt.isURLSearchParams(t)){t=t+""}if(dt.isString(t)){return(await Ue(t)).byteLength}};const Me=async(t,e)=>{const n=dt.toFiniteNumber(t.getContentLength());return n==null?ze(e):n};const $e=Fe&&(async t=>{let{url:e,method:n,data:o,signal:r,cancelToken:s,timeout:i,onDownloadProgress:c,onUploadProgress:u,responseType:a,headers:l,withCredentials:f="same-origin",fetchOptions:d}=Te(t);a=a?(a+"").toLowerCase():"text";let h=xe([r,s&&s.toAbortSignal()],i);let p;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let w;try{if(u&&ke&&n!=="get"&&n!=="head"&&(w=await Me(l,o))!==0){let t=new Request(e,{method:"POST",body:o,duplex:"half"});let n;if(dt.isFormData(o)&&(n=t.headers.get("content-type"))){l.setContentType(n)}if(t.body){const[e,n]=me(w,pe(we(u)));o=Be(t.body,qe,e,n)}}if(!dt.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=Le&&(a==="stream"||a==="response");if(Le&&(c||i&&m)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=s[e]}));const e=dt.toFiniteNumber(s.headers.get("content-length"));const[n,o]=c&&me(e,pe(we(c),true))||[];s=new Response(Be(s.body,qe,n,(()=>{o&&o();m&&m()})),t)}a=a||"text";let y=await Ie[dt.findKey(Ie,a)||"text"](s,t);!i&&m&&m();return await new Promise(((e,n)=>{le(e,n,{data:y,headers:ie.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 ht("Network Error",ht.ERR_NETWORK,t,p),{cause:e.cause||e})}throw ht.from(e,e&&e.code,t,p)}});const He={http:wt,xhr:je,fetch:$e};dt.forEach(He,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Je=t=>`- ${t}`;const Ke=t=>dt.isFunction(t)||t===null||t===false;const Ve={getAdapter:t=>{t=dt.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(!Ke(n)){o=He[(e=String(n)).toLowerCase()];if(o===undefined){throw new ht(`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(Je).join("\n"):" "+Je(t[0]):"as no adapter specified";throw new ht(`There is no suitable adapter to dispatch the request `+n,"ERR_NOT_SUPPORT")}return o},adapters:He};function We(t){if(t.cancelToken){t.cancelToken.throwIfRequested()}if(t.signal&&t.signal.aborted){throw new ae(null,t)}}function Ge(t){We(t);t.headers=ie.from(t.headers);t.data=ce.call(t,t.transformRequest);if(["post","put","patch"].indexOf(t.method)!==-1){t.headers.setContentType("application/x-www-form-urlencoded",false)}const e=Ve.getAdapter(t.adapter||Wt.adapter);return e(t).then((function e(n){We(t);n.data=ce.call(t,t.transformResponse,n);n.headers=ie.from(n.headers);return n}),(function e(n){if(!ue(n)){We(t);if(n&&n.response){n.response.data=ce.call(t,t.transformResponse,n.response);n.response.headers=ie.from(n.response.headers)}}return Promise.reject(n)}))}const Xe="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 Ze={};Ye.transitional=function t(e,n,o){function r(t,e){return"[Axios v"+Xe+"] Transitional option '"+t+"'"+e+(o?". "+o:"")}return(t,o,s)=>{if(e===false){throw new ht(r(o," has been removed"+(n?" in "+n:"")),ht.ERR_DEPRECATED)}if(n&&!Ze[o]){Ze[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 Qe(t,e,n){if(typeof t!=="object"){throw new ht("options must be an object",ht.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 ht("option "+s+" must be "+n,ht.ERR_BAD_OPTION_VALUE)}continue}if(n!==true){throw new ht("Unknown option "+s,ht.ERR_BAD_OPTION)}}}const tn={assertOptions:Qe,validators:Ye};const en=tn.validators;class nn{constructor(t){this.defaults=t;this.interceptors={request:new vt,response:new vt}}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=Ee(this.defaults,e);const{transitional:n,paramsSerializer:o,headers:r}=e;if(n!==undefined){tn.assertOptions(n,{silentJSONParsing:en.transitional(en.boolean),forcedJSONParsing:en.transitional(en.boolean),clarifyTimeoutError:en.transitional(en.boolean)},false)}if(o!=null){if(dt.isFunction(o)){e.paramsSerializer={serialize:o}}else{tn.assertOptions(o,{encode:en.function,serialize:en.function},true)}}e.method=(e.method||this.defaults.method||"get").toLowerCase();let s=r&&dt.merge(r.common,r[e.method]);r&&dt.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete r[t]}));e.headers=ie.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 u=[];this.interceptors.response.forEach((function t(e){u.push(e.fulfilled,e.rejected)}));let a;let l=0;let f;if(!c){const t=[Ge.bind(this),undefined];t.unshift.apply(t,i);t.push.apply(t,u);f=t.length;a=Promise.resolve(e);while(l<f){a=a.then(t[l++],t[l++])}return a}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{a=Ge.call(this,d)}catch(t){return Promise.reject(t)}l=0;f=u.length;while(l<f){a=a.then(u[l++],u[l++])}return a}getUri(t){t=Ee(this.defaults,t);const e=Oe(t.baseURL,t.url);return Nt(e,t.params,t.paramsSerializer)}}dt.forEach(["delete","get","head","options"],(function t(e){nn.prototype[e]=function(t,n){return this.request(Ee(n||{},{method:e,url:t,data:(n||{}).data}))}}));dt.forEach(["post","put","patch"],(function t(e){function n(t){return function n(o,r,s){return this.request(Ee(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}nn.prototype[e]=n();nn.prototype[e+"Form"]=n(true)}));const on=nn;class rn{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 ae(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 rn((function e(n){t=n}));return{token:e,cancel:t}}}const sn=rn;function cn(t){return function e(n){return t.apply(null,n)}}function un(t){return dt.isObject(t)&&t.isAxiosError===true}const an={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(an).forEach((([t,e])=>{an[e]=t}));const ln=an;function fn(t){const e=new on(t);const n=r(on.prototype.request,e);dt.extend(n,on.prototype,e,{allOwnKeys:true});dt.extend(n,e,null,{allOwnKeys:true});n.create=function e(n){return fn(Ee(t,n))};return n}const dn=fn(Wt);dn.Axios=on;dn.CanceledError=ae;dn.CancelToken=sn;dn.isCancel=ue;dn.VERSION=Xe;dn.toFormData=St;dn.AxiosError=ht;dn.Cancel=dn.CanceledError;dn.all=function t(e){return Promise.all(e)};dn.spread=cn;dn.isAxiosError=un;dn.mergeConfig=Ee;dn.AxiosHeaders=ie;dn.formToJSON=t=>Jt(dt.isHTMLForm(t)?new FormData(t):t);dn.getAdapter=Ve.getAdapter;dn.HttpStatusCode=ln;dn.default=dn;const hn=dn;const pn="https://wake-middleware.crmbonus.com/api";class mn{constructor(){this.axiosInstance=hn.create({baseURL:pn,headers:{"Content-Type":"application/json",accept:"application/json"}})}static getInstance(){if(this._instance){return this._instance}this._instance=new mn;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(n){const o=localStorage.getItem("@BYCODERS_KEY");const r={"Content-Type":"application/json",Authorization:`Bearer ${o}`};await this.axiosInstance.patch(`/checkouts/${n.cartId}/updateOrder`,{orderId:n.orderId,externalId:n.cartIdCrm},{headers:r});localStorage.removeItem("@BYCODERS_KEY");localStorage.removeItem(t);localStorage.removeItem(e(n.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,o;const r=await this.axiosInstance.post("/wake/requestToken",{storeName:t});this.token=(e=r===null||r===void 0?void 0:r.data)===null||e===void 0?void 0:e.token;localStorage.setItem(n,this.token);return(o=r===null||r===void 0?void 0:r.data)===null||o===void 0?void 0:o.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(o(t),JSON.stringify(n.data))}async cancelBonus(e,o){const r=localStorage.getItem(n);const s={"Content-Type":"application/json",Authorization:`Bearer ${r}`};await this.axiosInstance.post(`/crmbonus/cancel-bonus`,{cartId:e,usedBonus:true,storeName:o},{headers:s});localStorage.setItem(e,"0");localStorage.removeItem(t)}}mn._instance=null;export{mn as C};
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{U as t,g as e,B as n,a as o}from"./p-f9aeffc1.js";function r(t,e){return function n(){return t.apply(e,arguments)}}const{toString:s}=Object.prototype;const{getPrototypeOf:i}=Object;const c=(t=>e=>{const n=s.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null));const u=t=>{t=t.toLowerCase();return e=>c(e)===t};const a=t=>e=>typeof e===t;const{isArray:l}=Array;const f=a("undefined");function d(t){return t!==null&&!f(t)&&t.constructor!==null&&!f(t.constructor)&&w(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const h=u("ArrayBuffer");function p(t){let e;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){e=ArrayBuffer.isView(t)}else{e=t&&t.buffer&&h(t.buffer)}return e}const m=a("string");const w=a("function");const y=a("number");const b=t=>t!==null&&typeof t==="object";const g=t=>t===true||t===false;const R=t=>{if(c(t)!=="object"){return false}const e=i(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};const O=u("Date");const S=u("File");const E=u("Blob");const T=u("FileList");const A=t=>b(t)&&w(t.pipe);const j=t=>{let e;return t&&(typeof FormData==="function"&&t instanceof FormData||w(t.append)&&((e=c(t))==="formdata"||e==="object"&&w(t.toString)&&t.toString()==="[object FormData]"))};const N=u("URLSearchParams");const[x,v,C,P]=["ReadableStream","Request","Response","Headers"].map(u);const B=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function F(t,e,{allOwnKeys:n=false}={}){if(t===null||typeof t==="undefined"){return}let o;let r;if(typeof t!=="object"){t=[t]}if(l(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 D(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 U=(()=>{if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global})();const _=t=>!f(t)&&t!==U;function k(){const{caseless:t}=_(this)&&this||{};const e={};const n=(n,o)=>{const r=t&&D(e,o)||o;if(R(e[r])&&R(n)){e[r]=k(e[r],n)}else if(R(n)){e[r]=k({},n)}else if(l(n)){e[r]=n.slice()}else{e[r]=n}};for(let t=0,e=arguments.length;t<e;t++){arguments[t]&&F(arguments[t],n)}return e}const q=(t,e,n,{allOwnKeys:o}={})=>{F(e,((e,o)=>{if(n&&w(e)){t[o]=r(e,n)}else{t[o]=e}}),{allOwnKeys:o});return t};const L=t=>{if(t.charCodeAt(0)===65279){t=t.slice(1)}return t};const I=(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 z=(t,e,n,o)=>{let r;let s;let c;const u={};e=e||{};if(t==null)return e;do{r=Object.getOwnPropertyNames(t);s=r.length;while(s-- >0){c=r[s];if((!o||o(c,t,e))&&!u[c]){e[c]=t[c];u[c]=true}}t=n!==false&&i(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e};const M=(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 $=t=>{if(!t)return null;if(l(t))return t;let e=t.length;if(!y(e))return null;const n=new Array(e);while(e-- >0){n[e]=t[e]}return n};const H=(t=>e=>t&&e instanceof t)(typeof Uint8Array!=="undefined"&&i(Uint8Array));const J=(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 K=(t,e)=>{let n;const o=[];while((n=t.exec(e))!==null){o.push(n)}return o};const V=u("HTMLFormElement");const W=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function t(e,n,o){return n.toUpperCase()+o}));const G=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype);const X=u("RegExp");const Y=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t);const o={};F(n,((n,r)=>{let s;if((s=e(n,r,t))!==false){o[r]=s||n}}));Object.defineProperties(t,o)};const Z=t=>{Y(t,((e,n)=>{if(w(t)&&["arguments","caller","callee"].indexOf(n)!==-1){return false}const o=t[n];if(!w(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 Q=(t,e)=>{const n={};const o=t=>{t.forEach((t=>{n[t]=true}))};l(t)?o(t):o(String(t).split(e));return n};const tt=()=>{};const et=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;const nt="abcdefghijklmnopqrstuvwxyz";const ot="0123456789";const rt={DIGIT:ot,ALPHA:nt,ALPHA_DIGIT:nt+nt.toUpperCase()+ot};const st=(t=16,e=rt.ALPHA_DIGIT)=>{let n="";const{length:o}=e;while(t--){n+=e[Math.random()*o|0]}return n};function it(t){return!!(t&&w(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const ct=t=>{const e=new Array(10);const n=(t,o)=>{if(b(t)){if(e.indexOf(t)>=0){return}if(!("toJSON"in t)){e[o]=t;const r=l(t)?[]:{};F(t,((t,e)=>{const s=n(t,o+1);!f(s)&&(r[e]=s)}));e[o]=undefined;return r}}return t};return n(t,0)};const ut=u("AsyncFunction");const at=t=>t&&(b(t)||w(t))&&w(t.then)&&w(t.catch);const lt=((t,e)=>{if(t){return setImmediate}return e?((t,e)=>{U.addEventListener("message",(({source:n,data:o})=>{if(n===U&&o===t){e.length&&e.shift()()}}),false);return n=>{e.push(n);U.postMessage(t,"*")}})(`axios@${Math.random()}`,[]):t=>setTimeout(t)})(typeof setImmediate==="function",w(U.postMessage));const ft=typeof queueMicrotask!=="undefined"?queueMicrotask.bind(U):typeof process!=="undefined"&&process.nextTick||lt;const dt={isArray:l,isArrayBuffer:h,isBuffer:d,isFormData:j,isArrayBufferView:p,isString:m,isNumber:y,isBoolean:g,isObject:b,isPlainObject:R,isReadableStream:x,isRequest:v,isResponse:C,isHeaders:P,isUndefined:f,isDate:O,isFile:S,isBlob:E,isRegExp:X,isFunction:w,isStream:A,isURLSearchParams:N,isTypedArray:H,isFileList:T,forEach:F,merge:k,extend:q,trim:B,stripBOM:L,inherits:I,toFlatObject:z,kindOf:c,kindOfTest:u,endsWith:M,toArray:$,forEachEntry:J,matchAll:K,isHTMLForm:V,hasOwnProperty:G,hasOwnProp:G,reduceDescriptors:Y,freezeMethods:Z,toObjectSet:Q,toCamelCase:W,noop:tt,toFiniteNumber:et,findKey:D,global:U,isContextDefined:_,ALPHABET:rt,generateString:st,isSpecCompliantForm:it,toJSONObject:ct,isAsyncFn:ut,isThenable:at,setImmediate:lt,asap:ft};function ht(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}}dt.inherits(ht,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:dt.toJSONObject(this.config),code:this.code,status:this.status}}});const pt=ht.prototype;const mt={};["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=>{mt[t]={value:t}}));Object.defineProperties(ht,mt);Object.defineProperty(pt,"isAxiosError",{value:true});ht.from=(t,e,n,o,r,s)=>{const i=Object.create(pt);dt.toFlatObject(t,i,(function t(e){return e!==Error.prototype}),(t=>t!=="isAxiosError"));ht.call(i,t.message,e,n,o,r);i.cause=t;i.name=t.name;s&&Object.assign(i,s);return i};const wt=null;function yt(t){return dt.isPlainObject(t)||dt.isArray(t)}function bt(t){return dt.endsWith(t,"[]")?t.slice(0,-2):t}function gt(t,e,n){if(!t)return e;return t.concat(e).map((function t(e,o){e=bt(e);return!n&&o?"["+e+"]":e})).join(n?".":"")}function Rt(t){return dt.isArray(t)&&!t.some(yt)}const Ot=dt.toFlatObject(dt,{},null,(function t(e){return/^is[A-Z]/.test(e)}));function St(t,e,n){if(!dt.isObject(t)){throw new TypeError("target must be an object")}e=e||new FormData;n=dt.toFlatObject(n,{metaTokens:true,dots:false,indexes:false},false,(function t(e,n){return!dt.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 u=c&&dt.isSpecCompliantForm(e);if(!dt.isFunction(r)){throw new TypeError("visitor must be a function")}function a(t){if(t===null)return"";if(dt.isDate(t)){return t.toISOString()}if(!u&&dt.isBlob(t)){throw new ht("Blob is not supported. Use a Buffer instead.")}if(dt.isArrayBuffer(t)||dt.isTypedArray(t)){return u&&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(dt.endsWith(n,"{}")){n=o?n:n.slice(0,-2);t=JSON.stringify(t)}else if(dt.isArray(t)&&Rt(t)||(dt.isFileList(t)||dt.endsWith(n,"[]"))&&(c=dt.toArray(t))){n=bt(n);c.forEach((function t(o,r){!(dt.isUndefined(o)||o===null)&&e.append(i===true?gt([n],r,s):i===null?n:n+"[]",a(o))}));return false}}if(yt(t)){return true}e.append(gt(r,n,s),a(t));return false}const f=[];const d=Object.assign(Ot,{defaultVisitor:l,convertValue:a,isVisitable:yt});function h(t,n){if(dt.isUndefined(t))return;if(f.indexOf(t)!==-1){throw Error("Circular reference detected in "+n.join("."))}f.push(t);dt.forEach(t,(function t(o,s){const i=!(dt.isUndefined(o)||o===null)&&r.call(e,o,dt.isString(s)?s.trim():s,n,d);if(i===true){h(o,n?n.concat(s):[s])}}));f.pop()}if(!dt.isObject(t)){throw new TypeError("data must be an object")}h(t);return e}function Et(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 Tt(t,e){this._pairs=[];t&&St(t,this,e)}const At=Tt.prototype;At.append=function t(e,n){this._pairs.push([e,n])};At.toString=function t(e){const n=e?function(t){return e.call(this,t,Et)}:Et;return this._pairs.map((function t(e){return n(e[0])+"="+n(e[1])}),"").join("&")};function jt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Nt(t,e,n){if(!e){return t}const o=n&&n.encode||jt;const r=n&&n.serialize;let s;if(r){s=r(e,n)}else{s=dt.isURLSearchParams(e)?e.toString():new Tt(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 xt{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){dt.forEach(this.handlers,(function e(n){if(n!==null){t(n)}}))}}const vt=xt;const Ct={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};const Pt=typeof URLSearchParams!=="undefined"?URLSearchParams:Tt;const Bt=typeof FormData!=="undefined"?FormData:null;const Ft=typeof Blob!=="undefined"?Blob:null;const Dt={isBrowser:true,classes:{URLSearchParams:Pt,FormData:Bt,Blob:Ft},protocols:["http","https","file","blob","url","data"]};const Ut=typeof window!=="undefined"&&typeof document!=="undefined";const _t=typeof navigator==="object"&&navigator||undefined;const kt=Ut&&(!_t||["ReactNative","NativeScript","NS"].indexOf(_t.product)<0);const qt=(()=>typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function")();const Lt=Ut&&window.location.href||"http://localhost";const It=Object.freeze({__proto__:null,hasBrowserEnv:Ut,hasStandardBrowserWebWorkerEnv:qt,hasStandardBrowserEnv:kt,navigator:_t,origin:Lt});const zt={...It,...Dt};function Mt(t,e){return St(t,new zt.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,o){if(zt.isNode&&dt.isBuffer(t)){this.append(e,t.toString("base64"));return false}return o.defaultVisitor.apply(this,arguments)}},e))}function $t(t){return dt.matchAll(/\w+|\[(\w*)]/g,t).map((t=>t[0]==="[]"?"":t[1]||t[0]))}function Ht(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 Jt(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&&dt.isArray(o)?o.length:s;if(c){if(dt.hasOwnProp(o,s)){o[s]=[o[s],n]}else{o[s]=n}return!i}if(!o[s]||!dt.isObject(o[s])){o[s]=[]}const u=e(t,n,o[s],r);if(u&&dt.isArray(o[s])){o[s]=Ht(o[s])}return!i}if(dt.isFormData(t)&&dt.isFunction(t.entries)){const n={};dt.forEachEntry(t,((t,o)=>{e($t(t),o,n,0)}));return n}return null}function Kt(t,e,n){if(dt.isString(t)){try{(e||JSON.parse)(t);return dt.trim(t)}catch(t){if(t.name!=="SyntaxError"){throw t}}}return(n||JSON.stringify)(t)}const Vt={transitional:Ct,adapter:["xhr","http","fetch"],transformRequest:[function t(e,n){const o=n.getContentType()||"";const r=o.indexOf("application/json")>-1;const s=dt.isObject(e);if(s&&dt.isHTMLForm(e)){e=new FormData(e)}const i=dt.isFormData(e);if(i){return r?JSON.stringify(Jt(e)):e}if(dt.isArrayBuffer(e)||dt.isBuffer(e)||dt.isStream(e)||dt.isFile(e)||dt.isBlob(e)||dt.isReadableStream(e)){return e}if(dt.isArrayBufferView(e)){return e.buffer}if(dt.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 Mt(e,this.formSerializer).toString()}if((c=dt.isFileList(e))||o.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return St(c?{"files[]":e}:e,t&&new t,this.formSerializer)}}if(s||r){n.setContentType("application/json",false);return Kt(e)}return e}],transformResponse:[function t(e){const n=this.transitional||Vt.transitional;const o=n&&n.forcedJSONParsing;const r=this.responseType==="json";if(dt.isResponse(e)||dt.isReadableStream(e)){return e}if(e&&dt.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 ht.from(t,ht.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:zt.classes.FormData,Blob:zt.classes.Blob},validateStatus:function t(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":undefined}}};dt.forEach(["delete","get","head","post","put","patch"],(t=>{Vt.headers[t]={}}));const Wt=Vt;const Gt=dt.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 Xt=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]&&Gt[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 Zt(t){return t&&String(t).trim().toLowerCase()}function Qt(t){if(t===false||t==null){return t}return dt.isArray(t)?t.map(Qt):String(t)}function te(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 ee=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ne(t,e,n,o,r){if(dt.isFunction(o)){return o.call(this,e,n)}if(r){e=n}if(!dt.isString(e))return;if(dt.isString(o)){return e.indexOf(o)!==-1}if(dt.isRegExp(o)){return o.test(e)}}function oe(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}function re(t,e){const n=dt.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 se{constructor(t){t&&this.set(t)}set(t,e,n){const o=this;function r(t,e,n){const r=Zt(e);if(!r){throw new Error("header name must be a non-empty string")}const s=dt.findKey(o,r);if(!s||o[s]===undefined||n===true||n===undefined&&o[s]!==false){o[s||e]=Qt(t)}}const s=(t,e)=>dt.forEach(t,((t,n)=>r(t,n,e)));if(dt.isPlainObject(t)||t instanceof this.constructor){s(t,e)}else if(dt.isString(t)&&(t=t.trim())&&!ee(t)){s(Xt(t),e)}else if(dt.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=Zt(t);if(t){const n=dt.findKey(this,t);if(n){const t=this[n];if(!e){return t}if(e===true){return te(t)}if(dt.isFunction(e)){return e.call(this,t,n)}if(dt.isRegExp(e)){return e.exec(t)}throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){t=Zt(t);if(t){const n=dt.findKey(this,t);return!!(n&&this[n]!==undefined&&(!e||ne(this,this[n],n,e)))}return false}delete(t,e){const n=this;let o=false;function r(t){t=Zt(t);if(t){const r=dt.findKey(n,t);if(r&&(!e||ne(n,n[r],r,e))){delete n[r];o=true}}}if(dt.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||ne(this,this[r],r,t,true)){delete this[r];o=true}}return o}normalize(t){const e=this;const n={};dt.forEach(this,((o,r)=>{const s=dt.findKey(n,r);if(s){e[s]=Qt(o);delete e[r];return}const i=t?oe(r):String(r).trim();if(i!==r){delete e[r]}e[i]=Qt(o);n[i]=true}));return this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);dt.forEach(this,((n,o)=>{n!=null&&n!==false&&(e[o]=t&&dt.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=Zt(t);if(!n[e]){re(o,t);n[e]=true}}dt.isArray(t)?t.forEach(r):r(t);return this}}se.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);dt.reduceDescriptors(se.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}}));dt.freezeMethods(se);const ie=se;function ce(t,e){const n=this||Wt;const o=e||n;const r=ie.from(o.headers);let s=o.data;dt.forEach(t,(function t(o){s=o.call(n,s,r.normalize(),e?e.status:undefined)}));r.normalize();return s}function ue(t){return!!(t&&t.__CANCEL__)}function ae(t,e,n){ht.call(this,t==null?"canceled":t,ht.ERR_CANCELED,e,n);this.name="CanceledError"}dt.inherits(ae,ht,{__CANCEL__:true});function le(t,e,n){const o=n.config.validateStatus;if(!n.status||!o||o(n.status)){t(n)}else{e(new ht("Request failed with status code "+n.status,[ht.ERR_BAD_REQUEST,ht.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}}function fe(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function de(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(u){const a=Date.now();const l=o[s];if(!i){i=a}n[r]=u;o[r]=a;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(a-i<e){return}const h=l&&a-l;return h?Math.round(d*1e3/h):undefined}}function he(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 u=()=>r&&i(r);return[c,u]}const pe=(t,e,n=3)=>{let o=0;const r=de(50,250);return he((n=>{const s=n.loaded;const i=n.lengthComputable?n.total:undefined;const c=s-o;const u=r(c);const a=s<=i;o=s;const l={loaded:s,total:i,progress:i?s/i:undefined,bytes:c,rate:u?u:undefined,estimated:u&&i&&a?(i-s)/u:undefined,event:n,lengthComputable:i!=null,[e?"download":"upload"]:true};t(l)}),n)};const me=(t,e)=>{const n=t!=null;return[o=>e[0]({lengthComputable:n,total:t,loaded:o}),e[1]]};const we=t=>(...e)=>dt.asap((()=>t(...e)));const ye=zt.hasStandardBrowserEnv?function t(){const e=zt.navigator&&/(msie|trident)/i.test(zt.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=dt.isString(e)?r(e):e;return n.protocol===o.protocol&&n.host===o.host}}():function t(){return function t(){return true}}();const be=zt.hasStandardBrowserEnv?{write(t,e,n,o,r,s){const i=[t+"="+encodeURIComponent(e)];dt.isNumber(n)&&i.push("expires="+new Date(n).toGMTString());dt.isString(o)&&i.push("path="+o);dt.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 ge(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Re(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Oe(t,e){if(t&&!ge(e)){return Re(t,e)}return e}const Se=t=>t instanceof ie?{...t}:t;function Ee(t,e){e=e||{};const n={};function o(t,e,n){if(dt.isPlainObject(t)&&dt.isPlainObject(e)){return dt.merge.call({caseless:n},t,e)}else if(dt.isPlainObject(e)){return dt.merge({},e)}else if(dt.isArray(e)){return e.slice()}return e}function r(t,e,n){if(!dt.isUndefined(e)){return o(t,e,n)}else if(!dt.isUndefined(t)){return o(undefined,t,n)}}function s(t,e){if(!dt.isUndefined(e)){return o(undefined,e)}}function i(t,e){if(!dt.isUndefined(e)){return o(undefined,e)}else if(!dt.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 u={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(Se(t),Se(e),true)};dt.forEach(Object.keys(Object.assign({},t,e)),(function o(s){const i=u[s]||r;const a=i(t[s],e[s],s);dt.isUndefined(a)&&i!==c||(n[s]=a)}));return n}const Te=t=>{const e=Ee({},t);let{data:n,withXSRFToken:o,xsrfHeaderName:r,xsrfCookieName:s,headers:i,auth:c}=e;e.headers=i=ie.from(i);e.url=Nt(Oe(e.baseURL,e.url),t.params,t.paramsSerializer);if(c){i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")))}let u;if(dt.isFormData(n)){if(zt.hasStandardBrowserEnv||zt.hasStandardBrowserWebWorkerEnv){i.setContentType(undefined)}else if((u=i.getContentType())!==false){const[t,...e]=u?u.split(";").map((t=>t.trim())).filter(Boolean):[];i.setContentType([t||"multipart/form-data",...e].join("; "))}}if(zt.hasStandardBrowserEnv){o&&dt.isFunction(o)&&(o=o(e));if(o||o!==false&&ye(e.url)){const t=r&&s&&be.read(s);if(t){i.set(r,t)}}}return e};const Ae=typeof XMLHttpRequest!=="undefined";const je=Ae&&function(t){return new Promise((function e(n,o){const r=Te(t);let s=r.data;const i=ie.from(r.headers).normalize();let{responseType:c,onUploadProgress:u,onDownloadProgress:a}=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=ie.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};le((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 ht("Request aborted",ht.ECONNABORTED,t,w));w=null};w.onerror=function e(){o(new ht("Network Error",ht.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||Ct;if(r.timeoutErrorMessage){n=r.timeoutErrorMessage}o(new ht(n,s.clarifyTimeoutError?ht.ETIMEDOUT:ht.ECONNABORTED,t,w));w=null};s===undefined&&i.setContentType(null);if("setRequestHeader"in w){dt.forEach(i.toJSON(),(function t(e,n){w.setRequestHeader(n,e)}))}if(!dt.isUndefined(r.withCredentials)){w.withCredentials=!!r.withCredentials}if(c&&c!=="json"){w.responseType=r.responseType}if(a){[d,p]=pe(a,true);w.addEventListener("progress",d)}if(u&&w.upload){[f,h]=pe(u);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 ae(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=fe(r.url);if(b&&zt.protocols.indexOf(b)===-1){o(new ht("Unsupported protocol "+b+":",ht.ERR_BAD_REQUEST,t));return}w.send(s||null)}))};const Ne=(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 ht?e:new ae(e instanceof Error?e.message:e))}};let s=e&&setTimeout((()=>{s=null;r(new ht(`timeout ${e} of ms exceeded`,ht.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=()=>dt.asap(i);return c}};const xe=Ne;const ve=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 Ce=async function*(t,e){for await(const n of Pe(t)){yield*ve(n,e)}};const Pe=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 Be=(t,e,n,o)=>{const r=Ce(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 Fe=typeof fetch==="function"&&typeof Request==="function"&&typeof Response==="function";const De=Fe&&typeof ReadableStream==="function";const Ue=Fe&&(typeof TextEncoder==="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer()));const _e=(t,...e)=>{try{return!!t(...e)}catch(t){return false}};const ke=De&&_e((()=>{let t=false;const e=new Request(zt.origin,{body:new ReadableStream,method:"POST",get duplex(){t=true;return"half"}}).headers.has("Content-Type");return t&&!e}));const qe=64*1024;const Le=De&&_e((()=>dt.isReadableStream(new Response("").body)));const Ie={stream:Le&&(t=>t.body)};Fe&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Ie[e]&&(Ie[e]=dt.isFunction(t[e])?t=>t[e]():(t,n)=>{throw new ht(`Response type '${e}' is not supported`,ht.ERR_NOT_SUPPORT,n)})}))})(new Response);const ze=async t=>{if(t==null){return 0}if(dt.isBlob(t)){return t.size}if(dt.isSpecCompliantForm(t)){const e=new Request(zt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}if(dt.isArrayBufferView(t)||dt.isArrayBuffer(t)){return t.byteLength}if(dt.isURLSearchParams(t)){t=t+""}if(dt.isString(t)){return(await Ue(t)).byteLength}};const Me=async(t,e)=>{const n=dt.toFiniteNumber(t.getContentLength());return n==null?ze(e):n};const $e=Fe&&(async t=>{let{url:e,method:n,data:o,signal:r,cancelToken:s,timeout:i,onDownloadProgress:c,onUploadProgress:u,responseType:a,headers:l,withCredentials:f="same-origin",fetchOptions:d}=Te(t);a=a?(a+"").toLowerCase():"text";let h=xe([r,s&&s.toAbortSignal()],i);let p;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let w;try{if(u&&ke&&n!=="get"&&n!=="head"&&(w=await Me(l,o))!==0){let t=new Request(e,{method:"POST",body:o,duplex:"half"});let n;if(dt.isFormData(o)&&(n=t.headers.get("content-type"))){l.setContentType(n)}if(t.body){const[e,n]=me(w,pe(we(u)));o=Be(t.body,qe,e,n)}}if(!dt.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=Le&&(a==="stream"||a==="response");if(Le&&(c||i&&m)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=s[e]}));const e=dt.toFiniteNumber(s.headers.get("content-length"));const[n,o]=c&&me(e,pe(we(c),true))||[];s=new Response(Be(s.body,qe,n,(()=>{o&&o();m&&m()})),t)}a=a||"text";let y=await Ie[dt.findKey(Ie,a)||"text"](s,t);!i&&m&&m();return await new Promise(((e,n)=>{le(e,n,{data:y,headers:ie.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 ht("Network Error",ht.ERR_NETWORK,t,p),{cause:e.cause||e})}throw ht.from(e,e&&e.code,t,p)}});const He={http:wt,xhr:je,fetch:$e};dt.forEach(He,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Je=t=>`- ${t}`;const Ke=t=>dt.isFunction(t)||t===null||t===false;const Ve={getAdapter:t=>{t=dt.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(!Ke(n)){o=He[(e=String(n)).toLowerCase()];if(o===undefined){throw new ht(`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(Je).join("\n"):" "+Je(t[0]):"as no adapter specified";throw new ht(`There is no suitable adapter to dispatch the request `+n,"ERR_NOT_SUPPORT")}return o},adapters:He};function We(t){if(t.cancelToken){t.cancelToken.throwIfRequested()}if(t.signal&&t.signal.aborted){throw new ae(null,t)}}function Ge(t){We(t);t.headers=ie.from(t.headers);t.data=ce.call(t,t.transformRequest);if(["post","put","patch"].indexOf(t.method)!==-1){t.headers.setContentType("application/x-www-form-urlencoded",false)}const e=Ve.getAdapter(t.adapter||Wt.adapter);return e(t).then((function e(n){We(t);n.data=ce.call(t,t.transformResponse,n);n.headers=ie.from(n.headers);return n}),(function e(n){if(!ue(n)){We(t);if(n&&n.response){n.response.data=ce.call(t,t.transformResponse,n.response);n.response.headers=ie.from(n.response.headers)}}return Promise.reject(n)}))}const Xe="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 Ze={};Ye.transitional=function t(e,n,o){function r(t,e){return"[Axios v"+Xe+"] Transitional option '"+t+"'"+e+(o?". "+o:"")}return(t,o,s)=>{if(e===false){throw new ht(r(o," has been removed"+(n?" in "+n:"")),ht.ERR_DEPRECATED)}if(n&&!Ze[o]){Ze[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 Qe(t,e,n){if(typeof t!=="object"){throw new ht("options must be an object",ht.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 ht("option "+s+" must be "+n,ht.ERR_BAD_OPTION_VALUE)}continue}if(n!==true){throw new ht("Unknown option "+s,ht.ERR_BAD_OPTION)}}}const tn={assertOptions:Qe,validators:Ye};const en=tn.validators;class nn{constructor(t){this.defaults=t;this.interceptors={request:new vt,response:new vt}}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=Ee(this.defaults,e);const{transitional:n,paramsSerializer:o,headers:r}=e;if(n!==undefined){tn.assertOptions(n,{silentJSONParsing:en.transitional(en.boolean),forcedJSONParsing:en.transitional(en.boolean),clarifyTimeoutError:en.transitional(en.boolean)},false)}if(o!=null){if(dt.isFunction(o)){e.paramsSerializer={serialize:o}}else{tn.assertOptions(o,{encode:en.function,serialize:en.function},true)}}e.method=(e.method||this.defaults.method||"get").toLowerCase();let s=r&&dt.merge(r.common,r[e.method]);r&&dt.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete r[t]}));e.headers=ie.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 u=[];this.interceptors.response.forEach((function t(e){u.push(e.fulfilled,e.rejected)}));let a;let l=0;let f;if(!c){const t=[Ge.bind(this),undefined];t.unshift.apply(t,i);t.push.apply(t,u);f=t.length;a=Promise.resolve(e);while(l<f){a=a.then(t[l++],t[l++])}return a}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{a=Ge.call(this,d)}catch(t){return Promise.reject(t)}l=0;f=u.length;while(l<f){a=a.then(u[l++],u[l++])}return a}getUri(t){t=Ee(this.defaults,t);const e=Oe(t.baseURL,t.url);return Nt(e,t.params,t.paramsSerializer)}}dt.forEach(["delete","get","head","options"],(function t(e){nn.prototype[e]=function(t,n){return this.request(Ee(n||{},{method:e,url:t,data:(n||{}).data}))}}));dt.forEach(["post","put","patch"],(function t(e){function n(t){return function n(o,r,s){return this.request(Ee(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}nn.prototype[e]=n();nn.prototype[e+"Form"]=n(true)}));const on=nn;class rn{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 ae(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 rn((function e(n){t=n}));return{token:e,cancel:t}}}const sn=rn;function cn(t){return function e(n){return t.apply(null,n)}}function un(t){return dt.isObject(t)&&t.isAxiosError===true}const an={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(an).forEach((([t,e])=>{an[e]=t}));const ln=an;function fn(t){const e=new on(t);const n=r(on.prototype.request,e);dt.extend(n,on.prototype,e,{allOwnKeys:true});dt.extend(n,e,null,{allOwnKeys:true});n.create=function e(n){return fn(Ee(t,n))};return n}const dn=fn(Wt);dn.Axios=on;dn.CanceledError=ae;dn.CancelToken=sn;dn.isCancel=ue;dn.VERSION=Xe;dn.toFormData=St;dn.AxiosError=ht;dn.Cancel=dn.CanceledError;dn.all=function t(e){return Promise.all(e)};dn.spread=cn;dn.isAxiosError=un;dn.mergeConfig=Ee;dn.AxiosHeaders=ie;dn.formToJSON=t=>Jt(dt.isHTMLForm(t)?new FormData(t):t);dn.getAdapter=Ve.getAdapter;dn.HttpStatusCode=ln;dn.default=dn;const hn=dn;const pn="https://wake-middleware.crmbonus.com/api";class mn{constructor(){this.axiosInstance=hn.create({baseURL:pn,headers:{"Content-Type":"application/json",accept:"application/json"}})}static getInstance(){if(this._instance){return this._instance}this._instance=new mn;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(n){const o=localStorage.getItem("@BYCODERS_KEY");const r={"Content-Type":"application/json",Authorization:`Bearer ${o}`};await this.axiosInstance.patch(`/checkouts/${n.cartId}/updateOrder`,{orderId:n.orderId,externalId:n.cartIdCrm},{headers:r});localStorage.removeItem("@BYCODERS_KEY");localStorage.removeItem(t);localStorage.removeItem(e(n.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,o;const r=await this.axiosInstance.post("/wake/requestToken",{storeName:t});this.token=(e=r===null||r===void 0?void 0:r.data)===null||e===void 0?void 0:e.token;localStorage.setItem(n,this.token);return(o=r===null||r===void 0?void 0:r.data)===null||o===void 0?void 0:o.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(o(t),JSON.stringify(n.data))}async cancelBonus(e,o){const r=localStorage.getItem(n);const s={"Content-Type":"application/json",Authorization:`Bearer ${r}`};await this.axiosInstance.post(`/crmbonus/cancel-bonus`,{cartId:e,usedBonus:true,storeName:o},{headers:s});localStorage.setItem(e,"0");localStorage.removeItem(t)}async getInfoCart(){const t=await this.axiosInstance.get("https://bycoders.checkout.fbits.store/api/carrinho");return t.data}}mn._instance=null;export{mn as C};
|
2
|
+
//# sourceMappingURL=p-c44e2f02.js.map
|