PageSourceSearch

https://app.pratiqueemcasa.com.br/_next/static/chunks/pages/afiliados/_Geral-1e5a297252e60e80.js

js pratiqueemcasa.com.br collected 2026-10-01 14:22:24 UTC 15,239 bytes, 3 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25691],{40056:function(e,t,a){"use strict";a.d(t,{Z:function(){return j}});var n=a(67294),o=a(89739),r=a(4340),l=a(97937),i=a(21640),c=a(78860),s=a(93967),u=a.n(s),d=a(29372),p=a(64217),m=a(42550),f=a(96159),y=a(53124),g=a(49790),b=a(14747),v=a(83559);let h=(e,t,a,n,o)=>({background:e,border:`${(0,g.bf)(n.lineWidth)} ${n.lineType} ${t}`,[`${o}-icon`]:{color:a}}),E=e=>{let{componentCls:t,motionDurationSlow:a,marginXS:n,marginSM:o,fontSize:r,fontSizeLG:l,lineHeight:i,borderRadiusLG:c,motionEaseInOutCirc:s,withDescriptionIconSize:u,colorText:d,colorTextHeading:p,withDescriptionPadding:m,defaultPadding:f}=e;return{[t]:Object.assign(Object.assign({},(0,b.Wf)(e)),{position:"relative",display:"flex",alignItems:"center",padding:f,wordWrap:"break-word",borderRadius:c,[`&${t}-rtl`]:{direction:"rtl"},[`${t}-content`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:n,lineHeight:0},"&-description":{display:"none",fontSize:r,lineHeight:i},"&-message":{color:p},[`&${t}-motion-leave`]:{overflow:"hidden",opacity:1,transition:`max-height ${a} ${s}, opacity ${a} ${s},
2        padding-top ${a} ${s}, padding-bottom ${a} ${s},
3        margin-bottom ${a} ${s}`},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),[`${t}-with-description`]:{alignItems:"flex-start",padding:m,[`${t}-icon`]:{marginInlineEnd:o,fontSize:u,lineHeight:0},[`${t}-message`]:{display:"block",marginBottom:n,color:p,fontSize:l},[`${t}-description`]:{display:"block",color:d}},[`${t}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}},A=e=>{let{componentCls:t,colorSuccess:a,colorSuccessBorder:n,colorSuccessBg:o,colorWarning:r,colorWarningBorder:l,colorWarningBg:i,colorError:c,colorErrorBorder:s,colorErrorBg:u,colorInfo:d,colorInfoBorder:p,colorInfoBg:m}=e;return{[t]:{"&-success":h(o,n,a,e,t),"&-info":h(m,p,d,e,t),"&-warning":h(i,l,r,e,t),"&-error":Object.assign(Object.assign({},h(u,s,c,e,t)),{[`${t}-description > pre`]:{margin:0,padding:0}})}}},w=e=>{let{componentCls:t,iconCls:a,motionDurationMid:n,marginXS:o,fontSizeIcon:r,colorIcon:l,colorIconHover:i}=e;return{[t]:{"&-action":{marginInlineStart:o},[`${t}-close-icon`]:{marginInlineStart:o,padding:0,overflow:"hidden",fontSize:r,lineHeight:(0,g.bf)(r),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",[`${a}-close`]:{color:l,transition:`color ${n}`,"&:hover":{color:i}}},"&-close-text":{color:l,transition:`color ${n}`,"&:hover":{color:i}}}}};var $=(0,v.I$)("Alert",e=>[E(e),A(e),w(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`})),O=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)0>t.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(a[n[o]]=e[n[o]]);return a};let R={success:o.Z,info:c.Z,error:r.Z,warning:i.Z},I=e=>{let{icon:t,prefixCls:a,type:o}=e,r=R[o]||null;return t?(0,f.wm)(t,n.createElement("span",{className:`${a}-icon`},t),()=>({className:u()(`${a}-icon`,t.props.className)})):n.createElement(r,{className:`${a}-icon`})},S=e=>{let{isClosable:t,prefixCls:a,closeIcon:o,handleClose:r,ariaProps:i}=e,c=!0===o||void 0===o?n.createElement(l.Z,null):o;return t?n.createElement("button",Object.assign({type:"button",onClick:r,className:`${a}-close-icon`,tabIndex:0},i),c):null},x=n.forwardRef((e,t)=>{let{description:a,prefixCls:o,message:r,banner:l,className:i,rootClassName:c,style:s,onMouseEnter:f,onMouseLeave:g,onClick:b,afterClose:v,showIcon:h,closable:E,closeText:A,closeIcon:w,action:R,id:x}=e,N=O(e,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action","id"]),[C,P]=n.useState(!1),L=n.useRef(null);n.useImperativeHandle(t,()=>({nativeElement:L.current}));let{getPrefixCls:Z,direction:B,closable:T,closeIcon:j,className:M,style:U}=(0,y.dj)("alert"),H=Z("alert",o),[k,_,D]=$(H),q=t=>{var a;P(!0),null===(a=e.onClose)||void 0===a||a.call(e,t)},G=n.useMemo(()=>void 0!==e.type?e.type:l?"warning":"info",[e.type,l]),V=n.useMemo(()=>"object"==typeof E&&!!E.closeIcon||!!A||("boolean"==typeof E?E:!1!==w&&null!=w||!!T),[A,w,E,T]),K=!!l&&void 0===h||h,z=u()(H,`${H}-${G}`,{[`${H}-with-description`]:!!a,[`${H}-no-icon`]:!K,[`${H}-banner`]:!!l,[`${H}-rtl`]:"rtl"===B},M,i,c,D,_),F=(0,p.Z)(N,{aria:!0,data:!0}),Q=n.useMemo(()=>"object"==typeof E&&E.closeIcon?E.closeIcon:A||(void 0!==w?w:"object"==typeof T&&T.closeIcon?T.closeIcon:j),[w,E,T,A,j]),J=n.useMemo(()=>{let e=null!=E?E:T;if("object"==typeof e){let{closeIcon:t}=e,a=O(e,["closeIcon"]);return a}return{}},[E,T]);return k(n.createElement(d.ZP,{visible:!C,motionName:`${H}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:v},({className:t,style:o},l)=>n.createElement("div",Object.assign({id:x,ref:(0,m.sQ)(L,l),"data-show":!C,className:u()(z,t),style:Object.assign(Object.assign(Object.assign({},U),s),o),onMouseEnter:f,onMouseLeave:g,onClick:b,role:"alert"},F),K?n.createElement(I,{description:a,icon:e.icon,prefixCls:H,type:G}):null,n.createElement("div",{className:`${H}-content`},r?n.createElement("div",{className:`${H}-message`},r):null,a?n.createElement("div",{className:`${H}-description`},a):null),R?n.createElement("div",{className:`${H}-action`},R):null,n.createElement(S,{isClosable:V,prefixCls:H,closeIcon:Q,handleClose:q,ariaProps:J}))))});var N=a(15671),C=a(43144),P=a(61120),L=a(78814),Z=a(82963),B=a(60136);let T=function(e){function t(){var e,a,n;return(0,N.Z)(this,t),a=t,n=arguments,a=(0,P.Z)(a),(e=(0,Z.Z)(this,(0,L.Z)()?Reflect.construct(a,n||[],(0,P.Z)(this).constructor):a.apply(this,n))).state={error:void 0,info:{componentStack:""}},e}
3return(0,B.Z)(t,e),(0,C.Z)(t,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,info:t})}},{key:"render",value:function(){let{message:e,description:t,id:a,children:o}=this.props,{error:r,info:l}=this.state,i=(null==l?void 0:l.componentStack)||null,c=void 0===e?(r||"").toString():e;return r?n.createElement(x,{id:a,type:"error",message:c,description:n.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},void 0===t?i:t)}):o}}])}(n.Component);x.ErrorBoundary=T;var j=x},45264:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/afiliados/_Geral",function(){return a(96640)}])},69557:function(e,t,a){"use strict";a.d(t,{U:function(){return s}});var n=a(67294),o=a(9473),r=a(81173);let l=null,i=0,c={BR:{code:"BRL",symbol:"R$",locale:"pt-BR"},US:{code:"USD",symbol:"$",locale:"en-US"},PT:{code:"EUR",symbol:"€",locale:"pt-PT"},AR:{code:"ARS",symbol:"$",locale:"es-AR"}};function s(){let{usuario:e}=(0,o.v9)(e=>e.login),t=(null==e?void 0:e.country)||"BR",[a,s]=(0,n.useState)(()=>{if("BR"===t)return{rate:1,currency:"BRL",symbol:"R$",locale:"pt-BR",conversionEnabled:!1,loading:!1};if(l&&Date.now()-i<36e5){let e=c[t]||c.US;return{rate:l[e.code]||1,currency:e.code,symbol:e.symbol,locale:e.locale,conversionEnabled:!0,loading:!1}}return{rate:1,currency:"BRL",symbol:"R$",locale:"pt-BR",conversionEnabled:!1,loading:!0}}),u=(0,n.useCallback)(async()=>{if("BR"===t){s({rate:1,currency:"BRL",symbol:"R$",locale:"pt-BR",conversionEnabled:!1,loading:!1});return}if(l&&Date.now()-i<36e5){let e=c[t]||c.US;s({rate:l[e.code]||1,currency:e.code,symbol:e.symbol,locale:e.locale,conversionEnabled:!0,loading:!1});return}try{let a=await r.Z.get("/loja/exchange-rate",{params:{country:t}});if(a.data.conversion_enabled){var e;s({rate:a.data.rate||1,currency:a.data.currency||"USD",symbol:a.data.symbol||"$",locale:(null===(e=c[t])||void 0===e?void 0:e.locale)||"en-US",conversionEnabled:!0,loading:!1}),l={[a.data.currency]:a.data.rate},i=Date.now()}else s({rate:1,currency:"BRL",symbol:"R$",locale:"pt-BR",conversionEnabled:!1,loading:!1})}catch(e){console.error("Error fetching exchange rate:",e),s({rate:1,currency:"BRL",symbol:"R$",locale:"pt-BR",conversionEnabled:!1,loading:!1})}},[t]);(0,n.useEffect)(()=>{u()},[u]);let d=(0,n.useCallback)(e=>{if(!e||isNaN(e))return"-";let t=e*a.rate;try{return new Intl.NumberFormat(a.locale,{style:"currency",currency:a.currency,minimumFractionDigits:2,maximumFractionDigits:2}).format(t)}catch(e){return"".concat(a.symbol," ").concat(t.toFixed(2))}},[a]),p=(0,n.useCallback)(e=>!e||isNaN(e)?0:e*a.rate,[a.rate]);return{...a,formatPrice:d,convertPrice:p,refresh:u}}},5935:function(e,t,a){"use strict";a.d(t,{gz:function(){return I},lg:function(){return w},Nq:function(){return A},r0:function(){return g},LR:function(){return R},q:function(){return E},rf:function(){return y},Eu:function(){return p},sw:function(){return f},mh:function(){return h},Iu:function(){return b},yP:function(){return O},JE:function(){return v},qe:function(){return $},C7:function(){return m}});var n=a(29061);let o=n.Z.create({baseURL:"https://pratiquetecnologia.com.br/api/comprar",headers:{"Content-Type":"application/x-www-form-urlencoded"}});var r=a(91326),l=a(25440),i=a(81173),c=a(68872);let s=["CAMPANHA 1200"],u=["C\xc9U AZUL","PEDRO LEOPOLDO","MATOZINHOS CENTRO","S\xc3O SEBASTI\xc3O - PALHO\xc7A","CABRAL","CABRAL2","CAMARGOS","CAMARGOS 2","SANTA IN\xcaS","SANTA IN\xcaS II","NOVA PALHO\xc7A","RIO GRANDE 2","CACHOEIRINHA","GAVEA","G\xc1VEA","CASTELINHO","VILA OL","ESTREITO","FLORAMAR","ELDORADO","JARDIM ATLANTICO","MANTIQUEIRA","PRESIDENTE MEDICI","INGLESES FLORIANOPOLIS"],d=e=>{let t=(e||"").toUpperCase().trim();return!!(t.includes("SANTO AMARO")||t.includes("SHOPPING")&&t.includes("CONTAGEM"))||"LAGOA"===t||u.some(e=>t.includes(e))},p=()=>async(e,t)=>{let{login:a}=t();return e((0,r.dv)(!0)),i.Z.post("/afiliados/getPix",{email:a.usuario.user_email}).then(t=>{e((0,r.Ar)(t.data))}).finally(()=>{e((0,r.dv)(!1))})},m=(e,t,a)=>async(n,o)=>{let{login:l}=o();return n((0,r.dv)(!0)),i.Z.post("/afiliados/savePix",{email:l.usuario.user_email,tipo:e,chave:t}).then(e=>
3{n((0,r.Ar)(e.data[0])),c.ZP.success("Pix salvo com sucesso!"),a(!1)}).finally(()=>{n((0,r.dv)(!1))})},f=e=>async t=>{t((0,r.Ql)(!0));try{var a;let n=await i.Z.post("/afiliados/getPixPayments",{chave:e});if(null===(a=n.data)||void 0===a?void 0:a.pixPayments)return t((0,r.b7)(n.data.pixPayments)),{success:!0};return t((0,r.b7)([])),{success:!1,message:"Nenhum pagamento encontrado para esta chave Pix."}}catch(e){}finally{t((0,r.Ql)(!1))}},y=()=>async(e,t)=>{let{login:a}=t();return e((0,r.K4)(!0)),l.Z.post("getDadosAfiliado.php",{isAffiliate:a.usuario.isAffiliate,isEmail:a.usuario.user_login}).then(t=>{e((0,r.L6)(t.data))}).finally(()=>{e((0,r.K4)(!1))})},g=()=>async(e,t)=>{let{login:a}=t();return e((0,r.K4)(!0)),l.Z.post("getComisoesAfiliado.php",{isAffiliate:a.usuario.isAffiliate}).then(t=>{e((0,r.KT)(t.data))}).finally(()=>{e((0,r.K4)(!1))})},b=e=>async t=>(t((0,r.K4)(!0)),l.Z.post("getProdutosAfiliado.php",{isAffiliate:e}).then(e=>{t((0,r.kL)(e.data))}).finally(()=>{t((0,r.K4)(!1))})),v=()=>async e=>(e((0,r.K4)(!0)),o.get("getunidades/index2.php").then(t=>{e((0,r.rL)(t.data))}).finally(()=>{e((0,r.K4)(!1))})),h=(e,t,a,l)=>async i=>{i((0,r.au)(!0));try{let p=await o.get("getplanos/index.php?unidade=".concat(e,"|").concat(t,"&nome=").concat(a,"&slug=").concat(l)),m=Array.isArray(p.data)?p.data:[];if(m.push({plano:l,nome:"GOSLIM | AVULSO",saver:"teste",unidade:l}),!d(a))try{var c,u;let a=await n.Z.get("".concat("https://app.pactosolucoes.com.br/api/prest/v2","/vendas/").concat(e,"/planos/").concat(t)),o=Array.isArray(null===(c=a.data)||void 0===c?void 0:c.return)?a.data.return:(null===(u=a.data)||void 0===u?void 0:u.return)?[a.data.return]:[],r=new Set(m.map(e=>String(e.plano)));o.filter(e=>(null==e?void 0:e.nome)&&s.some(t=>e.nome.toUpperCase().includes(t))).forEach(e=>{r.has(String(e.codigo))||m.push({plano:e.codigo,nome:e.nome,saver:"teste",unidade:l})})}catch(e){console.error("Erro ao buscar planos de campanha:",e)}i((0,r.Pw)(m))}catch(e){console.error("Erro ao buscar planos:",e),i((0,r.Pw)([]))}finally{i((0,r.au)(!1))}},E=()=>async(e,t)=>{let{login:a}=t(),n=a.usuario.user_email;e((0,r.HH)(!0));try{let t=await i.Z.post("/afiliados/cuppom",{email:n});e(t.data.cuppom?(0,r.V1)(t.data.cuppom):(0,r.V1)(null))}catch(t){console.error("Erro ao obter cuppom:",t),c.ZP.error("Erro ao obter cuppom. Tente novamente mais tarde."),e((0,r.V1)(null))}finally{e((0,r.HH)(!1))}},A=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return async l=>{l((0,r.IQ)(!0));try{var i;let s=await o.get("samplecauculateafilliados2.php",{params:{start_date:e,end_date:t,afiliado:a,unidade_chave:n}});(null===(i=s.data)||void 0===i?void 0:i.success)?l((0,r.PI)({calculateMysql:s.data.result.calculateMysql||[],calculateBigquery:s.data.result.calculateBigquery||[]})):(l((0,r.PI)({calculateMysql:[],calculateBigquery:[]})),c.ZP.info(s.data.message||"Nenhum dado encontrado."))}catch(e){c.ZP.error("Erro ao buscar c\xe1lculo geral."),l((0,r.PI)({calculateMysql:[],calculateBigquery:[]}))}finally{l((0,r.IQ)(!1))}}},w=e=>async t=>{try{t((0,r.CF)(!0));let a=await i.Z.get("/afiliados/findByEmail",{params:{search:e}});return t((0,r.H0)(a.data.afiliado)),a.data.afiliado}catch(e){t((0,r.H0)(null))}finally{t((0,r.CF)(!1))}},$=()=>async e=>{try{e((0,r.Vt)(!0));let t=await i.Z.get("/afiliados/listUnidade");return e((0,r.rU)(t.data.unidades)),t.data.unidades}catch(t){e((0,r.rU)([]))}finally{e((0,r.Vt)(!1))}},O=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0;return async n=>{n((0,r.J$)(!0));try{let l=await o.get("sales_report.php",{params:{start_date:t,end_date:a,search:e}});l.data?(console.log(l.data),n((0,r.Bj)(l.data||null))):(n((0,r.Bj)(null)),c.ZP.info(l.data.message||"Nenhum dado encontrado."))}catch(e){c.ZP.error("Erro ao buscar o relat\xf3rio de vendas."),n((0,r.Bj)(null))}finally{n((0,r.J$)(!1))}}},R=async(e,t)=>{try{let a=await l.Z.post("getComissoesPreview.php",JSON.stringify({month:e,year:t}),{headers:{"Content-Type":"application/json"}});return a.data}catch(e){return console.error("Erro ao buscar preview de comiss\xf5es:",e),{count:0,total:0}}},I=async(e,t)=>{try{let a=await i.Z.post("/afiliados/exportar",{start_date:e,end_date:t},{responseType:"blob"}),n=window.URL.createObjectURL(new Blob([a.data])),o=document.createElement("a");return o.href=n,o.setAttribute("download","comissoes_afiliados_".concat(e,"_").concat(t,".xlsx")),document.body.appendChild(o),o.click(),o.remove(),window.URL.revokeObjectURL(n),{success:!0}}catch(e){return c.ZP.error("Erro ao exportar comiss\xf5es. Tente novamente."),{success:!1,error:e.message}}}},25440:function(e,t,a){"use strict";var n=a(29061);let o=n.Z.create({baseURL:"https://pratiquetecnologia.com.br/api/app/loja",headers:{"Content-Type":"application/x-www-form-urlencoded"}});t.Z=o}},function(e){e.O(0,[40411,63884,69977,19483,96640,49774,92888,40179],function(){return e(e.s=45264)}),_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.