PageSourceSearch

https://fenaprevi.org.br/_next/static/chunks/pages/imprensa/preferencias-201a9a0823728a58.js

js fenaprevi.org.br collected 2026-09-28 10:37:04 UTC 16,429 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2824],{67952:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/imprensa/preferencias",function(){return r(79246)}])},79765:function(e,n,r){"use strict";r.d(n,{GH:function(){return V},I9:function(){return q},II:function(){return D},KM:function(){return K},NI:function(){return R},Ol:function(){return T},Ph:function(){return G},TA:function(){return Q},XZ:function(){return Y},Yu:function(){return z},_R:function(){return W},__:function(){return F},cO:function(){return X},eW:function(){return M},f7:function(){return $},ke:function(){return H},kq:function(){return U},ll:function(){return O},nj:function(){return L},p6:function(){return B},r2:function(){return J},uw:function(){return _},y:function(){return A}});var t=r(7297),o=r(14141);function i(){let e=(0,t.Z)(["\n  width: 100%;\n  min-height: calc(100vh - 140px);\n  background: ",';\n  padding: 13rem 2rem 8rem;\n  font-family: "Lato", "Montserrat", sans-serif;\n']);return i=function(){return e},e}function a(){let e=(0,t.Z)(["\n  width: min(960px, 100%);\n  margin: 0 auto;\n  display: flex;\n  flex-direction: column;\n  gap: 2rem;\n"]);return a=function(){return e},e}function s(){let e=(0,t.Z)(["\n  background: ",";\n  border: 1px solid ",";\n  border-radius: 12px;\n  box-shadow: 0 2px 10px rgba(45, 45, 58, 0.08);\n  overflow: hidden;\n"]);return s=function(){return e},e}function c(){let e=(0,t.Z)(["\n  background: ",";\n  color: #ffffff;\n  padding: 1.6rem 2rem;\n  border-bottom: 4px solid ",";\n"]);return c=function(){return e},e}function l(){let e=(0,t.Z)(["\n  margin: 0;\n  font-size: 2rem;\n  font-weight: 700;\n"]);return l=function(){return e},e}function d(){let e=(0,t.Z)(["\n  margin: 0.8rem 0 0;\n  font-size: 1.5rem;\n  font-weight: 400;\n  color: rgba(255, 255, 255, 0.86);\n"]);return d=function(){return e},e}function u(){let e=(0,t.Z)(["\n  padding: 2.4rem;\n"]);return u=function(){return e},e}function f(){let e=(0,t.Z)(["\n  display: flex;\n  flex-direction: column;\n  gap: 1.6rem;\n"]);return f=function(){return e},e}function x(){let e=(0,t.Z)(["\n  display: flex;\n  flex-direction: column;\n  gap: 0.8rem;\n"]);return x=function(){return e},e}function m(){let e=(0,t.Z)(["\n  font-size: 1.4rem;\n  color: ",";\n  font-weight: 700;\n"]);return m=function(){return e},e}function p(){let e=(0,t.Z)(["\n  border: 1px solid ",";\n  border-radius: 8px;\n  min-height: 4.4rem;\n  padding: 1.1rem 1.2rem;\n  font-size: 1.5rem;\n  color: ",";\n\n  &:focus {\n    outline: none;\n    border-color: ",";\n    box-shadow: 0 0 0 2px rgba(232, 101, 10, 0.2);\n  }\n"]);return p=function(){return e},e}function h(){let e=(0,t.Z)(["\n  border: 1px solid ",";\n  border-radius: 8px;\n  min-height: 4.4rem;\n  padding: 1.1rem 3.6rem 1.1rem 1.2rem;\n  font-size: 1.5rem;\n  color: ",";\n  background: #fff;\n  appearance: none;\n  background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E\");\n  background-repeat: no-repeat;\n  background-position: right 1.2rem center;\n\n  &:focus {\n    outline: none;\n    border-color: ",";\n    box-shadow: 0 0 0 2px rgba(232, 101, 10, 0.2);\n  }\n"]);return h=function(){return e},e}function g(){let e=(0,t.Z)(["\n  display: grid;\n  grid-template-columns: repeat(2, minmax(0, 1fr));\n  gap: 0.8rem;\n\n  @media screen and (max-width: 700px) {\n    grid-template-columns: minmax(0, 1fr);\n  }\n"]);return g=function(){return e},e}function b(){let e=(0,t.Z)(["\n  display: flex;\n  align-items: flex-start;\n  gap: 0.8rem;\n  font-size: 1.4rem;\n  color: ",";\n  cursor: pointer;\n  line-height: 1.4;\n"]);return b=function(){return e},e}function j(){let e=(0,t.Z)(["\n  margin-top: 0.2rem;\n"]);return j=function(){return e},e}function w(){let e=(0,t.Z)(["\n  color: ",";\n  font-size: 1.3rem;\n"]);return w=function(){return e},e}function v(){let e=(0,t.Z)(["\n  margin: 0;\n  color: ",";\n  font-size: 1.3rem;\n"]);return v=function(){return e},e}function k(){let e=(0,t.Z)(["\n  display: flex;\n  flex-wrap: wrap;\n  gap: 1rem;\n  margin-top: 0.8rem;\n"]);return k=function(){return e},e}function C(){let e=(0,t.Z)(["\n  border: 0;\n  border-radius: 8px;\n  min-height: 4.4rem;\n  padding: 0.8rem 1.8rem;\n  background: ",";\n  color: #fff;\n  font-size: 1.5rem;\n  font-weight: 700;\n  transition: background 0.2s ease;\n\n  &:hover:not(:disabled) {\n    background: ",";\n  }\n\n  &:disabled {\n    opacity: 0.55;
1\n    cursor: not-allowed;\n  }\n"]);return C=function(){return e},e}function y(){let e=(0,t.Z)(["\n  border: 1px solid ",";\n  border-radius: 8px;\n  min-height: 4.4rem;\n  padding: 0.8rem 1.8rem;\n  background: #fff;\n  color: ",";\n  font-size: 1.5rem;\n  font-weight: 700;\n  transition: border-color 0.2s ease, color 0.2s ease;\n\n  &:hover:not(:disabled) {\n    border-color: ",";\n    color: ",";\n  }\n\n  &:disabled {\n    opacity: 0.55;\n    cursor: not-allowed;\n  }\n"]);return y=function(){return e},e}function Z(){let e=(0,t.Z)(["\n  border: 0;\n  background: transparent;\n  color: ",";\n  font-size: 1.4rem;\n  text-decoration: underline;\n  padding: 0;\n  width: fit-content;\n"]);return Z=function(){return e},e}function I(){let e=(0,t.Z)(["\n  display: inline-flex;\n  align-items: center;\n  gap: 0.8rem;\n  font-size: 1.5rem;\n  font-weight: 700;\n  color: ",";\n"]);return I=function(){return e},e}function P(){let e=(0,t.Z)(["\n  margin: 0;\n  color: ",";\n  font-size: 1.4rem;\n"]);return P=function(){return e},e}function S(){let e=(0,t.Z)(["\n  max-height: ",";\n  opacity: ",";\n  overflow: hidden;\n  transform: translateY(",");\n  transition: max-height 0.25s ease, opacity 0.25s ease, transform 0.25s ease;\n"]);return S=function(){return e},e}function E(){let e=(0,t.Z)(["\n  border: 1px solid ",";\n  border-left: 4px solid ",";\n  background: #fff8f2;\n  color: ",";\n  padding: 1rem 1.2rem;\n  border-radius: 8px;\n  font-size: 1.4rem;\n"]);return E=function(){return e},e}let N={header:"#2d2d3a",accent:"#e8650a",background:"#f2efe9",card:"#ffffff",border:"#dddad3",text:"#2d2d3a",muted:"#66616f",success:"#1f8b4c",danger:"#b4472a"},z=o.ZP.section.withConfig({componentId:"sc-386072ad-0"})(i(),N.background),_=o.ZP.div.withConfig({componentId:"sc-386072ad-1"})(a()),q=o.ZP.article.withConfig({componentId:"sc-386072ad-2"})(s(),N.card,N.border),T=o.ZP.header.withConfig({componentId:"sc-386072ad-3"})(c(),N.header,N.accent),O=o.ZP.h1.withConfig({componentId:"sc-386072ad-4"})(l()),W=o.ZP.p.withConfig({componentId:"sc-386072ad-5"})(d()),M=o.ZP.div.withConfig({componentId:"sc-386072ad-6"})(u());o.ZP.form.withConfig({componentId:"sc-386072ad-7"})(f());let R=o.ZP.div.withConfig({componentId:"sc-386072ad-8"})(x()),F=o.ZP.label.withConfig({componentId:"sc-386072ad-9"})(m(),N.text),D=o.ZP.input.withConfig({componentId:"sc-386072ad-10"})(p(),N.border,N.text,N.accent),G=o.ZP.select.withConfig({componentId:"sc-386072ad-11"})(h(),N.border,N.text,N.accent),X=o.ZP.div.withConfig({componentId:"sc-386072ad-12"})(g()),H=o.ZP.label.withConfig({componentId:"sc-386072ad-13"})(b(),N.text),Y=o.ZP.input.withConfig({componentId:"sc-386072ad-14"})(j()),A=o.ZP.span.withConfig({componentId:"sc-386072ad-15"})(w(),N.danger),B=o.ZP.p.withConfig({componentId:"sc-386072ad-16"})(v(),N.muted),V=o.ZP.div.withConfig({componentId:"sc-386072ad-17"})(k()),K=o.ZP.button.withConfig({componentId:"sc-386072ad-18"})(C(),N.header,N.accent),U=o.ZP.button.withConfig({componentId:"sc-386072ad-19"})(y(),N.border,N.text,N.accent,N.accent);o.ZP.button.withConfig({componentId:"sc-386072ad-20"})(Z(),N.accent);let L=o.ZP.label.withConfig({componentId:"sc-386072ad-21"})(I(),N.text),J=o.ZP.p.withConfig({componentId:"sc-386072ad-22"})(P(),e=>{let{tone:n}=e;return"success"===n?N.success:N.danger}),Q=o.ZP.div.withConfig({componentId:"sc-386072ad-23"})(S(),e=>{let{isVisible:n}=e;return n?"400px":"0"},e=>{let{isVisible:n}=e;return n?1:0},e=>{let{isVisible:n}=e;return n?"0":"-4px"}),$=o.ZP.div.withConfig({componentId:"sc-386072ad-24"})(E(),N.border,N.accent,N.text)},20524:function(e,n,r){"use strict";r.d(n,{m:function(){return i}});var t=r(67294),o=r(11997);let i=()=>{let[e,n]=(0,t.useState)([]),[r,i]=(0,t.useState)(!0),[a,s]=(0,t.useState)(""),c=(0,t.useCallback)(async()=>{try{i(!0),s("");let e=await o.Nb.listarAssuntos();n(e)}catch(e){s(e instanceof Error?e.message:"N\xe3o foi poss\xedvel carregar os assuntos de interesse.")}finally{i(!1)}},[]);return(0,t.useEffect)(()=>{c()},[c]),{assuntos:e,isLoading:r,error:a,refetch:c}}},79246:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return m}});
1var t=r(85893),o=r(67294),i=r(11163),a=r(86501),s=r(33602),c=r(20524),l=r(11997);let d=()=>{let{token:e,user:n,updateUser:r}=(0,s.a)(),[t,i]=(0,o.useState)(n),[a,c]=(0,o.useState)(!0),[d,u]=(0,o.useState)(!1),[f,x]=(0,o.useState)(""),m=(0,o.useCallback)(async()=>{if(!e)return i(null),x("Sess\xe3o expirada. Fa\xe7a login novamente."),c(!1),null;try{c(!0),x("");let n=await l.Nb.obterUsuarioMe(e);return i(n),r(n),n}catch(n){let e=n instanceof Error?n.message:"N\xe3o foi poss\xedvel carregar os seus dados.";return x(e),null}finally{c(!1)}},[e,r]),p=(0,o.useCallback)(async n=>{if(!e)throw Error("Sess\xe3o expirada. Fa\xe7a login novamente.");try{u(!0),x("");let t=await l.Nb.salvarPreferencias(e,n);return i(t),r(t),t}catch(n){let e=n instanceof Error?n.message:"N\xe3o foi poss\xedvel salvar as prefer\xeancias.";throw x(e),Error(e)}finally{u(!1)}},[e,r]);return(0,o.useEffect)(()=>{i(n)},[n]),(0,o.useEffect)(()=>{m()},[m]),{usuario:t,isLoading:a,isSaving:d,error:f,carregarUsuario:m,salvarPreferencias:p}};var u=r(79765);let f=[{value:"imediata",label:"Imediata — a cada nova publica\xe7\xe3o"},{value:"diaria",label:"Di\xe1ria — resumo \xe0s 18h do dia"},{value:"semanal",label:"Semanal — resumo toda sexta-feira \xe0s 18h"}];function x(e){let{onboarding:n=!1}=e,r=(0,i.useRouter)(),{logout:l}=(0,s.a)(),{usuario:x,isLoading:m,isSaving:p,error:h,salvarPreferencias:g}=d(),{assuntos:b,isLoading:j,error:w,refetch:v}=(0,c.m)(),[k,C]=(0,o.useState)(!0),[y,Z]=(0,o.useState)(["imediata"]),[I,P]=(0,o.useState)([]),[S,E]=(0,o.useState)(""),[N,z]=(0,o.useState)("");(0,o.useEffect)(()=>{x&&(C(x.receberNotificacoes),Z(x.frequencias.length>0?x.frequencias:["imediata"]),P(x.assuntos))},[x]);let _=(0,o.useCallback)(e=>{if(C(e),!e){Z([]);return}Z(e=>e.length>0?e:["imediata"])},[]),q=(0,o.useCallback)((e,n)=>{Z(r=>n?r.includes(e)?r:[...r,e]:r.filter(n=>n!==e))},[]),T=(0,o.useCallback)((e,n)=>{P(r=>n?r.includes(e)?r:[...r,e]:r.filter(n=>n!==e))},[]),O=(0,o.useCallback)(()=>{P(b.map(e=>e.id))},[b]),W=(0,o.useCallback)(()=>{P([])},[]),M=(0,o.useCallback)(async()=>{if(E(""),z(""),k&&0===y.length){E("Selecione pelo menos uma frequ\xeancia de notifica\xe7\xe3o."),a.ZP.error("Selecione pelo menos uma frequ\xeancia de notifica\xe7\xe3o.");return}try{await g({receberNotificacoes:k,frequencias:y,assuntos:I}),z("Prefer\xeancias salvas com sucesso!"),a.ZP.success("Prefer\xeancias salvas com sucesso!")}catch(e){E(e instanceof Error?e.message:"N\xe3o foi poss\xedvel salvar as prefer\xeancias."),a.ZP.error(e instanceof Error?e.message:"N\xe3o foi poss\xedvel salvar as prefer\xeancias.")}},[I,y,k,g]),R=(0,o.useMemo)(()=>j?(0,t.jsx)(u.p6,{children:"Carregando assuntos..."}):w?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.y,{children:w}),(0,t.jsx)(u.kq,{type:"button",onClick:v,children:"Tentar novamente"})]}):0===b.length?(0,t.jsx)(u.p6,{children:"Nenhum assunto dispon\xedvel no CMS."}):(0,t.jsx)(u.cO,{children:b.map(e=>(0,t.jsxs)(u.ke,{children:[(0,t.jsx)(u.XZ,{type:"checkbox",checked:I.includes(e.id),onChange:n=>T(e.id,n.currentTarget.checked)}),e.nome]},e.id))}),[b,w,j,I,T,v]);return m?(0,t.jsx)(u.I9,{children:(0,t.jsx)(u.eW,{children:(0,t.jsx)(u.p6,{children:"Carregando prefer\xeancias..."})})}):x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.I9,{children:[(0,t.jsxs)(u.Ol,{children:[(0,t.jsx)(u.ll,{children:"Prefer\xeancias da Sala de Imprensa"}),(0,t.jsxs)(u._R,{children:["Ol\xe1, ",x.nomeCompleto||x.email,". Gerencie seus alertas."]})]}),(0,t.jsxs)(u.eW,{children:[n&&(0,t.jsx)(u.f7,{children:"Este \xe9 o seu primeiro acesso. Revise e salve suas prefer\xeancias de notifica\xe7\xe3o."}),(0,t.jsxs)(u.GH,{children:[(0,t.jsx)(u.kq,{type:"button",onClick:()=>r.push("/imprensa/releases"),children:"Voltar \xe0 Sala de Imprensa"}),(0,t.jsx)(u.kq,{type:"button",onClick:()=>r.push("/imprensa/editar"),children:"Editar dados"}),(0,t.jsx)(u.kq,{type:"button",onClick:()=>{l(),r.push("/imprensa/acesso")},children:"Sair"})]})]})]}),(0,t.jsxs)(u.I9,{children:[(0,t.jsx)(u.Ol,{children:(0,t.jsx)(u.ll,{children:"Dados Pessoais"})}),(0,t.jsx)(u.eW,{children:(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:[{label:"Nome completo",value:x.nomeCompleto},{label:"E-mail",value:x.email},{label:"Telefone",value:x.telefone},{label:"Ve\xedculo de comunica\xe7\xe3o",value:x.veiculoComunicacao},{label:"Estado (UF)",value:x.uf}].map((e,n,r)=>{let{label:o,value:i}=e;return(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"0.3rem",padding:"1.2rem 0",borderBottom:n<r.length-1?"1px solid #edeae4":"none"},children:[(0,t.jsx)("span",{style:{fontSize:"1.1rem",fontWeight:700,color:"#9490a0",textTransform:"uppercase",letterSpacing:"0.07em"},children:o}),(0,t.jsx)("span",{style:{fontSize:"1.5rem",fontWeight:500,color:"#2d2d3a"},children:i||"N\xe3o informado"})]},o)})})})]}),(0,t.jsxs)(u.I9,{children:[(0,t.jsx)(u.Ol,{children:(0,t.jsx)(u.ll,{children:"Prefer\xeancias de Notifica\xe7\xe3o"})}),(0,t.jsx)(u.eW,{children:(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,t.jsx)("div",{style:{padding:"1.2rem 0",borderBottom:"1px solid #edeae4"},children:(0,t.jsxs)(u.nj,{children:[(0,t.jsx)(u.XZ,{type:"checkbox",checked:k,onChange:e=>_(e.currentTarget.checked)}),"Receber notifica\xe7\xf5es por e-mail"]})}),!k&&(0,t.jsx)("div",{style:{padding:"1.2rem 0"},children:(0,t.jsx)(u.f7,{children:"Voc\xea n\xe3o receber\xe1 nenhuma notifica\xe7\xe3o por e-mail."})}),(0,t.jsxs)(u.TA,{isVisible:k,children:[(0,t.jsx)("div",{style:{padding:"1.2rem 0",borderBottom:"1px solid #edeae4"},children:(0,t.jsxs)(u.NI,{children:[(0,t.jsx)("span",{style:{fontSize:"1.1rem",fontWeight:700,color:"#9490a0",textTransform:"uppercase",letterSpacing:"0.07em"},children:"Frequ\xeancias"}),(0,t.jsx)(u.cO,{children:f.map(e=>(0,t.jsxs)(u.ke,{children:[(0,t.jsx)(u.XZ,{type:"checkbox",checked:y.includes(e.value),onChange:n=>q(e.value,n.currentTarget.checked)}),e.label]},e.value))})]})}),(0,t.jsx)("div",{style:{padding:"1.2rem 0"},children:(0,t.jsxs)(u.NI,{children:[(0,t.jsx)("span",{style:{fontSize:"1.1rem",fontWeight:700,color:"#9490a0",textTransform:"uppercase",letterSpacing:"0.07em"}
1,children:"Assuntos de interesse"}),R,(0,t.jsxs)(u.GH,{children:[(0,t.jsx)(u.kq,{type:"button",onClick:O,children:"Selecionar todos"}),(0,t.jsx)(u.kq,{type:"button",onClick:W,children:"Desmarcar todos"})]})]})})]}),(S||N||h)&&(0,t.jsxs)("div",{style:{padding:"0.8rem 0"},children:[S&&(0,t.jsx)(u.r2,{tone:"error",children:S}),N&&(0,t.jsx)(u.r2,{tone:"success",children:N}),h&&(0,t.jsx)(u.r2,{tone:"error",children:h})]}),(0,t.jsx)("div",{style:{paddingTop:"1.2rem"},children:(0,t.jsx)(u.GH,{children:(0,t.jsx)(u.KM,{type:"button",disabled:p,onClick:M,children:p?"Salvando...":"Salvar prefer\xeancias"})})})]})})]})]}):(0,t.jsx)(u.I9,{children:(0,t.jsxs)(u.eW,{children:[(0,t.jsx)(u.y,{children:h||"N\xe3o foi poss\xedvel carregar seus dados de acesso."}),(0,t.jsx)(u.GH,{children:(0,t.jsx)(u.KM,{type:"button",onClick:()=>r.push("/imprensa/acesso"),children:"Fazer login novamente"})})]})})}function m(){let e=(0,i.useRouter)(),{isReady:n,isAuthenticated:r}=(0,s.a)(),a=(0,o.useMemo)(()=>"true"===e.query.onboarding,[e.query.onboarding]);return((0,o.useEffect)(()=>{n&&!r&&e.replace("/imprensa/acesso?redirect=".concat(encodeURIComponent(e.asPath)))},[r,n,e]),n)?r?(0,t.jsx)(u.Yu,{children:(0,t.jsx)(u.uw,{children:(0,t.jsx)(x,{onboarding:a})})}):(0,t.jsx)(u.Yu,{children:(0,t.jsx)(u.uw,{children:(0,t.jsx)(u.p6,{children:"Redirecionando para login..."})})}):(0,t.jsx)(u.Yu,{children:(0,t.jsx)(u.uw,{children:(0,t.jsx)(u.p6,{children:"Carregando..."})})})}}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=67952)}),_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.