1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4510],{1636:(e,t,r)=>{r.d(t,{I:()=>m});var a=r(95155),s=r(12115),o=r(73321),n=r(61878),i=r(94514),l=r(5853);let d={noticias:!0,revistas:!0,maiores:!0,videos:!0},c=[{key:"noticias",label:"Not\xedcias"},{key:"revistas",label:"Revistas"},{key:"maiores",label:"Maiores"},{key:"videos",label:"V\xeddeos"}];function u(e){return Object.entries(e).filter(([,e])=>e).map(([e])=>e).join(",")}function m({onSearchSubmit:e}={}){let t=(0,o.useRouter)(),r=(0,o.usePathname)(),f=(0,o.useSearchParams)(),[p,h]=(0,s.useState)(f.get("q")||""),{searchMode:x,setSearchMode:b,setUseDeepSearch:g}=(0,l.S)(),[v,w]=(0,s.useState)(d);(0,s.useEffect)(()=>{let e=f.get("q")||"",t=f.get("sources");h(e),w(function(e){if(!e?.trim())return{...d};let t=e.split(",").map(e=>e.trim().toLowerCase());return{noticias:t.includes("noticias"),revistas:t.includes("revistas"),maiores:t.includes("maiores"),videos:t.includes("videos")}}(t))},[f]);let y="ai"===x||"deep"===x;return(0,a.jsxs)("div",{className:"flex flex-col gap-2 w-full max-w-lg",children:[(0,a.jsxs)("form",{onSubmit:r=>{if(r.preventDefault(),!p.trim())return;let a=u(v);t.push(`/premium/search?q=${encodeURIComponent(p)}&sources=${a}&mode=${"fast"===x?"fast":"ai"}`),e?.()},className:"flex items-center w-full h-9 rounded-full bg-white border border-white/90 overflow-hidden",children:[(0,a.jsx)("span",{className:"flex items-center justify-center pl-3 pr-1 shrink-0",style:{color:"#4f0000"},children:(0,a.jsx)(n.A,{size:16})}),(0,a.jsx)("input",{type:"search",placeholder:"Buscar no acervo...",className:"flex-1 h-full bg-transparent text-black placeholder:text-gray-400 text-[13px] outline-none border-none px-1 min-w-0",value:p,onChange:e=>h(e.target.value)}),(0,a.jsxs)("div",{className:"flex items-center shrink-0 h-full",children:[(0,a.jsx)("button",{type:"submit",className:"group/search flex items-center justify-center h-7 w-7 rounded-full hover:bg-[#4f0000]/10 transition-colors cursor-pointer",title:"Buscar",children:(0,a.jsx)(n.A,{size:15,style:{color:"#4f0000"}})}),(0,a.jsx)("span",{className:"w-px h-4 bg-gray-300 mx-1"}),(0,a.jsxs)("button",{type:"button",onClick:()=>{b(y?"fast":"ai"),g(!1)},className:"flex items-center gap-1.5 px-2 pr-1.5 h-full hover:bg-gray-50 transition-colors rounded-r-full","aria-pressed":y,title:"Busca com Intelig\xeancia Artificial",children:[(0,a.jsx)("span",{className:"text-[10px] font-semibold text-slate-500 tracking-wide whitespace-nowrap",children:"Pergunte \xe0 IA"}),(0,a.jsx)("span",{className:`h-[18px] w-8 rounded-full border transition-colors flex items-center ${y?"border-[#4f0000]":"bg-slate-300 border-slate-300"}`,style:y?{backgroundColor:"#4f0000"}:void 0,children:(0,a.jsx)("span",{className:`block h-3.5 w-3.5 rounded-full bg-white shadow-sm transition-transform ${y?"translate-x-[14px]":"translate-x-0.5"}`})})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs pl-1",children:[(0,a.jsx)("span",{className:"text-white/90",children:"Buscar em:"}),c.map(({key:e,label:s})=>{let o=v[e];return(0,a.jsxs)("button",{type:"button",onClick:()=>(e=>{let a={...v,[e]:!v[e]};w(a);let s=u(a);if(r.includes("/premium/search")){let e=new URLSearchParams(f.toString());e.set("sources",s),t.replace(`${r}?${e.toString()}`)}})(e),className:"inline-flex items-center gap-1 px-2.5 py-1 rounded-full text-xs border border-current transition-colors hover:opacity-90 focus:outline-none focus:ring-1 focus:ring-white/30",style:{backgroundColor:o?"#750000":"#4d0000",color:"#fbf0e9",borderColor:o?"#750000":"rgba(0,0,0,0.4)"},children:[(0,a.jsx)("span",{className:"flex items-center justify-center w-2.5 h-2.5 rounded-full border border-current shrink-0",style:{borderWidth:"1px"},children:o&&(0,a.jsx)(i.A,{className:"w-1.5 h-1.5",strokeWidth:3})}),(0,a.jsx)("span",{className:"text-xs",children:s})]},e)})]})]})}},5853:(e,t,r)=>{r.d(t,{S:()=>i,SearchProvider:()=>n});var a=r(95155),s=r(12115);let o=(0,s.createContext)(void 0);function n({children:e}){let[t,r]=(0,s.useState)("fast"),[i,l]=(0,s.useState)(!1);return(0,a.jsx)(o.Provider,{value:{searchMode:t,setSearchMode:r,useDeepSearch:i,setUseDeepSearch:e=>{l(e),e?r("deep"):"deep"===t&&r("ai")},useAI:"ai"===t||"deep"===t,setUseAI:e=>{e?r(i?"deep":"ai"):(r("fast"),l(!1))}},children:e})}function i(){let e=(0,s.useContext)(o);if(void 0===e)throw Error("useSearch must be used within a SearchProvider");return e}},19865:(e,t,r)=>{r.d(t,{IG:()=>c,db:()=>u,j2:()=>d,yA:()=>l});var a=r(97873),s=r(65140),o=r(30928),n=r(4927);let i={apiKey:"AIzaSyAO_sbTBemKD068NVqv3RYb15ckEthjtrQ",authDomain:"login.brasilmineral.com.br",projectId:"brasil-mineral-newsletter",storageBucket:"brasil-mineral-newsletter.firebasestorage.app",messagingSenderId:"145521886346",a
1ppId:"1:145521886346:web:bb9afd106c161d05031973",measurementId:"G-QCKC22MY1G"},l=0===(0,a.Dk)().length?(0,a.Wp)(i):(0,a.Sx)(),d=(0,s.xI)(l),c=(0,o.c7)(l),u=(0,n.aU)(l,"premium-us".trim()||"(default)");i.projectId||console.error("Firebase Initialization Error: Firebase config is not fully set. Check your NEXT_PUBLIC_FIREBASE_ environment variables. Firebase features may not work correctly.")},40980:(e,t,r)=>{r.d(t,{Y:()=>n,cn:()=>o,o:()=>i});var a=r(29722),s=r(622);function o(...e){return(0,s.QP)((0,a.$)(e))}function n(e){return e?e.toString().toLowerCase().trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[\s_]+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,""):`artigo-sem-titulo-${Date.now()}`}function i(e){return e&&"string"==typeof e?e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]/g,""):""}},41754:(e,t,r)=>{r.d(t,{Cn:()=>a,SS:()=>o,yy:()=>s}),r(41463);let a="brasil-mineral",s="Brasil Mineral",o=a},48375:(e,t,r)=>{r.d(t,{A:()=>d,O:()=>l});var a=r(95155),s=r(12115),o=r(65140),n=r(19865);let i=(0,s.createContext)(void 0);function l({children:e}){let[t,r]=(0,s.useState)(null),[d,c]=(0,s.useState)(null),[u,m]=(0,s.useState)(null),[f,p]=(0,s.useState)(null),[h,x]=(0,s.useState)(!0),[b,g]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let e,t=!1,a=()=>{t||(e=(0,o.hg)(n.j2,async e=>{if(r(e),g(!!e?.emailVerified),e)try{let t=await e.getIdToken(),r=await fetch("/api/auth/me",{headers:{Authorization:`Bearer ${t}`}}),a=r.ok?await r.json():null;c(a?.user??null),m(a?.profile??null),p(a?.access??null)}catch(e){console.error("[AuthContext] Failed to fetch user data:",e),c(null),m(null),p(null)}else c(null),m(null),p(null);x(!1)}))},s="function"==typeof window.requestIdleCallback?window.requestIdleCallback(a,{timeout:2e3}):window.setTimeout(a,0);return()=>{t=!0,"function"==typeof window.cancelIdleCallback?window.cancelIdleCallback(s):window.clearTimeout(s),e?.()}},[]);let v=(0,s.useMemo)(()=>f?.isAdmin??d?.role==="admin",[f,d]),w=(0,s.useMemo)(()=>f?.isEditor??(d?.role==="admin"||d?.role==="editor"),[f,d]),y=(0,s.useMemo)(()=>f?.dashboardPermissions??d?.dashboardPermissions??[],[f,d]),N=(0,s.useMemo)(()=>e=>v||y.includes(e),[v,y]),j=(0,s.useMemo)(()=>!!t,[t]),S=(0,s.useMemo)(()=>u?.accountType==="premium",[u]),k=(0,s.useMemo)(()=>!!u?.isAdvertiser,[u]),C=async()=>{await n.j2.currentUser?.reload(),g(!!n.j2.currentUser?.emailVerified)},I=(0,s.useMemo)(()=>({user:t,appUser:d,userProfile:u,isLoading:h,isAdmin:v,isEditor:w,dashboardPermissions:y,hasFeature:N,isAuthenticated:j,isPremium:S,isAdvertiser:k,emailVerified:b,refreshEmailVerified:C}),[t,d,u,h,v,w,y,N,j,S,k,b]);return(0,a.jsx)(i.Provider,{value:I,children:e})}function d(){let e=(0,s.useContext)(i);if(void 0===e)throw Error("useAuth must be used within an AuthProvider");return e}},68136:(e,t,r)=>{r.d(t,{N:()=>i,w:()=>l});var a=r(95155),s=r(12115),o=r(41754);let n=(0,s.createContext)(void 0);function i({children:e}
1){let[t,r]=(0,s.useState)(o.SS),[l,d]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let e=(localStorage.getItem("app-theme"),o.SS);r(e),localStorage.setItem("app-theme",e),document.documentElement.setAttribute("data-theme",e),d(!1)},[]);let c=e=>{let t=o.SS;r(t),localStorage.setItem("app-theme",t),document.documentElement.setAttribute("data-theme",t)},u=(0,s.useMemo)(()=>({theme:t,setTheme:c,isLoadingTheme:l}),[t,l]);return(0,a.jsx)(n.Provider,{value:u,children:e})}function l(){let e=(0,s.useContext)(n);if(void 0===e)throw Error("useThemeContext must be used within a ThemeProvider");return e}},72264:(e,t,r)=>{r.d(t,{SQ:()=>m,_2:()=>f,lp:()=>p,mB:()=>h,rI:()=>c,ty:()=>u});var a=r(95155),s=r(12115),o=r(57793),n=r(21362),i=r(94514),l=r(16950),d=r(40980);let c=o.bL,u=o.l9;o.YJ,o.ZL,o.Pb,o.z6,s.forwardRef(({className:e,inset:t,children:r,...s},i)=>(0,a.jsxs)(o.ZP,{ref:i,className:(0,d.cn)("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...s,children:[r,(0,a.jsx)(n.A,{className:"ml-auto"})]})).displayName=o.ZP.displayName,s.forwardRef(({className:e,...t},r)=>(0,a.jsx)(o.G5,{ref:r,className:(0,d.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})).displayName=o.G5.displayName;let m=s.forwardRef(({className:e,sideOffset:t=4,...r},s)=>(0,a.jsx)(o.ZL,{children:(0,a.jsx)(o.UC,{ref:s,sideOffset:t,className:(0,d.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));m.displayName=o.UC.displayName;let f=s.forwardRef(({className:e,inset:t,...r},s)=>(0,a.jsx)(o.q7,{ref:s,className:(0,d.cn)("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r}));f.displayName=o.q7.displayName,s.forwardRef(({className:e,children:t,checked:r,...s},n)=>(0,a.jsxs)(o.H_,{ref:n,className:(0,d.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...s,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(o.VF,{children:(0,a.jsx)(i.A,{className:"h-4 w-4"})})}),t]})).displayName=o.H_.displayName,s.forwardRef(({className:e,children:t,...r},s)=>(0,a.jsxs)(o.hN,{ref:s,className:(0,d.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(o.VF,{children:(0,a.jsx)(l.A,{className:"h-2 w-2 fill-current"})})}),t]})).displayName=o.hN.displayName;let p=s.forwardRef(({className:e,inset:t,...r},s)=>(0,a.jsx)(o.JU,{ref:s,className:(0,d.cn)("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));p.displayName=o.JU.displayName;let h=s.forwardRef(({className:e,...t},r)=>(0,a.jsx)(o.wv,{ref:r,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",e),...t}));h.displayName=o.wv.displayName},89239:(e,t,r)=>{r.d(t,{$:()=>d,r:()=>l});var a=r(95155),s=r(12115),o=r(42442),n=r(18460),i=r(40980);let l=(0,n.F)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),d=s.forwardRef(({className:e,variant:t,size:r,asChild:s=!1,...n},d)=>{let c=s?o.DX:"button";return(0,a.jsx)(c,{className:(0,i.cn)(l({variant:t,size:r,className:e})),ref:d,...n})});d.displayName="Button"}}]);
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.