<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">sessionStorage.setItem("CONTEUDO_CONSUMIDO_DATE",(new Date).getTime());var sendDataAtendimento=function(e,t,n,o,i,a,s,r,c,d,l,m,u,g,A,f,p,E,S){"SBRT"==n&amp;&amp;(o="SEM_TEMA"),getKeycloak((function(P){if(f){var I={"Content-Type":"application/json"};$.ajax({type:"POST",url:e,headers:I,crossDomain:!0,data:JSON.stringify({guid:t,tipo:n,tema:o,titulo:i,codTema:a,resumo:s,instrumento:r,retranca:c,contabilizacaoPNEE:d,indEmailMkt:1,cpf:m,cnpj:u,url:btoa(window.location.href),codAtendimento:null,indEmissor:A,emailMkt:f,ferramentaUrl:E}),error:function(e,t,n){console.log("erro gerarAtendimento: "+n)},complete:S})}else if(P.authenticated){I={"Content-Type":"application/json"};null===l&amp;&amp;(I.Authorization="bearer "+P.token),$.ajax({type:"POST",url:e,headers:I,crossDomain:!0,data:JSON.stringify({guid:t,tipo:n,tema:o,titulo:i,codTema:a,resumo:s,instrumento:r,retranca:c,contabilizacaoPNEE:d,indEmailMkt:l,cpf:m,cnpj:u,url:btoa(window.location.href),codAtendimento:g,indEmissor:A,emailMkt:f,ferramentaUrl:btoa(E)}),success:e=&gt;p(e,P),error:function(e,t,n){console.log("erro gerarAtendimento: "+n)},complete:S})}else S&amp;&amp;S()}))},AtendimentoAPI={sendAtendimento:function sendAtendimento(e={},t={},n={}){let{endpoint:o,timeout:i=15e3}=e,{guid:a,tipo:s,tema:r,titulo:c,codTema:d,resumo:l,instrumento:m,retranca:u,contabilizacaoPNEE:g,codAtendimento:A,indEmissor:f,cpfMkt:p,ferramentaUrl:E}=t,{onComplete:S,onSuccess:P,onError:I}=n;"SBRT"==s&amp;&amp;(r="SEM_TEMA"),getKeycloak((e=&gt;{let n={"Content-Type":"application/json"};if(!e.authenticated&amp;&amp;!p)return;e.authenticated&amp;&amp;(n.Authorization="bearer "+e.token);let i={...t,url:btoa(window.location.href),codAtendimento:p?null:A,ferramentaUrl:E?btoa(E):null},a={type:"POST",url:o,headers:n,crossDomain:!0,data:JSON.stringify(i),error:I,success:P?(...t)=&gt;P(e,t):null,complete:S};$.ajax(a)}))},defaultOnSuccess:function defaultOnSuccess(e){console.debug("Atendimento registrado com sucesso")},defaultOnComplete:function defaultOnComplete(){},defaultOnError:function defaultOnError(e,t,n){console.debug("Erro ao gerar atendimento",n)}},AtendimentoStorage=(()=&gt;{let e=!1,t=["PCT","PIN","PRS","PCW","CDB","PMC","PWA"];return getKeycloak((t=&gt;{try{if(t.authenticated){if(function invalidState(e){const t=localStorage.getItem("Atendimentos");if(!t)return!0;const n=JSON.parse(t),o=!(n&amp;&amp;n.hash&amp;&amp;n.sid&amp;&amp;n.consumed),i=n.hash!=e.sub||n.sid!=e.sid;return o||i}(t.tokenParsed)){const e=localStorage.getItem("Atendimentos"),n=e?JSON.parse(e):{};localStorage.setItem("Atendimentos",JSON.stringify({hash:t.tokenParsed.sub,sid:t.tokenParsed.sid,consumed:{PCT:[],PIN:[],PRS:[],PCW:[],CDB:n.consumed&amp;&amp;n.consumed.CDB&amp;&amp;n.consumed.CDB.length?n.consumed.CDB:[],PMC:[],PWA:[]}}))}}else{const e=localStorage.getItem("Atendimentos"),t=e?JSON.parse(e):{};localStorage.setItem("Atendimentos",JSON.stringify({consumed:{PCT:[],PIN:[],PRS:[],PCW:[],CDB:t.consumed&amp;&amp;t.consumed.CDB&amp;&amp;t.consumed.CDB.length&amp;&amp;!t.hash?t.consumed.CDB:[],PMC:t.consumed&amp;&amp;t.consumed.PMC&amp;&amp;t.consumed.PMC.length&amp;&amp;!t.hash?t.consumed.PMC:[],PWA:t.consumed&amp;&amp;t.consumed.PWA&amp;&amp;t.consumed.PWA.length&amp;&amp;!t.hash?t.consumed.PWA:[]}}))}}catch(e){}e=!0})),{checkAndInsert:async function checkAndInsert(n,o){if(!e){for(let t=0;t&lt;5&amp;&amp;!e;t++)await new Promise(((e,t)=&gt;setTimeout((()=&gt;e("DONE")),500)));e||(e=!0,console.debug("NÃ£o foi possÃ­vel iniciar a tranca"))}if(!t.includes(n))return"INVALID";const i=localStorage.getItem("Atendimentos"),a=i?JSON.parse(i):{};return a.consumed[n].includes(o)?"ALREADY_REGISTERED":(a.consumed[n].push(o),localStorage.setItem("Atendimentos",JSON.stringify(a)),"INSERTED")},remove:function remove(e,t){const n=localStorage.getItem("Atendimentos"),o=n?JSON.parse(n):{};o.consumed&amp;&amp;o.consumed[e]&amp;&amp;o.consumed[e].length&amp;&amp;o.consumed[e].includes(t)&amp;&amp;(o.consumed[e]=o.consumed[e].filter((e=&gt;e!==t)),localStorage.setItem("Atendimentos",JSON.stringify(o)))}}})(),AtendimentoUtilities={getPossibleEmailMkt:function getPossibleEmailMkt(){var e=window.location.search.split("&amp;").find((e=&gt;(e+"").includes("emailMkt=")));return e?e.substring(e.indexOf("emailMkt=")+9):null},getOffset:function getOffset(){let e=sessionStorage.getItem("CONTEUDO_CONSUMIDO_OFFSET");if(e)return parseInt(e);const t=document.querySelector("footer.sb-structure__footer"),n=document.querySelector("section.sb-common-content__banner-horizontal"),o=document.querySelector("section.tagged-gtm-carousel");return t&amp;&amp;(e+=t.offsetHeight,n&amp;&amp;n.classList.contains("sb-common-content__banner-horizontal")&amp;&amp;"SECTION"===n.tagName&amp;&amp;(e+=n.offsetHeight,o&amp;&amp;o.classList.contains("tagged-gtm-carousel")&amp;&amp;"SECTION"===o.tagName&amp;&amp;(e+=o.offsetHeight))),e=e&lt;800?800:e,sessionStorage.setItem("CONTEUDO_CONSUMIDO_OFFSET",e),e},applyWidgetNpsConditions:function applyWidgetNpsConditions(e,t,n,o,i){$(window).scroll((function scrollWidget(){let a=AtendimentoUtilities.getOffset();if($(window).scrollTop()+$(window).height()&lt;$(document).height()-parseInt(a))return;let s=sessionStorage.getItem("CONTEUDO_CONSUMIDO_DATE");if(s)if(s=parseInt(s),parseInt(s)+12e4&lt;=Date.now())injetarWidgetNpsByCookie(e,t,n,o,"OrientaÃ§Ã£o TÃ©cnica",i),$(window).off("scroll",scrollWidget);else{const a=Date.now()-s+12e4;setTimeout((()=&gt;{injetarWidgetNpsByCookie(e,t,n,o,"OrientaÃ§Ã£o TÃ©cnica",i)}),a),$(window).off("scroll",scrollWidget)}}))},chooseEndpoint:async function chooseEndpoint(e){const t=await async function getEndpoints(){return new Promise(((e,t)=&gt;{$.getJSON("/Sebrae/Portal Sebrae/resources/js/amei/endpoints.json").done((t=&gt;{endpoint=t,e(t)})).fail(((e,n,o)=&gt;t(o)))}))}();let n=null;switch(e){case"PIN":n=t.endpoints.gerarAtendimentoPIN;break;case"PMC":n=t.endpoints.gerarAtendimentoEmail;break;case"PRS":n=t.endpoints.gerarAtendimentoPRS;break;case"PWA":n=t.endpoints.gerarAtendimentoPWA;break;case"PCT":n=t.endpoints.gerarAtendimento;break;case"CDB":n=t.endpoints.gerarAtendimentoCDB}return t.origin+n},getContabilizacaoInfo:function getContabilizacaoInfo(e){const t=function getEncryptData(){var e=window.location.search.split("&amp;").find((e=&gt;(e+"").includes("cpfMkt=")));return e?e.substring(e.indexOf("cpfMkt=")+7):null}(),n=function getEncryptDataOrigin(){return new URL(window.location.href).searchParams.get("from")}();return["CDB"!==e&amp;&amp;t?"whatsapp"===n?"PWA":"PMC":e,t]}};async function gerarAtendimentoPIN(e,t,n,o,i,a,s,r,c,d){c=c||0;const[l,m]=AtendimentoUtilities.getContabilizacaoInfo("PIN"),u=await AtendimentoStorage.checkAndInsert(l,e),g=await AtendimentoUtilities.chooseEndpoint(l);if("ALREADY_REGISTERED"!==u&amp;&amp;"INVALID"!==u)return await new Promise(((u,A)=&gt;{AtendimentoAPI.sendAtendimento({endpoint:g},{guid:e,tipo:t,tema:n,titulo:o,codTema:i,resumo:a,instrumento:s,retranca:r,contabilizacaoPNEE:c,indEmissor:d,cpfMkt:m},{onSuccess:(e,t)=&gt;{"9"==s&amp;&amp;AtendimentoUtilities.applyWidgetNpsConditions(t,o,n,i,e),u(t)},onError:(t,n,o)=&gt;{AtendimentoStorage.remove(l,e),A(n)}})})).catch((e=&gt;console.error(e)));console.log(`Could not insert ${e} - ${u}`)}async function gerarAtendimentoPRS(e,t,n,o,i,a,s,r,c,d){c=c||0;const[l,m]=AtendimentoUtilities.getContabilizacaoInfo("PRS"),u=await AtendimentoUtilities.chooseEndpoint(l),g=await AtendimentoStorage.checkAndInsert(l,e);if("ALREADY_REGISTERED"!==g&amp;&amp;"INVALID"!==g)return await new Promise(((g,A)=&gt;{AtendimentoAPI.sendAtendimento({endpoint:u},{guid:e,tipo:t,tema:n,titulo:o,codTema:i,resumo:a,instrumento:s,retranca:r,contabilizacaoPNEE:c,indEmissor:d,cpfMkt:m},{onSuccess:(e,t)=&gt;{"9"==s&amp;&amp;AtendimentoUtilities.applyWidgetNpsConditions(t,o,n,i,e),g(t)},onError:(t,n,o)=&gt;{AtendimentoStorage.remove(l,e),A(n)}})})).catch((e=&gt;console.error(e)));console.log(`Could not insert ${e} - ${g}`)}async function gerarAtendimentoPCT(e,t,n,o,i,a,s,r,c,d){c=c||0;const[l,m]=AtendimentoUtilities.getContabilizacaoInfo("PCT"),u=await AtendimentoStorage.checkAndInsert(l,e),g=await AtendimentoUtilities.chooseEndpoint(l);if("ALREADY_REGISTERED"!==u&amp;&amp;"INVALID"!==u)return await new Promise(((u,A)=&gt;{AtendimentoAPI.sendAtendimento({endpoint:g},{guid:e,tipo:t,tema:n,titulo:o,codTema:i,resumo:a,instrumento:s,retranca:r,contabilizacaoPNEE:c,indEmissor:d,cpfMkt:m},{onSuccess:(e,t)=&gt;{"9"==s&amp;&amp;AtendimentoUtilities.applyWidgetNpsConditions(t,o,n,i,e),u(t)},onError:(t,n,o)=&gt;{AtendimentoStorage.remove(l,e),A(n)}})})).catch((e=&gt;console.error(e)));console.log(`Could not insert ${e} - ${u}`)}async function gerarAtendimentoCDB(e,t,n,o,i,a,s,r,c,d,l){d=d||0;const[m,u]=AtendimentoUtilities.getContabilizacaoInfo("CDB"),g=await AtendimentoStorage.checkAndInsert(m,t),A=await AtendimentoUtilities.chooseEndpoint(m);if("ALREADY_REGISTERED"!==g&amp;&amp;"INVALID"!==g)return await new Promise(((g,f)=&gt;{AtendimentoAPI.sendAtendimento({endpoint:A},{guid:t,tipo:n,tema:o,titulo:i,codTema:a,resumo:s,instrumento:r,retranca:c,contabilizacaoPNEE:d,indEmissor:l,cpfMkt:u,ferramentaUrl:e},{onSuccess:(e,t)=&gt;{"9"==r&amp;&amp;AtendimentoUtilities.applyWidgetNpsConditions(t,i,o,a,e),g(t)},onError:(e,n,o)=&gt;{AtendimentoStorage.remove(m,t),f(n)}})})).catch((e=&gt;console.error(e)));console.log(`Could not insert ${t} - ${g}`)}async function gerarAtendimento(e,t,n,o,i,a,s,r,c,d){return"SERVICODIGITAL"==t?await gerarAtendimentoPRS(e,t,n,o,i,a,s,r,c,d):"IDEIAS DE NEGOCIO"==t?await gerarAtendimentoPIN(e,t,n,o,i,a,s,r,c,d):await gerarAtendimentoPCT(e,t,n,o,i,a,s,r,c,d)}
</pre></body></html>