1"use strict";(globalThis.webpackChunklabi_spa||=[]).push([[8116],{98116(a,o,e){e.r(o),e.d(o,{default:()=>l});var t=e(9950),r=e(96690),i=e(43273),n=e(99335);const c=e.p+"static/media/arrow-purple.6be384e61b2cf2a7009536fdad2fc6d6.svg";const s=e.p+"static/media/icone_presente.7b26c824ee53a39ae1b7b683d191edf3.svg";var d=e(44414);function l(a){let{value:o}=a;const[e,l]=(0,t.useState)(!1),{handleUpdateUserCredits:u}=(0,i.A)();return(0,t.useEffect)(()=>{u()},[]),(0,d.jsx)("div",{onClick:()=>{l(!e)},className:"container-bag-drawer",children:(0,d.jsxs)("div",{className:"bag-drawer "+(e?"open-bag-drawer":""),children:[(0,d.jsx)("img",{className:"bag",src:s,alt:"Abrir"}),(0,d.jsx)(r.N_,{to:"/minha-conta/labi-creditos",children:(0,d.jsxs)("span",{children:["Voc\xea tem ",(0,d.jsx)("strong",{className:"bold",children:(0,n.uQ)(o)})," em labi cr\xe9ditos"]})}),(0,d.jsx)("img",{className:"arrow",src:c,alt:"fechar"})]})})}},43273(a,o,e){e.d(o,{A:()=>v});var t=e(9950),r=e(75638),i=e(22532),n=e(7652),c=e(77274),s=e(34687),d=e(11313),l=e(94913),u=e(88507),m=e(4729),p=e(8147),h=e(64709);function v(){const[a,o]=(0,t.useState)(!1),{Cart:e,User:v,Checkout:b}=(0,r.useSelector)(a=>a),_=(0,r.useDispatch)(),{value:f}=(0,i.z)({cartReference:e,userReference:v,voucherReference:b});function g(){_((0,s.OT)(!1)),_((0,d.$w)({}))}async function w(a){const o={title:"Sobre o Labi Cr\xe9ditos",className:"modal-new-promoter",confirmLabel:a?"Ok, entendi!":"Continuar",cancelLabel:!a&&"Cancelar",confirmIcon:!1,hasCloseButton:!0,...a?{text:"Li e estou de acordo com as regras acima.",textError:"Voc\xea precisa estar de acordo para participar do programa."}:{}};await _((0,l.WG)('\n <ol class="new-promoter-modal">\n <li>\n Quando voc\xea compartilha o seu c\xf3digo de indica\xe7\xe3o com amigos, eles podem ganhar R$ 50 de desconto na primeira compra no site com valor m\xednimo de R$ 75.\n </li>\n <li>\n E voc\xea recebe o cr\xe9dito de R$25 em at\xe9 10 dias na sua conta do Labi para utilizar em pr\xf3ximas compras no site.\n </li>\n <li>\n Os cr\xe9ditos s\xe3o cumulativos, voc\xea pode indicar o quanto quiser, mas fique de olho no vencimento. Pois a partir da data de libera\xe7\xe3o, o cr\xe9dito vence em 12 meses.\n </li>\n <li>\n Para utilizar o seu saldo de cr\xe9ditos em pr\xf3ximas compras \xe9 s\xf3 ativar o bot\xe3o \u201cUsar Labi Cr\xe9ditos\u201d no momento do pagamento para ganhar o desconto no valor total.\n </li>\n <li>\n Se a quantidade de cr\xe9ditos for maior do que o valor total da sua compra, a compra sai de gra\xe7a. E se sobrarem cr\xe9ditos, eles continuam na sua conta.\n </li>\n <li>\n Caso a pessoa que utilizou o seu c\xf3digo de indica\xe7\xe3o solicite estorno da compra, o cr\xe9dito que voc\xea receberia \xe9 invalidado.\n </li>\n <li>\n Caso o seu c\xf3digo de indica\xe7\xe3o seja utilizado, n\xe3o ser\xe1 mais poss\xedvel utilizar o c\xf3digo de indica\xe7\xe3o de outra pessoa.\n </li>\n </ul>\n ',o))}return{loadingPromoter:a,handleUpdateUserCredits:async function(){try{const a=await(0,n.CY)();if((0,p.Ux)(a)){if(_((0,c.uE)(a.beta_promoter)),_((0,c.$n)(a.indication_code)),v.user.labi_credits===a.labi_credits)return;_((0,c.R7)(a.labi_credits))}}catch(a){const{code:o}=(0,h.h)({error:a})}},handleOpenModalNewPromoter:async function(){try{await w(!0),o(!0);const{indication_code:a}=await(0,n.pF)();if(!a)throw(0,h.h)({code:"indication code not returned",message:"Ocorreu um erro na gera\xe7\xe3o do c\xf3digo de indica\xe7\xe3o, por favor, tente novamente."});_((0,c.x7)(a)),(0,u.C)("success","Parab\xe9ns! Seu c\xf3digo de indica\xe7\xe3o foi gerado com sucesso.")}catch(a){console.log(a);const{message:o}=a||{};o&&(0,u.C)("error",o)}finally{o(!1)}},handleOpenRulesModal:w,handleUseLabiCredits:function(a,o){if(_((0,s.OT)(a)),!a)return g();const t=function(a){var o,t,r,i;if(a)return{discount_percent_in_plot:0,order_subtotal:null===e||void 0===e||null===(r=e.cocart_calculate)||void 0===r?void 0:r.cart_contents_total,order_total:"0",value_discount_plot:"0",discount_labi_credits:null===e||void 0===e||null===(i=e.cocart_calculate)||void 0===i?void 0:i.total};const n=(0,m.bR)(null===v||void 0===v||null===(o=v.user)||void 0===o?void 0:o.labi_credits),c=f-n;return{discount_percent_in_plot:0,order_subtotal:null===e||void 0===e||null===(t=e.cocart_calculate)||void 0===t?void 0:t.cart_contents_total,discount_labi_credits:String(n),order_total:String(c),value_discount_plot:0}}(o);_((0,d.$w)({payment_details:t},"MEMBER_GET_MEMBER"))},handleClearMemberGetMemberDiscounts:g}}},7652(a,o,e){e.d(o,{CY:()=>s,Kw:()=>c,RX:()=>l,Rc:()=>n,o:()=>d,pF:()=>i});var t=e(64709),r=e(14074);async function i(){try{return(await r.A.post("/promoter/create")).data}catch(a){throw(0,t.h)({error:a})}}async function n(a,o){try{return(await r.A.post("/promoter/share/mail",{indication_code:a,recipient:o})).data}catch(e){throw(0,t.h)({error:e})}}async function c(a){try{return(await r.A.post("/indication/create",{indication_code:a})).data}catch(o){throw(0,t.h)({error:o})}}async function s(){try{return(await r.A.get("/promoter/amount")).data}catch(a){throw(0,t.h)({error:a})}}async function d(){try{return(await r.A.delete("/indication/destroy")).data}catch(a){throw(0,t.h)({error:a})}}async function l(){let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;try{return(await r.A.get(`/promoter/extract?page=${a}`)).data}catch(o){throw(0,t.h)({error:o})}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.