PageSourceSearch

https://appcasacor.com.br/_next/static/chunks/pages/gift-card/[slug]/b2b-purchase-1f4a7bf401cb364a.js

js appcasacor.com.br collected 2026-10-02 03:41:49 UTC 42,181 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8609],{40010:function(e,a,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/gift-card/[slug]/b2b-purchase",function(){return t(34874)}])},77872:function(e,a,t){"use strict";t.d(a,{Z:function(){return v}});var r=t(85893);t(67294);var l=t(54109),n=t(23599),i=t(94054),o=t(18360),d=t(98456),s=t(93946),c=t(56815),u=t(95537);function v(e){let{label:a,options:t,value:v="",onChange:m,className:p,error:x,errorMessage:g,multiple:h,renderValue:f,selectProps:y={},disabled:j,name:b,cleanable:N,isLoading:D}=e,C=(e,a)=>{let t=e.target.value;"string"==typeof t||"number"==typeof t?m(h?t.split(","):t):m(t)};return(0,r.jsxs)(i.Z,{fullWidth:!0,className:"basic-select "+p,disabled:j,children:[(0,r.jsx)(l.Z,{id:"basic-select",children:a}),(0,r.jsx)(o.Z,{labelId:"basic-select",id:"select",value:h?v||[]:null==v?void 0:v.toString(),label:a,name:b,onChange:C,error:x,multiple:h,renderValue:f||void 0,...y,children:D?(0,r.jsxs)(n.Z,{children:[(0,r.jsx)(d.Z,{size:20,sx:{marginRight:1}}),(0,r.jsx)("span",{children:"Carregando..."})]}):t.map(e=>"string"==typeof e||"number"==typeof e?(0,r.jsx)(n.Z,{value:e,children:e},e):(0,r.jsx)(n.Z,{value:e.value,disabled:!!e.disabled,children:e.label},e.value))}),N&&!!v&&(0,r.jsx)(s.Z,{className:"clean-btn",onClick:function(){m()},children:(0,r.jsx)(u.Z,{})}),!!g&&(0,r.jsx)(c.Z,{error:!0,children:g})]})}},96013:function(e,a,t){"use strict";var r=t(85893),l=t(67294),n=t(89755),i=t.n(n),o=t(45332);let d=e=>{let{src:a,...t}=e,[n,d]=(0,l.useState)((0,o.e6)(a));return l.useEffect(()=>{d((0,o.e6)(a))},[a]),(0,r.jsx)(i(),{src:n,alt:"",placeholder:"blur",className:"placeholder image-with-fallback",draggable:!1,objectFit:"contain",blurDataURL:o.LG,unoptimized:"/placeholder.png"===n,onError:()=>{d("/placeholder.png")},...t})};a.Z=d},32101:function(e,a,t){"use strict";var r=t(85893),l=t(50135),n=t(67294);let i=e=>{var a;let{...t}=e,i=(0,n.useRef)((null===(a=t.value)||void 0===a?void 0:a.toString())||""),o={};return t.onValueChange&&(o.onChange=e=>{e.stopPropagation(),t.onValueChange&&t.onValueChange(e.target.value)}),t.onBlur&&(o.onBlur=()=>{let e=i.current.value;e="string"==typeof e?null==e?void 0:e.trim():e,t.onValueChange&&t.onValueChange(e),t.onBlur&&t.onBlur(e)}),n.useEffect(()=>{t.defaultValue&&(i.current.value=t.defaultValue)},[t.defaultValue]),(0,r.jsx)(l.Z,{inputRef:i,className:"textfield",autoComplete:"off",...t,...o})};a.Z=i},34874:function(e,a,t){"use strict";t.r(a),t.d(a,{__N_SSP:function(){return ee},default:function(){return ea}});var r=t(85893),l=t(67294),n=t(4298),i=t.n(n),o=t(28133),d=t(89834),s=t(34768),c=t(11163),u=t(77058),v=t(32101),m=t(83321),p=t(46901),x=t(98456),g=t(79332),h=t(68061),f=t(50480),y=t(36872),j=t(93946),b=t(45332),N=t(39332),D=t(72132),C=t(58467),I=t(21313),w=t(69697),E=t(87168),S=t(504);function A(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.trim().replace(/\D+/g,"")}let P={INVALID_NUMBER:"N\xfamero cart\xe3o inv\xe1lido.",INVALID_SECURITY_CODE:"C\xf3digo de seguran\xe7a inv\xe1lido. Voc\xea deve passar 3, 4 d\xedgitos.",INVALID_EXPIRATION_MONTH:"Data de validade do cart\xe3o inv\xe1lida.",INVALID_EXPIRATION_YEAR:"Data de validade do cart\xe3o inv\xe1lida.",INVALID_PUBLIC_KEY:"Chave p\xfablica inv\xe1lida.",INVALID_HOLDER:"Nome impresso no cart\xe3o inv\xe1lido."};var T=t(39759),G=t(46870);let Z=()=>{let e=(0,N.useSearchParams)(),a=e.get("orderId"),{toggleLoader:t}=(0,I.U2)(),[r,n]=l.useState("pix"),[i,o]=l.useState(),[d,s]=l.useState({name:"",number:"",expiry:"",cvc:"",installments:""}),[c,u]=l.useState([]),[v,m]=l.useState(""),[p,x]=l.useState({}),[g,h]=l.useState({eventId:"",type:"B2B",payerInfo:{},paymentMethod:"pix",channel:"website",encryptedCard:void 0,installments:1,recaptchaToken:"",givexGiftCardDatas:[{orderSender:"",customerName:"",orderTotal:0}],userTimezoneOffset:180}),[f,y]=l.useState("");l.useEffect(()=>{console.log("\uD83D\uDE80 ~ React.useEffect ~ orderId:",a),a&&(async()=>{try{var e,t,r,l,n,i,d,s,c,u,v,m,p,x,g,h,f,y,j,b,N,D,I,w,E,S;let A=await (0,C.ZP)("/givex/order-payment?orderId=".concat(a));if(console.log("\uD83D\uDE80 ~ res:",A),A.data.error)throw Error(A.data.error.message);((null==A?void 0:null===(e=A.data)||void 0===e?void 0:e.paymentStatus)==="PAID"&&(null==A?void 0:null===(t=A.data)||void 0===t?void 0:t.paymentMethod.includes("credit_card"))||(null==A?void 0:null===(r=A.data)||void 0===r?void 0:r.paymentMethod)==="pix"||(null==A?void 0:null===(l=A.data)||void 0===l?void 0:l.paymentMethod)==="bank_slip")&&o({orderId:null==A?void 0:null===(n=A.data)||void 0===n?void 0:n.orderId,paymentMethod:null==A?void 0:null===(i=A.data)||void 0===i?void 0:i.paymentMethod,paymentStatus:null==A?void 0:null===(d=A.data)||void 0===d?void 0:d.paymentStatus,amount:null==A?void 0:null===(s=A.data)||void 0===s?void 0:null===(c=s.transaction)||void 0===c?void 0:c.amount,givexGiftCardDatas:null==A?void 0:null===(u=A.data)||void 0===u?void 0:u.givexGiftCardDatas,givexStatus:null==A?void 0:null===(v=A.data)||void 0===v?void 0:v.givexStatus,payerEmail:null==A?void 0:null===(m=A.data)||void 0===m?void 0:m.payerEmail,barcode:null==A?void 0:null===(p=A.data)||void 0===p?void 0:null===(x=p.transaction)||void 0===x?void 0:x.barcode,pdf:null==A?void 0:null===(g=A.data)||void 0===g?void 0:null===(h=g.transaction)||void 0===h?void 0:h.pdf,qrCode:(null==A?void 0:null===(f=A.data)||void 0===f?void 0:f.qrCode)?{id:null==A?void 0:null===(y=A.data)||void 0===y?void 0:null===(j=y.qrCode)||void 0===j?void 0:j.id,code:null==A?void 0:null===(b=A.data)||void 0===b?void 0:null===(N=b.qrCode)||void 0===N?void 0:N.text,image:null===(D=null==A?void 0:null===(I=A.data)||void 0===I?void 0:null===(w=I.qrCode)||void 0===w?void 0:w.links[0])||void 0===D?void 0:D.href,expiration:null==A?void 0:null===(E=A.data)||void 0===E?void 0:null===(S=E.qrCode)||void 0===S?void 0:S.expiration_date}:void 0})}catch(e){}})()},[a]),l.useEffect(()=>{if(r.includes("credit_card")){var e;let a=null===(e=d.number)||void 0===e?void 0:e.replace(/\D/g,""),t=null==a?void 0:a.slice(0,6),r=async()=>{try{var e,a;m("processing");let r=await (0,C.ZP)("/payment/credit-card-installments?eventId=".concat(f,"&cartTotalValue=").concat(Number((null==g?void 0:null===(e=g.givexGiftCardDatas)||void 0===e?void 0:e.reduce((e,a)=>e+a.orderTotal*((null==a?void 0:a.itemQuantity)||1),0))||0),"&creditCardBin=").concat(t));if(r.data.error)throw Error(r.data.error.message);u(null===(a=r.data)||void 0===a?void 0:a.installments.installment_plans.map(e=>({label:"".concat(e.installments," x ").concat((0,S.n)(e.installment_value/100)," = ").concat((0,S.n)(e.amount.value/100)),value:JSON.stringify(e)}))),m("success")}catch(e){u([]),m("error"),D.Am.error(e.message)}};r()}},[g,r,d.number]);let j=async()=>{let e;t(!0);let a=g,l={};x(l);let{name:n,email:i,docNumber:o,address:s,celphone:c}=(null==g?void 0:g.payerInfo)||{},u="Campo obrigat\xf3rio",v="Campo inv\xe1lido";for(let e of(console.log("\uD83D\uDE80 ~ getOrderDetails ~ data:",a),(null==g?void 0:g.givexGiftCardDatas)||[])){let{orderSender:a,customerName:t,orderTotal:r}=e||{};a||(l.orderSender=u),t||(l.customerName=u),r||(l.orderTotal=u)}if(n||(l.name=u),i||(l.email=u),i&&!(0,b.oH)(i)&&(l.email=v),c||(l.celphone=u),o||(l.docNumber=u),!o||w.wn.isValid(o)||w.s3.isValid(o)||(l.docNumber=v),(null==s?void 0:s.zip)||
1(l.zip=u),null==s?void 0:s.zip){let e=await fetch("https://viacep.com.br/ws/"+s.zip+"/json/");console.log(s.zip),console.log(e);let t=await e.json();t.erro?l.zip=v:a.address={...null==a?void 0:a.payerInfo.address,street:t.logradouro,district:t.bairro,city:t.localidade,state:t.uf}}if(Object.keys(l).length){x(l),t(),D.Am.error("Formul\xe1rio incompleto!");return}if(r.includes("credit_card")){if(d.name||(l.cardName=u),d.number||(l.cardNumber=u),d.number&&!(d.number.length>=18)&&(l.cardNumber=v),d.expiry||(l.cardExpiry=u),d.expiry&&(h=d.expiry,!/^(0[1-9]|1[0-2])[/](\d{4})/.test(h))&&(l.cardExpiry=v),d.cvc||(l.cardCvc=u),d.cvc&&(y=d.cvc,!/\d{3,4}/.test(y))&&(l.cardCvc=v),d.installments||(l.cardInstallments=u),Object.keys(l).length){x(l),D.Am.error("Dados do cartāo de cr\xe9dito incompletos!");return}let[a,t]=d.expiry.split("/"),{data:r}=await C.ZP.get("/gateway-payment/active");if(console.log("\uD83D\uDE80 ~ submitCreditCardOrder ~ activeGatewayPayment:",r),"PAGSEGURO"===r.codename){var m,p,h,y,j,N,I=window.PagSeguro.encryptCard({publicKey:"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwnj1S7T31mlq4C0KSmenGAJYYl+KfB2MIeqaG97+ayTaEJGx3b37GhMnX9HhhaJB821FTNUn95i279uS5gFqc7RNQ/urmK9lGw+mr6l734A+h6d9apuJAvH3QoH/br8lUE1Z6bMCn1D371Z+/8zCrswUzTB4p+W+KfhZQg0pkmI1fRTso9Bjftwsb9PJ9O7sHGLS4AxTWWHis2iG1ZfIkVJPdxfw1s7oRDziLAUqPctui9k1rlu3Xuwf5yuEo9dFymMaGpMynXbdJoIEHLtQlJZ2MKQXbEmifMg5M+sHaspo7ORrK/VI9RS7g49/NLsr9GVSJ49Ghgefu81/doAiewIDAQAB",holder:d.name,number:d.number.toString().replace(/\s/g,""),expMonth:a,expYear:t,securityCode:d.cvc});e=I.encryptedCard;var{hasErrors:E,errors:S}=I;if(E){let e=[];
1if(S.map(a=>{e.push(P[a.code])}),e.length){x({}),D.Am.error(e.join("\n "));return}}}if("PAGARME"===r.codename){let r={type:"card",card:{number:null==d?void 0:null===(j=d.number)||void 0===j?void 0:null===(N=j.replace)||void 0===N?void 0:N.call(j,/ /g,""),holder_name:d.name,exp_month:Number(a),exp_year:Number(t),cvv:d.cvc}};console.log("\uD83D\uDE80 ~ submitCreditCardOrder ~ requestBody ~ PAGARME:",r);let{data:l}=await T.Z.post("/tokens?appId=".concat("pk_PYgL1wBcEwF4y07N"),r);console.log("\uD83D\uDE80 ~ submitCreditCardOrder ~ data ~ PAGARME:",l),e=l.id}}let A={eventId:f,type:"B2B",encryptedCard:e,recaptchaToken:"",givexGiftCardDatas:null==a?void 0:a.givexGiftCardDatas,payerInfo:{...null==a?void 0:a.payerInfo,name:n,email:i,address:null==a?void 0:a.address,docType:(null===(m=null==a?void 0:a.payerInfo.docNumber)||void 0===m?void 0:m.replace(/\D/g,"").length)===11?"CPF":"CNPJ",celphone:(0,b.un)((null==c?void 0:c.toString())||" "),docNumber:(null==a?void 0:a.payerInfo.docNumber)||""},installments:r.includes("credit_card")?Number((null==d?void 0:null===(p=d.installments)||void 0===p?void 0:p.installments)||1):1,paymentMethod:r.includes("credit_card")?"credit_card":r,channel:"website",userTimezoneOffset:(0,G.Y5)()};return console.log("\uD83D\uDE80 ~ getOrderDetails ~ order:",A),A};async function A(){try{let e=await j();if(console.log("\uD83D\uDE80 ~ submitPayment ~ orderDetails:",e),!e)return t();let a=null==window?void 0:window.grecaptcha;null==a||a.enterprise.ready(function(){a.enterprise.execute("6LdtN0orAAAAAEfpIYpKcvdS-7Y08IHLfmDo6Mmm",{action:"submit"}).then(async a=>{let l={...e,recaptchaToken:a};try{var n,i,d,s,c,u,v,m,p,x,g,h,f,y,j,b,N,I,w,S,A,P;t(!0,"Processando transa\xe7\xe3o");let e=await C.ZP.post("/givex/order-create-card",l);t();let{error:a}=e.data;if(null==a?void 0:a.message)return D.Am.error(a.message);if("string"==typeof a)return D.Am.error(a);localStorage.setItem(E.Ue,null==e?void 0:null===(n=e.data)||void 0===n?void 0:n.orderId),console.log("\uD83D\uDE80 ~ .then ~ res.data",null==e?void 0:e.data),o({orderId:null==e?void 0:null===(i=e.data)||void 0===i?void 0:i.orderId,paymentMethod:r.includes("credit_card")?"credit_card":r,paymentStatus:null==e?void 0:null===(d=e.data)||void 0===d?void 0:d.paymentStatus,amount:null==e?void 0:null===(s=e.data)||void 0===s?void 0:null===(c=s.transaction)||void 0===c?void 0:c.amount,givexStatus:null==e?void 0:null===(u=e.data)||void 0===u?void 0:u.givexStatus,givexGiftCardDatas:null==e?void 0:null===(v=e.data)||void 0===v?void 0:v.givexGiftCardDatas,payerEmail:null==e?void 0:null===(m=e.data)||void 0===m?void 0:m.payerEmail,barcode:null==e?void 0:null===(p=e.data)||void 0===p?void 0:null===(x=p.transaction)||void 0===x?void 0:x.barcode,pdf:null==e?void 0:null===(g=e.data)||void 0===g?void 0:null===(h=g.transaction)||void 0===h?void 0:h.pdf,qrCode:(null==e?void 0:null===(f=e.data)||void 0===f?void 0:f.qrCode)?{id:null==e?void 0:null===(y=e.data)||void 0===y?void 0:null===(j=y.qrCode)||void 0===j?void 0:j.id,code:null==e?void 0:null===(b=e.data)||void 0===b?void 0:null===(N=b.qrCode)||void 0===N?void 0:N.text,image:null===(I=null==e?void 0:null===(w=e.data)||void 0===w?void 0:null===(S=w.qrCode)||void 0===S?void 0:S.links[0])||void 0===I?void 0:I.href,expiration:null==e?void 0:null===(A=e.data)||void 0===A?void 0:null===(P=A.qrCode)||void 0===P?void 0:P.expiration_date}:void 0})}catch(e){console.log("\uD83D\uDE80 ~ submitPayment ~ err:",e),t(),D.Am.error(e.message)}})})}catch(e){console.log("\uD83D\uDE80 ~ submitPayment ~ err:",e),t(),D.Am.error(e.message)}}return{paymentMethod:r,setPaymentMethod:n,successPaymentData:i,cardData:d,setCardData:e=>s(a=>({...a,...e})),errors:p,setErrors:x,cardInstallments:c,processingCardState:v,setProcessingCardState:m,setPaymentData:h,setEventId:y,paymentData:g,submitPayment:A}};var _=t(77872),M=t(15567),R=t(46761),k=t(95537),V=t(62026),O=t(70983),B=t(801);let L=e=>{console.log("\uD83D\uDE80 ~ SuccessPayment ~ props:",e),(0,c.useRouter)();let{orderId:a,paymentStatus:t,paymentMethod:l,pageHeaderImage:n,givexGiftCardDatas:o}=e,d=["AUTHORIZED","PAID"].includes(t);return(0,r.jsxs)("div",{className:"givex-giftcard",children:[(0,r.jsx)("div",{className:"header",style:{backgroundImage:"url(".concat((0,b.e6)(null==n?void 0:n.image),")")}}),(0,r.jsxs)("div",{className:"success-payment fade-in-animation",children:[(0,r.jsx)(i(),{id:"gtm",strategy:"afterInteractive",children:"\n            (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n            new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n            j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n            'https://www.googletagmanager.com/gtm.js?id='
1+i+dl;f.parentNode.insertBefore(j,f);\n            })(window,document,'script','dataLayer','GTM-P3WSWMX');\n          "}),(0,r.jsx)("noscript",{dangerouslySetInnerHTML:{__html:'<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-P3WSWMX" height="0" width="0" style="display: none; visibility: hidden;" />'}}),d?(0,r.jsx)(B.sB,{viewBox:"0 0 100 100"}):(0,r.jsx)(B.AT,{viewBox:"0 0 100 100"}),(0,r.jsx)("label",{children:d?"Compra finalizada com sucesso!":"Aguardando aprova\xe7\xe3o!"}),(0,r.jsx)("p",{children:"Pagamento confirmado, o(s) email(s) informado(s) ".concat([...new Set(o.map(e=>{let{orderSender:a}=e;return a}))].join(", ")," para receber o cart\xe3o de presente,\n          cada um receber\xe1 um email da GIVEX com o n\xfamero e o pin do cart\xe3o,\n          use o aplicativo CASACOR para resgatar o cart\xe3o.\n          Por favor, fique atento(a) a caixa de spam do e-mail\n          cadastrado na compra.")})]})]})};var q=t(60845);let z=(e,a)=>{let[t,r]=l.useState("WAITING_PAYMENT"),{toggleLoader:n}=(0,I.U2)(),i=()=>{navigator.clipboard.writeText(a),D.Am.success("Pix copiado!")};async function o(e){try{n(!0,"Pagando pix");let a=await C.ZP.post("/payment/simulate-pix-payment",{qrCodeId:e});n();let{error:t}=a.data;if(t)throw Error(JSON.stringify(t))}catch(e){n(),console.log(JSON.stringify(e,null,2)),D.Am.error(e.message)}}return{copyQrCode:i,onPaymentStatusChange:r,paymentStatus:t,simulatePayment:o}},X=()=>{let e=(0,N.useSearchParams)(),a=e.get("orderId"),[t,r]=(0,l.useState)({});return l.useEffect(()=>{let e=setInterval(async()=>{var t,l;let n=await (0,C.ZP)("/givex/order-payment-status?orderId=".concat(a,"&date=").concat(new Date));console.log("\uD83D\uDE80 ~ timer ~ data:",n.data),r(n.data),(null==n?void 0:null===(t=n.data)||void 0===t?void 0:t.paymentStatus)!=="WAITING_PAYMENT"&&(null==n?void 0:null===(l=n.data)||void 0===l?void 0:l.paymentStatus)!=="IN_ANALYSIS"&&clearInterval(e)},1e4);return()=>{e&&clearInterval(e)}},[a]),{paymentStatus:t.paymentStatus,amount:t.amount,orderId:a,qrCode:t.qrCode,paymentMethod:t.paymentMethod,givexGiftCardDatas:t.givexGiftCardDatas,payerEmail:t.payerEmail,transaction:t.transaction}};var Q=t(83454);let U=e=>{var a;let t=(0,c.useRouter)(),{qrCode:n,orderId:o,paymentMethod:d,email:s,orderTotal:u,givexGiftCardDatas:v,pageHeaderImage:p}=e,{t:x}=(0,q.$G)("common"),{copyQrCode:g,simulatePayment:h}=z(null==n?void 0:n.id,null==n?void 0:n.code),{paymentStatus:f,amount:y,givexGiftCardDatas:N}=X(),D=u||y?(0,b.fe)(u||y):"",C=(null===(a=v||N)||void 0===a?void 0:a.length)&&"".concat((v||N).length," X Cart\xe3o Presente");return(l.useEffect(()=>{let e={...t.query,orderId:o};t.push({pathname:t.pathname,query:e},void 0,{shallow:!0})},[t,d]),"AUTHORIZED"===f||"PAID"===f)?(0,r.jsx)(L,{orderId:o,paymentMethod:"pix",paymentStatus:f,pageHeaderImage:p,givexGiftCardDatas:v||N,email:s}):(0,r.jsxs)("div",{className:"givex-giftcard",children:[(0,r.jsx)("div",{className:"header",style:{backgroundImage:"url(".concat((0,b.e6)(null==p?void 0:p.image),")")}}),(0,r.jsxs)("div",{className:"pix-payment content-wrapper",children:[(0,r.jsx)(i(),{id:"gtm",strategy:"afterInteractive",children:"\n            (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n            new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n            j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n            'https://www.googletagmanager.com/gtm.js?id='
1+i+dl;f.parentNode.insertBefore(j,f);\n            })(window,document,'script','dataLayer','GTM-P3WSWMX');\n          "}),(0,r.jsx)("noscript",{dangerouslySetInnerHTML:{__html:'<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-P3WSWMX" height="0" width="0" style="display: none; visibility: hidden;" />'}}),(0,r.jsx)("div",{className:"content",children:"DECLINED"===f||"CANCELED"===f||"PIX_EXPIRED"===f?(0,r.jsxs)("div",{className:"expired-screen",children:[(0,r.jsx)(B.AT,{viewBox:"0 0 100 100"}),(0,r.jsx)("label",{children:"PIX_EXPIRED"===f?"Tempo expirado!":"Pagamento cancelado!"}),(0,r.jsx)("p",{children:"PIX_EXPIRED"===f?"O tempo do seu c\xf3digo do PIX foi expirado. Por favor volte a etapa anterior e gere um novo c\xf3digo para finalizar a compra.":"Seu PIX foi cancelado. Por favor volte a etapa anterior e gere um novo c\xf3digo para finalizar a compra."}),(0,r.jsx)(m.Z,{className:"btn-primary",children:"Voltar para o in\xedcio"})]}):(0,r.jsxs)("div",{className:"pix-container",children:[(0,r.jsxs)("div",{className:"expire",children:[(0,r.jsx)(B.zM,{}),"Voc\xea tem 10 minutos para concluir esta compra. O c\xf3digo ser\xe1 expirado ap\xf3s este per\xedodo."]}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsxs)("div",{className:"col",children:[(0,r.jsx)("div",{className:"title",children:"Instru\xe7\xf5es para pagamento:"}),(0,r.jsx)("div",{className:"subtitle",children:x("event.code_reading")}),(0,r.jsx)("div",{children:x("event.step-one")}),(0,r.jsx)("div",{children:x("event.step-two")}),(0,r.jsx)("div",{children:x("event.step-three")}),(0,r.jsx)("div",{className:"subtitle",children:x("event.important")}),(0,r.jsx)("div",{children:x("event.payment_not_time")}),(0,r.jsx)("div",{children:x("event.after_payment")})]}),(0,r.jsxs)("div",{className:"col",children:[(0,r.jsx)("img",{className:"qrcode",src:null==n?void 0:n.image,alt:""}),(0,r.jsxs)("div",{className:"expire-at",children:["Expira \xe0s: ",(0,G.p6)(null==n?void 0:n.expiration,"Pp")]}),(0,r.jsxs)("div",{className:"social",children:["Favorecido: CASA COR PROMOCOES E COMERCIAL LTDA",(0,r.jsxs)("div",{className:"paymentInfo",children:[(0,r.jsx)("div",{children:C}),(0,r.jsxs)("div",{children:["Total: ",(0,r.jsx)("b",{children:D})]})]})]}),(0,r.jsxs)("div",{className:"field-code",children:[(0,r.jsx)("div",{className:"code",children:null==n?void 0:n.code}),(0,r.jsx)(j.Z,{onClick:g,children:(0,r.jsx)(B.TI,{})})]}),"development"===Q.env.NEXT_PUBLIC_MODE&&(0,r.jsx)(m.Z,{onClick:()=>h(n.id),className:"simulate-pix-btn",children:"Simular pagamento"})]})]})]})})]})]})};var H=t(9336),J=t(96013);let W=e=>{let a=(0,c.useRouter)(),{qrCode:t,orderId:n,paymentMethod:o,email:d,orderTotal:s,givexGiftCardDatas:u,pageHeaderImage:v,barcode:p,pdf:x}=e,{t:g}=(0,q.$G)("common"),h=s?(0,b.fe)(s):"",f="".concat(null==u?void 0:u.length," X Cart\xe3o Presente");return l.useEffect(()=>{let e={...a.query,orderId:n};a.push({pathname:a.pathname,query:e},void 0,{shallow:!0})},[a,o]),(0,r.jsxs)("div",{className:"givex-giftcard",children:[(0,r.jsx)("div",{className:"header",style:{backgroundImage:"url(".concat((0,b.e6)(null==v?void 0:v.image),")")}}),(0,r.jsxs)("div",{className:"pix-payment content-wrapper",children:[(0,r.jsx)(i(),{id:"gtm",strategy:"afterInteractive",children:"\n            (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n            new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n            j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n            'https://www.googletagmanager.com/gtm.js?id='
1+i+dl;f.parentNode.insertBefore(j,f);\n            })(window,document,'script','dataLayer','GTM-P3WSWMX');\n          "}),(0,r.jsx)("noscript",{dangerouslySetInnerHTML:{__html:'<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-P3WSWMX" height="0" width="0" style="display: none; visibility: hidden;" />'}}),(0,r.jsx)("div",{className:"content",children:(0,r.jsx)("div",{className:"pix-container",children:(0,r.jsxs)("div",{className:"row",children:[(0,r.jsxs)("div",{className:"col",children:[(0,r.jsx)("div",{className:"title",children:"Instru\xe7\xf5es para pagamento com c\xf3digo de barras:"}),(0,r.jsx)("div",{className:"subtitle",children:g("event.code_reading-bar")}),(0,r.jsx)("div",{children:g("event.step-one-bar")}),(0,r.jsx)("div",{children:g("event.step-two-bar")}),(0,r.jsx)("div",{children:g("event.step-three-bar")}),(0,r.jsxs)("div",{children:[(0,r.jsx)("img",{className:"qrcode",src:p,alt:""}),(0,r.jsx)("div",{className:"social",children:(0,r.jsxs)("div",{className:"paymentInfo",children:[(0,r.jsx)("div",{children:f}),(0,r.jsxs)("div",{children:["Total: ",(0,r.jsx)("b",{children:h})]})]})}),(0,r.jsx)(m.Z,{className:"btn-primary",onClick:()=>{window.open(x)},children:"Baixar PDF"})]})]}),(0,r.jsxs)("div",{className:"col",children:[(0,r.jsx)("div",{className:"title",children:"Instru\xe7\xf5es para pagamento com QR code:"}),(0,r.jsx)("div",{className:"subtitle",children:g("event.code_reading")}),(0,r.jsx)("div",{children:g("event.step-one")}),(0,r.jsx)("div",{children:g("event.step-two")}),(0,r.jsx)("div",{children:g("event.step-three")}),(0,r.jsxs)("div",{children:[(0,r.jsx)("img",{className:"qrcode",src:null==t?void 0:t.code,alt:""}),(0,r.jsx)("div",{className:"social",children:(0,r.jsxs)("div",{className:"paymentInfo",children:[(0,r.jsx)("div",{children:f}),(0,r.jsxs)("div",{children:["Total: ",(0,r.jsx)("b",{children:h})]})]})}),(0,r.jsx)("div",{className:"field-code",children:(0,r.jsx)("div",{className:"code",children:null==t?void 0:t.code})})]})]})]})})})]})]})},Y={pix:"PIX",bank_slip:"Boleto",credit_card:"Cart\xe3o de cr\xe9dito"},F=[{label:"R$ 25",value:2500},{label:"R$ 50",value:5e3},{label:"R$ 100",value:1e4},{label:"R$ 200",value:2e4}],K=e=>{var a,t,n,i,o,N,D,C,I,w,E,S,P,T;let{event:q}=e,{errors:z,setErrors:X,successPaymentData:Q,paymentMethod:K,setPaymentMethod:$,cardData:ee,setCardData:ea,cardInstallments:et,processingCardState:er,setProcessingCardState:el,setPaymentData:en,paymentData:ei,setEventId:eo,submitPayment:ed}=Z(),es=(0,c.useRouter)(),{t:ec,i18n:eu}=(0,u.$)("common"),[ev,em]=l.useState(!1),{id:ep,title:ex,image:eg,description:eh,address:ef,type:ey,startAt:ej,endAt:eb,relatedEvents:eN,pageHeaderImage:eD,sponsors:eC,sellGivexGiftCardGroupPurchase:eI,givexPageCardBanner:ew,givexPageHeaderBanner:eE,givexPageTextInfo:eS}=q||{},eA=()=>{es.push("/")};function eP(e){en(a=>({...a,...e}))}l.useEffect(()=>{let e=document.querySelector(".grecaptcha-badge");console.log("\uD83D\uDE80 ~ React.useEffect ~ recaptchaBadge:",e),e&&(e.style.bottom="140px",e.style.visibility="visible")},[es.query]);let eT=(0,l.useCallback)(e=>{(async()=>{eP({...ei,payerInfo:{...null==ei?void 0:ei.payerInfo,address:{zip:(0,b.Se)(e),city:"",state:"",street:"",district:""}}});let a=e.replace(/[^\d]+/g,"");if(a.length>=8){em(!0);let a=await (0,H.G)(e);X(e=>({...e,zip:"not_found"===a.street?"Endere\xe7o n\xe3o encontrado":""})),eP({...ei,payerInfo:{...null==ei?void 0:ei.payerInfo,address:{...null==ei?void 0:ei.payerInfo.address,...a}}}),em(!1)}})()},[null==ei?void 0:ei.payerInfo]);return(l.useEffect(()=>{ep&&eo(ep)},[ep]),eI)?Q&&Q.paymentMethod.includes("credit_card")?(0,r.jsx)(L,{orderId:null==Q?void 0:Q.orderId,paymentStatus:Q.paymentStatus,paymentMethod:Q.paymentMethod,givexGiftCardDatas:null==Q?void 0:Q.givexGiftCardDatas,pageHeaderImage:eE?{image:eE}:eD,email:null==Q?void 0:Q.payerEmail}):Q&&"pix"===Q.paymentMethod?(0,r.jsx)(U,{orderId:null==Q?void 0:Q.orderId,orderTotal:(null==Q?void 0:Q.amount)||0,givexGiftCardData:null==Q?void 0:Q.givexGiftCardDatas,pageHeaderImage:eE?{image:eE}:eD,email:null==Q?void 0:Q.payerEmail,qrCode:null==Q?void 0:Q.qrCode}):Q&&"bank_slip"===Q.paymentMethod?(0,r.jsx)(W,{orderId:null==Q?void 0:Q.orderId,orderTotal:(null==Q?void 0:Q.amount)||0,paymentMethod:null==Q?void 0:Q.paymentMethod,pageHeaderImage:eE?{image:eE}:eD,givexGiftCardDatas:null==Q?void 0:Q.givexGiftCardDatas,email:null==Q?void 0:Q.payerEmail,barcode:null==Q?void 0:Q.barcode,pdf:null==Q?void 0:Q.pdf,qrCode:null==Q?void 0:Q.qrCode}):(0,r.jsxs)("div",{className:"givex-giftcard",children:[(0,r.jsx)("div",{className:"header",style:{backgroundImage:"url(".concat((0,b.e6)(eE||(null==eD?void 0:eD.image)),")")}}),(0,r.jsxs)("div",{className:"giftcard-payment content-wrapper",children:[(0,r.jsx)("h3",{children:"Gift Card"}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("section",{children:(0,r.jsx)("div",{className:"cover-image",children:(0,r.jsx)(J.Z,{src:(0,b.e6)(ew||eg),layout:"fill"})})}),(0,r.jsx)("section",{children:(0,r.jsx)(d.D,{rehypePlugins:[s.Z],className:"description",children:eS})})]}),(0,r.jsxs)("div",{className:"content",children:[(0,r.jsxs)("div",{className:"col",children:[(0,r.jsx)("div",{className:"label",children:"Complete o formul\xe1rio"}),(0,r.jsxs)("div",{className:"card",children:[(0,r.jsx)("div",{className:"title",children:"Comprador"}),(0,r.jsx)(v.Z,{sx:{mb:3},label:"Nome completo*",value:(null==ei?void 0:null===(a=ei.payerInfo)||void 0===a?void 0:a.name)||"",onValueChange:e=>eP({...ei,payerInfo:{...null==ei?void 0:ei.payerInfo,name:e},givexGiftCardDatas:ei.givexGiftCardDatas.map((a,t)=>0===t?{...a,customerName:e}:a)}),error:z.name,helperText:z.name}),(0,r.jsx)(v.Z,{sx:{mb:3},label:"Email*",type:"email",value:(null==ei?void 0:null===(t=ei.payerInfo)||void 0===t?void 0:t.email)||"",onValueChange:e=>eP({...ei,payerInfo:{...null==ei?void 0:ei.payerInfo,email:e},givexGiftCardDatas:ei.givexGiftCardDatas.map((a,t)=>0===t?{...a,orderSender:e}:a)}),error:!!z.email,helperText:z.email}),(0,r.jsx)(v.Z,{sx:{mb:3},label:"CPF/CNPJ*",value:(null==ei?void 0:null===(n=ei.payerInfo)||void 0===n?void 0:n.docNumber)||"",onValueChange:e=>eP({...ei,payerInfo:{...null==ei?void 0:ei.payerInfo,docNumber:(0,b.i6)(e)}}),error:!!z.docNumber,helperText:z.docNumber}),(0,r.jsx)(v.Z,{sx:{mb:3},label:"Celular",value:(null==ei?void 0:null===(i=ei.payerInfo)||void 0===i?void 0:i.celphone)||"",onValueChange:e=>eP({...ei,payerInfo:{...null==ei?void 0:ei.payerInfo,celphone:(0,b.un)(e)}}),error:!!z.celphone,helperText:z.celphone}),(0,r.jsx)(v.Z,{sx:{mb:3},label:"CEP*",value:(null==ei?void 0:null===(o=ei.payerInfo)||void 0===o?void 0:null===(N=o.address)||void 0===N?void 0:N.zip)||"",onValueChange:eT,error:!!z.zip,helperText:z.zip}),ev?(0,r.jsxs)("div",{children:[(0,r.jsx)(x.Z,{size:16,sx:{mr:2}}),"Buscando endere\xe7o ..."]}):(0,r.jsx)("div",{children:(0,b.hk)(null==ei?void 0:null===(D=ei.payerInfo)||void 0===D?void 0:D.address)})]})]}),(0,r.jsxs)("div",{className:"col",children:[(0,r.jsx)("div",{className:"label",children:"Para quem ser\xe1 enviado o cart\xe3o presente"}),(0,r.jsxs)("div",{className:"card",children:[(0,r.jsx)("div",{className:"title",children:"Recebedor do cart\xe3o presente"}),ei.givexGiftCardDatas.filter((e,a)=>a<F.length).map((e,a)=>(0,r.jsxs)("div",{className:"form",children:[(0,r.jsx)(v.Z,{sx:{mb:3},label:"* "+ec("givexgiftcard.orderSendToEmail"),value:(null==e?void 0:e.orderSender)||"",onValueChange:e=>eP({...ei,givexGiftCardDatas:ei.givexGiftCardDatas.map((t,r)=>r===a?{...t,orderSender:e}:t)}),error:!!z.orderSender&&!(null==e?void 0:e.orderSender),helperText:(null==e?void 0:e.orderSender)?""
1:z.orderSender}),(0,r.jsx)(v.Z,{sx:{mb:3},label:"* "+ec("givexgiftcard.customerName"),value:(null==e?void 0:e.customerName)||"",onValueChange:e=>eP({...ei,givexGiftCardDatas:ei.givexGiftCardDatas.map((t,r)=>r===a?{...t,customerName:e}:t)}),error:!!z.customerName&&!(null==e?void 0:e.customerName),helperText:(null==e?void 0:e.customerName)?"":z.customerName}),(0,r.jsx)("div",{className:"card-selected",children:F.filter(a=>(null==e?void 0:e.orderTotal)===a.value).map(t=>(0,r.jsxs)("div",{className:"card-selected-item",children:[(0,r.jsx)("div",{className:"title",children:"Cart\xe3o Presente Selecionado"}),(0,r.jsx)("div",{className:"value-label",children:"Valor do cart\xe3o"}),(0,r.jsx)("div",{className:"value",children:t.label}),(0,r.jsx)("div",{className:"quantity-label",children:"Quantidade de cart\xf5es"}),(0,r.jsxs)("div",{className:"btn-increase-decrease-container",children:[(0,r.jsx)(m.Z,{className:"btn-decrease",onClick:()=>{(null==e?void 0:e.itemQuantity)!==1&&eP({...ei,givexGiftCardDatas:ei.givexGiftCardDatas.map((e,t)=>t===a?{...e,itemQuantity:((null==e?void 0:e.itemQuantity)||1)-1}:e)})},children:"-"}),(0,r.jsx)(g.Z,{inputProps:{style:{textAlign:"center"}},className:"input-quantity",value:(null==e?void 0:e.itemQuantity)||1,onChange:e=>eP({...ei,givexGiftCardDatas:ei.givexGiftCardDatas.map((t,r)=>r===a?{...t,itemQuantity:/^\d+$/.test(e.target.value)?Number(e.target.value):1}:t)})}),(0,r.jsx)(m.Z,{className:"btn-increase",onClick:()=>eP({...ei,givexGiftCardDatas:ei.givexGiftCardDatas.map((e,t)=>t===a?{...e,itemQuantity:((null==e?void 0:e.itemQuantity)||1)+1}:e)}),children:"+"})]})]},"price-card-selected-".concat(t.value)))}),(0,r.jsx)("div",{className:"btn-toggle",children:F.filter(e=>!ei.givexGiftCardDatas.find(a=>{let{orderTotal:t}=a;return t===e.value})&&a===ei.givexGiftCardDatas.length-1).map(t=>(0,r.jsx)(m.Z,{className:"btn ".concat((null==e?void 0:e.orderTotal)===t.value?"active":""),onClick:()=>eP({...ei,givexGiftCardDatas:ei.givexGiftCardDatas.map((e,r)=>r===a?{...e,orderTotal:t.value}:e)}),children:t.label},t.value))}),a>0&&(0,r.jsx)("div",{className:"delete",children:(0,r.jsxs)(m.Z,{className:"btn-primary btn-delete",onClick:()=>eP({...ei,givexGiftCardDatas:ei.givexGiftCardDatas.filter((e,t)=>t!==a)}),children:[(0,r.jsx)(R.Z,{}),"Remover"]})})]},"givex-giftcard-data-".concat(a))),ei.givexGiftCardDatas.length<F.length&&ei.givexGiftCardDatas.some(e=>{let{orderTotal:a}=e;return a>0})&&(0,r.jsx)(m.Z,{className:"btn-primary",variant:"contained",onClick:()=>{var e,a;return eP({...ei,givexGiftCardDatas:[...null==ei?void 0:ei.givexGiftCardDatas,{customerName:null==ei?void 0:null===(e=ei.payerInfo)||void 0===e?void 0:e.name,orderSender:null==ei?void 0:null===(a=ei.payerInfo)||void 0===a?void 0:a.email,orderTotal:0,itemQuantity:1}]})},children:(0,r.jsx)("h5",{children:"Adicionar mais Cart\xf5es"})})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"label",children:"Pagamento"}),(0,r.jsxs)("div",{className:"card",children:[(0,r.jsx)("div",{className:"title",children:"M\xe9todo de Pagamento"}),(0,r.jsx)("div",{className:"form",children:(0,r.jsx)(h.Z,{value:K,onChange:e=>$(e.target.value),style:{alignItems:"flex-start"},children:null==Object?void 0:null===(C=Object.keys)||void 0===C?void 0:null===(I=C.call(Object,Y))||void 0===I?void 0:I.map(e=>(0,r.jsx)(f.Z,{value:e,control:(0,r.jsx)(y.Z,{}),label:Y[e]},e))})}),"credit_card"===K&&(0,r.jsxs)("div",{className:"form",children:[(0,r.jsx)("div",{className:"title",children:"Informe os dados do Cart\xe3o"}),(0,r.jsx)(v.Z,{sx:{mb:3},label:"* N\xfamero cart\xe3o",className:"textfield",value:ee.number,onValueChange:e=>{let a;return ea({number:(a=(a=A(e)).length>12?"".concat(a.slice(0,4)," ").concat(a.slice(4,8)," ").concat(a.slice(8,12)," ").concat(a.slice(12,16)):a.length>8?"".concat(a.slice(0,4)," ").concat(a.slice(4,8)," ").concat(a.slice(8,12)):a.length>4?"".concat(a.slice(0,4)," ").concat(a.slice(4,8)):"".concat(a.slice(0,4))).slice(0,19)})},error:!!z.cardNumber||"error"===er,helperText:z.cardNumber,InputProps:{endAdornment:"processing"===er?(0,r.jsx)(x.Z,{}):"error"===er?(0,r.jsx)(j.Z,{onClick:()=>{ea({number:""}),el("")},children:(0,r.jsx)(k.Z,{})}):"success"===er?(0,r.jsx)(V.Z,{}):null}}),(0,r.jsx)(v.Z,{sx:{mb:3},label:"Nome impresso no cart\xe3o",className:"textfield",value:ee.name,onValueChange:e=>ea({name:e}),error:!!z.cardName,helperText:z.cardName}),(0,r.jsx)(v.Z,{sx:{mb:3}
1,label:"Validade",className:"textfield",value:ee.expiry,onValueChange:e=>{let a;return ea({expiry:((a=A(e)).length>=3&&(a="".concat(a.slice(0,2),"/").concat(a.slice(2))),a.slice(0,7))})},error:!!z.cardExpiry,helperText:z.cardExpiry,placeholder:"XX/XXXX"}),(0,r.jsx)(v.Z,{sx:{mb:3},label:"CVC",className:"textfield",value:ee.cvc,onValueChange:e=>ea({cvc:function(e){let a=A(e);return a.slice(0,4)}(e)}),error:!!z.cardCvc,helperText:z.cardCvc}),(0,r.jsx)(_.Z,{label:"Parcelamento",options:et,value:ee.installments||"",onChange:e=>ea({installments:e}),error:!!z.cardInstallments,errorMessage:z.cardInstallments,disabled:!et.length})]}),(0,r.jsx)("div",{children:((null==ei?void 0:null===(w=ei.givexGiftCardDatas)||void 0===w?void 0:null===(E=w.reduce)||void 0===E?void 0:E.call(w,(e,a)=>e+a.orderTotal,0))||0)>0&&(0,r.jsxs)("div",{className:"total",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"title",children:"Total da Compra"}),(0,r.jsx)("div",{className:"value",children:(0,b.fe)((null==ei?void 0:null===(S=ei.givexGiftCardDatas)||void 0===S?void 0:null===(P=S.reduce)||void 0===P?void 0:P.call(S,(e,a)=>e+a.orderTotal*((null==a?void 0:a.itemQuantity)||1),0))||0)}),F.filter(e=>ei.givexGiftCardDatas.find(a=>{let{orderTotal:t}=a;return t===e.value})).map(e=>(0,r.jsx)("div",{className:"label",children:"".concat(ei.givexGiftCardDatas.filter(a=>{let{orderTotal:t}=a;return t===e.value}).reduce((e,a)=>e+(a.itemQuantity||1),0)," X Cart\xe3o Presente de ").concat(e.label)},"total-price-".concat(e.value)))]}),(0,r.jsx)("div",{className:"button",children:(0,r.jsxs)(m.Z,{sx:{width:"100%"},className:"btn-primary",onClick:ed,children:[(0,r.jsx)(O.Z,{}),"Finalizar Compra"]})})]})})]})]})]})]}),(0,r.jsxs)(m.Z,{className:"btn-go-back-home",variant:"contained",onClick:eA,children:[(0,r.jsx)(M.Z,{sx:{mr:2}}),"Voltar para o In\xedcio"]})]}):(0,r.jsxs)("div",{className:"givex-giftcard",children:[(0,r.jsx)("div",{className:"header",style:{backgroundImage:"url(".concat((0,b.e6)(null==eD?void 0:eD.image),")")}}),(0,r.jsxs)(m.Z,{className:"btn-go-back-home",variant:"contained",onClick:eA,children:[(0,r.jsx)(M.Z,{sx:{mr:2}}),"Voltar para o In\xedcio"]}),(0,r.jsxs)("div",{className:"giftcard-payment content-wrapper",children:[(0,r.jsx)("h3",{children:"Compra em Grupo"}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("section",{children:(0,r.jsx)("div",{className:"cover-image",children:(0,r.jsx)(J.Z,{src:eg,layout:"fill"})})}),(0,r.jsxs)("section",{children:[(0,r.jsxs)("h2",{children:["CASACOR / ",(0,r.jsxs)("span",{children:[" ",ex]})]}),(0,r.jsxs)("div",{className:"info",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(B.qQ,{className:"icon-text"}),(0,r.jsx)("span",{children:(0,b.Cy)(ef)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(B.Qu,{className:"icon-text"}),(0,r.jsxs)("span",{children:["De ",null===(T=(0,G.p6)(ej,"P",eu.language))||void 0===T?void 0:T.slice(0,5)," a ",(0,G.p6)(eb,"P",eu.language)]})]})]})]})]}),(0,r.jsx)(p.Z,{severity:"warning",sx:{justifyContent:"center",pt:"2rem"},children:(0,r.jsx)("h3",{style:{textAlign:"center"},children:"Este evento n\xe3o vende cart\xf5es presentes para compra em grupo"})})]})]})},$=e=>((0,o.Z)(),console.log(e),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i(),{src:"https://assets.pagseguro.com.br/checkout-sdk-js/rc/dist/browser/pagseguro.min.js",onLoad:()=>console.log("script loaded correctly")}),(0,r.jsx)(i(),{src:"https://www.google.com/recaptcha/enterprise.js?render=6LdtN0orAAAAAEfpIYpKcvdS-7Y08IHLfmDo6Mmm",async:!0,defer:!0,onLoad:()=>console.log("grecaptcha is ready!")}),(0,r.jsx)(K,{...e})]}));var ee=!0,ea=$},9336:function(e,a,t){"use strict";t.d(a,{G:function(){return s}});var r=t(9669),l=t.n(r);let n=l().create({baseURL:"https://brasilapi.com.br/api"}),i=l().create({baseURL:"https://api.brasilaberto.com/v1"}),o=l().create({baseURL:"https://viacep.com.br/ws"});var d=t(45332);async function s(e){console.log("\uD83D\uDE80 ~ searchAddress ~ value:",e);try{if(""!==e){let a=e.replace(/[^\d]+/g,"");if((0,d.Ip)(a))try{console.log("\uD83D\uDE80 ~ consultando ~ by via api ~ searchAddress ~ value:",e);let{data:a}=await o.get("/".concat(e,"/json")),{logradouro:t,bairro:r,localidade:l,uf:n}=a;if(console.log("\uD83D\uDE80 ~ consultaCep ~ by via cep ~ logradouro, bairro, localidade, uf:",t,r,l,n),a.erro)try{let{data:{result:{street:
1a,district:t,city:r,stateShortname:l}}}=await i.get("/zipcode/".concat(e));return console.log("\uD83D\uDE80 ~ consultaCep ~ by brasil aberto api ~ ~ street, district, city, stateShortname:",a,t,r,l),{zip:e,street:a,district:t,state:l,city:r}}catch(a){return console.log("\uD83D\uDE80 ~ consultaCep ~ by brasil aberto api ~ brasilAbertoApiError:",a),{zip:e,street:"not_found"}}return{zip:e,street:"".concat(t).trim()||"Endere\xe7o sem rua",district:"".concat(r).trim()||"Endere\xe7o sem bairro",state:n,city:l}}catch(a){console.log("\uD83D\uDE80 ~ consultaCep ~ by via cep api ~ viaCepError:",a);try{let{data:{result:{street:a,district:t,city:r,stateShortname:l}}}=await i.get("/zipcode/".concat(e));return{zip:e,street:"".concat(a).trim()||"Endere\xe7o sem rua",district:"".concat(t).trim()||"Endere\xe7o sem bairro",state:l,city:r}}catch(a){console.log("\uD83D\uDE80 ~ consultaCep ~ by brasil aberto api ~ brasilAbertoApiError:",a);try{console.log("\uD83D\uDE80 ~ consultando ~ by brasil api ~ searchAddress ~ value:",e);let a=await n.get("/cep/v1/".concat(e));console.log("\uD83D\uDE80 ~ searchAddress ~ res:",a);let{data:{street:t,neighborhood:r,state:l,city:i}}=a;return console.log("\uD83D\uDE80 ~ consultaCep ~ by brasil api ~ street, neighborhood, state, city:",t,r,l,i),{zip:e,street:"".concat(t).trim()||"Endere\xe7o sem rua",district:"".concat(r).trim()||"Endere\xe7o sem bairro",state:l,city:i}}catch(e){console.log("\uD83D\uDE80 ~ consultaCep ~ by brasil api ~ brasilApiError:",e)}}}}return{zip:e,street:"not_found"}}catch(a){return console.log("\uD83D\uDE80 ~ consultaCep ~ error:",a),{zip:e,street:"not_found"}}}},39759:function(e,a,t){"use strict";t.d(a,{y:function(){return i}});var r=t(9669),l=t.n(r),n=t(4250);let i=l().create({baseURL:"https://api.pagar.me/core/v5",headers:{accept:"application/json","content-type":"application/json"}});i.interceptors.response.use(e=>e,e=>{var a;let t=(0,n.j)(e);return Promise.reject(Object.assign(Error(t),{response:e.response,status:null===(a=e.response)||void 0===a?void 0:a.status}))}),a.Z=i},504:function(e,a,t){"use strict";t.d(a,{n:function(){return i}});var r=t(45332),l=t(50246);let n={pt:{locale:"pt-BR",currency:"BRL"},us:{locale:"en-US",currency:"USD"}};function i(e,a){let t=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!(0,r.Ft)(e))return(0,l.B)({value:t?(parseInt("".concat(e))/100).toString():e.toString(),decimalScale:2,intlConfig:n[a||"pt"]})}},46870:function(e,a,t){"use strict";t.d(a,{Au:function(){return f},GT:function(){return D},MQ:function(){return g},O:function(){return v},Rg:function(){return j},U6:function(){return C},Y5:function(){return u},YR:function(){return s},j9:function(){return I},mX:function(){return m},mr:function(){return y},nv:function(){return p},oJ:function(){return b},p6:function(){return c},qb:function(){return w},tE:function(){return h},uP:function(){return x},y5:function(){return N}});var r=t(61436),l=t(32912),n=t(29081),i=t(95826),o=t(99490);let d={pt:n.Z,en:i.Z},s="America/Sao_Paulo";function c(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"PPPP",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"pt";if(!e)return;if(!(0,r.Z)(new Date(e)))return"".concat(e);let n=(0,l.Z)(new Date(e),a,{locale:d[t]});return n}function u(){return new Date().getTimezoneOffset()}function v(e){let a=new Date(e);if(Number.isNaN(a.getTime()))return{year:NaN,month:NaN,day:NaN};if(0===a.getHours()&&0===a.getMinutes()&&0===a.getSeconds()&&0===a.getMilliseconds())return{year:a.getFullYear(),month:a.getMonth()+1,day:a.getDate()};let t=o.ou.fromJSDate(a,{zone:s});return t.isValid?{year:t.year,month:t.month,day:t.day}:{year:NaN,month:NaN,day:NaN}}function m(e){let{year:a,month:t,day:r}=v(e);return Number.isNaN(a)?"":"".concat(a,"-").concat(String(t).padStart(2,"0"),"-").concat(String(r).padStart(2,"0"))}function p(e,a){let t=m(e),r=m(a);return Boolean(t&&r&&t===r)}function x(e){let{year:a,month:t,day:r}=v(e);return Number.isNaN(a)?"NaN":new Date(Date.UTC(a,t-1,r,12)).getUTCDay().toString()}function g(e,a){let t=m(e),r=m(a);return!!t&&!!r&&t>r}function h(e){let{year:a,month:t,day:r}=v(e);return Number.isNaN(a)?new Date(NaN):new Date(a,t-1,r)}
1function f(){return o.ou.now().toJSDate()}function y(e,a){let{year:t,month:r,day:l}=v(e);if(Number.isNaN(t))return new Date(NaN);let[n="0",i="0"]=a.split(":");return o.ou.fromObject({year:t,month:r,day:l,hour:Number(n)||0,minute:Number(i)||0,second:0,millisecond:0},{zone:s}).toJSDate()}function j(e,a){let[t="00:00",r="23:00"]=(a||"").split("-");return{start:y(e,t),end:y(e,r)}}function b(e){let a=o.ou.fromJSDate(new Date(e));return!a.isValid||a.toMillis()<o.ou.now().toMillis()}function N(e,a){return new Date(e).getTime()>new Date(a).getTime()}function D(e,a){return new Date(e).getTime()<new Date(a).getTime()}function C(e,a){return(null==a?void 0:a.onlyToday)?h(f()):h(e)}function I(e,a){return(null==a?void 0:a.onlyToday)?h(f()):h(e)}function w(e){return(0,r.Z)(new Date(e))}}},function(e){e.O(0,[9809,9755,3243,135,8423,1237,246,6273,5581,9774,2888,179],function(){return e(e.s=40010)}),_N_E=e.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.