PageSourceSearch

https://secure-static.schutz.com.br/_next/static/chunks/pages/login/televendas-5c24a40a669916c5.js

js schutz.com.br collected 2026-09-24 11:13:18 UTC 6,579 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3452],{26930:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/login/televendas",function(){return r(33009)}])},33009:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return TelesalesLogin}});var n=r(85893),o=r(67294),a=r(9008),s=r.n(a),l=r(5602),i=r(93759),c=r(11163);let u="Erro no login televendas SSO",d={ACCESS_DENIED:"Voc\xea n\xe3o tem permiss\xe3o para acessar o televendas. Verifique se seu acesso est\xe1 habilitado.",MICROSOFT_ERROR:"N\xe3o foi poss\xedvel conectar com a Microsoft. Tente novamente.",NETWORK_ERROR:"Falha na comunica\xe7\xe3o com o servidor. Verifique sua conex\xe3o e tente novamente.",FORBIDDEN:"Seu usu\xe1rio n\xe3o tem permiss\xe3o para acessar o televendas desta marca.",INTERACTION_IN_PROGRESS:"J\xe1 existe uma autentica\xe7\xe3o em andamento. Aguarde ou recarregue a p\xe1gina.",POPUP_BLOCKED:"O popup de login foi bloqueado pelo navegador. Permita popups para este site e tente novamente."};var w=r(16447),p=r(5121),x=r(73713),m=r(73866),f=r(67710),E=r(23455);let g=p.Z.create({baseURL:"https://backoffice.schutz.com.br",timeout:3e4}),exchangeToken=async e=>{let{microsoftAccessToken:t}=e;try{let{data:e,status:r}=await g.post("/arezzocoocc/v2/".concat("schutz","/telesales/oauth/token"),new URLSearchParams({microsoft_token:t}));return f.N.setAccessToken(e.access_token),f.N.set(x.E.IS_AUTHENTICATED,"true"),(0,E.m9)({hasError:!1,errors:[],data:e,status:r,isServiceAvailable:!0,hasErrorRefreshingUserSession:!1,hasErrorRefreshingAnonymousSession:!1},e=>e)}catch(e){return m.vU({title:u,stack:[e]}),(0,E.$p)(e)}},h={exchangeToken};var v=r(84337);let _=["openid","profile","email","User.Read"],buildMsalConfig=()=>({auth:{clientId:"824c9e63-3262-4cc1-b553-e1ecb42b6910",authority:"https://login.microsoftonline.com/".concat("a94d3a29-8a64-40c2-966f-e9001602ae14"),redirectUri:"/login/televendas"},cache:{cacheLocation:"sessionStorage"},system:{loggerOptions:{logLevel:v.in.Warning}}}),R=new Set(["user_cancelled","timed_out"]),getMsalErrorCode=e=>e instanceof Error&&"errorCode"in e?e.errorCode:null,isSilentMsalError=e=>{let t=getMsalErrorCode(e);return null!==t&&R.has(t)},isInteractionInProgressError=e=>"interaction_in_progress"===getMsalErrorCode(e),isPopupBlockedError=e=>"popup_window_error"===getMsalErrorCode(e),N={401:d.ACCESS_DENIED,403:d.FORBIDDEN};var T=r(85413),b=r(85519),C=r(57207),O=r(28542),S=r(62854);let I=(0,S.C$)({_common:"tw-flex tw-items-center tw-justify-center tw-gap-3 tw-rounded-md\n    tw-border tw-border-solid tw-border-gray-300 tw-bg-white tw-px-6 tw-py-3\n    tw-text-sm tw-font-medium tw-text-gray-700 tw-shadow-sm tw-transition-colors\n    tw-duration-200 hover:tw-bg-gray-50 disabled:tw-cursor-not-allowed\n    disabled:tw-opacity-60"});function LoginButton(e){let{onClick:t,isLoading:r}=e;return(0,n.jsx)("button",{type:"button",onClick:t,disabled:r,className:I,"data-testid":O.RZ.TELESALES_LOGIN_BUTTON,children:r?(0,n.jsx)(b.$,{size:20}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(C.X,{name:"microsoft",className:"tw-size-5 tw-flex-shrink-0"}),(0,n.jsx)("span",{children:"Entrar com Microsoft"})]})})}var k=r(42473);function LoginError(e){let{error:t}=e;return t?(0,n.jsxs)("div",{role:"alert",className:"tw-flex tw-items-center tw-gap-2 tw-text-sm\n  tw-text-upsdell-red","data-testid":O.RZ.TELESALES_LOGIN_ERROR,children:[(0,n.jsx)(k.X,{name:"error",className:"tw-size-4 tw-flex-shrink-0"}),(0,n.jsx)("span",{children:t})]}):null}let y="Login Televendas | ".concat(T.T.PAGE_TITLE_BRAND_NAME);function TelesalesLoginPage(){let{handleLogin:e,isLoading:t,error:a}=function(){let[e,t]=(0,o.useState)(!1),[n,a]=(0,o.useState)(null),s=(0,o.useRef)(null),l=(0,c.useRouter)(),i=(0,o.useCallback)(async()=>{t(!0),a(null);let e=null,n=null;try{if(!s.current){let{PublicClientApplication:e}=await r.e(2422).then(r.bind(r,54368)),t=new e(buildMsalConfig());await t.initialize(),await t.handleRedirectPromise(),s.current=t}let i=s.current,c=i.addEventCallback(r=>{var n;if("msal:popupOpened"!==r.eventType)return;let o=null===(n=r.payload)||void 0===n?void 0:n.popupWindow;o&&(e=window.setInterval(()=>{o.closed&&(e&&clearInterval(e),t(!1))},500))});n=()=>{c&&i.removeEventCallback(c),e&&clearInterval(e)};let{accessToken:u}=await i.loginPopup({scopes:[..._]});n();let{hasError:p,status:x}=await h.exchangeToken({microsoftAccessToken:u});if(p){var o;
1a(null!==(o=N[x])&&void 0!==o?o:d.NETWORK_ERROR);return}await l.replace(w.Z.MY_ACCOUNT.INDEX)}catch(e){if(null==n||n(),isSilentMsalError(e))return;if(isInteractionInProgressError(e)){a(d.INTERACTION_IN_PROGRESS);return}if(isPopupBlockedError(e)){a(d.POPUP_BLOCKED);return}m.vU({title:u,stack:[e]}),a(d.MICROSOFT_ERROR)}finally{t(!1)}},[l]);return{handleLogin:i,isLoading:e,error:n}}();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s(),{children:(0,n.jsx)("title",{children:y})}),(0,n.jsxs)(l.A,{children:[(0,n.jsx)(i.h,{simple:!0}),(0,n.jsx)("section",{className:"tw-flex tw-flex-1 tw-flex-col tw-items-center tw-justify-center tw-bg-snow-point tw-px-4",children:(0,n.jsxs)("div",{className:"tw-flex tw-w-full tw-max-w-md tw-flex-col tw-items-center tw-gap-6 tw-rounded-lg tw-bg-white tw-px-8 tw-py-10 tw-shadow-sm",children:[(0,n.jsx)("h1",{className:"tw-text-gray-900 tw-text-xl tw-font-semibold",children:"Televendas"}),(0,n.jsx)("p",{className:"tw-text-gray-500 tw-text-center tw-text-sm",children:"Acesse o painel de televendas utilizando sua conta corporativa Microsoft."}),(0,n.jsx)(LoginButton,{onClick:e,isLoading:t}),(0,n.jsx)(LoginError,{error:a})]})}),(0,n.jsx)("footer",{className:"tw-text-gray-400 tw-w-full tw-py-4 tw-text-center tw-text-xs",children:(0,n.jsxs)("p",{children:["\xa9 ",new Date().getFullYear()," ",T.T.BRAND_NAME,". Todos os direitos reservados."]})})]})]})}let isMsalPopupContext=()=>{let{hash:e}=window.location;if(!e.includes("code=")&&!e.includes("error="))return!1;try{var t;let r=new URLSearchParams(e.slice(1)),n=r.get("state");if(!n)return!1;let o=JSON.parse(atob(decodeURIComponent(n)));return(null==o?void 0:null===(t=o.meta)||void 0===t?void 0:t.interactionType)==="popup"}catch(e){return!1}};function TelesalesLogin(){let[e,t]=(0,o.useState)(!1);return((0,o.useEffect)(()=>{isMsalPopupContext()&&(t(!0),r.e(2422).then(r.bind(r,64462)).then(e=>{let{broadcastResponseToMainFrame:t}=e;t()}).catch(e=>{m.vU({title:"Erro ao resolver autentica\xe7\xe3o MSAL no popup",stack:[e]})}))},[]),e)?null:(0,n.jsx)(TelesalesLoginPage,{})}}},function(e){e.O(0,[2422,741,3985,8597,3445,4607,9774,2888,179],function(){return e(e.s=26930)}),_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.