crmbonus-component-wake 1.0.41 → 1.0.43

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.
Files changed (52) hide show
  1. package/dist/cjs/app-modal_4.cjs.entry.js +15 -10
  2. package/dist/cjs/app-modal_4.cjs.entry.js.map +1 -1
  3. package/dist/cjs/crm-bonus.cjs.entry.js +4 -4
  4. package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -1
  5. package/dist/cjs/{crmbonus.service-e46a5941.js → crmbonus.service-ad521d7d.js} +12 -12
  6. package/dist/cjs/crmbonus.service-ad521d7d.js.map +1 -0
  7. package/dist/cjs/pedido-finalizado.cjs.entry.js +1 -1
  8. package/dist/collection/components/crm-bonus/crm-bonus.js +3 -3
  9. package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -1
  10. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +14 -9
  11. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +1 -1
  12. package/dist/collection/dto/validate.pin.bonus.js.map +1 -1
  13. package/dist/collection/services/crmbonus.service.js +10 -10
  14. package/dist/collection/services/crmbonus.service.js.map +1 -1
  15. package/dist/components/crm-bonus-form.js +1 -1
  16. package/dist/components/crm-bonus.js +5 -5
  17. package/dist/components/crm-bonus.js.map +1 -1
  18. package/dist/components/{p-84832959.js → p-0ebfe0d3.js} +16 -11
  19. package/dist/components/p-0ebfe0d3.js.map +1 -0
  20. package/dist/components/{p-a7e4526b.js → p-aeaad64e.js} +12 -12
  21. package/dist/components/p-aeaad64e.js.map +1 -0
  22. package/dist/components/pedido-finalizado.js +1 -1
  23. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
  24. package/dist/crmbonus-component-wake/{p-e67e5649.entry.js → p-04db24fc.entry.js} +2 -2
  25. package/dist/crmbonus-component-wake/p-04db24fc.entry.js.map +1 -0
  26. package/dist/crmbonus-component-wake/p-60249052.entry.js +2 -0
  27. package/dist/crmbonus-component-wake/p-60249052.entry.js.map +1 -0
  28. package/dist/crmbonus-component-wake/{p-3fa8e7b2.entry.js → p-6de2e9c3.entry.js} +2 -2
  29. package/dist/crmbonus-component-wake/{p-a7e4526b.js → p-aeaad64e.js} +2 -2
  30. package/dist/crmbonus-component-wake/p-aeaad64e.js.map +1 -0
  31. package/dist/env.js +1 -1
  32. package/dist/env.js.map +1 -1
  33. package/dist/esm/app-modal_4.entry.js +15 -10
  34. package/dist/esm/app-modal_4.entry.js.map +1 -1
  35. package/dist/esm/crm-bonus.entry.js +4 -4
  36. package/dist/esm/crm-bonus.entry.js.map +1 -1
  37. package/dist/esm/{crmbonus.service-1b7f193d.js → crmbonus.service-dda2d96b.js} +12 -12
  38. package/dist/esm/crmbonus.service-dda2d96b.js.map +1 -0
  39. package/dist/esm/pedido-finalizado.entry.js +1 -1
  40. package/dist/types/dto/validate.pin.bonus.d.ts +14 -9
  41. package/dist/types/home/darlison/Projects/crmbonus/app/crmbonus-component/.stencil/env.d.ts +1 -1
  42. package/dist/types/services/crmbonus.service.d.ts +1 -1
  43. package/package.json +1 -1
  44. package/dist/cjs/crmbonus.service-e46a5941.js.map +0 -1
  45. package/dist/components/p-84832959.js.map +0 -1
  46. package/dist/components/p-a7e4526b.js.map +0 -1
  47. package/dist/crmbonus-component-wake/p-a7e4526b.js.map +0 -1
  48. package/dist/crmbonus-component-wake/p-b5e9ea5d.entry.js +0 -2
  49. package/dist/crmbonus-component-wake/p-b5e9ea5d.entry.js.map +0 -1
  50. package/dist/crmbonus-component-wake/p-e67e5649.entry.js.map +0 -1
  51. package/dist/esm/crmbonus.service-1b7f193d.js.map +0 -1
  52. /package/dist/crmbonus-component-wake/{p-3fa8e7b2.entry.js.map → p-6de2e9c3.entry.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["crmBonusCss","CrmBonusStyle0","CrmBonus","this","crmBonusService","CrmBonusService","birthDate","document","name","phone","componentWillLoad","handleLoad","userId","customer","getCustomer","storeName","console","log","amount","localStorage","getItem","cartId","canCancel","amountCancel","error","buildAndGetProducts","key","cache_products","setItem","productsInString","productsInCart","JSON","parse","products_in_cache","products","product_cart","pro","filter","p","ProdutoVarianteId","push","Object","assign","PrecoPor","sendPin","loading","message","_phone","replace","Number","sent","crmBonusRef","setStep","StepFormEnum","STEP_PIN","showModal","_b","_a","response","data","sendPinName","customerName","buildProducts","map","product","sku","SKU","value","Quantidade","productVariantId","toString","quantity","handleCloseModal","save","cancel","removeItem","handleSendPin","STEP_NAME","render","h","class","isOpen","modalTitle","onModalClosed","loadingModal","saveStore","ref","handleCustomerName"],"sources":["src/components/crm-bonus/crm-bonus.css?tag=crm-bonus&encapsulation=shadow","src/components/crm-bonus/crm-bonus.tsx"],"sourcesContent":["/* :host {\n display: block;\n} */\n\n.container-button {\n /* max-width: 100%; */\n cursor: pointer;\n padding: 5px 5px 5px 14px;\n /* display: flex; */\n}\n\n/* padding: 0 15px 15px;\nborder: 1px solid #ddd;\nmargin-bottom: 20px; */\n\n.section-crm {\n border: 1px solid #dbd4d4;\n /* min-height: 50px; */\n text-align: -webkit-center;\n margin-bottom: 20px;\n}\n\n.section-cart-crm {\n margin-top: 10px;\n}\n\n.section-cart-crm p {\n padding: 0;\n margin: 0px 0px 0px 15px;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n /* border-radius: 10px; */\n padding: 15px;\n min-height: 30px;\n min-width: 120px;\n font-size: 20px;\n cursor: pointer;\n margin-left: 10px;\n height: 70px;\n}\n\n.form-container {\n width: 97%;\n display: flex;\n justify-content: space-around;\n}\n\n\n.btn {\n display: inline-block;\n padding: 6px 12px;\n margin-bottom: 0;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.42857143;\n text-align: center;\n white-space: nowrap;\n vertical-align: middle;\n -ms-touch-action: manipulation;\n touch-action: manipulation;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n background-image: none;\n border: 1px solid transparent;\n border-radius: 0px;\n}\n\n.form-container .btnCrm {\n background: #00162e;\n border-color: #00162e;\n width: 30%;\n color: #fff;\n}\n\n.message-alert {\n font-family: sans-serif;\n color: #df4d4d;\n margin-top: 5px;\n}","import { Component, Prop, State, h } from '@stencil/core';\nimport { IProduct, IProductWake, ICustomer } from '../../dto/validate.pin.bonus';\nimport { CrmBonusService } from '../../services/crmbonus.service';\nimport { IPinSent } from '../../components';\nimport { StepFormEnum } from '../../contants';\n\n@Component({\n tag: 'crm-bonus',\n styleUrl: 'crm-bonus.css',\n shadow: true,\n assetsDirs: ['assets']\n})\nexport class CrmBonus {\n\n private crmBonusService: CrmBonusService = new CrmBonusService();\n\n private crmBonusRef: HTMLCrmBonusFormElement;\n\n @State() showModal: boolean = false;\n @Prop({ attribute: 'userid' }) userId: number;\n @Prop({ attribute: 'storename' }) storeName;\n @Prop({ attribute: 'products' }) productsInString: string;\n @Prop({ attribute: 'cartid' }) cartId;\n\n @State() products: Array<IProductWake>;\n @State() customer: ICustomer = {\n birthDate: \"\",\n document: \"\",\n name: \"\",\n phone: \"\"\n };\n\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: number;\n @State() canCancel: boolean = false;\n @State() amountCancel: string;\n @State() sent: IPinSent;\n\n\n async componentWillLoad() {\n await this.handleLoad();\n }\n\n async handleLoad() {\n try {\n if (this.userId) {\n this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);\n console.log('user', this.customer);\n }\n\n const amount = localStorage.getItem(this.cartId);\n\n if (amount) {\n this.canCancel = true;\n this.amountCancel = amount;\n }\n\n } catch (error) {\n console.log('info customer')\n }\n \n this.buildAndGetProducts();\n }\n\n\n async buildAndGetProducts() {\n const key = `bc-products:${this.cartId}`;\n const cache_products = localStorage.getItem(key)\n\n if (!cache_products) {\n localStorage.setItem(key, this.productsInString);\n }\n\n const productsInCart = JSON.parse(this.productsInString);\n const products_in_cache = JSON.parse(localStorage.getItem(key));\n\n const products: Array<IProductWake> = []\n\n for (const product_cart of productsInCart) {\n\n const [pro] = products_in_cache.filter(p => p.ProdutoVarianteId == product_cart.ProdutoVarianteId)\n\n if (pro) {\n products.push({\n ...product_cart,\n PrecoPor: pro.PrecoPor\n })\n } else {\n products.push(product_cart)\n }\n \n }\n\n this.products = products; //cache_products ? JSON.parse(cache_products) : JSON.parse(this.productsInString);\n\n }\n\n public async sendPin(phone: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n\n this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.storeName);;\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n\n this.showModal = true;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n public async sendPinName(customerName: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n this.customer.name = customerName;\n\n this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.storeName);;\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n\n this.showModal = true;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n buildProducts(): IProduct[] {\n return this.products.map(product => ({ sku: product.SKU, value: (product.PrecoPor * product.Quantidade), productVariantId: product.ProdutoVarianteId.toString(), quantity: product.Quantidade }))\n }\n\n handleCloseModal() {\n this.showModal = false;\n }\n\n save(amount: number) {\n localStorage.setItem(this.cartId, amount.toString());\n this.canCancel = true;\n this.amountCancel = amount.toString()\n }\n\n async cancel() {\n this.message = \"\";\n this.loading = true;\n try {\n await this.crmBonusService.cancel(this.cartId, this.storeName);\n this.canCancel = false;\n\n localStorage.removeItem(this.cartId);\n } catch (error) {\n this.message = \"Não consegui cancelar o bônus, tente novamente!\"\n } finally {\n this.loading = false;\n }\n }\n\n async handleSendPin(phone: string) {\n this.message = \"\"\n if (!phone) {\n this.message = \"Informe seu telefone\";\n return;\n }\n\n this.customer.phone = phone;\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n\n if (this.customer.name) {\n return this.sendPin(phone)\n }\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_NAME);\n this.showModal = true;\n }\n\n render() {\n return (\n <div class=\"section-cart-crm\">\n <p class=\"text-left fbits-responsive-carrinho-desconto-texto\">Giftback</p>\n <div class=\"container-button\">\n {/* <img src={logo} onClick={() => (this.showModal = true)} /> */}\n {\n this.canCancel ? <phone-cancel-input value={this.amountCancel} sendPin={() => { this.cancel() }} loading={this.loading} />\n : <phone-input value={this.customer.phone} sendPin={(phone) => { this.handleSendPin(phone) }} loading={this.loading} />\n }\n </div>\n <p class=\"message-alert\" >{this.message}</p>\n <app-modal\n isOpen={this.showModal}\n modalTitle={`Giftback`}\n onModalClosed={() => (this.showModal = false)}\n >\n <crm-bonus-form\n loadingModal={this.loading}\n saveStore={(amount: number) => this.save(amount)}\n ref={ref => this.crmBonusRef = ref}\n sent={this.sent}\n phone={this.phone}\n cancel={() => this.handleCloseModal()}\n storeName={this.storeName}\n products={this.buildProducts()}\n cartId={this.cartId} customer={this.customer}\n handleCustomerName={(name: string) => this.sendPinName(name)}\n />\n </app-modal>\n </div>\n )\n }\n}\n"],"mappings":"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","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r as e,c as s,h as t,H as i}from"./p-72510682.js";import{C as a}from"./p-aeaad64e.js";import{S as d}from"./p-9b967605.js";const n=".modal-backdrop{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);display:none;justify-content:center;align-items:center;z-index:1000}.modal-backdrop.visible{display:flex}.modal{background:white;border-radius:8px;padding:1rem;max-width:500px;width:90%;box-shadow:0 2px 10px rgba(0, 0, 0, 0.3)}.modal-header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #ddd;margin-bottom:1rem}.close-button{background:none;border:none;font-size:1.5rem;cursor:pointer}.modal-body{}";const o=n;const c=class{constructor(t){e(this,t);this.modalClosed=s(this,"modalClosed",7);this.isOpen=false;this.modalTitle=undefined}closeModal(){this.modalClosed.emit()}render(){return t("div",{key:"c6da9ce70d919346c641a5aa372ba17305c0d670",class:`modal-backdrop ${this.isOpen?"visible":""}`},t("div",{key:"807ac561f4825f3ba470529d80135b7e2024a149",class:"modal"},t("div",{key:"57de6ce754a7ad665b7bac3bcfc561e0baa694b4",class:"modal-header"},t("h3",{key:"a716a0c910ba51cf3700b4812924e8e75505b6ac"},this.modalTitle),t("button",{key:"295e0b32f08233d48c376287496717a4edfeae6d",class:"close-button",onClick:()=>this.closeModal()},"×")),t("div",{key:"b1abe2d5c073ba9a7bd329c47a631e5cff51e0ea",class:"modal-body"},t("slot",{key:"135950e8e07a6eb1dc8c3eb2326c182617143893"}))))}};c.style=o;const h=".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 r=h;const l=class{constructor(s){e(this,s);this.crmBonusService=new a;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=d.STEP_NAME;this.message=undefined;this.bonus=undefined}async setStep(e){this.step=e}async validateBonus(e){var s,t;this.loading=true;this.message="";const i={pin:e,cellphone: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(i,this.storeName);console.log("[this.bonus]",this.bonus);this.step=d.STEP_RESERVE}catch(e){this.message=(t=(s=e===null||e===void 0?void 0:e.response)===null||s===void 0?void 0:s.data)===null||t===void 0?void 0:t.message}finally{this.loading=false}console.log("payload",i)}async reserveApply(e){this.loading=true;this.message="";try{await this.reserve(e);this.step=d.STEP_APPLY;this.saveStore(e)}catch(e){this.message="ocorreu um error ao solicitar a aplicação do bonus! tente novamente"}finally{this.loading=false}}async reserve(e){await this.crmBonusService.reserve({redeemedBonus:e,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=d.STEP_PHONE;this.cancel()}render(){return t(i,{key:"42f30d9d144911d341eac720507b3eba4f1bae72"},this.step==d.STEP_NAME&&t("name-input",{key:"fb1668693ceb8c359d7bd6f4ed4e375206f9769f",loading:this.loadingModal,value:this.customer.name,applyName:e=>this.handleCustomerName(e)}),this.step===d.STEP_PIN&&t("giftback-pin",{key:"bffbdd4db2f183ac8947fdbaa1216f8b6851d76b",cancel:()=>this.handleCancel(),sent:this.sent,validate:e=>this.validateBonus(e),loading:this.loading}),this.step===d.STEP_RESERVE&&t("giftback-progress",{key:"411ef7c01bb9a83e30559873d7d087d8f31f6969",loading:this.loading,cancel:()=>this.handleCancel(),bonus:this.bonus,reserve:e=>this.reserveApply(e)}),this.step===d.STEP_APPLY&&t("giftback-finish",{key:"f4924e85e201d692ebcbe67bee5070a66d4b730a"}),t("p",{key:"9b364a2cabc105fb5512e544a86fbc48b91b9c90",class:"message-error"},this.message))}};l.style=r;const b=class{constructor(s){e(this,s);this.sendPin=undefined;this.loading=undefined;this.value=undefined}async validatePhone(){const e=await this.phoneInputMask.getPhone();await this.sendPin(e)}render(){return t("div",{key:"7d3f18239fdd1c87fda497e8940629664a3ea177",class:"form-container"},t("phone-input-mask",{key:"83227ee73df037e32c2923a5bcdcb1a97f8adf4b",initialValue:`Valor aplicado R$ ${this.value}`,ref:e=>this.phoneInputMask=e,disabled:true}),t("button",{key:"03e84e9279aaae1a02c581c233367b175bdc8a88",class:`btn btn-success btnCrm ${this.loading?"disabled":""} `,disabled:this.loading,onClick:()=>this.validatePhone()},!this.loading?"Cancelar":t("loading-spinner",{size:"11px",color:"#fff"})))}};const f=class{constructor(s){e(this,s);this.sendPin=undefined;this.loading=undefined;this.value=undefined}async validatePhone(){const e=await this.phoneInputMask.getPhone();await this.sendPin(e)}render(){return t("div",{key:"32725cc609ea28dced36cc25ad20e0458446eee6",class:"form-container"},t("phone-input-mask",{key:"60ec6db64dbee3896f14b149853fbe541d0aa0d9",initialValue:this.value,ref:e=>this.phoneInputMask=e}),t("button",{key:"893acc63121be36c0a56fdff99e07d4bc0801412",class:`btn btn-success btnCrm ${this.loading?"disabled":""} `,disabled:this.loading,onClick:()=>this.validatePhone()},!this.loading?"validar":t("loading-spinner",{size:"11px",color:"#fff"})))}};export{c as app_modal,l as crm_bonus_form,b as phone_cancel_input,f as phone_input};
2
+ //# sourceMappingURL=p-60249052.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["appModalCss","AppModalStyle0","AppModal","closeModal","this","modalClosed","emit","render","h","key","class","isOpen","modalTitle","onClick","crmBonusFormCss","CrmBonusFormStyle0","CrmBonusForm","crmBonusService","CrmBonusService","phone","birthDate","document","name","StepFormEnum","STEP_NAME","setStep","step","validateBonus","pin","loading","message","payload","cellphone","toString","storeId","sent","userId","checkoutId","cartId","checkoutProducts","products","storeName","bonus","validatePinBonus","console","log","STEP_RESERVE","error","_b","_a","response","data","reserveApply","amount","reserve","STEP_APPLY","saveStore","redeemedBonus","ticket","grossValue","Number","totalValue","handleCancel","STEP_PHONE","cancel","Host","loadingModal","value","customer","applyName","handleCustomerName","STEP_PIN","validate","amountRedeemed","PhoneCancelInput","validatePhone","phoneInputMask","getPhone","sendPin","initialValue","ref","disabled","size","color","PhoneInput"],"sources":["src/components/modal/app-modal.css?tag=app-modal&encapsulation=shadow","src/components/modal/app-modal.tsx","src/components/crm-bonus-form/crm-bonus-form.css?tag=crm-bonus-form&encapsulation=shadow","src/components/crm-bonus-form/crm-bonus-form.tsx","src/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.tsx","src/components/crm-bonus-form/subcomponents/phone/phone.input.tsx"],"sourcesContent":[".modal-backdrop {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n display: none;\n justify-content: center;\n align-items: center;\n z-index: 1000;\n }\n \n .modal-backdrop.visible {\n display: flex;\n }\n \n .modal {\n background: white;\n border-radius: 8px;\n padding: 1rem;\n max-width: 500px;\n width: 90%;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);\n }\n \n .modal-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-bottom: 1px solid #ddd;\n margin-bottom: 1rem;\n }\n \n .close-button {\n background: none;\n border: none;\n font-size: 1.5rem;\n cursor: pointer;\n }\n \n .modal-body {\n /* padding: 1rem 0; */\n }\n ","import { Component, Event, EventEmitter, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'app-modal',\n styleUrl: 'app-modal.css',\n shadow: true,\n})\nexport class AppModal {\n\n // Controle da visibilidade do modal\n @Prop({ reflect: true }) isOpen: boolean = false;\n\n // Título do modal\n @Prop() modalTitle: string;\n\n // Evento emitido ao fechar o modal\n @Event() modalClosed: EventEmitter<void>;\n\n private closeModal() {\n this.modalClosed.emit();\n }\n\n render() {\n return (\n <div class={`modal-backdrop ${this.isOpen ? 'visible' : ''}`}>\n <div class=\"modal\">\n <div class=\"modal-header\">\n <h3>{this.modalTitle}</h3>\n <button class=\"close-button\" onClick={() => this.closeModal()}>\n ×\n </button>\n </div>\n <div class=\"modal-body\">\n <slot />\n </div>\n </div>\n </div>\n )\n }\n}",".form-container {\n width: 100%;\n display: flex;\n justify-content: center;\n justify-content: space-around;\n}\n\n.disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.message-error {\n color: #d11111;\n font-weight: bold;\n font-family: Arial;\n font-size: small;\n margin-left: 16px;\n}","import { Component, Host, Method, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { IBonus, ICustomer, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { StepFormEnum } from \"../../contants\";\nimport { IPinSent } from '../../dto/pin.sent';\n\n@Component({\n tag: 'crm-bonus-form',\n styleUrl: 'crm-bonus-form.css',\n shadow: true\n})\nexport class CrmBonusForm {\n\n private crmBonusService: CrmBonusService = new CrmBonusService();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n @Prop() customer: ICustomer = {\n phone: \"\",\n birthDate: \"\",\n document: \"\",\n name: \"\"\n };\n @Prop() sent: IPinSent;\n @Prop() stepNext: StepFormEnum;\n @Prop() phone: number;\n @Prop() loadingModal: boolean;\n\n @Prop() saveStore: (amount: number) => void;\n\n @Prop() cancel: () => void;\n\n @Prop() handleCustomerName: (name: string) => void;\n\n @State() loading: boolean = false;\n\n @State() step: number = StepFormEnum.STEP_NAME;\n\n @State() message: string;\n\n @State() bonus: IBonus;\n\n @Method()\n async setStep(step: StepFormEnum) {\n this.step = step\n }\n\n public async validateBonus(pin: string) {\n this.loading = true;\n this.message = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.phone.toString(),\n storeId: this.sent.storeId.toString(),\n userId: this.sent.userId.toString(),\n checkoutId: this.cartId,\n checkoutProducts: this.products,\n name: null,\n storeName: this.storeName\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload, this.storeName);\n\n console.log('[this.bonus]', this.bonus);\n this.step = StepFormEnum.STEP_RESERVE;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false;\n }\n console.log('payload', payload)\n }\n\n public async reserveApply(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.reserve(amount);\n\n this.step = StepFormEnum.STEP_APPLY;\n\n this.saveStore(amount);\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n } finally {\n this.loading = false;\n }\n }\n\n public async reserve(amount: number) {\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 public handleCancel() {\n this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n render() {\n return (\n <Host>\n {/* {this.step === StepFormEnum.STEP_PHONE && <phone-input value={this.customer.phone} sendPin={(phone) => this.sendPin(phone)} loading={this.loading} />} */}\n \n {this.step == StepFormEnum.STEP_NAME && <name-input loading={this.loadingModal} value={this.customer.name} applyName={(name) => this.handleCustomerName(name)} />}\n {this.step === StepFormEnum.STEP_PIN && <giftback-pin cancel={() => this.handleCancel()} sent={this.sent} validate={(data) => this.validateBonus(data)} loading={this.loading} />}\n\n {this.step === StepFormEnum.STEP_RESERVE && <giftback-progress loading={this.loading} cancel={() => this.handleCancel()} bonus={this.bonus} reserve={(amountRedeemed: number) => this.reserveApply(amountRedeemed)} />}\n {this.step === StepFormEnum.STEP_APPLY && <giftback-finish />}\n <p class=\"message-error\">{this.message}</p>\n </Host>\n )\n }\n}","import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'phone-cancel-input'\n})\nexport class PhoneCancelInput {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() sendPin: Function;\n @Prop() loading: boolean;\n @Prop() value: string;\n\n async validatePhone() {\n const phone = await this.phoneInputMask.getPhone();\n await this.sendPin(phone);\n }\n\n render() {\n return (\n <div class=\"form-container\">\n <phone-input-mask initialValue={`Valor aplicado R$ ${this.value}`} ref={ref => this.phoneInputMask = ref} disabled={true} />\n <button class={`btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePhone()}>\n {\n !this.loading ? \"Cancelar\" : <loading-spinner size=\"11px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}","import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'phone-input'\n})\nexport class PhoneInput {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() sendPin: Function;\n @Prop() loading: boolean;\n @Prop() value: string;\n\n async validatePhone() {\n const phone = await this.phoneInputMask.getPhone();\n await this.sendPin(phone);\n }\n\n render() {\n return (\n <div class=\"form-container\">\n <phone-input-mask initialValue={this.value} ref={ref => this.phoneInputMask = ref} />\n <button class={`btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePhone()}>\n {\n !this.loading ? \"validar\" : <loading-spinner size=\"11px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"],"mappings":"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","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{r as t,h as s}from"./p-72510682.js";import{C as i}from"./p-a7e4526b.js";const o=class{constructor(s){t(this,s);this.cartId=undefined;this.orderId=undefined;this.metadadoString=undefined}async componentWillLoad(){console.log("this.metadadoString",this.metadadoString);const t=this.metadadoString?JSON.parse(this.metadadoString):{id:null};console.log("this.cartId",this.cartId);console.log("this.orderid",this.orderId);console.log("metadadoid",t);if(this.cartId&&this.orderId){await(new i).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:"34e7ac77759542688be961e4f84c5a2f2dbf6539"})}};export{o as pedido_finalizado};
2
- //# sourceMappingURL=p-3fa8e7b2.entry.js.map
1
+ import{r as t,h as s}from"./p-72510682.js";import{C as i}from"./p-aeaad64e.js";const o=class{constructor(s){t(this,s);this.cartId=undefined;this.orderId=undefined;this.metadadoString=undefined}async componentWillLoad(){console.log("this.metadadoString",this.metadadoString);const t=this.metadadoString?JSON.parse(this.metadadoString):{id:null};console.log("this.cartId",this.cartId);console.log("this.orderid",this.orderId);console.log("metadadoid",t);if(this.cartId&&this.orderId){await(new i).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:"34e7ac77759542688be961e4f84c5a2f2dbf6539"})}};export{o as pedido_finalizado};
2
+ //# sourceMappingURL=p-6de2e9c3.entry.js.map
@@ -1,2 +1,2 @@
1
- function t(t,e){return function n(){return t.apply(e,arguments)}}const{toString:e}=Object.prototype;const{getPrototypeOf:n}=Object;const r=(t=>n=>{const r=e.call(n);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null));const o=t=>{t=t.toLowerCase();return e=>r(e)===t};const s=t=>e=>typeof e===t;const{isArray:i}=Array;const c=s("undefined");function u(t){return t!==null&&!c(t)&&t.constructor!==null&&!c(t.constructor)&&d(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const a=o("ArrayBuffer");function f(t){let e;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){e=ArrayBuffer.isView(t)}else{e=t&&t.buffer&&a(t.buffer)}return e}const l=s("string");const d=s("function");const h=s("number");const p=t=>t!==null&&typeof t==="object";const m=t=>t===true||t===false;const w=t=>{if(r(t)!=="object"){return false}const e=n(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};const b=o("Date");const y=o("File");const g=o("Blob");const R=o("FileList");const O=t=>p(t)&&d(t.pipe);const E=t=>{let e;return t&&(typeof FormData==="function"&&t instanceof FormData||d(t.append)&&((e=r(t))==="formdata"||e==="object"&&d(t.toString)&&t.toString()==="[object FormData]"))};const S=o("URLSearchParams");const[T,A,j,x]=["ReadableStream","Request","Response","Headers"].map(o);const N=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function P(t,e,{allOwnKeys:n=false}={}){if(t===null||typeof t==="undefined"){return}let r;let o;if(typeof t!=="object"){t=[t]}if(i(t)){for(r=0,o=t.length;r<o;r++){e.call(null,t[r],r,t)}}else{const o=n?Object.getOwnPropertyNames(t):Object.keys(t);const s=o.length;let i;for(r=0;r<s;r++){i=o[r];e.call(null,t[i],i,t)}}}function C(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length;let o;while(r-- >0){o=n[r];if(e===o.toLowerCase()){return o}}return null}const v=(()=>{if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global})();const F=t=>!c(t)&&t!==v;function B(){const{caseless:t}=F(this)&&this||{};const e={};const n=(n,r)=>{const o=t&&C(e,r)||r;if(w(e[o])&&w(n)){e[o]=B(e[o],n)}else if(w(n)){e[o]=B({},n)}else if(i(n)){e[o]=n.slice()}else{e[o]=n}};for(let t=0,e=arguments.length;t<e;t++){arguments[t]&&P(arguments[t],n)}return e}const U=(e,n,r,{allOwnKeys:o}={})=>{P(n,((n,o)=>{if(r&&d(n)){e[o]=t(n,r)}else{e[o]=n}}),{allOwnKeys:o});return e};const D=t=>{if(t.charCodeAt(0)===65279){t=t.slice(1)}return t};const _=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r);t.prototype.constructor=t;Object.defineProperty(t,"super",{value:e.prototype});n&&Object.assign(t.prototype,n)};const q=(t,e,r,o)=>{let s;let i;let c;const u={};e=e||{};if(t==null)return e;do{s=Object.getOwnPropertyNames(t);i=s.length;while(i-- >0){c=s[i];if((!o||o(c,t,e))&&!u[c]){e[c]=t[c];u[c]=true}}t=r!==false&&n(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e};const k=(t,e,n)=>{t=String(t);if(n===undefined||n>t.length){n=t.length}n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n};const L=t=>{if(!t)return null;if(i(t))return t;let e=t.length;if(!h(e))return null;const n=new Array(e);while(e-- >0){n[e]=t[e]}return n};const I=(t=>e=>t&&e instanceof t)(typeof Uint8Array!=="undefined"&&n(Uint8Array));const M=(t,e)=>{const n=t&&t[Symbol.iterator];const r=n.call(t);let o;while((o=r.next())&&!o.done){const n=o.value;e.call(t,n[0],n[1])}};const H=(t,e)=>{let n;const r=[];while((n=t.exec(e))!==null){r.push(n)}return r};const z=o("HTMLFormElement");const $=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function t(e,n,r){return n.toUpperCase()+r}));const J=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype);const K=o("RegExp");const V=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t);const r={};P(n,((n,o)=>{let s;if((s=e(n,o,t))!==false){r[o]=s||n}}));Object.defineProperties(t,r)};const W=t=>{V(t,((e,n)=>{if(d(t)&&["arguments","caller","callee"].indexOf(n)!==-1){return false}const r=t[n];if(!d(r))return;e.enumerable=false;if("writable"in e){e.writable=false;return}if(!e.set){e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}}}))};const G=(t,e)=>{const n={};const r=t=>{t.forEach((t=>{n[t]=true}))};i(t)?r(t):r(String(t).split(e));return n};const X=()=>{};const Z=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;const Q="abcdefghijklmnopqrstuvwxyz";const Y="0123456789";const tt={DIGIT:Y,ALPHA:Q,ALPHA_DIGIT:Q+Q.toUpperCase()+Y};const et=(t=16,e=tt.ALPHA_DIGIT)=>{let n="";const{length:r}=e;while(t--){n+=e[Math.random()*r|0]}return n};function nt(t){return!!(t&&d(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const rt=t=>{const e=new Array(10);const n=(t,r)=>{if(p(t)){if(e.indexOf(t)>=0){return}if(!("toJSON"in t)){e[r]=t;const o=i(t)?[]:{};P(t,((t,e)=>{const s=n(t,r+1);!c(s)&&(o[e]=s)}));e[r]=undefined;return o}}return t};return n(t,0)};const ot=o("AsyncFunction");const st=t=>t&&(p(t)||d(t))&&d(t.then)&&d(t.catch);const it=((t,e)=>{if(t){return setImmediate}return e?((t,e)=>{v.addEventListener("message",(({source:n,data:r})=>{if(n===v&&r===t){e.length&&e.shift()()}}),false);return n=>{e.push(n);v.postMessage(t,"*")}})(`axios@${Math.random()}`,[]):t=>setTimeout(t)})(typeof setImmediate==="function",d(v.postMessage));const ct=typeof queueMicrotask!=="undefined"?queueMicrotask.bind(v):typeof process!=="undefined"&&process.nextTick||it;const ut={isArray:i,isArrayBuffer:a,isBuffer:u,isFormData:E,isArrayBufferView:f,isString:l,isNumber:h,isBoolean:m,isObject:p,isPlainObject:w,isReadableStream:T,isRequest:A,isResponse:j,isHeaders:x,isUndefined:c,isDate:b,isFile:y,isBlob:g,isRegExp:K,isFunction:d,isStream:O,isURLSearchParams:S,isTypedArray:I,isFileList:R,forEach:P,merge:B,extend:U,trim:N,stripBOM:D,inherits:_,toFlatObject:q,kindOf:r,kindOfTest:o,endsWith:k,toArray:L,forEachEntry:M,matchAll:H,isHTMLForm:z,hasOwnProperty:J,hasOwnProp:J,reduceDescriptors:V,freezeMethods:W,toObjectSet:G,toCamelCase:$,noop:X,toFiniteNumber:Z,findKey:C,global:v,isContextDefined:F,ALPHABET:tt,generateString:et,isSpecCompliantForm:nt,toJSONObject:rt,isAsyncFn:ot,isThenable:st,setImmediate:it,asap:ct};function at(t,e,n,r,o){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);r&&(this.request=r);if(o){this.response=o;this.status=o.status?o.status:null}}ut.inherits(at,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:ut.toJSONObject(this.config),code:this.code,status:this.status}}});const ft=at.prototype;const lt={};["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=>{lt[t]={value:t}}));Object.defineProperties(at,lt);Object.defineProperty(ft,"isAxiosError",{value:true});at.from=(t,e,n,r,o,s)=>{const i=Object.create(ft);ut.toFlatObject(t,i,(function t(e){return e!==Error.prototype}),(t=>t!=="isAxiosError"));at.call(i,t.message,e,n,r,o);i.cause=t;i.name=t.name;s&&Object.assign(i,s);return i};const dt=null;function ht(t){return ut.isPlainObject(t)||ut.isArray(t)}function pt(t){return ut.endsWith(t,"[]")?t.slice(0,-2):t}function mt(t,e,n){if(!t)return e;return t.concat(e).map((function t(e,r){e=pt(e);return!n&&r?"["+e+"]":e})).join(n?".":"")}function wt(t){return ut.isArray(t)&&!t.some(ht)}const bt=ut.toFlatObject(ut,{},null,(function t(e){return/^is[A-Z]/.test(e)}));function yt(t,e,n){if(!ut.isObject(t)){throw new TypeError("target must be an object")}e=e||new FormData;n=ut.toFlatObject(n,{metaTokens:true,dots:false,indexes:false},false,(function t(e,n){return!ut.isUndefined(n[e])}));const r=n.metaTokens;const o=n.visitor||f;const s=n.dots;const i=n.indexes;const c=n.Blob||typeof Blob!=="undefined"&&Blob;const u=c&&ut.isSpecCompliantForm(e);if(!ut.isFunction(o)){throw new TypeError("visitor must be a function")}function a(t){if(t===null)return"";if(ut.isDate(t)){return t.toISOString()}if(!u&&ut.isBlob(t)){throw new at("Blob is not supported. Use a Buffer instead.")}if(ut.isArrayBuffer(t)||ut.isTypedArray(t)){return u&&typeof Blob==="function"?new Blob([t]):Buffer.from(t)}return t}function f(t,n,o){let c=t;if(t&&!o&&typeof t==="object"){if(ut.endsWith(n,"{}")){n=r?n:n.slice(0,-2);t=JSON.stringify(t)}else if(ut.isArray(t)&&wt(t)||(ut.isFileList(t)||ut.endsWith(n,"[]"))&&(c=ut.toArray(t))){n=pt(n);c.forEach((function t(r,o){!(ut.isUndefined(r)||r===null)&&e.append(i===true?mt([n],o,s):i===null?n:n+"[]",a(r))}));return false}}if(ht(t)){return true}e.append(mt(o,n,s),a(t));return false}const l=[];const d=Object.assign(bt,{defaultVisitor:f,convertValue:a,isVisitable:ht});function h(t,n){if(ut.isUndefined(t))return;if(l.indexOf(t)!==-1){throw Error("Circular reference detected in "+n.join("."))}l.push(t);ut.forEach(t,(function t(r,s){const i=!(ut.isUndefined(r)||r===null)&&o.call(e,r,ut.isString(s)?s.trim():s,n,d);if(i===true){h(r,n?n.concat(s):[s])}}));l.pop()}if(!ut.isObject(t)){throw new TypeError("data must be an object")}h(t);return e}function gt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function t(n){return e[n]}))}function Rt(t,e){this._pairs=[];t&&yt(t,this,e)}const Ot=Rt.prototype;Ot.append=function t(e,n){this._pairs.push([e,n])};Ot.toString=function t(e){const n=e?function(t){return e.call(this,t,gt)}:gt;return this._pairs.map((function t(e){return n(e[0])+"="+n(e[1])}),"").join("&")};function Et(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function St(t,e,n){if(!e){return t}const r=n&&n.encode||Et;const o=n&&n.serialize;let s;if(o){s=o(e,n)}else{s=ut.isURLSearchParams(e)?e.toString():new Rt(e,n).toString(r)}if(s){const e=t.indexOf("#");if(e!==-1){t=t.slice(0,e)}t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Tt{constructor(){this.handlers=[]}use(t,e,n){this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:false,runWhen:n?n.runWhen:null});return this.handlers.length-1}eject(t){if(this.handlers[t]){this.handlers[t]=null}}clear(){if(this.handlers){this.handlers=[]}}forEach(t){ut.forEach(this.handlers,(function e(n){if(n!==null){t(n)}}))}}const At=Tt;const jt={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};const xt=typeof URLSearchParams!=="undefined"?URLSearchParams:Rt;const Nt=typeof FormData!=="undefined"?FormData:null;const Pt=typeof Blob!=="undefined"?Blob:null;const Ct={isBrowser:true,classes:{URLSearchParams:xt,FormData:Nt,Blob:Pt},protocols:["http","https","file","blob","url","data"]};const vt=typeof window!=="undefined"&&typeof document!=="undefined";const Ft=typeof navigator==="object"&&navigator||undefined;const Bt=vt&&(!Ft||["ReactNative","NativeScript","NS"].indexOf(Ft.product)<0);const Ut=(()=>typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function")();const Dt=vt&&window.location.href||"http://localhost";const _t=Object.freeze({__proto__:null,hasBrowserEnv:vt,hasStandardBrowserWebWorkerEnv:Ut,hasStandardBrowserEnv:Bt,navigator:Ft,origin:Dt});const qt={..._t,...Ct};function kt(t,e){return yt(t,new qt.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){if(qt.isNode&&ut.isBuffer(t)){this.append(e,t.toString("base64"));return false}return r.defaultVisitor.apply(this,arguments)}},e))}function Lt(t){return ut.matchAll(/\w+|\[(\w*)]/g,t).map((t=>t[0]==="[]"?"":t[1]||t[0]))}function It(t){const e={};const n=Object.keys(t);let r;const o=n.length;let s;for(r=0;r<o;r++){s=n[r];e[s]=t[s]}return e}function Mt(t){function e(t,n,r,o){let s=t[o++];if(s==="__proto__")return true;const i=Number.isFinite(+s);const c=o>=t.length;s=!s&&ut.isArray(r)?r.length:s;if(c){if(ut.hasOwnProp(r,s)){r[s]=[r[s],n]}else{r[s]=n}return!i}if(!r[s]||!ut.isObject(r[s])){r[s]=[]}const u=e(t,n,r[s],o);if(u&&ut.isArray(r[s])){r[s]=It(r[s])}return!i}if(ut.isFormData(t)&&ut.isFunction(t.entries)){const n={};ut.forEachEntry(t,((t,r)=>{e(Lt(t),r,n,0)}));return n}return null}function Ht(t,e,n){if(ut.isString(t)){try{(e||JSON.parse)(t);return ut.trim(t)}catch(t){if(t.name!=="SyntaxError"){throw t}}}return(n||JSON.stringify)(t)}const zt={transitional:jt,adapter:["xhr","http","fetch"],transformRequest:[function t(e,n){const r=n.getContentType()||"";const o=r.indexOf("application/json")>-1;const s=ut.isObject(e);if(s&&ut.isHTMLForm(e)){e=new FormData(e)}const i=ut.isFormData(e);if(i){return o?JSON.stringify(Mt(e)):e}if(ut.isArrayBuffer(e)||ut.isBuffer(e)||ut.isStream(e)||ut.isFile(e)||ut.isBlob(e)||ut.isReadableStream(e)){return e}if(ut.isArrayBufferView(e)){return e.buffer}if(ut.isURLSearchParams(e)){n.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return e.toString()}let c;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1){return kt(e,this.formSerializer).toString()}if((c=ut.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return yt(c?{"files[]":e}:e,t&&new t,this.formSerializer)}}if(s||o){n.setContentType("application/json",false);return Ht(e)}return e}],transformResponse:[function t(e){const n=this.transitional||zt.transitional;const r=n&&n.forcedJSONParsing;const o=this.responseType==="json";if(ut.isResponse(e)||ut.isReadableStream(e)){return e}if(e&&ut.isString(e)&&(r&&!this.responseType||o)){const t=n&&n.silentJSONParsing;const r=!t&&o;try{return JSON.parse(e)}catch(t){if(r){if(t.name==="SyntaxError"){throw at.from(t,at.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:qt.classes.FormData,Blob:qt.classes.Blob},validateStatus:function t(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":undefined}}};ut.forEach(["delete","get","head","post","put","patch"],(t=>{zt.headers[t]={}}));const $t=zt;const Jt=ut.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Kt=t=>{const e={};let n;let r;let o;t&&t.split("\n").forEach((function t(s){o=s.indexOf(":");n=s.substring(0,o).trim().toLowerCase();r=s.substring(o+1).trim();if(!n||e[n]&&Jt[n]){return}if(n==="set-cookie"){if(e[n]){e[n].push(r)}else{e[n]=[r]}}else{e[n]=e[n]?e[n]+", "+r:r}}));return e};const Vt=Symbol("internals");function Wt(t){return t&&String(t).trim().toLowerCase()}function Gt(t){if(t===false||t==null){return t}return ut.isArray(t)?t.map(Gt):String(t)}function Xt(t){const e=Object.create(null);const n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;while(r=n.exec(t)){e[r[1]]=r[2]}return e}const Zt=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Qt(t,e,n,r,o){if(ut.isFunction(r)){return r.call(this,e,n)}if(o){e=n}if(!ut.isString(e))return;if(ut.isString(r)){return e.indexOf(r)!==-1}if(ut.isRegExp(r)){return r.test(e)}}function Yt(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}function te(t,e){const n=ut.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,o){return this[r].call(this,e,t,n,o)},configurable:true})}))}class ee{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function o(t,e,n){const o=Wt(e);if(!o){throw new Error("header name must be a non-empty string")}const s=ut.findKey(r,o);if(!s||r[s]===undefined||n===true||n===undefined&&r[s]!==false){r[s||e]=Gt(t)}}const s=(t,e)=>ut.forEach(t,((t,n)=>o(t,n,e)));if(ut.isPlainObject(t)||t instanceof this.constructor){s(t,e)}else if(ut.isString(t)&&(t=t.trim())&&!Zt(t)){s(Kt(t),e)}else if(ut.isHeaders(t)){for(const[e,r]of t.entries()){o(r,e,n)}}else{t!=null&&o(e,t,n)}return this}get(t,e){t=Wt(t);if(t){const n=ut.findKey(this,t);if(n){const t=this[n];if(!e){return t}if(e===true){return Xt(t)}if(ut.isFunction(e)){return e.call(this,t,n)}if(ut.isRegExp(e)){return e.exec(t)}throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){t=Wt(t);if(t){const n=ut.findKey(this,t);return!!(n&&this[n]!==undefined&&(!e||Qt(this,this[n],n,e)))}return false}delete(t,e){const n=this;let r=false;function o(t){t=Wt(t);if(t){const o=ut.findKey(n,t);if(o&&(!e||Qt(n,n[o],o,e))){delete n[o];r=true}}}if(ut.isArray(t)){t.forEach(o)}else{o(t)}return r}clear(t){const e=Object.keys(this);let n=e.length;let r=false;while(n--){const o=e[n];if(!t||Qt(this,this[o],o,t,true)){delete this[o];r=true}}return r}normalize(t){const e=this;const n={};ut.forEach(this,((r,o)=>{const s=ut.findKey(n,o);if(s){e[s]=Gt(r);delete e[o];return}const i=t?Yt(o):String(o).trim();if(i!==o){delete e[o]}e[i]=Gt(r);n[i]=true}));return this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);ut.forEach(this,((n,r)=>{n!=null&&n!==false&&(e[r]=t&&ut.isArray(n)?n.join(", "):n)}));return e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);e.forEach((t=>n.set(t)));return n}static accessor(t){const e=this[Vt]=this[Vt]={accessors:{}};const n=e.accessors;const r=this.prototype;function o(t){const e=Wt(t);if(!n[e]){te(r,t);n[e]=true}}ut.isArray(t)?t.forEach(o):o(t);return this}}ee.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ut.reduceDescriptors(ee.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}}));ut.freezeMethods(ee);const ne=ee;function re(t,e){const n=this||$t;const r=e||n;const o=ne.from(r.headers);let s=r.data;ut.forEach(t,(function t(r){s=r.call(n,s,o.normalize(),e?e.status:undefined)}));o.normalize();return s}function oe(t){return!!(t&&t.__CANCEL__)}function se(t,e,n){at.call(this,t==null?"canceled":t,at.ERR_CANCELED,e,n);this.name="CanceledError"}ut.inherits(se,at,{__CANCEL__:true});function ie(t,e,n){const r=n.config.validateStatus;if(!n.status||!r||r(n.status)){t(n)}else{e(new at("Request failed with status code "+n.status,[at.ERR_BAD_REQUEST,at.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}}function ce(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ue(t,e){t=t||10;const n=new Array(t);const r=new Array(t);let o=0;let s=0;let i;e=e!==undefined?e:1e3;return function c(u){const a=Date.now();const f=r[s];if(!i){i=a}n[o]=u;r[o]=a;let l=s;let d=0;while(l!==o){d+=n[l++];l=l%t}o=(o+1)%t;if(o===s){s=(s+1)%t}if(a-i<e){return}const h=f&&a-f;return h?Math.round(d*1e3/h):undefined}}function ae(t,e){let n=0;let r=1e3/e;let o;let s;const i=(e,r=Date.now())=>{n=r;o=null;if(s){clearTimeout(s);s=null}t.apply(null,e)};const c=(...t)=>{const e=Date.now();const c=e-n;if(c>=r){i(t,e)}else{o=t;if(!s){s=setTimeout((()=>{s=null;i(o)}),r-c)}}};const u=()=>o&&i(o);return[c,u]}const fe=(t,e,n=3)=>{let r=0;const o=ue(50,250);return ae((n=>{const s=n.loaded;const i=n.lengthComputable?n.total:undefined;const c=s-r;const u=o(c);const a=s<=i;r=s;const f={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(f)}),n)};const le=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]};const de=t=>(...e)=>ut.asap((()=>t(...e)));const he=qt.hasStandardBrowserEnv?function t(){const e=qt.navigator&&/(msie|trident)/i.test(qt.navigator.userAgent);const n=document.createElement("a");let r;function o(t){let r=t;if(e){n.setAttribute("href",r);r=n.href}n.setAttribute("href",r);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}}r=o(window.location.href);return function t(e){const n=ut.isString(e)?o(e):e;return n.protocol===r.protocol&&n.host===r.host}}():function t(){return function t(){return true}}();const pe=qt.hasStandardBrowserEnv?{write(t,e,n,r,o,s){const i=[t+"="+encodeURIComponent(e)];ut.isNumber(n)&&i.push("expires="+new Date(n).toGMTString());ut.isString(r)&&i.push("path="+r);ut.isString(o)&&i.push("domain="+o);s===true&&i.push("secure");document.cookie=i.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function me(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function we(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function be(t,e){if(t&&!me(e)){return we(t,e)}return e}const ye=t=>t instanceof ne?{...t}:t;function ge(t,e){e=e||{};const n={};function r(t,e,n){if(ut.isPlainObject(t)&&ut.isPlainObject(e)){return ut.merge.call({caseless:n},t,e)}else if(ut.isPlainObject(e)){return ut.merge({},e)}else if(ut.isArray(e)){return e.slice()}return e}function o(t,e,n){if(!ut.isUndefined(e)){return r(t,e,n)}else if(!ut.isUndefined(t)){return r(undefined,t,n)}}function s(t,e){if(!ut.isUndefined(e)){return r(undefined,e)}}function i(t,e){if(!ut.isUndefined(e)){return r(undefined,e)}else if(!ut.isUndefined(t)){return r(undefined,t)}}function c(n,o,s){if(s in e){return r(n,o)}else if(s in t){return r(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)=>o(ye(t),ye(e),true)};ut.forEach(Object.keys(Object.assign({},t,e)),(function r(s){const i=u[s]||o;const a=i(t[s],e[s],s);ut.isUndefined(a)&&i!==c||(n[s]=a)}));return n}const Re=t=>{const e=ge({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:c}=e;e.headers=i=ne.from(i);e.url=St(be(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(ut.isFormData(n)){if(qt.hasStandardBrowserEnv||qt.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(qt.hasStandardBrowserEnv){r&&ut.isFunction(r)&&(r=r(e));if(r||r!==false&&he(e.url)){const t=o&&s&&pe.read(s);if(t){i.set(o,t)}}}return e};const Oe=typeof XMLHttpRequest!=="undefined";const Ee=Oe&&function(t){return new Promise((function e(n,r){const o=Re(t);let s=o.data;const i=ne.from(o.headers).normalize();let{responseType:c,onUploadProgress:u,onDownloadProgress:a}=o;let f;let l,d;let h,p;function m(){h&&h();p&&p();o.cancelToken&&o.cancelToken.unsubscribe(f);o.signal&&o.signal.removeEventListener("abort",f)}let w=new XMLHttpRequest;w.open(o.method.toUpperCase(),o.url,true);w.timeout=o.timeout;function b(){if(!w){return}const e=ne.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders());const o=!c||c==="text"||c==="json"?w.responseText:w.response;const s={data:o,status:w.status,statusText:w.statusText,headers:e,config:t,request:w};ie((function t(e){n(e);m()}),(function t(e){r(e);m()}),s);w=null}if("onloadend"in w){w.onloadend=b}else{w.onreadystatechange=function t(){if(!w||w.readyState!==4){return}if(w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)){return}setTimeout(b)}}w.onabort=function e(){if(!w){return}r(new at("Request aborted",at.ECONNABORTED,t,w));w=null};w.onerror=function e(){r(new at("Network Error",at.ERR_NETWORK,t,w));w=null};w.ontimeout=function e(){let n=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const s=o.transitional||jt;if(o.timeoutErrorMessage){n=o.timeoutErrorMessage}r(new at(n,s.clarifyTimeoutError?at.ETIMEDOUT:at.ECONNABORTED,t,w));w=null};s===undefined&&i.setContentType(null);if("setRequestHeader"in w){ut.forEach(i.toJSON(),(function t(e,n){w.setRequestHeader(n,e)}))}if(!ut.isUndefined(o.withCredentials)){w.withCredentials=!!o.withCredentials}if(c&&c!=="json"){w.responseType=o.responseType}if(a){[d,p]=fe(a,true);w.addEventListener("progress",d)}if(u&&w.upload){[l,h]=fe(u);w.upload.addEventListener("progress",l);w.upload.addEventListener("loadend",h)}if(o.cancelToken||o.signal){f=e=>{if(!w){return}r(!e||e.type?new se(null,t,w):e);w.abort();w=null};o.cancelToken&&o.cancelToken.subscribe(f);if(o.signal){o.signal.aborted?f():o.signal.addEventListener("abort",f)}}const y=ce(o.url);if(y&&qt.protocols.indexOf(y)===-1){r(new at("Unsupported protocol "+y+":",at.ERR_BAD_REQUEST,t));return}w.send(s||null)}))};const Se=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let n=new AbortController;let r;const o=function(t){if(!r){r=true;i();const e=t instanceof Error?t:this.reason;n.abort(e instanceof at?e:new se(e instanceof Error?e.message:e))}};let s=e&&setTimeout((()=>{s=null;o(new at(`timeout ${e} of ms exceeded`,at.ETIMEDOUT))}),e);const i=()=>{if(t){s&&clearTimeout(s);s=null;t.forEach((t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)}));t=null}};t.forEach((t=>t.addEventListener("abort",o)));const{signal:c}=n;c.unsubscribe=()=>ut.asap(i);return c}};const Te=Se;const Ae=function*(t,e){let n=t.byteLength;if(!e||n<e){yield t;return}let r=0;let o;while(r<n){o=r+e;yield t.slice(r,o);r=o}};const je=async function*(t,e){for await(const n of xe(t)){yield*Ae(n,e)}};const xe=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t){break}yield n}}finally{await e.cancel()}};const Ne=(t,e,n,r)=>{const o=je(t,e);let s=0;let i;let c=t=>{if(!i){i=true;r&&r(t)}};return new ReadableStream({async pull(t){try{const{done:e,value:r}=await o.next();if(e){c();t.close();return}let i=r.byteLength;if(n){let t=s+=i;n(t)}t.enqueue(new Uint8Array(r))}catch(t){c(t);throw t}},cancel(t){c(t);return o.return()}},{highWaterMark:2})};const Pe=typeof fetch==="function"&&typeof Request==="function"&&typeof Response==="function";const Ce=Pe&&typeof ReadableStream==="function";const ve=Pe&&(typeof TextEncoder==="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer()));const Fe=(t,...e)=>{try{return!!t(...e)}catch(t){return false}};const Be=Ce&&Fe((()=>{let t=false;const e=new Request(qt.origin,{body:new ReadableStream,method:"POST",get duplex(){t=true;return"half"}}).headers.has("Content-Type");return t&&!e}));const Ue=64*1024;const De=Ce&&Fe((()=>ut.isReadableStream(new Response("").body)));const _e={stream:De&&(t=>t.body)};Pe&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!_e[e]&&(_e[e]=ut.isFunction(t[e])?t=>t[e]():(t,n)=>{throw new at(`Response type '${e}' is not supported`,at.ERR_NOT_SUPPORT,n)})}))})(new Response);const qe=async t=>{if(t==null){return 0}if(ut.isBlob(t)){return t.size}if(ut.isSpecCompliantForm(t)){const e=new Request(qt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}if(ut.isArrayBufferView(t)||ut.isArrayBuffer(t)){return t.byteLength}if(ut.isURLSearchParams(t)){t=t+""}if(ut.isString(t)){return(await ve(t)).byteLength}};const ke=async(t,e)=>{const n=ut.toFiniteNumber(t.getContentLength());return n==null?qe(e):n};const Le=Pe&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:c,onUploadProgress:u,responseType:a,headers:f,withCredentials:l="same-origin",fetchOptions:d}=Re(t);a=a?(a+"").toLowerCase():"text";let h=Te([o,s&&s.toAbortSignal()],i);let p;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let w;try{if(u&&Be&&n!=="get"&&n!=="head"&&(w=await ke(f,r))!==0){let t=new Request(e,{method:"POST",body:r,duplex:"half"});let n;if(ut.isFormData(r)&&(n=t.headers.get("content-type"))){f.setContentType(n)}if(t.body){const[e,n]=le(w,fe(de(u)));r=Ne(t.body,Ue,e,n)}}if(!ut.isString(l)){l=l?"include":"omit"}const o="credentials"in Request.prototype;p=new Request(e,{...d,signal:h,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:o?l:undefined});let s=await fetch(p);const i=De&&(a==="stream"||a==="response");if(De&&(c||i&&m)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=s[e]}));const e=ut.toFiniteNumber(s.headers.get("content-length"));const[n,r]=c&&le(e,fe(de(c),true))||[];s=new Response(Ne(s.body,Ue,n,(()=>{r&&r();m&&m()})),t)}a=a||"text";let b=await _e[ut.findKey(_e,a)||"text"](s,t);!i&&m&&m();return await new Promise(((e,n)=>{ie(e,n,{data:b,headers:ne.from(s.headers),status:s.status,statusText:s.statusText,config:t,request:p})}))}catch(e){m&&m();if(e&&e.name==="TypeError"&&/fetch/i.test(e.message)){throw Object.assign(new at("Network Error",at.ERR_NETWORK,t,p),{cause:e.cause||e})}throw at.from(e,e&&e.code,t,p)}});const Ie={http:dt,xhr:Ee,fetch:Le};ut.forEach(Ie,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Me=t=>`- ${t}`;const He=t=>ut.isFunction(t)||t===null||t===false;const ze={getAdapter:t=>{t=ut.isArray(t)?t:[t];const{length:e}=t;let n;let r;const o={};for(let s=0;s<e;s++){n=t[s];let e;r=n;if(!He(n)){r=Ie[(e=String(n)).toLowerCase()];if(r===undefined){throw new at(`Unknown adapter '${e}'`)}}if(r){break}o[e||"#"+s]=r}if(!r){const t=Object.entries(o).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(Me).join("\n"):" "+Me(t[0]):"as no adapter specified";throw new at(`There is no suitable adapter to dispatch the request `+n,"ERR_NOT_SUPPORT")}return r},adapters:Ie};function $e(t){if(t.cancelToken){t.cancelToken.throwIfRequested()}if(t.signal&&t.signal.aborted){throw new se(null,t)}}function Je(t){$e(t);t.headers=ne.from(t.headers);t.data=re.call(t,t.transformRequest);if(["post","put","patch"].indexOf(t.method)!==-1){t.headers.setContentType("application/x-www-form-urlencoded",false)}const e=ze.getAdapter(t.adapter||$t.adapter);return e(t).then((function e(n){$e(t);n.data=re.call(t,t.transformResponse,n);n.headers=ne.from(n.headers);return n}),(function e(n){if(!oe(n)){$e(t);if(n&&n.response){n.response.data=re.call(t,t.transformResponse,n.response);n.response.headers=ne.from(n.response.headers)}}return Promise.reject(n)}))}const Ke="1.7.7";const Ve={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Ve[t]=function n(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));const We={};Ve.transitional=function t(e,n,r){function o(t,e){return"[Axios v"+Ke+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(t,r,s)=>{if(e===false){throw new at(o(r," has been removed"+(n?" in "+n:"")),at.ERR_DEPRECATED)}if(n&&!We[r]){We[r]=true;console.warn(o(r," has been deprecated since v"+n+" and will be removed in the near future"))}return e?e(t,r,s):true}};function Ge(t,e,n){if(typeof t!=="object"){throw new at("options must be an object",at.ERR_BAD_OPTION_VALUE)}const r=Object.keys(t);let o=r.length;while(o-- >0){const s=r[o];const i=e[s];if(i){const e=t[s];const n=e===undefined||i(e,s,t);if(n!==true){throw new at("option "+s+" must be "+n,at.ERR_BAD_OPTION_VALUE)}continue}if(n!==true){throw new at("Unknown option "+s,at.ERR_BAD_OPTION)}}}const Xe={assertOptions:Ge,validators:Ve};const Ze=Xe.validators;class Qe{constructor(t){this.defaults=t;this.interceptors={request:new At,response:new At}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const n=e.stack?e.stack.replace(/^.+\n/,""):"";try{if(!t.stack){t.stack=n}else if(n&&!String(t.stack).endsWith(n.replace(/^.+\n.+\n/,""))){t.stack+="\n"+n}}catch(t){}}throw t}}_request(t,e){if(typeof t==="string"){e=e||{};e.url=t}else{e=t||{}}e=ge(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:o}=e;if(n!==undefined){Xe.assertOptions(n,{silentJSONParsing:Ze.transitional(Ze.boolean),forcedJSONParsing:Ze.transitional(Ze.boolean),clarifyTimeoutError:Ze.transitional(Ze.boolean)},false)}if(r!=null){if(ut.isFunction(r)){e.paramsSerializer={serialize:r}}else{Xe.assertOptions(r,{encode:Ze.function,serialize:Ze.function},true)}}e.method=(e.method||this.defaults.method||"get").toLowerCase();let s=o&&ut.merge(o.common,o[e.method]);o&&ut.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]}));e.headers=ne.concat(s,o);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 f=0;let l;if(!c){const t=[Je.bind(this),undefined];t.unshift.apply(t,i);t.push.apply(t,u);l=t.length;a=Promise.resolve(e);while(f<l){a=a.then(t[f++],t[f++])}return a}l=i.length;let d=e;f=0;while(f<l){const t=i[f++];const e=i[f++];try{d=t(d)}catch(t){e.call(this,t);break}}try{a=Je.call(this,d)}catch(t){return Promise.reject(t)}f=0;l=u.length;while(f<l){a=a.then(u[f++],u[f++])}return a}getUri(t){t=ge(this.defaults,t);const e=be(t.baseURL,t.url);return St(e,t.params,t.paramsSerializer)}}ut.forEach(["delete","get","head","options"],(function t(e){Qe.prototype[e]=function(t,n){return this.request(ge(n||{},{method:e,url:t,data:(n||{}).data}))}}));ut.forEach(["post","put","patch"],(function t(e){function n(t){return function n(r,o,s){return this.request(ge(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}Qe.prototype[e]=n();Qe.prototype[e+"Form"]=n(true)}));const Ye=Qe;class tn{constructor(t){if(typeof t!=="function"){throw new TypeError("executor must be a function.")}let e;this.promise=new Promise((function t(n){e=n}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;while(e-- >0){n._listeners[e](t)}n._listeners=null}));this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t);e=t})).then(t);r.cancel=function t(){n.unsubscribe(e)};return r};t((function t(r,o,s){if(n.reason){return}n.reason=new se(r,o,s);e(n.reason)}))}throwIfRequested(){if(this.reason){throw this.reason}}subscribe(t){if(this.reason){t(this.reason);return}if(this._listeners){this._listeners.push(t)}else{this._listeners=[t]}}unsubscribe(t){if(!this._listeners){return}const e=this._listeners.indexOf(t);if(e!==-1){this._listeners.splice(e,1)}}toAbortSignal(){const t=new AbortController;const e=e=>{t.abort(e)};this.subscribe(e);t.signal.unsubscribe=()=>this.unsubscribe(e);return t.signal}static source(){let t;const e=new tn((function e(n){t=n}));return{token:e,cancel:t}}}const en=tn;function nn(t){return function e(n){return t.apply(null,n)}}function rn(t){return ut.isObject(t)&&t.isAxiosError===true}const on={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(on).forEach((([t,e])=>{on[e]=t}));const sn=on;function cn(e){const n=new Ye(e);const r=t(Ye.prototype.request,n);ut.extend(r,Ye.prototype,n,{allOwnKeys:true});ut.extend(r,n,null,{allOwnKeys:true});r.create=function t(n){return cn(ge(e,n))};return r}const un=cn($t);un.Axios=Ye;un.CanceledError=se;un.CancelToken=en;un.isCancel=oe;un.VERSION=Ke;un.toFormData=yt;un.AxiosError=at;un.Cancel=un.CanceledError;un.all=function t(e){return Promise.all(e)};un.spread=nn;un.isAxiosError=rn;un.mergeConfig=ge;un.AxiosHeaders=ne;un.formToJSON=t=>Mt(ut.isHTMLForm(t)?new FormData(t):t);un.getAdapter=ze.getAdapter;un.HttpStatusCode=sn;un.default=un;const an=un;const fn="https://crmbonus-service-staging-d15ba5377115.herokuapp.com";class ln{constructor(){this.axiosInstance=an.create({baseURL:fn,headers:{"Content-Type":"application/json",accept:"application/json"}})}async getCustomer(t,e){const n=await this.axiosInstance.get(`/api/wake/store/${e}/customer/${t}`,{headers:{"Content-Type":"application/json"}});console.log("response.data",n.data);return n.data}async updateOrder(t){const e=await this.axiosInstance.put(`/api/carts/update_cart/${t.cartId}`,{orderId:t.orderId,cartIdCrm:t.cartIdCrm},{headers:{"Content-Type":"application/json"}});console.log("response",e.data)}async sendPin(t,e,n){const r=await this.axiosInstance.post("/api/crm-bonus/send-pin",{celular:t,nome:e},{headers:{store:n}});return{storeId:r.data.store_id,userId:r.data.user_id}}async validatePinBonus(t,e){console.log("[validatePinBonus]",t);const n=await this.axiosInstance.post("/api/crm-bonus/process-pin-bonus",t,{headers:{store:e}});return n.data}async reserve(t,e){const n=await this.axiosInstance.post("/api/crm-bonus/redeem-bonus",t,{headers:{store:e}});return n.data}async cancel(t,e){const n=await this.axiosInstance.post("/api/crm-bonus/cancel-apply-bonus",{ticket:t},{headers:{store:e}});return n.data}}export{ln as C};
2
- //# sourceMappingURL=p-a7e4526b.js.map
1
+ function t(t,e){return function n(){return t.apply(e,arguments)}}const{toString:e}=Object.prototype;const{getPrototypeOf:n}=Object;const r=(t=>n=>{const r=e.call(n);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null));const o=t=>{t=t.toLowerCase();return e=>r(e)===t};const s=t=>e=>typeof e===t;const{isArray:i}=Array;const c=s("undefined");function u(t){return t!==null&&!c(t)&&t.constructor!==null&&!c(t.constructor)&&d(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const a=o("ArrayBuffer");function f(t){let e;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){e=ArrayBuffer.isView(t)}else{e=t&&t.buffer&&a(t.buffer)}return e}const l=s("string");const d=s("function");const h=s("number");const p=t=>t!==null&&typeof t==="object";const m=t=>t===true||t===false;const w=t=>{if(r(t)!=="object"){return false}const e=n(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};const b=o("Date");const y=o("File");const g=o("Blob");const R=o("FileList");const O=t=>p(t)&&d(t.pipe);const E=t=>{let e;return t&&(typeof FormData==="function"&&t instanceof FormData||d(t.append)&&((e=r(t))==="formdata"||e==="object"&&d(t.toString)&&t.toString()==="[object FormData]"))};const S=o("URLSearchParams");const[T,A,j,x]=["ReadableStream","Request","Response","Headers"].map(o);const N=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function P(t,e,{allOwnKeys:n=false}={}){if(t===null||typeof t==="undefined"){return}let r;let o;if(typeof t!=="object"){t=[t]}if(i(t)){for(r=0,o=t.length;r<o;r++){e.call(null,t[r],r,t)}}else{const o=n?Object.getOwnPropertyNames(t):Object.keys(t);const s=o.length;let i;for(r=0;r<s;r++){i=o[r];e.call(null,t[i],i,t)}}}function C(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length;let o;while(r-- >0){o=n[r];if(e===o.toLowerCase()){return o}}return null}const F=(()=>{if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global})();const v=t=>!c(t)&&t!==F;function B(){const{caseless:t}=v(this)&&this||{};const e={};const n=(n,r)=>{const o=t&&C(e,r)||r;if(w(e[o])&&w(n)){e[o]=B(e[o],n)}else if(w(n)){e[o]=B({},n)}else if(i(n)){e[o]=n.slice()}else{e[o]=n}};for(let t=0,e=arguments.length;t<e;t++){arguments[t]&&P(arguments[t],n)}return e}const U=(e,n,r,{allOwnKeys:o}={})=>{P(n,((n,o)=>{if(r&&d(n)){e[o]=t(n,r)}else{e[o]=n}}),{allOwnKeys:o});return e};const D=t=>{if(t.charCodeAt(0)===65279){t=t.slice(1)}return t};const _=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r);t.prototype.constructor=t;Object.defineProperty(t,"super",{value:e.prototype});n&&Object.assign(t.prototype,n)};const q=(t,e,r,o)=>{let s;let i;let c;const u={};e=e||{};if(t==null)return e;do{s=Object.getOwnPropertyNames(t);i=s.length;while(i-- >0){c=s[i];if((!o||o(c,t,e))&&!u[c]){e[c]=t[c];u[c]=true}}t=r!==false&&n(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e};const k=(t,e,n)=>{t=String(t);if(n===undefined||n>t.length){n=t.length}n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n};const L=t=>{if(!t)return null;if(i(t))return t;let e=t.length;if(!h(e))return null;const n=new Array(e);while(e-- >0){n[e]=t[e]}return n};const I=(t=>e=>t&&e instanceof t)(typeof Uint8Array!=="undefined"&&n(Uint8Array));const M=(t,e)=>{const n=t&&t[Symbol.iterator];const r=n.call(t);let o;while((o=r.next())&&!o.done){const n=o.value;e.call(t,n[0],n[1])}};const H=(t,e)=>{let n;const r=[];while((n=t.exec(e))!==null){r.push(n)}return r};const z=o("HTMLFormElement");const $=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function t(e,n,r){return n.toUpperCase()+r}));const J=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype);const K=o("RegExp");const V=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t);const r={};P(n,((n,o)=>{let s;if((s=e(n,o,t))!==false){r[o]=s||n}}));Object.defineProperties(t,r)};const W=t=>{V(t,((e,n)=>{if(d(t)&&["arguments","caller","callee"].indexOf(n)!==-1){return false}const r=t[n];if(!d(r))return;e.enumerable=false;if("writable"in e){e.writable=false;return}if(!e.set){e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}}}))};const G=(t,e)=>{const n={};const r=t=>{t.forEach((t=>{n[t]=true}))};i(t)?r(t):r(String(t).split(e));return n};const X=()=>{};const Z=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;const Q="abcdefghijklmnopqrstuvwxyz";const Y="0123456789";const tt={DIGIT:Y,ALPHA:Q,ALPHA_DIGIT:Q+Q.toUpperCase()+Y};const et=(t=16,e=tt.ALPHA_DIGIT)=>{let n="";const{length:r}=e;while(t--){n+=e[Math.random()*r|0]}return n};function nt(t){return!!(t&&d(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const rt=t=>{const e=new Array(10);const n=(t,r)=>{if(p(t)){if(e.indexOf(t)>=0){return}if(!("toJSON"in t)){e[r]=t;const o=i(t)?[]:{};P(t,((t,e)=>{const s=n(t,r+1);!c(s)&&(o[e]=s)}));e[r]=undefined;return o}}return t};return n(t,0)};const ot=o("AsyncFunction");const st=t=>t&&(p(t)||d(t))&&d(t.then)&&d(t.catch);const it=((t,e)=>{if(t){return setImmediate}return e?((t,e)=>{F.addEventListener("message",(({source:n,data:r})=>{if(n===F&&r===t){e.length&&e.shift()()}}),false);return n=>{e.push(n);F.postMessage(t,"*")}})(`axios@${Math.random()}`,[]):t=>setTimeout(t)})(typeof setImmediate==="function",d(F.postMessage));const ct=typeof queueMicrotask!=="undefined"?queueMicrotask.bind(F):typeof process!=="undefined"&&process.nextTick||it;const ut={isArray:i,isArrayBuffer:a,isBuffer:u,isFormData:E,isArrayBufferView:f,isString:l,isNumber:h,isBoolean:m,isObject:p,isPlainObject:w,isReadableStream:T,isRequest:A,isResponse:j,isHeaders:x,isUndefined:c,isDate:b,isFile:y,isBlob:g,isRegExp:K,isFunction:d,isStream:O,isURLSearchParams:S,isTypedArray:I,isFileList:R,forEach:P,merge:B,extend:U,trim:N,stripBOM:D,inherits:_,toFlatObject:q,kindOf:r,kindOfTest:o,endsWith:k,toArray:L,forEachEntry:M,matchAll:H,isHTMLForm:z,hasOwnProperty:J,hasOwnProp:J,reduceDescriptors:V,freezeMethods:W,toObjectSet:G,toCamelCase:$,noop:X,toFiniteNumber:Z,findKey:C,global:F,isContextDefined:v,ALPHABET:tt,generateString:et,isSpecCompliantForm:nt,toJSONObject:rt,isAsyncFn:ot,isThenable:st,setImmediate:it,asap:ct};function at(t,e,n,r,o){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);r&&(this.request=r);if(o){this.response=o;this.status=o.status?o.status:null}}ut.inherits(at,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:ut.toJSONObject(this.config),code:this.code,status:this.status}}});const ft=at.prototype;const lt={};["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=>{lt[t]={value:t}}));Object.defineProperties(at,lt);Object.defineProperty(ft,"isAxiosError",{value:true});at.from=(t,e,n,r,o,s)=>{const i=Object.create(ft);ut.toFlatObject(t,i,(function t(e){return e!==Error.prototype}),(t=>t!=="isAxiosError"));at.call(i,t.message,e,n,r,o);i.cause=t;i.name=t.name;s&&Object.assign(i,s);return i};const dt=null;function ht(t){return ut.isPlainObject(t)||ut.isArray(t)}function pt(t){return ut.endsWith(t,"[]")?t.slice(0,-2):t}function mt(t,e,n){if(!t)return e;return t.concat(e).map((function t(e,r){e=pt(e);return!n&&r?"["+e+"]":e})).join(n?".":"")}function wt(t){return ut.isArray(t)&&!t.some(ht)}const bt=ut.toFlatObject(ut,{},null,(function t(e){return/^is[A-Z]/.test(e)}));function yt(t,e,n){if(!ut.isObject(t)){throw new TypeError("target must be an object")}e=e||new FormData;n=ut.toFlatObject(n,{metaTokens:true,dots:false,indexes:false},false,(function t(e,n){return!ut.isUndefined(n[e])}));const r=n.metaTokens;const o=n.visitor||f;const s=n.dots;const i=n.indexes;const c=n.Blob||typeof Blob!=="undefined"&&Blob;const u=c&&ut.isSpecCompliantForm(e);if(!ut.isFunction(o)){throw new TypeError("visitor must be a function")}function a(t){if(t===null)return"";if(ut.isDate(t)){return t.toISOString()}if(!u&&ut.isBlob(t)){throw new at("Blob is not supported. Use a Buffer instead.")}if(ut.isArrayBuffer(t)||ut.isTypedArray(t)){return u&&typeof Blob==="function"?new Blob([t]):Buffer.from(t)}return t}function f(t,n,o){let c=t;if(t&&!o&&typeof t==="object"){if(ut.endsWith(n,"{}")){n=r?n:n.slice(0,-2);t=JSON.stringify(t)}else if(ut.isArray(t)&&wt(t)||(ut.isFileList(t)||ut.endsWith(n,"[]"))&&(c=ut.toArray(t))){n=pt(n);c.forEach((function t(r,o){!(ut.isUndefined(r)||r===null)&&e.append(i===true?mt([n],o,s):i===null?n:n+"[]",a(r))}));return false}}if(ht(t)){return true}e.append(mt(o,n,s),a(t));return false}const l=[];const d=Object.assign(bt,{defaultVisitor:f,convertValue:a,isVisitable:ht});function h(t,n){if(ut.isUndefined(t))return;if(l.indexOf(t)!==-1){throw Error("Circular reference detected in "+n.join("."))}l.push(t);ut.forEach(t,(function t(r,s){const i=!(ut.isUndefined(r)||r===null)&&o.call(e,r,ut.isString(s)?s.trim():s,n,d);if(i===true){h(r,n?n.concat(s):[s])}}));l.pop()}if(!ut.isObject(t)){throw new TypeError("data must be an object")}h(t);return e}function gt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function t(n){return e[n]}))}function Rt(t,e){this._pairs=[];t&&yt(t,this,e)}const Ot=Rt.prototype;Ot.append=function t(e,n){this._pairs.push([e,n])};Ot.toString=function t(e){const n=e?function(t){return e.call(this,t,gt)}:gt;return this._pairs.map((function t(e){return n(e[0])+"="+n(e[1])}),"").join("&")};function Et(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function St(t,e,n){if(!e){return t}const r=n&&n.encode||Et;const o=n&&n.serialize;let s;if(o){s=o(e,n)}else{s=ut.isURLSearchParams(e)?e.toString():new Rt(e,n).toString(r)}if(s){const e=t.indexOf("#");if(e!==-1){t=t.slice(0,e)}t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Tt{constructor(){this.handlers=[]}use(t,e,n){this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:false,runWhen:n?n.runWhen:null});return this.handlers.length-1}eject(t){if(this.handlers[t]){this.handlers[t]=null}}clear(){if(this.handlers){this.handlers=[]}}forEach(t){ut.forEach(this.handlers,(function e(n){if(n!==null){t(n)}}))}}const At=Tt;const jt={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};const xt=typeof URLSearchParams!=="undefined"?URLSearchParams:Rt;const Nt=typeof FormData!=="undefined"?FormData:null;const Pt=typeof Blob!=="undefined"?Blob:null;const Ct={isBrowser:true,classes:{URLSearchParams:xt,FormData:Nt,Blob:Pt},protocols:["http","https","file","blob","url","data"]};const Ft=typeof window!=="undefined"&&typeof document!=="undefined";const vt=typeof navigator==="object"&&navigator||undefined;const Bt=Ft&&(!vt||["ReactNative","NativeScript","NS"].indexOf(vt.product)<0);const Ut=(()=>typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function")();const Dt=Ft&&window.location.href||"http://localhost";const _t=Object.freeze({__proto__:null,hasBrowserEnv:Ft,hasStandardBrowserWebWorkerEnv:Ut,hasStandardBrowserEnv:Bt,navigator:vt,origin:Dt});const qt={..._t,...Ct};function kt(t,e){return yt(t,new qt.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){if(qt.isNode&&ut.isBuffer(t)){this.append(e,t.toString("base64"));return false}return r.defaultVisitor.apply(this,arguments)}},e))}function Lt(t){return ut.matchAll(/\w+|\[(\w*)]/g,t).map((t=>t[0]==="[]"?"":t[1]||t[0]))}function It(t){const e={};const n=Object.keys(t);let r;const o=n.length;let s;for(r=0;r<o;r++){s=n[r];e[s]=t[s]}return e}function Mt(t){function e(t,n,r,o){let s=t[o++];if(s==="__proto__")return true;const i=Number.isFinite(+s);const c=o>=t.length;s=!s&&ut.isArray(r)?r.length:s;if(c){if(ut.hasOwnProp(r,s)){r[s]=[r[s],n]}else{r[s]=n}return!i}if(!r[s]||!ut.isObject(r[s])){r[s]=[]}const u=e(t,n,r[s],o);if(u&&ut.isArray(r[s])){r[s]=It(r[s])}return!i}if(ut.isFormData(t)&&ut.isFunction(t.entries)){const n={};ut.forEachEntry(t,((t,r)=>{e(Lt(t),r,n,0)}));return n}return null}function Ht(t,e,n){if(ut.isString(t)){try{(e||JSON.parse)(t);return ut.trim(t)}catch(t){if(t.name!=="SyntaxError"){throw t}}}return(n||JSON.stringify)(t)}const zt={transitional:jt,adapter:["xhr","http","fetch"],transformRequest:[function t(e,n){const r=n.getContentType()||"";const o=r.indexOf("application/json")>-1;const s=ut.isObject(e);if(s&&ut.isHTMLForm(e)){e=new FormData(e)}const i=ut.isFormData(e);if(i){return o?JSON.stringify(Mt(e)):e}if(ut.isArrayBuffer(e)||ut.isBuffer(e)||ut.isStream(e)||ut.isFile(e)||ut.isBlob(e)||ut.isReadableStream(e)){return e}if(ut.isArrayBufferView(e)){return e.buffer}if(ut.isURLSearchParams(e)){n.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return e.toString()}let c;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1){return kt(e,this.formSerializer).toString()}if((c=ut.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return yt(c?{"files[]":e}:e,t&&new t,this.formSerializer)}}if(s||o){n.setContentType("application/json",false);return Ht(e)}return e}],transformResponse:[function t(e){const n=this.transitional||zt.transitional;const r=n&&n.forcedJSONParsing;const o=this.responseType==="json";if(ut.isResponse(e)||ut.isReadableStream(e)){return e}if(e&&ut.isString(e)&&(r&&!this.responseType||o)){const t=n&&n.silentJSONParsing;const r=!t&&o;try{return JSON.parse(e)}catch(t){if(r){if(t.name==="SyntaxError"){throw at.from(t,at.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:qt.classes.FormData,Blob:qt.classes.Blob},validateStatus:function t(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":undefined}}};ut.forEach(["delete","get","head","post","put","patch"],(t=>{zt.headers[t]={}}));const $t=zt;const Jt=ut.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Kt=t=>{const e={};let n;let r;let o;t&&t.split("\n").forEach((function t(s){o=s.indexOf(":");n=s.substring(0,o).trim().toLowerCase();r=s.substring(o+1).trim();if(!n||e[n]&&Jt[n]){return}if(n==="set-cookie"){if(e[n]){e[n].push(r)}else{e[n]=[r]}}else{e[n]=e[n]?e[n]+", "+r:r}}));return e};const Vt=Symbol("internals");function Wt(t){return t&&String(t).trim().toLowerCase()}function Gt(t){if(t===false||t==null){return t}return ut.isArray(t)?t.map(Gt):String(t)}function Xt(t){const e=Object.create(null);const n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;while(r=n.exec(t)){e[r[1]]=r[2]}return e}const Zt=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Qt(t,e,n,r,o){if(ut.isFunction(r)){return r.call(this,e,n)}if(o){e=n}if(!ut.isString(e))return;if(ut.isString(r)){return e.indexOf(r)!==-1}if(ut.isRegExp(r)){return r.test(e)}}function Yt(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}function te(t,e){const n=ut.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,o){return this[r].call(this,e,t,n,o)},configurable:true})}))}class ee{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function o(t,e,n){const o=Wt(e);if(!o){throw new Error("header name must be a non-empty string")}const s=ut.findKey(r,o);if(!s||r[s]===undefined||n===true||n===undefined&&r[s]!==false){r[s||e]=Gt(t)}}const s=(t,e)=>ut.forEach(t,((t,n)=>o(t,n,e)));if(ut.isPlainObject(t)||t instanceof this.constructor){s(t,e)}else if(ut.isString(t)&&(t=t.trim())&&!Zt(t)){s(Kt(t),e)}else if(ut.isHeaders(t)){for(const[e,r]of t.entries()){o(r,e,n)}}else{t!=null&&o(e,t,n)}return this}get(t,e){t=Wt(t);if(t){const n=ut.findKey(this,t);if(n){const t=this[n];if(!e){return t}if(e===true){return Xt(t)}if(ut.isFunction(e)){return e.call(this,t,n)}if(ut.isRegExp(e)){return e.exec(t)}throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){t=Wt(t);if(t){const n=ut.findKey(this,t);return!!(n&&this[n]!==undefined&&(!e||Qt(this,this[n],n,e)))}return false}delete(t,e){const n=this;let r=false;function o(t){t=Wt(t);if(t){const o=ut.findKey(n,t);if(o&&(!e||Qt(n,n[o],o,e))){delete n[o];r=true}}}if(ut.isArray(t)){t.forEach(o)}else{o(t)}return r}clear(t){const e=Object.keys(this);let n=e.length;let r=false;while(n--){const o=e[n];if(!t||Qt(this,this[o],o,t,true)){delete this[o];r=true}}return r}normalize(t){const e=this;const n={};ut.forEach(this,((r,o)=>{const s=ut.findKey(n,o);if(s){e[s]=Gt(r);delete e[o];return}const i=t?Yt(o):String(o).trim();if(i!==o){delete e[o]}e[i]=Gt(r);n[i]=true}));return this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);ut.forEach(this,((n,r)=>{n!=null&&n!==false&&(e[r]=t&&ut.isArray(n)?n.join(", "):n)}));return e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);e.forEach((t=>n.set(t)));return n}static accessor(t){const e=this[Vt]=this[Vt]={accessors:{}};const n=e.accessors;const r=this.prototype;function o(t){const e=Wt(t);if(!n[e]){te(r,t);n[e]=true}}ut.isArray(t)?t.forEach(o):o(t);return this}}ee.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ut.reduceDescriptors(ee.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}}));ut.freezeMethods(ee);const ne=ee;function re(t,e){const n=this||$t;const r=e||n;const o=ne.from(r.headers);let s=r.data;ut.forEach(t,(function t(r){s=r.call(n,s,o.normalize(),e?e.status:undefined)}));o.normalize();return s}function oe(t){return!!(t&&t.__CANCEL__)}function se(t,e,n){at.call(this,t==null?"canceled":t,at.ERR_CANCELED,e,n);this.name="CanceledError"}ut.inherits(se,at,{__CANCEL__:true});function ie(t,e,n){const r=n.config.validateStatus;if(!n.status||!r||r(n.status)){t(n)}else{e(new at("Request failed with status code "+n.status,[at.ERR_BAD_REQUEST,at.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}}function ce(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ue(t,e){t=t||10;const n=new Array(t);const r=new Array(t);let o=0;let s=0;let i;e=e!==undefined?e:1e3;return function c(u){const a=Date.now();const f=r[s];if(!i){i=a}n[o]=u;r[o]=a;let l=s;let d=0;while(l!==o){d+=n[l++];l=l%t}o=(o+1)%t;if(o===s){s=(s+1)%t}if(a-i<e){return}const h=f&&a-f;return h?Math.round(d*1e3/h):undefined}}function ae(t,e){let n=0;let r=1e3/e;let o;let s;const i=(e,r=Date.now())=>{n=r;o=null;if(s){clearTimeout(s);s=null}t.apply(null,e)};const c=(...t)=>{const e=Date.now();const c=e-n;if(c>=r){i(t,e)}else{o=t;if(!s){s=setTimeout((()=>{s=null;i(o)}),r-c)}}};const u=()=>o&&i(o);return[c,u]}const fe=(t,e,n=3)=>{let r=0;const o=ue(50,250);return ae((n=>{const s=n.loaded;const i=n.lengthComputable?n.total:undefined;const c=s-r;const u=o(c);const a=s<=i;r=s;const f={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(f)}),n)};const le=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]};const de=t=>(...e)=>ut.asap((()=>t(...e)));const he=qt.hasStandardBrowserEnv?function t(){const e=qt.navigator&&/(msie|trident)/i.test(qt.navigator.userAgent);const n=document.createElement("a");let r;function o(t){let r=t;if(e){n.setAttribute("href",r);r=n.href}n.setAttribute("href",r);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}}r=o(window.location.href);return function t(e){const n=ut.isString(e)?o(e):e;return n.protocol===r.protocol&&n.host===r.host}}():function t(){return function t(){return true}}();const pe=qt.hasStandardBrowserEnv?{write(t,e,n,r,o,s){const i=[t+"="+encodeURIComponent(e)];ut.isNumber(n)&&i.push("expires="+new Date(n).toGMTString());ut.isString(r)&&i.push("path="+r);ut.isString(o)&&i.push("domain="+o);s===true&&i.push("secure");document.cookie=i.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function me(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function we(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function be(t,e){if(t&&!me(e)){return we(t,e)}return e}const ye=t=>t instanceof ne?{...t}:t;function ge(t,e){e=e||{};const n={};function r(t,e,n){if(ut.isPlainObject(t)&&ut.isPlainObject(e)){return ut.merge.call({caseless:n},t,e)}else if(ut.isPlainObject(e)){return ut.merge({},e)}else if(ut.isArray(e)){return e.slice()}return e}function o(t,e,n){if(!ut.isUndefined(e)){return r(t,e,n)}else if(!ut.isUndefined(t)){return r(undefined,t,n)}}function s(t,e){if(!ut.isUndefined(e)){return r(undefined,e)}}function i(t,e){if(!ut.isUndefined(e)){return r(undefined,e)}else if(!ut.isUndefined(t)){return r(undefined,t)}}function c(n,o,s){if(s in e){return r(n,o)}else if(s in t){return r(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)=>o(ye(t),ye(e),true)};ut.forEach(Object.keys(Object.assign({},t,e)),(function r(s){const i=u[s]||o;const a=i(t[s],e[s],s);ut.isUndefined(a)&&i!==c||(n[s]=a)}));return n}const Re=t=>{const e=ge({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:c}=e;e.headers=i=ne.from(i);e.url=St(be(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(ut.isFormData(n)){if(qt.hasStandardBrowserEnv||qt.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(qt.hasStandardBrowserEnv){r&&ut.isFunction(r)&&(r=r(e));if(r||r!==false&&he(e.url)){const t=o&&s&&pe.read(s);if(t){i.set(o,t)}}}return e};const Oe=typeof XMLHttpRequest!=="undefined";const Ee=Oe&&function(t){return new Promise((function e(n,r){const o=Re(t);let s=o.data;const i=ne.from(o.headers).normalize();let{responseType:c,onUploadProgress:u,onDownloadProgress:a}=o;let f;let l,d;let h,p;function m(){h&&h();p&&p();o.cancelToken&&o.cancelToken.unsubscribe(f);o.signal&&o.signal.removeEventListener("abort",f)}let w=new XMLHttpRequest;w.open(o.method.toUpperCase(),o.url,true);w.timeout=o.timeout;function b(){if(!w){return}const e=ne.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders());const o=!c||c==="text"||c==="json"?w.responseText:w.response;const s={data:o,status:w.status,statusText:w.statusText,headers:e,config:t,request:w};ie((function t(e){n(e);m()}),(function t(e){r(e);m()}),s);w=null}if("onloadend"in w){w.onloadend=b}else{w.onreadystatechange=function t(){if(!w||w.readyState!==4){return}if(w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)){return}setTimeout(b)}}w.onabort=function e(){if(!w){return}r(new at("Request aborted",at.ECONNABORTED,t,w));w=null};w.onerror=function e(){r(new at("Network Error",at.ERR_NETWORK,t,w));w=null};w.ontimeout=function e(){let n=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const s=o.transitional||jt;if(o.timeoutErrorMessage){n=o.timeoutErrorMessage}r(new at(n,s.clarifyTimeoutError?at.ETIMEDOUT:at.ECONNABORTED,t,w));w=null};s===undefined&&i.setContentType(null);if("setRequestHeader"in w){ut.forEach(i.toJSON(),(function t(e,n){w.setRequestHeader(n,e)}))}if(!ut.isUndefined(o.withCredentials)){w.withCredentials=!!o.withCredentials}if(c&&c!=="json"){w.responseType=o.responseType}if(a){[d,p]=fe(a,true);w.addEventListener("progress",d)}if(u&&w.upload){[l,h]=fe(u);w.upload.addEventListener("progress",l);w.upload.addEventListener("loadend",h)}if(o.cancelToken||o.signal){f=e=>{if(!w){return}r(!e||e.type?new se(null,t,w):e);w.abort();w=null};o.cancelToken&&o.cancelToken.subscribe(f);if(o.signal){o.signal.aborted?f():o.signal.addEventListener("abort",f)}}const y=ce(o.url);if(y&&qt.protocols.indexOf(y)===-1){r(new at("Unsupported protocol "+y+":",at.ERR_BAD_REQUEST,t));return}w.send(s||null)}))};const Se=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let n=new AbortController;let r;const o=function(t){if(!r){r=true;i();const e=t instanceof Error?t:this.reason;n.abort(e instanceof at?e:new se(e instanceof Error?e.message:e))}};let s=e&&setTimeout((()=>{s=null;o(new at(`timeout ${e} of ms exceeded`,at.ETIMEDOUT))}),e);const i=()=>{if(t){s&&clearTimeout(s);s=null;t.forEach((t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)}));t=null}};t.forEach((t=>t.addEventListener("abort",o)));const{signal:c}=n;c.unsubscribe=()=>ut.asap(i);return c}};const Te=Se;const Ae=function*(t,e){let n=t.byteLength;if(!e||n<e){yield t;return}let r=0;let o;while(r<n){o=r+e;yield t.slice(r,o);r=o}};const je=async function*(t,e){for await(const n of xe(t)){yield*Ae(n,e)}};const xe=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t){break}yield n}}finally{await e.cancel()}};const Ne=(t,e,n,r)=>{const o=je(t,e);let s=0;let i;let c=t=>{if(!i){i=true;r&&r(t)}};return new ReadableStream({async pull(t){try{const{done:e,value:r}=await o.next();if(e){c();t.close();return}let i=r.byteLength;if(n){let t=s+=i;n(t)}t.enqueue(new Uint8Array(r))}catch(t){c(t);throw t}},cancel(t){c(t);return o.return()}},{highWaterMark:2})};const Pe=typeof fetch==="function"&&typeof Request==="function"&&typeof Response==="function";const Ce=Pe&&typeof ReadableStream==="function";const Fe=Pe&&(typeof TextEncoder==="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer()));const ve=(t,...e)=>{try{return!!t(...e)}catch(t){return false}};const Be=Ce&&ve((()=>{let t=false;const e=new Request(qt.origin,{body:new ReadableStream,method:"POST",get duplex(){t=true;return"half"}}).headers.has("Content-Type");return t&&!e}));const Ue=64*1024;const De=Ce&&ve((()=>ut.isReadableStream(new Response("").body)));const _e={stream:De&&(t=>t.body)};Pe&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!_e[e]&&(_e[e]=ut.isFunction(t[e])?t=>t[e]():(t,n)=>{throw new at(`Response type '${e}' is not supported`,at.ERR_NOT_SUPPORT,n)})}))})(new Response);const qe=async t=>{if(t==null){return 0}if(ut.isBlob(t)){return t.size}if(ut.isSpecCompliantForm(t)){const e=new Request(qt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}if(ut.isArrayBufferView(t)||ut.isArrayBuffer(t)){return t.byteLength}if(ut.isURLSearchParams(t)){t=t+""}if(ut.isString(t)){return(await Fe(t)).byteLength}};const ke=async(t,e)=>{const n=ut.toFiniteNumber(t.getContentLength());return n==null?qe(e):n};const Le=Pe&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:c,onUploadProgress:u,responseType:a,headers:f,withCredentials:l="same-origin",fetchOptions:d}=Re(t);a=a?(a+"").toLowerCase():"text";let h=Te([o,s&&s.toAbortSignal()],i);let p;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let w;try{if(u&&Be&&n!=="get"&&n!=="head"&&(w=await ke(f,r))!==0){let t=new Request(e,{method:"POST",body:r,duplex:"half"});let n;if(ut.isFormData(r)&&(n=t.headers.get("content-type"))){f.setContentType(n)}if(t.body){const[e,n]=le(w,fe(de(u)));r=Ne(t.body,Ue,e,n)}}if(!ut.isString(l)){l=l?"include":"omit"}const o="credentials"in Request.prototype;p=new Request(e,{...d,signal:h,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:o?l:undefined});let s=await fetch(p);const i=De&&(a==="stream"||a==="response");if(De&&(c||i&&m)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=s[e]}));const e=ut.toFiniteNumber(s.headers.get("content-length"));const[n,r]=c&&le(e,fe(de(c),true))||[];s=new Response(Ne(s.body,Ue,n,(()=>{r&&r();m&&m()})),t)}a=a||"text";let b=await _e[ut.findKey(_e,a)||"text"](s,t);!i&&m&&m();return await new Promise(((e,n)=>{ie(e,n,{data:b,headers:ne.from(s.headers),status:s.status,statusText:s.statusText,config:t,request:p})}))}catch(e){m&&m();if(e&&e.name==="TypeError"&&/fetch/i.test(e.message)){throw Object.assign(new at("Network Error",at.ERR_NETWORK,t,p),{cause:e.cause||e})}throw at.from(e,e&&e.code,t,p)}});const Ie={http:dt,xhr:Ee,fetch:Le};ut.forEach(Ie,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Me=t=>`- ${t}`;const He=t=>ut.isFunction(t)||t===null||t===false;const ze={getAdapter:t=>{t=ut.isArray(t)?t:[t];const{length:e}=t;let n;let r;const o={};for(let s=0;s<e;s++){n=t[s];let e;r=n;if(!He(n)){r=Ie[(e=String(n)).toLowerCase()];if(r===undefined){throw new at(`Unknown adapter '${e}'`)}}if(r){break}o[e||"#"+s]=r}if(!r){const t=Object.entries(o).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(Me).join("\n"):" "+Me(t[0]):"as no adapter specified";throw new at(`There is no suitable adapter to dispatch the request `+n,"ERR_NOT_SUPPORT")}return r},adapters:Ie};function $e(t){if(t.cancelToken){t.cancelToken.throwIfRequested()}if(t.signal&&t.signal.aborted){throw new se(null,t)}}function Je(t){$e(t);t.headers=ne.from(t.headers);t.data=re.call(t,t.transformRequest);if(["post","put","patch"].indexOf(t.method)!==-1){t.headers.setContentType("application/x-www-form-urlencoded",false)}const e=ze.getAdapter(t.adapter||$t.adapter);return e(t).then((function e(n){$e(t);n.data=re.call(t,t.transformResponse,n);n.headers=ne.from(n.headers);return n}),(function e(n){if(!oe(n)){$e(t);if(n&&n.response){n.response.data=re.call(t,t.transformResponse,n.response);n.response.headers=ne.from(n.response.headers)}}return Promise.reject(n)}))}const Ke="1.7.7";const Ve={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Ve[t]=function n(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));const We={};Ve.transitional=function t(e,n,r){function o(t,e){return"[Axios v"+Ke+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(t,r,s)=>{if(e===false){throw new at(o(r," has been removed"+(n?" in "+n:"")),at.ERR_DEPRECATED)}if(n&&!We[r]){We[r]=true;console.warn(o(r," has been deprecated since v"+n+" and will be removed in the near future"))}return e?e(t,r,s):true}};function Ge(t,e,n){if(typeof t!=="object"){throw new at("options must be an object",at.ERR_BAD_OPTION_VALUE)}const r=Object.keys(t);let o=r.length;while(o-- >0){const s=r[o];const i=e[s];if(i){const e=t[s];const n=e===undefined||i(e,s,t);if(n!==true){throw new at("option "+s+" must be "+n,at.ERR_BAD_OPTION_VALUE)}continue}if(n!==true){throw new at("Unknown option "+s,at.ERR_BAD_OPTION)}}}const Xe={assertOptions:Ge,validators:Ve};const Ze=Xe.validators;class Qe{constructor(t){this.defaults=t;this.interceptors={request:new At,response:new At}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const n=e.stack?e.stack.replace(/^.+\n/,""):"";try{if(!t.stack){t.stack=n}else if(n&&!String(t.stack).endsWith(n.replace(/^.+\n.+\n/,""))){t.stack+="\n"+n}}catch(t){}}throw t}}_request(t,e){if(typeof t==="string"){e=e||{};e.url=t}else{e=t||{}}e=ge(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:o}=e;if(n!==undefined){Xe.assertOptions(n,{silentJSONParsing:Ze.transitional(Ze.boolean),forcedJSONParsing:Ze.transitional(Ze.boolean),clarifyTimeoutError:Ze.transitional(Ze.boolean)},false)}if(r!=null){if(ut.isFunction(r)){e.paramsSerializer={serialize:r}}else{Xe.assertOptions(r,{encode:Ze.function,serialize:Ze.function},true)}}e.method=(e.method||this.defaults.method||"get").toLowerCase();let s=o&&ut.merge(o.common,o[e.method]);o&&ut.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]}));e.headers=ne.concat(s,o);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 f=0;let l;if(!c){const t=[Je.bind(this),undefined];t.unshift.apply(t,i);t.push.apply(t,u);l=t.length;a=Promise.resolve(e);while(f<l){a=a.then(t[f++],t[f++])}return a}l=i.length;let d=e;f=0;while(f<l){const t=i[f++];const e=i[f++];try{d=t(d)}catch(t){e.call(this,t);break}}try{a=Je.call(this,d)}catch(t){return Promise.reject(t)}f=0;l=u.length;while(f<l){a=a.then(u[f++],u[f++])}return a}getUri(t){t=ge(this.defaults,t);const e=be(t.baseURL,t.url);return St(e,t.params,t.paramsSerializer)}}ut.forEach(["delete","get","head","options"],(function t(e){Qe.prototype[e]=function(t,n){return this.request(ge(n||{},{method:e,url:t,data:(n||{}).data}))}}));ut.forEach(["post","put","patch"],(function t(e){function n(t){return function n(r,o,s){return this.request(ge(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}Qe.prototype[e]=n();Qe.prototype[e+"Form"]=n(true)}));const Ye=Qe;class tn{constructor(t){if(typeof t!=="function"){throw new TypeError("executor must be a function.")}let e;this.promise=new Promise((function t(n){e=n}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;while(e-- >0){n._listeners[e](t)}n._listeners=null}));this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t);e=t})).then(t);r.cancel=function t(){n.unsubscribe(e)};return r};t((function t(r,o,s){if(n.reason){return}n.reason=new se(r,o,s);e(n.reason)}))}throwIfRequested(){if(this.reason){throw this.reason}}subscribe(t){if(this.reason){t(this.reason);return}if(this._listeners){this._listeners.push(t)}else{this._listeners=[t]}}unsubscribe(t){if(!this._listeners){return}const e=this._listeners.indexOf(t);if(e!==-1){this._listeners.splice(e,1)}}toAbortSignal(){const t=new AbortController;const e=e=>{t.abort(e)};this.subscribe(e);t.signal.unsubscribe=()=>this.unsubscribe(e);return t.signal}static source(){let t;const e=new tn((function e(n){t=n}));return{token:e,cancel:t}}}const en=tn;function nn(t){return function e(n){return t.apply(null,n)}}function rn(t){return ut.isObject(t)&&t.isAxiosError===true}const on={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(on).forEach((([t,e])=>{on[e]=t}));const sn=on;function cn(e){const n=new Ye(e);const r=t(Ye.prototype.request,n);ut.extend(r,Ye.prototype,n,{allOwnKeys:true});ut.extend(r,n,null,{allOwnKeys:true});r.create=function t(n){return cn(ge(e,n))};return r}const un=cn($t);un.Axios=Ye;un.CanceledError=se;un.CancelToken=en;un.isCancel=oe;un.VERSION=Ke;un.toFormData=yt;un.AxiosError=at;un.Cancel=un.CanceledError;un.all=function t(e){return Promise.all(e)};un.spread=nn;un.isAxiosError=rn;un.mergeConfig=ge;un.AxiosHeaders=ne;un.formToJSON=t=>Mt(ut.isHTMLForm(t)?new FormData(t):t);un.getAdapter=ze.getAdapter;un.HttpStatusCode=sn;un.default=un;const an=un;const fn="https://crmbonus-wake-hub-staging-5daedbc4e22b.herokuapp.com/api";class ln{constructor(){this.axiosInstance=an.create({baseURL:fn,headers:{"Content-Type":"application/json",accept:"application/json"}})}async getCustomer(t,e){const n=await this.axiosInstance.get(`/store/${e}/customer/${t}`,{headers:{"Content-Type":"application/json"}});console.log("response.data",n.data);return n.data}async updateOrder(t){const e=await this.axiosInstance.patch(`/checkouts/${t.cartId}/updateOrder`,{orderId:t.orderId,externalId:t.cartIdCrm},{headers:{"Content-Type":"application/json"}});console.log("response",e.data)}async sendPin(t,e,n){const r=await this.axiosInstance.post("/crmbonus/send-pin",{cellphone:t,name:e,storeName:n},{headers:{store:n}});return{storeId:r.data.storeId,userId:r.data.userId}}async validatePinBonus(t,e){console.log("[validatePinBonus]",t);const n=await this.axiosInstance.post("/crmbonus/process-pin-bonus",t,{headers:{store:e}});return n.data}async reserve(t){const e=await this.axiosInstance.post("/crmbonus/redeem-bonus",t);return e.data}async cancel(t,e){const n=await this.axiosInstance.post("/crmbonus/cancel-apply-bonus",{ticket:t},{headers:{store:e}});return n.data}}export{ln as C};
2
+ //# sourceMappingURL=p-aeaad64e.js.map