crmbonus-component-wake 2.1.20-homolog → 2.1.21-homolog-tray

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 (39) hide show
  1. package/dist/cjs/crm-bonus-tray.cjs.entry.js +18 -0
  2. package/dist/cjs/crm-bonus-tray.cjs.entry.js.map +1 -0
  3. package/dist/cjs/crm-giftback-form_2.cjs.entry.js +5 -5
  4. package/dist/cjs/crm-giftback-form_2.cjs.entry.js.map +1 -1
  5. package/dist/cjs/crmbonus-component-wake.cjs.js +1 -1
  6. package/dist/cjs/crmbonus.service-7a4f6786.js.map +1 -1
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/collection/collection-manifest.json +2 -1
  9. package/dist/collection/components/giftback-form/giftback-form.js +5 -5
  10. package/dist/collection/components/giftback-form/giftback-form.js.map +1 -1
  11. package/dist/collection/tray-ecommerce/crm-bonus-tray.js +8 -0
  12. package/dist/collection/tray-ecommerce/crm-bonus-tray.js.map +1 -0
  13. package/dist/components/crm-bonus-tray.d.ts +11 -0
  14. package/dist/components/crm-bonus-tray.js +32 -0
  15. package/dist/components/crm-bonus-tray.js.map +1 -0
  16. package/dist/components/crm-bonus.js +1 -1
  17. package/dist/components/crm-giftback-form.js +1 -1
  18. package/dist/components/p-a428d5df.js.map +1 -1
  19. package/dist/components/{p-f9372dc4.js → p-ec317fb9.js} +6 -6
  20. package/dist/components/{p-f9372dc4.js.map → p-ec317fb9.js.map} +1 -1
  21. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
  22. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
  23. package/dist/crmbonus-component-wake/p-4792c140.entry.js +2 -0
  24. package/dist/crmbonus-component-wake/p-4792c140.entry.js.map +1 -0
  25. package/dist/crmbonus-component-wake/p-a428d5df.js.map +1 -1
  26. package/dist/crmbonus-component-wake/{p-4cdd8038.entry.js → p-ed22d88f.entry.js} +2 -2
  27. package/dist/crmbonus-component-wake/p-ed22d88f.entry.js.map +1 -0
  28. package/dist/env.js.map +1 -1
  29. package/dist/esm/crm-bonus-tray.entry.js +14 -0
  30. package/dist/esm/crm-bonus-tray.entry.js.map +1 -0
  31. package/dist/esm/crm-giftback-form_2.entry.js +5 -5
  32. package/dist/esm/crm-giftback-form_2.entry.js.map +1 -1
  33. package/dist/esm/crmbonus-component-wake.js +1 -1
  34. package/dist/esm/crmbonus.service-0bd0a5ac.js.map +1 -1
  35. package/dist/esm/loader.js +1 -1
  36. package/dist/types/components.d.ts +13 -0
  37. package/dist/types/tray-ecommerce/crm-bonus-tray.d.ts +3 -0
  38. package/package.json +1 -1
  39. package/dist/crmbonus-component-wake/p-4cdd8038.entry.js.map +0 -1
@@ -254,11 +254,11 @@ const CrmBonus = /*@__PURE__*/ proxyCustomElement(class CrmBonus extends H {
254
254
  }
255
255
  render() {
256
256
  console.log("cartId", this.cartId);
257
- return (h("div", { key: 'aae6cd9a2d849d4e527d261baa1461ea28c9d912', class: "crm-container-form fbits-responsive-carrinho-desconto", style: this.customStyles }, h("label", { key: '8fd3be923b655331dae5483440a704a3967900ee', class: "crm-title" }, this.config.giftbackTitle), this.step === StepFormEnum.STEP_PHONE &&
258
- h("phone-form", { key: '152f66c6dabdba8551fed578e5336feab07dd27f', value: this.customer.phone, config: this.config, loading: this.loading, handlerSubmit: (phone) => this.handleSendPin(phone) }), this.step === StepFormEnum.STEP_PIN &&
259
- h("pin-form", { key: '4af74183630de5efa631aa38fa372137423abf05', config: this.config, phone: this.phone, cancel: () => this.changePhone(), resend: () => this.sendPin(), validate: (data) => this.validateBonus(data), loading: this.loading }, this.sucess && h("p", { key: 'c2d23017ae6fa8aa628e5a646f4589b2892eea12', class: "crm-message-info" }, this.sucess), this.error && h("p", { key: '1b906433ab7d97cf7363f7906a6a434fcc0b8b6e', class: "crm-message-error" }, this.error)), this.step === StepFormEnum.STEP_RESERVE &&
260
- h("giftback-info", { key: '3d85470e96bde46288e1196dad88064d1209e286', storeName: this.storeName, infoBonus: this.reservedInfo, config: this.config, loading: this.loading, cancel: () => this.handleCancel(), bonus: this.bonus, reserve: () => this.processBonus(), cartId: this.cartId }), this.step === StepFormEnum.STEP_NO_BONUS &&
261
- (h("div", { key: '2c96d402197e8d0cf1b1d3bddfcf84c955d4f6e3', class: "container-message" }, instance.t("noGiftback", { storename: this.config.giftbackTitle })))));
257
+ return (h("div", { key: '9bf7b12fff0d3a546ec65ad23a5d427f50f889b0', class: "crm-container-form fbits-responsive-carrinho-desconto", style: this.customStyles }, h("label", { key: '4f85edd446d41922947687f91de10eae6c575ac2', class: "crm-title" }, this.config.giftbackTitle), this.step === StepFormEnum.STEP_PHONE &&
258
+ h("phone-form", { key: '60bd8e8268061b113d8c07680276dcac8f2dc57f', value: this.customer.phone, config: this.config, loading: this.loading, handlerSubmit: (phone) => this.handleSendPin(phone) }), this.step === StepFormEnum.STEP_PIN &&
259
+ h("pin-form", { key: '2cafec0da8d445eb9fddaff2a6bb03b62d956ab3', config: this.config, phone: this.phone, cancel: () => this.changePhone(), resend: () => this.sendPin(), validate: (data) => this.validateBonus(data), loading: this.loading }, this.sucess && h("p", { key: '7a45765d3c7cf2009858b330ddaa4749de4238a6', class: "crm-message-info" }, this.sucess), this.error && h("p", { key: '2c5fdc1a7c8737b69f0f6d2d253a114089c6be60', class: "crm-message-error" }, this.error)), this.step === StepFormEnum.STEP_RESERVE &&
260
+ h("giftback-info", { key: '409d87bbbd48b510d18c2c85f99514a4a4a026f4', storeName: this.storeName, infoBonus: this.reservedInfo, config: this.config, loading: this.loading, cancel: () => this.handleCancel(), bonus: this.bonus, reserve: () => this.processBonus(), cartId: this.cartId }), this.step === StepFormEnum.STEP_NO_BONUS &&
261
+ (h("div", { key: '7d31c5b48add98eef78aee93d352067b4ca28302', class: "container-message" }, instance.t("noGiftback", { storename: this.config.giftbackTitle })))));
262
262
  }
263
263
  static get style() { return CrmGiftbackFormStyle0; }
264
264
  }, [0, "crm-giftback-form", {
@@ -341,4 +341,4 @@ defineCustomElement();
341
341
 
342
342
  export { CrmBonus as C, defineCustomElement as d };
343
343
 
344
- //# sourceMappingURL=p-f9372dc4.js.map
344
+ //# sourceMappingURL=p-ec317fb9.js.map
@@ -1 +1 @@
1
- {"file":"p-f9372dc4.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,k3BAAk3B,CAAC;AAC34B,8BAAe,eAAe;;MCgBjB,QAAQ;;;;;QAGX,oBAAe,GAAoB,eAAe,CAAC,WAAW,EAAE,CAAC;;;;;;;;;;uBAa7C,KAAK;;;;oBAIH,YAAY,CAAC,YAAY;;sBAG7B,EAAE;qBACH,EAAE;;6BAEF,KAAK;;IAG9B,MAAM,OAAO,CAAC,IAAkB;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;KACjB;IAGD,MAAM,YAAY,CAAC,WAAuB,EAAE,EAAE,aAAa,GAAG,KAAK;QACjE,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;QACzB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QAEjB,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;QAC/B,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;SAC1B;QAED,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAExE,IAAI,MAAM,EAAE;YAEV,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;YAEhC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YAEnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;YACzB,IAAI,CAAC,OAAO,GAAG;gBACb,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,MAAM,EAAE,KAAK,CAAC,MAAM;aACrB,CAAA;YAED,MAAM,IAAI,CAAC,aAAa,CAA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ACE,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,MAAM,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,EAChC,MAAM,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,EAC5B,QAAQ,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAC5C,OAAO,EAAE,IAAI,CAAC,OAAO,IAEpB,IAAI,CAAC,MAAM,IAAI,0DAAG,KAAK,EAAC,kBAAkB,IAAE,IAAI,CAAC,MAAM,CAAK,EAC5D,IAAI,CAAC,KAAK,IAAI,0DAAG,KAAK,EAAC,mBAAmB,IAAE,IAAI,CAAC,KAAK,CAAK,CAEnD,EAIX,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,YAAY;YACvC,sEACE,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,SAAS,EAAE,IAAI,CAAC,YAAY,EAC5B,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,MAAM,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,EACjC,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,EAClC,MAAM,EAAE,IAAI,CAAC,MAAM,GACnB,EAIF,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,aAAa;aAEtC,4DAAK,KAAK,EAAC,mBAAmB,IAC3BA,QAAO,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAC9D,CACP,CAGC,EACP;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18next"],"sources":["src/components/giftback-form/giftback-form.css?tag=crm-giftback-form","src/components/giftback-form/giftback-form.tsx"],"sourcesContent":["* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n /* font-size: var(--crmfont-sizebodymd); */\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n /* font-size: 14px; */\n font-size: .875rem;\n line-height: 1.25rem;\n \n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n /* font-size: 16px; */\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n /* font-size: 12px; */\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n /* font-size: 12px; */\n}","import { Component, Method, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { StepFormEnum } from \"../../contants\";\nimport { IPinSent } from '../../dto/pin.sent'\nimport { IBonus, ICustomer, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport i18next from \"../../i18n/i18n\"\nimport { USED_KEY, getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport { persisteMetadata } from \"../../helpers/cart.helper\";\nimport { ReservedInfoDTO } from \"../../dto/reserved-info.dto\";\n\n@Component({\n tag: 'crm-giftback-form',\n styleUrl: 'giftback-form.css',\n shadow: false\n})\nexport class CrmBonus {\n // private phoneInputMask: HTMLPhoneFormElement;\n\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n @Prop() customer: ICustomer;\n @Prop() loadProducts: () => void;\n @Prop() loadAll: () => void;\n\n @Prop() customStyles;\n @Prop() reservedInfo: ReservedInfoDTO;\n\n @State() value: string;\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: string;\n @State() pinInfo: IPinSent;\n @State() step: StepFormEnum = StepFormEnum.STEP_RESERVE;\n @State() bonus: IBonus;\n\n @State() sucess: string = \"\";\n @State() error: string = \"\";\n @State() config: IInfoStore;\n @State() hasApplyBonus = false;\n\n @Method()\n async setStep(step: StepFormEnum) {\n this.step = step\n }\n\n @Method()\n async processBonus(products: IProduct[] = [], hasNewProduct = false) {\n await this.loadProducts()\n this.sucess = \"\";\n\n console.log('processBonus', [])\n if (hasNewProduct) {\n this.products = products;\n }\n\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n if (_bonus) {\n\n const bonus = JSON.parse(_bonus)\n\n this.bonus = bonus;\n\n this.phone = bonus.phone;\n this.pinInfo = {\n storeId: bonus.storeId,\n userId: bonus.userId\n }\n\n await this.validateBonus(\"2018\");\n //this.step = StepFormEnum.STEP_RESERVE;\n\n }\n }\n\n async handleSendPin(phone: string) {\n await this.loadAll()\n this.message = \"\"\n if (!phone) {\n this.message = \"Informe seu telefone\";\n return;\n }\n\n this.phone = phone;\n\n this.sendPin();\n }\n\n async componentWillLoad() {\n this.sucess = \"\";\n this.error = \"\"\n this.config = getInfoCustomization(this.storeName);\n\n const phoneAgain = this.getPhoneNumberAgain();\n\n if (phoneAgain) {\n this.step = StepFormEnum.STEP_PHONE;\n return\n }\n\n await this.processBonus();\n\n }\n\n getPhoneNumberAgain() {\n const consulta_bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n if (!consulta_bonus) return true;\n\n const bonus = JSON.parse(consulta_bonus);\n\n return !bonus.hasBonus;\n }\n\n private convertStringToNumber(): number {\n const _phone = this.phone.replace(/\\D/g, '');\n return Number(_phone);\n }\n\n public async sendPin() {\n this.loading = true;\n this.message = \"\";\n this.sucess = \"\";\n this.error = \"\"\n\n try {\n\n const _phone = this.convertStringToNumber();\n const pinInfoCache = localStorage.getItem(`bc:${this.phone}`);\n\n if (!pinInfoCache) {\n this.pinInfo = await this.crmBonusService.sendPin(_phone, this.customer?.name, this.storeName);\n }\n\n if (pinInfoCache) {\n\n const bonus = JSON.parse(pinInfoCache);\n\n this.pinInfo = {\n storeId: bonus.storeId,\n userId: bonus.userId\n }\n\n await this.validateBonus(\"2018\");\n this.step = StepFormEnum.STEP_RESERVE;\n } else {\n this.step = StepFormEnum.STEP_PIN;\n }\n\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n changePhone() {\n this.sucess = \"\";\n this.error = \"\"\n this.step = StepFormEnum.STEP_PHONE;\n }\n\n public async validateBonus(pin: string) {\n\n await this.loadProducts();\n\n const used_or_no = localStorage.getItem(USED_KEY);\n\n if (used_or_no == \"dontUse\") {\n this.step = StepFormEnum.STEP_RESERVE;\n return\n }\n\n this.loading = true;\n this.sucess = \"\";\n this.error = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.convertStringToNumber(),\n storeId: this.pinInfo.storeId.toString(),\n userId: this.pinInfo.userId.toString(),\n checkoutId: this.cartId,\n checkoutProducts: this.products,\n name: this.customer?.name,\n storeName: this.storeName\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload);\n\n if (!this.bonus.hasBonus) {\n\n localStorage.setItem(getKeyReserveByCartId(this.cartId), JSON.stringify({ ...this.bonus, phone: this.phone }));\n\n this.loading = false;\n this.step = StepFormEnum.STEP_NO_BONUS;\n return\n }\n\n this.sucess = \"Código validado com sucesso!\";\n localStorage.setItem(getKeyReserveByCartId(this.cartId), JSON.stringify({ ...this.bonus, phone: this.phone }));\n localStorage.setItem(`bc:${this.phone}`, JSON.stringify(this.bonus));\n\n localStorage.setItem(USED_KEY, \"use\");\n localStorage.setItem(this.cartId, this.bonus.bonusBalance.toString());\n\n await this.updateMetadata();\n\n this.step = StepFormEnum.STEP_RESERVE;\n\n } catch (error) {\n const _error: string = error?.response?.data?.response;\n\n if (_error && _error.includes(\"Pin\")) {\n this.error = \"Código inválido!\"\n } else {\n this.error = _error;\n this.step = StepFormEnum.STEP_NO_BONUS;\n }\n } finally {\n this.loading = false;\n }\n }\n\n private async updateMetadata() {\n try {\n\n if(!this.reservedInfo.isBonusProcessed) return;\n\n if (this.reservedInfo.isExpired()) {\n console.log('[CRM:updateMetadata]')\n await persisteMetadata(this.storeName, this.cartId, {\n createdAt: Date.now(),\n url: window.location.href\n });\n\n localStorage.removeItem(\"bc:time\");\n }\n } catch (error) {\n console.error('[CRMBONUS:updateMetadata]: ', error);\n }\n }\n\n public handleCancel() {\n // this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n async cancel() {\n this.message = \"\";\n this.loading = true;\n try {\n await this.crmBonusService.cancel(this.cartId);\n\n localStorage.setItem(USED_KEY, \"dontUse\");\n this.save(0)\n await this.updateMetadata();\n } catch (error) {\n this.message = \"Não consegui cancelar o bônus, tente novamente!\"\n } finally {\n this.loading = false;\n }\n }\n\n public async reserveApply(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.reserve(amount);\n this.save(amount);\n\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n\n this.step = StepFormEnum.STEP_NO_BONUS;\n localStorage.removeItem(this.cartId);\n } finally {\n this.loading = false;\n }\n }\n\n save(amount: number) {\n localStorage.setItem(this.cartId, amount.toString());\n }\n\n public async reserve(amount: number) {\n\n await this.crmBonusService.reserve({\n redeemedBonus: amount,\n cartId: this.cartId,\n ticket: this.cartId,\n grossValue: Number(this.bonus.totalValue),\n storeName: this.storeName,\n storeId: this.bonus.storeId.toString(),\n userId: this.bonus.userId\n });\n }\n\n render() {\n console.log(\"cartId\", this.cartId)\n return (\n <div class=\"crm-container-form fbits-responsive-carrinho-desconto\" style={this.customStyles} >\n\n {/* <loading-container /> */}\n\n <label class=\"crm-title\">{this.config.giftbackTitle}</label>\n\n {this.step === StepFormEnum.STEP_PHONE &&\n <phone-form\n value={this.customer.phone}\n config={this.config}\n loading={this.loading}\n handlerSubmit={(phone) => this.handleSendPin(phone)}\n />}\n {\n this.step === StepFormEnum.STEP_PIN &&\n <pin-form\n config={this.config}\n phone={this.phone}\n cancel={() => this.changePhone()}\n resend={() => this.sendPin()}\n validate={(data) => this.validateBonus(data)}\n loading={this.loading}\n >\n {this.sucess && <p class=\"crm-message-info\">{this.sucess}</p>}\n {this.error && <p class=\"crm-message-error\">{this.error}</p>}\n\n </pin-form>\n }\n\n {\n this.step === StepFormEnum.STEP_RESERVE &&\n <giftback-info\n storeName={this.storeName}\n infoBonus={this.reservedInfo}\n config={this.config}\n loading={this.loading}\n cancel={() => this.handleCancel()}\n bonus={this.bonus}\n reserve={() => this.processBonus()}\n cartId={this.cartId}\n />\n }\n\n {\n this.step === StepFormEnum.STEP_NO_BONUS &&\n (\n <div class=\"container-message\">\n {i18next.t(\"noGiftback\", { storename: this.config.giftbackTitle })}\n </div>\n )\n\n }\n </div>\n )\n }\n}"],"version":3}
1
+ {"file":"p-ec317fb9.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,k3BAAk3B,CAAC;AAC34B,8BAAe,eAAe;;MCgBjB,QAAQ;;;;;QAGX,oBAAe,GAAoB,eAAe,CAAC,WAAW,EAAE,CAAC;;;;;;;;;;uBAa7C,KAAK;;;;oBAIH,YAAY,CAAC,YAAY;;sBAG7B,EAAE;qBACH,EAAE;;6BAEF,KAAK;;IAG9B,MAAM,OAAO,CA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AK,CAEnD,EAIX,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,YAAY;YACvC,sEACE,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,SAAS,EAAE,IAAI,CAAC,YAAY,EAC5B,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,MAAM,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,EACjC,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,EAClC,MAAM,EAAE,IAAI,CAAC,MAAM,GACnB,EAIF,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,aAAa;aAEtC,4DAAK,KAAK,EAAC,mBAAmB,IAC3BA,QAAO,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAC9D,CACP,CAGC,EACP;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18next"],"sources":["src/components/giftback-form/giftback-form.css?tag=crm-giftback-form","src/components/giftback-form/giftback-form.tsx"],"sourcesContent":["* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n /* font-size: var(--crmfont-sizebodymd); */\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n /* font-size: 14px; */\n font-size: .875rem;\n line-height: 1.25rem;\n \n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n /* font-size: 16px; */\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n /* font-size: 12px; */\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n /* font-size: 12px; */\n}","import { Component, Method, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { StepFormEnum } from \"../../contants\";\nimport { IPinSent } from '../../dto/pin.sent'\nimport { IBonus, ICustomer, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport i18next from \"../../i18n/i18n\"\nimport { USED_KEY, getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport { persisteMetadata } from \"../../helpers/cart.helper\";\nimport { ReservedInfoDTO } from \"../../dto/reserved-info.dto\";\n\n@Component({\n tag: 'crm-giftback-form',\n styleUrl: 'giftback-form.css',\n shadow: false\n})\nexport class CrmBonus {\n // private phoneInputMask: HTMLPhoneFormElement;\n\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n @Prop() customer: ICustomer;\n @Prop() loadProducts: () => void;\n @Prop() loadAll: () => void;\n\n @Prop() customStyles;\n @Prop() reservedInfo: ReservedInfoDTO;\n\n @State() value: string;\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: string;\n @State() pinInfo: IPinSent;\n @State() step: StepFormEnum = StepFormEnum.STEP_RESERVE;\n @State() bonus: IBonus;\n\n @State() sucess: string = \"\";\n @State() error: string = \"\";\n @State() config: IInfoStore;\n @State() hasApplyBonus = false;\n\n @Method()\n async setStep(step: StepFormEnum) {\n this.step = step\n }\n\n @Method()\n async processBonus(products: IProduct[] = [], hasNewProduct = false) {\n await this.loadProducts();\n this.sucess = \"\";\n\n console.log('processBonus', [])\n if (hasNewProduct) {\n this.products = products;\n }\n\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n if (_bonus) {\n\n const bonus = JSON.parse(_bonus)\n\n this.bonus = bonus;\n\n this.phone = bonus.phone;\n this.pinInfo = {\n storeId: bonus.storeId,\n userId: bonus.userId\n }\n\n \n\n await this.validateBonus(\"2018\");\n //this.step = StepFormEnum.STEP_RESERVE;\n\n }\n }\n\n async handleSendPin(phone: string) {\n await this.loadAll()\n this.message = \"\"\n if (!phone) {\n this.message = \"Informe seu telefone\";\n return;\n }\n\n this.phone = phone;\n\n this.sendPin();\n }\n\n async componentWillLoad() {\n this.sucess = \"\";\n this.error = \"\"\n this.config = getInfoCustomization(this.storeName);\n\n const phoneAgain = this.getPhoneNumberAgain();\n\n if (phoneAgain) {\n this.step = StepFormEnum.STEP_PHONE;\n return\n }\n\n await this.processBonus();\n\n }\n\n getPhoneNumberAgain() {\n const consulta_bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n if (!consulta_bonus) return true;\n\n const bonus = JSON.parse(consulta_bonus);\n\n return !bonus.hasBonus;\n }\n\n private convertStringToNumber(): number {\n const _phone = this.phone.replace(/\\D/g, '');\n return Number(_phone);\n }\n\n public async sendPin() {\n this.loading = true;\n this.message = \"\";\n this.sucess = \"\";\n this.error = \"\"\n\n try {\n\n const _phone = this.convertStringToNumber();\n const pinInfoCache = localStorage.getItem(`bc:${this.phone}`);\n\n if (!pinInfoCache) {\n this.pinInfo = await this.crmBonusService.sendPin(_phone, this.customer?.name, this.storeName);\n }\n\n if (pinInfoCache) {\n\n const bonus = JSON.parse(pinInfoCache);\n\n this.pinInfo = {\n storeId: bonus.storeId,\n userId: bonus.userId\n }\n\n await this.validateBonus(\"2018\");\n this.step = StepFormEnum.STEP_RESERVE;\n } else {\n this.step = StepFormEnum.STEP_PIN;\n }\n\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n changePhone() {\n this.sucess = \"\";\n this.error = \"\"\n this.step = StepFormEnum.STEP_PHONE;\n }\n\n public async validateBonus(pin: string) {\n\n await this.loadProducts();\n\n const used_or_no = localStorage.getItem(USED_KEY);\n\n if (used_or_no == \"dontUse\") {\n this.step = StepFormEnum.STEP_RESERVE;\n return\n }\n\n this.loading = true;\n this.sucess = \"\";\n this.error = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.convertStringToNumber(),\n storeId: this.pinInfo.storeId.toString(),\n userId: this.pinInfo.userId.toString(),\n checkoutId: this.cartId,\n checkoutProducts: this.products,\n name: this.customer?.name,\n storeName: this.storeName\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload);\n\n if (!this.bonus.hasBonus) {\n\n localStorage.setItem(getKeyReserveByCartId(this.cartId), JSON.stringify({ ...this.bonus, phone: this.phone }));\n\n this.loading = false;\n this.step = StepFormEnum.STEP_NO_BONUS;\n return\n }\n\n this.sucess = \"Código validado com sucesso!\";\n localStorage.setItem(getKeyReserveByCartId(this.cartId), JSON.stringify({ ...this.bonus, phone: this.phone }));\n localStorage.setItem(`bc:${this.phone}`, JSON.stringify(this.bonus));\n\n localStorage.setItem(USED_KEY, \"use\");\n localStorage.setItem(this.cartId, this.bonus.bonusBalance.toString());\n\n await this.updateMetadata();\n\n this.step = StepFormEnum.STEP_RESERVE;\n\n } catch (error) {\n const _error: string = error?.response?.data?.response;\n\n if (_error && _error.includes(\"Pin\")) {\n this.error = \"Código inválido!\"\n } else {\n this.error = _error;\n this.step = StepFormEnum.STEP_NO_BONUS;\n }\n } finally {\n this.loading = false;\n }\n }\n\n private async updateMetadata() {\n try {\n\n if(!this.reservedInfo.isBonusProcessed) return;\n\n if (this.reservedInfo.isExpired()) {\n console.log('[CRM:updateMetadata]')\n await persisteMetadata(this.storeName, this.cartId, {\n createdAt: Date.now(),\n url: window.location.href\n });\n\n localStorage.removeItem(\"bc:time\");\n }\n } catch (error) {\n console.error('[CRMBONUS:updateMetadata]: ', error);\n }\n }\n\n public handleCancel() {\n // this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n async cancel() {\n this.message = \"\";\n this.loading = true;\n try {\n await this.crmBonusService.cancel(this.cartId);\n\n localStorage.setItem(USED_KEY, \"dontUse\");\n this.save(0)\n await this.updateMetadata();\n } catch (error) {\n this.message = \"Não consegui cancelar o bônus, tente novamente!\"\n } finally {\n this.loading = false;\n }\n }\n\n public async reserveApply(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.reserve(amount);\n this.save(amount);\n\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n\n this.step = StepFormEnum.STEP_NO_BONUS;\n localStorage.removeItem(this.cartId);\n } finally {\n this.loading = false;\n }\n }\n\n save(amount: number) {\n localStorage.setItem(this.cartId, amount.toString());\n }\n\n public async reserve(amount: number) {\n\n await this.crmBonusService.reserve({\n redeemedBonus: amount,\n cartId: this.cartId,\n ticket: this.cartId,\n grossValue: Number(this.bonus.totalValue),\n storeName: this.storeName,\n storeId: this.bonus.storeId.toString(),\n userId: this.bonus.userId\n });\n }\n\n render() {\n console.log(\"cartId\", this.cartId)\n return (\n <div class=\"crm-container-form fbits-responsive-carrinho-desconto\" style={this.customStyles} >\n\n {/* <loading-container /> */}\n\n <label class=\"crm-title\">{this.config.giftbackTitle}</label>\n\n {this.step === StepFormEnum.STEP_PHONE &&\n <phone-form\n value={this.customer.phone}\n config={this.config}\n loading={this.loading}\n handlerSubmit={(phone) => this.handleSendPin(phone)}\n />}\n {\n this.step === StepFormEnum.STEP_PIN &&\n <pin-form\n config={this.config}\n phone={this.phone}\n cancel={() => this.changePhone()}\n resend={() => this.sendPin()}\n validate={(data) => this.validateBonus(data)}\n loading={this.loading}\n >\n {this.sucess && <p class=\"crm-message-info\">{this.sucess}</p>}\n {this.error && <p class=\"crm-message-error\">{this.error}</p>}\n\n </pin-form>\n }\n\n {\n this.step === StepFormEnum.STEP_RESERVE &&\n <giftback-info\n storeName={this.storeName}\n infoBonus={this.reservedInfo}\n config={this.config}\n loading={this.loading}\n cancel={() => this.handleCancel()}\n bonus={this.bonus}\n reserve={() => this.processBonus()}\n cartId={this.cartId}\n />\n }\n\n {\n this.step === StepFormEnum.STEP_NO_BONUS &&\n (\n <div class=\"container-message\">\n {i18next.t(\"noGiftback\", { storename: this.config.giftbackTitle })}\n </div>\n )\n\n }\n </div>\n )\n }\n}"],"version":3}
@@ -1,2 +1,2 @@
1
- import{p as e,b as n}from"./p-8c362346.js";export{s as setNonce}from"./p-8c362346.js";import{g as o}from"./p-e1255160.js";var a=()=>{const n=import.meta.url;const o={};if(n!==""){o.resourcesUrl=new URL(".",n).href}return e(o)};a().then((async e=>{await o();return n([["p-0055876c",[[1,"crm-bonus",{cart:[8],showModal:[32],cartWake:[32],customer:[32],loading:[32],message:[32],phone:[32],canCancel:[32],amountCancel:[32],sent:[32],session:[32],loading_reprocess:[32],styles:[32],reservedInfo:[32],resetBonus:[64],setloading:[64],reprocess:[64]}]]],["p-35b95848",[[1,"crm-bonus-form",{storeName:[8,"storename"],cartId:[8,"cart-id"],products:[16],customer:[16],sent:[16],stepNext:[2,"step-next"],phone:[2],loadingModal:[4,"loading-modal"],saveStore:[16],cancel:[16],handleCustomerName:[16],loading:[32],step:[32],message:[32],bonus:[32],setStep:[64]}]]],["p-53b6a7e8",[[1,"phone-cancel-input",{sendPin:[16],loading:[4],value:[1]}]]],["p-1b0969ff",[[1,"phone-input",{sendPin:[16],loading:[4],value:[1]}]]],["p-8e2d6659",[[0,"crm-bonus-note",{cart:[8],cartWake:[32],url:[32],config:[32],bonus:[32],showEdit:[32],styles:[32],info:[32]}]]],["p-e4aae2ed",[[1,"app-modal",{isOpen:[516,"is-open"],modalTitle:[1,"modal-title"]}]]],["p-0a40bcba",[[1,"countdown-timer-v2",{downtime:[16],reload:[4],dates:[16],seconds:[32],minutes:[32]}]]],["p-b2941d60",[[0,"pedido-finalizado",{cart:[8]}]]],["p-cc754208",[[0,"crm-button",{txtBtn:[1,"txt-btn"],loading:[4],handleClick:[16]}]]],["p-5aa35e0f",[[0,"countdown-timer",{downtime:[16],dataCriacao:[1,"data-criacao"],minutos:[2],segundos:[2],tempoRestante:[32]}]]],["p-154b5318",[[1,"phone-input-mask",{initialValue:[1,"initial-value"],disabled:[4],phone:[32],message:[32],getPhone:[64]}]]],["p-77d8e96c",[[1,"loading-spinner",{size:[1],color:[1]}]]],["p-81ec64ff",[[0,"phone-form",{value:[1],loading:[4],handlerSubmit:[16],config:[16]}],[1,"pin-form",{validate:[16],cancel:[16],resend:[16],sent:[16],loading:[4],phone:[1],config:[16],pin:[32],isVerified:[32],canResend:[32]}],[0,"giftback-info",{cartId:[8,"cart-id"],loading:[4],bonus:[16],reserve:[16],cancel:[16],config:[16],infoBonus:[16],storeName:[1,"store-name"],usedValue:[32],selectedOption:[32],sliderPosition:[32],sliderValuePosition:[32],loadingTime:[32]},null,{bonus:["changedBonus"]}],[0,"crm-tooltip",{text:[1],identity:[1]}]]],["p-4cdd8038",[[0,"crm-giftback-form",{storeName:[8,"storename"],cartId:[8,"cart-id"],products:[16],customer:[16],loadProducts:[16],loadAll:[16],customStyles:[8,"custom-styles"],reservedInfo:[16],value:[32],loading:[32],message:[32],phone:[32],pinInfo:[32],step:[32],bonus:[32],sucess:[32],error:[32],config:[32],hasApplyBonus:[32],setStep:[64],processBonus:[64]}],[4,"loading-container",{loading:[4]}]]],["p-bcb65b4e",[[1,"giftback-pin",{sent:[16],validate:[16],cancel:[16],loading:[4],pin:[32],isVerified:[32]}],[1,"giftback-progress",{loading:[4],bonus:[16],reserve:[16],cancel:[16],usedValue:[32]}],[1,"name-input",{value:[1],loading:[4],applyName:[16],cancel:[16],newValue:[32],message:[32]}],[1,"giftback-finish"]]]],e)}));
1
+ import{p as e,b as n}from"./p-8c362346.js";export{s as setNonce}from"./p-8c362346.js";import{g as o}from"./p-e1255160.js";var a=()=>{const n=import.meta.url;const o={};if(n!==""){o.resourcesUrl=new URL(".",n).href}return e(o)};a().then((async e=>{await o();return n([["p-0055876c",[[1,"crm-bonus",{cart:[8],showModal:[32],cartWake:[32],customer:[32],loading:[32],message:[32],phone:[32],canCancel:[32],amountCancel:[32],sent:[32],session:[32],loading_reprocess:[32],styles:[32],reservedInfo:[32],resetBonus:[64],setloading:[64],reprocess:[64]}]]],["p-35b95848",[[1,"crm-bonus-form",{storeName:[8,"storename"],cartId:[8,"cart-id"],products:[16],customer:[16],sent:[16],stepNext:[2,"step-next"],phone:[2],loadingModal:[4,"loading-modal"],saveStore:[16],cancel:[16],handleCustomerName:[16],loading:[32],step:[32],message:[32],bonus:[32],setStep:[64]}]]],["p-53b6a7e8",[[1,"phone-cancel-input",{sendPin:[16],loading:[4],value:[1]}]]],["p-1b0969ff",[[1,"phone-input",{sendPin:[16],loading:[4],value:[1]}]]],["p-8e2d6659",[[0,"crm-bonus-note",{cart:[8],cartWake:[32],url:[32],config:[32],bonus:[32],showEdit:[32],styles:[32],info:[32]}]]],["p-e4aae2ed",[[1,"app-modal",{isOpen:[516,"is-open"],modalTitle:[1,"modal-title"]}]]],["p-0a40bcba",[[1,"countdown-timer-v2",{downtime:[16],reload:[4],dates:[16],seconds:[32],minutes:[32]}]]],["p-4792c140",[[0,"crm-bonus-tray"]]],["p-b2941d60",[[0,"pedido-finalizado",{cart:[8]}]]],["p-cc754208",[[0,"crm-button",{txtBtn:[1,"txt-btn"],loading:[4],handleClick:[16]}]]],["p-5aa35e0f",[[0,"countdown-timer",{downtime:[16],dataCriacao:[1,"data-criacao"],minutos:[2],segundos:[2],tempoRestante:[32]}]]],["p-154b5318",[[1,"phone-input-mask",{initialValue:[1,"initial-value"],disabled:[4],phone:[32],message:[32],getPhone:[64]}]]],["p-77d8e96c",[[1,"loading-spinner",{size:[1],color:[1]}]]],["p-ed22d88f",[[0,"crm-giftback-form",{storeName:[8,"storename"],cartId:[8,"cart-id"],products:[16],customer:[16],loadProducts:[16],loadAll:[16],customStyles:[8,"custom-styles"],reservedInfo:[16],value:[32],loading:[32],message:[32],phone:[32],pinInfo:[32],step:[32],bonus:[32],sucess:[32],error:[32],config:[32],hasApplyBonus:[32],setStep:[64],processBonus:[64]}],[4,"loading-container",{loading:[4]}]]],["p-bcb65b4e",[[1,"giftback-pin",{sent:[16],validate:[16],cancel:[16],loading:[4],pin:[32],isVerified:[32]}],[1,"giftback-progress",{loading:[4],bonus:[16],reserve:[16],cancel:[16],usedValue:[32]}],[1,"name-input",{value:[1],loading:[4],applyName:[16],cancel:[16],newValue:[32],message:[32]}],[1,"giftback-finish"]]],["p-81ec64ff",[[0,"phone-form",{value:[1],loading:[4],handlerSubmit:[16],config:[16]}],[1,"pin-form",{validate:[16],cancel:[16],resend:[16],sent:[16],loading:[4],phone:[1],config:[16],pin:[32],isVerified:[32],canResend:[32]}],[0,"giftback-info",{cartId:[8,"cart-id"],loading:[4],bonus:[16],reserve:[16],cancel:[16],config:[16],infoBonus:[16],storeName:[1,"store-name"],usedValue:[32],selectedOption:[32],sliderPosition:[32],sliderValuePosition:[32],loadingTime:[32]},null,{bonus:["changedBonus"]}],[0,"crm-tooltip",{text:[1],identity:[1]}]]]],e)}));
2
2
  //# sourceMappingURL=crmbonus-component-wake.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","async","options","globalScripts","bootstrapLazy","cart","showModal","cartWake","customer","loading","message","phone","canCancel","amountCancel","sent","session","loading_reprocess","styles","reservedInfo","resetBonus","setloading","reprocess","storeName","cartId","products","stepNext","loadingModal","saveStore","cancel","handleCustomerName","step","bonus","setStep","sendPin","value","config","showEdit","info","isOpen","modalTitle","downtime","reload","dates","seconds","minutes","txtBtn","handleClick","dataCriacao","minutos","segundos","tempoRestante","initialValue","disabled","getPhone","size","color","handlerSubmit","validate","resend","pin","isVerified","canResend","reserve","infoBonus","usedValue","selectedOption","sliderPosition","sliderValuePosition","loadingTime","text","identity","loadProducts","loadAll","customStyles","pinInfo","sucess","error","hasApplyBonus","processBonus","applyName","newValue"],"sources":["node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.22.2 | MIT Licensed | https://stenciljs.com\n */\n\n// src/client/client-patch-browser.ts\nimport { BUILD, NAMESPACE } from \"@stencil/core/internal/app-data\";\nimport { consoleDevInfo, doc, H, promiseResolve } from \"@stencil/core\";\nvar patchBrowser = () => {\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo(\"Running in development mode.\");\n }\n if (BUILD.cloneNodeFix) {\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts ? Array.from(doc.querySelectorAll(\"script\")).find(\n (s) => new RegExp(`/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) || s.getAttribute(\"data-stencil-namespace\") === NAMESPACE\n ) : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})[\"data-opts\"] || {} : {};\n if (importMeta !== \"\") {\n opts.resourcesUrl = new URL(\".\", importMeta).href;\n }\n return promiseResolve(opts);\n};\nvar patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function(deep) {\n if (this.nodeName === \"TEMPLATE\") {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport {\n patchBrowser\n};\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(async (options) => {\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"0HAOA,IAAIA,EAAe,KAUjB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACrBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACjD,CACE,OAAOC,EAAeJ,EAAK,EClB7BH,IAAeQ,MAAKC,MAAOC,UACnBC,IACN,OAAOC,EAAc,+BAA8B,CAAAC,KAAS,IAAAC,UAAA,KAAAC,SAAA,KAAAC,SAAA,KAAAC,QAAA,KAAAC,QAAA,KAAAC,MAAA,KAAAC,UAAA,KAAAC,aAAA,KAAAC,KAAA,KAAAC,QAAA,KAAAC,kBAAA,KAAAC,OAAA,KAAAC,aAAA,KAAAC,WAAA,KAAAC,WAAA,KAAAC,UAAA,6CAAAC,UAAA,gBAAAC,OAAA,cAAAC,SAAA,KAAAhB,SAAA,KAAAM,KAAA,KAAAW,SAAA,gBAAAd,MAAA,IAAAe,aAAA,oBAAAC,UAAA,KAAAC,OAAA,KAAAC,mBAAA,KAAApB,QAAA,KAAAqB,KAAA,KAAApB,QAAA,KAAAqB,MAAA,KAAAC,QAAA,iDAAAC,QAAA,KAAAxB,QAAA,IAAAyB,MAAA,yCAAAD,QAAA,KAAAxB,QAAA,IAAAyB,MAAA,4CAAA7B,KAAA,IAAAE,SAAA,KAAAb,IAAA,KAAAyC,OAAA,KAAAJ,MAAA,KAAAK,SAAA,KAAAnB,OAAA,KAAAoB,KAAA,wCAAAC,OAAA,gBAAAC,WAAA,8DAAAC,SAAA,KAAAC,OAAA,IAAAC,MA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QAAA,gCAAAR,EAAA","ignoreList":[]}
1
+ {"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","async","options","globalScripts","bootstrapLazy","cart","showModal","cartWake","customer","loading","message","phone","canCancel","amountCancel","sent","session","loading_reprocess","styles","reservedInfo","resetBonus","setloading","reprocess","storeName","cartId","products","stepNext","loadingModal","saveStore","cancel","handleCustomerName","step","bonus","setStep","sendPin","value","config","showEdit","info","isOpen","modalTitle","downtime","reload","dates","seconds","minutes","txtBtn","handleClick","dataCriacao","minutos","segundos","tempoRestante","initialValue","disabled","getPhone","size","color","loadProducts","loadAll","customStyles","pinInfo","sucess","error","hasApplyBonus","processBonus","validate","pin","isVerified","reserve","usedValue","applyName","newValue","handlerSubmit","resend","canResend","infoBonus","selectedOption","sliderPosition","sliderValuePosition","loadingTime","text","identity"],"sources":["node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.22.2 | MIT Licensed | https://stenciljs.com\n */\n\n// src/client/client-patch-browser.ts\nimport { BUILD, NAMESPACE } from \"@stencil/core/internal/app-data\";\nimport { consoleDevInfo, doc, H, promiseResolve } from \"@stencil/core\";\nvar patchBrowser = () => {\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo(\"Running in development mode.\");\n }\n if (BUILD.cloneNodeFix) {\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts ? Array.from(doc.querySelectorAll(\"script\")).find(\n (s) => new RegExp(`/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) || s.getAttribute(\"data-stencil-namespace\") === NAMESPACE\n ) : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})[\"data-opts\"] || {} : {};\n if (importMeta !== \"\") {\n opts.resourcesUrl = new URL(\".\", importMeta).href;\n }\n return promiseResolve(opts);\n};\nvar patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function(deep) {\n if (this.nodeName === \"TEMPLATE\") {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport {\n patchBrowser\n};\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(async (options) => {\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"0HAOA,IAAIA,EAAe,KAUjB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACrBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACjD,CACE,OAAOC,EAAeJ,EAAK,EClB7BH,IAAeQ,MAAKC,MAAOC,UACnBC,IACN,OAAOC,EAAc,+BAA8B,CAAAC,KAAS,IAAAC,UAAA,KAAAC,SAAA,KAAAC,SAAA,KAAAC,QAAA,KAAAC,QAAA,KAAAC,MAAA,KAAAC,UAAA,KAAAC,aAAA,KAAAC,KAAA,KAAAC,QAAA,KAAAC,kBAAA,KAAAC,OAAA,KAAAC,aAAA,KAAAC,WAAA,KAAAC,WAAA,KAAAC,UAAA,6CAAAC,UAAA,gBAAAC,OAAA,cAAAC,SAAA,KAAAhB,SAAA,KAAAM,KAAA,KAAAW,SAAA,gBAAAd,MAAA,IAAAe,aAAA,oBAAAC,UAAA,KAAAC,OAAA,KAAAC,mBAAA,KAAApB,QAAA,KAAAqB,KAAA,KAAApB,QAAA,KAAAqB,M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E,MAAA,IAAAwB,OAAA,KAAA8B,IAAA,KAAAC,WAAA,KAAAO,UAAA,2BAAAlD,OAAA,cAAAd,QAAA,IAAAsB,MAAA,KAAAoC,QAAA,KAAAvC,OAAA,KAAAO,OAAA,KAAAuC,UAAA,KAAApD,UAAA,iBAAA8C,UAAA,KAAAO,eAAA,KAAAC,eAAA,KAAAC,oBAAA,KAAAC,YAAA,YAAA/C,MAAA,qCAAAgD,KAAA,IAAAC,SAAA,SAAA9E,EAAA","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r,h as c}from"./p-8c362346.js";const s=class{constructor(c){r(this,c)}render(){return c("div",{key:"b14a932e4fe5118f73c319e9fcd1c7f6ca6466fb"},"COMPONENT BYCODER")}};export{s as crm_bonus_tray};
2
+ //# sourceMappingURL=p-4792c140.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["crmBonusTray","render","h","key"],"sources":["src/tray-ecommerce/crm-bonus-tray.tsx"],"sourcesContent":["import { Component, h } from \"@stencil/core\";\n\n@Component({\n tag: 'crm-bonus-tray'\n})\nexport class crmBonusTray {\n\n render() {\n return (\n <div>COMPONENT BYCODER</div>\n )\n }\n}"],"mappings":"4CAKaA,EAAY,M,yBAErB,MAAAC,GACI,OACIC,EAAA,OAAAC,IAAA,gE","ignoreList":[]}