Files
bigtux 20a26affaa 📚 Documentação inicial do ALETHEIA
- MANUAL-PRODUTO.md: Manual do usuário final
- MANUAL-VENDAS.md: Estratégia comercial e vendas
- MANUAL-TECNICO.md: Infraestrutura e deploy
- README.md: Visão geral do projeto
2026-02-10 15:08:15 -03:00

1 line
13 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(()=>{var e={};e.id=398,e.ids=[398],e.modules={2934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},4580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},5869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},9498:(e,t,s)=>{"use strict";s.r(t),s.d(t,{GlobalError:()=>l.a,__next_app__:()=>x,originalPathname:()=>m,pages:()=>d,routeModule:()=>u,tree:()=>c}),s(989),s(3062),s(996);var a=s(170),r=s(5002),n=s(3876),l=s.n(n),i=s(6299),o={};for(let e in i)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(o[e]=()=>i[e]);s.d(t,o);let c=["",{children:["scan",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(s.bind(s,989)),"/home/kernelpanic/projetos_jarvis/aletheia/frontend/src/app/scan/page.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(s.bind(s,3062)),"/home/kernelpanic/projetos_jarvis/aletheia/frontend/src/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(s.t.bind(s,996,23)),"next/dist/client/components/not-found-error"]}],d=["/home/kernelpanic/projetos_jarvis/aletheia/frontend/src/app/scan/page.tsx"],m="/scan/page",x={require:s,loadChunk:()=>Promise.resolve()},u=new a.AppPageRouteModule({definition:{kind:r.x.APP_PAGE,page:"/scan/page",pathname:"/scan",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:c}})},5531:(e,t,s)=>{Promise.resolve().then(s.t.bind(s,3642,23)),Promise.resolve().then(s.t.bind(s,7586,23)),Promise.resolve().then(s.t.bind(s,7838,23)),Promise.resolve().then(s.t.bind(s,8057,23)),Promise.resolve().then(s.t.bind(s,7741,23)),Promise.resolve().then(s.t.bind(s,3118,23))},8440:(e,t,s)=>{Promise.resolve().then(s.bind(s,1999)),Promise.resolve().then(s.bind(s,8210))},1655:(e,t,s)=>{Promise.resolve().then(s.bind(s,4368))},4178:(e,t,s)=>{"use strict";var a=s(5289);s.o(a,"useRouter")&&s.d(t,{useRouter:function(){return a.useRouter}})},4368:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>c});var a=s(7247),r=s(8964),n=s(4178),l=s(2),i=s(2064),o=s(9906);function c(){let[e,t]=(0,r.useState)(!1),[c,d]=(0,r.useState)(""),[m,x]=(0,r.useState)(!1),[u,h]=(0,r.useState)(""),[p,g]=(0,r.useState)(null),{user:b,hydrate:j}=(0,i.t)();(0,n.useRouter)();let f=(0,r.useRef)(null),v=(0,r.useRef)(null),y=async()=>{t(!0),h("");try{let{Html5Qrcode:e}=await s.e(921).then(s.bind(s,8921)),a=new e("scanner-view");f.current=a,await a.start({facingMode:"environment"},{fps:10,qrbox:{width:250,height:150}},e=>{a.stop().catch(()=>{}),t(!1),N(e)},()=>{})}catch(e){t(!1),h("N\xe3o foi poss\xedvel acessar a c\xe2mera. Use o c\xf3digo manual.")}},N=async e=>{x(!0),h(""),g(null);try{let t=await l.h.scan(e);g(t)}catch(e){h(e.message)}finally{x(!1)}},k=e=>"good"===e?"text-green-400":"warning"===e?"text-yellow-400":"text-red-400",w=e=>"good"===e?"\uD83D\uDFE2":"warning"===e?"\uD83D\uDFE1":"\uD83D\uDD34";if(p){var P;let e=(P=p.score)>=71?"#10B981":P>=51?"#EAB308":P>=31?"#F97316":"#EF4444";return(0,a.jsxs)("div",{className:"min-h-screen bg-dark px-4 py-6 max-w-lg mx-auto",children:[a.jsx("button",{onClick:()=>g(null),className:"text-gray-400 mb-4 hover:text-white",children:"← Voltar"}),(0,a.jsxs)("div",{className:"text-center mb-8",children:[a.jsx("h2",{className:"text-lg font-semibold mb-1",children:p.product_name||"Produto"}),p.brand&&a.jsx("p",{className:"text-gray-500 text-sm",children:p.brand}),(0,a.jsxs)("div",{className:"relative w-40 h-40 mx-auto mt-6",children:[(0,a.jsxs)("svg",{viewBox:"0 0 120 120",className:"w-full h-full -rotate-90",children:[a.jsx("circle",{cx:"60",cy:"60",r:"52",fill:"none",stroke:"#374151",strokeWidth:"10"}),a.jsx("circle",{cx:"60",cy:"60",r:"52",fill:"none",stroke:e,strokeWidth:"10",strokeDasharray:`${3.267*p.score} 326.7`,strokeLinecap:"round",className:"transition-all duration-1000"})]}),(0,a.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[a.jsx("span",{className:"text-4xl font-black",style:{color:e},children:p.score}),a.jsx("span",{className:"text-gray-500 text-sm",children:"/100"})]})]})]}),a.jsx("div",{className:"bg-dark-light rounded-2xl p-4 mb-4",children:a.jsx("p",{className:"text-gray-300 text-sm leading-relaxed",children:p.summary})}),p.positives?.length>0&&(0,a.jsxs)("div",{className:"mb-4",children:[a.jsx("h3",{className:"font-semibold text-green-400 mb-2",children:"✅ Positivos"}),p.positives.map((e,t)=>(0,a.jsxs)("p",{className:"text-gray-300 text-sm ml-4 mb-1",children:["• ",e]},t))]}),p.negatives?.length>0&&(0,a.jsxs)("div",{className:"mb-4",children:[a.jsx("h3",{className:"font-semibold text-red-400 mb-2",children:"❌ Negativos"}),p.negatives.map((e,t)=>(0,a.jsxs)("p",{className:"text-gray-300 text-sm ml-4 mb-1",children:["• ",e]},t))]}),p.ingredients?.length>0&&(0,a.jsxs)("div",{className:"mb-6",children:[a.jsx("h3",{className:"font-semibold mb-3",children:"\uD83D\uDCCB Ingredientes"}),a.jsx("div",{className:"space-y-2",children:p.ingredients.map((e,t)=>(0,a.jsxs)("div",{className:"bg-dark-light rounded-xl p-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("span",{children:w(e.classification)}),(0,a.jsxs)("span",{className:`font-medium text-sm ${k(e.classification)}`,children:[e.name,e.popular_name&&e.popular_name!==e.name?` (${e.popular_name})`:""]})]}),a.jsx("p",{className:"text-gray-400 text-xs ml-6",children:e.explanation}),a.jsx("p",{className:"text-gray-500 text-xs ml-6 italic",children:e.reason})]},t))})]}),(0,a.jsxs)("div",{className:"flex gap-3",children:[a.jsx("button",{onClick:()=>{navigator.share&&navigator.share({title:`Aletheia: ${p.product_name}`,text:`Score: ${p.score}/100 - ${p.summary}`,url:window.location.href})},className:"flex-1 bg-primary text-dark font-bold py-3 rounded-xl",children:"\uD83D\uDCE4 Compartilhar"}),a.jsx("button",{onClick:()=>g(null),className:"flex-1 bg-dark-light text-white font-bold py-3 rounded-xl",children:"\uD83D\uDCF7 Novo Scan"})]})]})}return(0,a.jsxs)("div",{className:"min-h-screen bg-dark px-4 py-6 max-w-lg mx-auto",children:[(0,a.jsxs)("nav",{className:"flex items-center justify-between mb-8",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xl",children:"\uD83D\uDC41"}),a.jsx("span",{className:"font-bold tracking-wider text-primary",children:"ALETHEIA"})]}),(0,a.jsxs)("div",{className:"flex gap-3",children:[a.jsx(o.default,{href:"/history",className:"text-gray-400 text-sm hover:text-white",children:"Hist\xf3rico"}),a.jsx(o.default,{href:"/premium",className:"text-primary text-sm font-semibold",children:"Premium"})]})]}),(0,a.jsxs)("div",{className:"text-center mb-8",children:[a.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Escanear Produto"}),a.jsx("p",{className:"text-gray-400 text-sm",children:"Aponte a c\xe2mera para o c\xf3digo de barras"})]}),u&&a.jsx("div",{className:"bg-red-500/10 text-red-400 text-sm p-3 rounded-xl mb-4",children:u}),m&&(0,a.jsxs)("div",{className:"text-center py-20",children:[a.jsx("div",{className:"animate-spin text-4xl mb-4",children:"\uD83D\uDC41"}),a.jsx("p",{className:"text-gray-400",children:"Analisando produto..."})]}),!m&&(0,a.jsxs)(a.Fragment,{children:[a.jsx("div",{className:"mb-6",children:e?(0,a.jsxs)("div",{children:[a.jsx("div",{id:"scanner-view",ref:v,className:"rounded-2xl overflow-hidden mb-4"}),a.jsx("button",{onClick:()=>{f.current?.stop().catch(()=>{}),t(!1)},className:"w-full bg-red-500/20 text-red-400 py-3 rounded-xl font-semibold",children:"Parar Scanner"})]}):a.jsx("button",{onClick:y,className:"w-full bg-primary text-dark py-6 rounded-2xl font-bold text-xl hover:bg-primary-dark transition transform hover:scale-[1.02] active:scale-95",children:"\uD83D\uDCF7 Escanear C\xf3digo de Barras"})}),(0,a.jsxs)("div",{className:"relative mb-6",children:[a.jsx("div",{className:"absolute inset-0 flex items-center",children:a.jsx("div",{className:"w-full border-t border-gray-700"})}),a.jsx("div",{className:"relative flex justify-center",children:a.jsx("span",{className:"bg-dark px-4 text-gray-500 text-sm",children:"ou digite o c\xf3digo"})})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[a.jsx("input",{type:"text",placeholder:"Ex: 7891000100103",value:c,onChange:e=>d(e.target.value),className:"flex-1 bg-dark-light rounded-xl px-4 py-3 text-white placeholder-gray-500 outline-none focus:ring-2 focus:ring-primary"}),a.jsx("button",{onClick:()=>c&&N(c),disabled:!c,className:"bg-primary text-dark px-6 py-3 rounded-xl font-bold disabled:opacity-50",children:"Buscar"})]}),(0,a.jsxs)("div",{className:"mt-8",children:[a.jsx("p",{className:"text-gray-500 text-sm mb-3",children:"\uD83E\uDDEA Teste com produtos demo:"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:[{name:"Coca-Cola",code:"7891000100103"},{name:"Nescau",code:"7891000053508"},{name:"Miojo",code:"7891000305232"},{name:"Aveia",code:"7891000362006"},{name:"Oreo",code:"7622300830236"}].map(e=>a.jsx("button",{onClick:()=>N(e.code),className:"bg-dark-light text-gray-300 px-3 py-1.5 rounded-lg text-xs hover:bg-gray-600 transition",children:e.name},e.code))})]})]})]})}},1999:(e,t,s)=>{"use strict";s.d(t,{InstallPrompt:()=>n});var a=s(7247),r=s(8964);function n(){let[e,t]=(0,r.useState)(null),[s,n]=(0,r.useState)(!1),l=async()=>{e&&(e.prompt(),await e.userChoice,t(null),n(!1))};return s?(0,a.jsxs)("div",{className:"fixed bottom-4 left-4 right-4 z-50 bg-gradient-to-r from-[#1A7A4C] to-[#0d5c38] text-white p-4 rounded-2xl shadow-2xl flex items-center justify-between gap-3 animate-fade-up",children:[(0,a.jsxs)("div",{children:[a.jsx("p",{className:"font-bold text-sm",children:"\uD83D\uDCF2 Instalar ALETHEIA"}),a.jsx("p",{className:"text-xs text-white/70",children:"Acesse direto da tela inicial"})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[a.jsx("button",{onClick:()=>n(!1),className:"text-xs text-white/50 px-3 py-2",children:"Depois"}),a.jsx("button",{onClick:l,className:"bg-white text-[#1A7A4C] font-bold text-sm px-4 py-2 rounded-xl",children:"Instalar"})]})]}):null}},8210:(e,t,s)=>{"use strict";function a(){return null}s.d(t,{ServiceWorkerRegister:()=>a}),s(8964)},2:(e,t,s)=>{"use strict";s.d(t,{h:()=>n});let a=process.env.NEXT_PUBLIC_API_URL||"http://localhost:8090";async function r(e,t={}){let s={"Content-Type":"application/json",...t.headers||{}},r=await fetch(`${a}${e}`,{...t,headers:s});if(!r.ok)throw Error((await r.json().catch(()=>({detail:"Erro de rede"}))).detail||`HTTP ${r.status}`);return r.json()}let n={register:e=>r("/api/auth/register",{method:"POST",body:JSON.stringify(e)}),login:e=>r("/api/auth/login",{method:"POST",body:JSON.stringify(e)}),me:()=>r("/api/auth/me"),scan:e=>r("/api/scan",{method:"POST",body:JSON.stringify({barcode:e})}),history:()=>r("/api/history")}},2064:(e,t,s)=>{"use strict";let a;s.d(t,{t:()=>c});var r=s(8964);let n=e=>{let t;let s=new Set,a=(e,a)=>{let r="function"==typeof e?e(t):e;if(!Object.is(r,t)){let e=t;t=(null!=a?a:"object"!=typeof r||null===r)?r:Object.assign({},t,r),s.forEach(s=>s(t,e))}},r=()=>t,n={setState:a,getState:r,getInitialState:()=>l,subscribe:e=>(s.add(e),()=>s.delete(e))},l=t=e(a,r,n);return n},l=e=>e?n(e):n,i=e=>e,o=e=>{let t=l(e),s=e=>(function(e,t=i){let s=r.useSyncExternalStore(e.subscribe,r.useCallback(()=>t(e.getState()),[e,t]),r.useCallback(()=>t(e.getInitialState()),[e,t]));return r.useDebugValue(s),s})(t,e);return Object.assign(s,t),s},c=(a=e=>({user:null,token:null,setAuth:(t,s)=>{localStorage.setItem("token",t),localStorage.setItem("user",JSON.stringify(s)),e({token:t,user:s})},logout:()=>{localStorage.removeItem("token"),localStorage.removeItem("user"),e({token:null,user:null})},hydrate:()=>{let t=localStorage.getItem("token"),s=localStorage.getItem("user");t&&s&&e({token:t,user:JSON.parse(s)})}}))?o(a):o},3062:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>c,metadata:()=>i,viewport:()=>o});var a=s(2051);s(5023);var r=s(5347);let n=(0,r.createProxy)(String.raw`/home/kernelpanic/projetos_jarvis/aletheia/frontend/src/components/InstallPrompt.tsx#InstallPrompt`),l=(0,r.createProxy)(String.raw`/home/kernelpanic/projetos_jarvis/aletheia/frontend/src/components/ServiceWorkerRegister.tsx#ServiceWorkerRegister`),i={title:"ALETHEIA — A verdade sobre o que voc\xea come",description:"Escaneie qualquer produto e nossa IA revela o que a ind\xfastria aliment\xedcia esconde nos r\xf3tulos.",manifest:"/manifest.json",appleWebApp:{capable:!0,statusBarStyle:"black-translucent",title:"ALETHEIA"},other:{"mobile-web-app-capable":"yes"}},o={themeColor:"#1A7A4C",width:"device-width",initialScale:1,maximumScale:1};function c({children:e}){return(0,a.jsxs)("html",{lang:"pt-BR",className:"dark",children:[a.jsx("head",{children:a.jsx("link",{rel:"apple-touch-icon",href:"/icons/icon-192.png"})}),(0,a.jsxs)("body",{className:"bg-dark text-white min-h-screen antialiased",children:[e,a.jsx(n,{}),a.jsx(l,{})]})]})}},989:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>a});let a=(0,s(5347).createProxy)(String.raw`/home/kernelpanic/projetos_jarvis/aletheia/frontend/src/app/scan/page.tsx#default`)},5023:()=>{}};var t=require("../../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),a=t.X(0,[138,906],()=>s(9498));module.exports=a})();