1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[797],{45:(e,t,a)=>{"use strict";a.d(t,{default:()=>c});var r=a(5155),s=a(2115),i=a(6823),l=a(7301),n=a(9996),o=a(5300);let c=()=>{let{certificates:e,isLoading:t}=(0,l.Tt)(),[a,c]=(0,s.useState)({}),[d,u]=(0,s.useState)({});return((0,s.useEffect)(()=>{let t=!0;return(async()=>{if(!e||!e.length)return;if(!window.pdfjsLib)try{let e=document.createElement("script");e.src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.min.js",document.head.appendChild(e),await new Promise((t,a)=>{e.onload=t,e.onerror=a}),window.pdfjsLib.GlobalWorkerOptions.workerSrc="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.worker.min.js"}catch(e){console.error("Falha ao injetar pdfjsLib",e);return}let r=window.pdfjsLib;for(let l of e){if(!t)return;if(!l||!l.id||a[l.id])continue;let e=(0,i.Hb)(l.pdf||l.file||l.url||l.src||l.arquivo||l.document||l.storagePath||l.pdfUrl);if(!e){var s;console.debug("No possiblePdf found for certificate:",null!=(s=null==l?void 0:l.id)?s:"(no id)",{availableFields:Object.keys(l||{}),cert:l});continue}let d=e;try{if(d&&!/^https?:\/\//i.test(d))try{d=await (0,n.qk)((0,n.KR)(o.IG,d))}catch(e){console.debug("getDownloadURL failed for",d,e)}console.debug("Fetching pdf at resolved url:",d,"for cert id:",l.id);let e=await fetch(d);if(!e.ok)throw console.debug("Fetch returned non-ok status for",d,"status:",e.status,"statusText:",e.statusText),Error("Failed to fetch pdf: "+e.status);let a=await e.arrayBuffer(),s=r.getDocument({data:a}),i=await s.promise,u=await i.getPage(1),f=u.getViewport({scale:1.5}),m=document.createElement("canvas"),h=m.getContext("2d");m.width=Math.floor(f.width),m.height=Math.floor(f.height),await u.render({canvasContext:h,viewport:f}).promise;let g=m.toDataURL("image/png");if(!t)return;c(e=>({...e,[l.id]:g}))}catch(e){console.warn("Could not render preview for certificate",l.id,e)}}})(),()=>{t=!1}},[e]),(0,s.useEffect)(()=>{let t=!0;return(async()=>{if(e&&e.length)for(let a of e){if(!t)return;if(!a||!a.id||d[a.id])continue;let e=null;if(Array.isArray(a.images)&&a.images.length)e=a.images[0];else if("string"==typeof a.image&&a.image)e=a.image;else{let t=(0,i.xC)(a.images||a.imagem||a.image||[]);e=t&&t.length?t[0]:null}if(e){if(/^https?:\/\//i.test(e)){u(t=>({...t,[a.id]:e}));continue}try{let r=await (0,n.qk)((0,n.KR)(o.IG,e));if(!t)return;u(e=>({...e,[a.id]:r}))}catch(t){console.debug("Could not resolve storage image for",e,t)}}}})(),()=>{t=!1}},[e,d]),t)?(0,r.jsx)("section",{className:"w-full p-8 font-sans",children:(0,r.jsxs)("div",{className:"text-center mb-6",children:[(0,r.jsx)("h2",{className:"text-3xl text-[#CC3333] font-light",children:"Certificados"}),(0,r.jsx)("p",{className:"text-gray-600 mt-3",children:"Carregando certificados..."})]})}):(0,r.jsxs)("section",{className:"w-full",children:[(0,r.jsx)("section",{className:"mt-8 hidden md:block",children:(0,r.jsx)("div",{className:"bg-white rounded-lg border border-gray-200 overflow-hidden shadow-sm mb-6",children:(0,r.jsxs)("div",{className:"flex flex-col md:flex-row items-stretch",children:[(0,r.jsx)("div",{className:"md:w-1/4 w-full",children:(0,r.jsx)("img",{src:"/images/certificado.jpg",alt:"Workshop",className:"w-full h-56 md:h-72 object-cover"})}),(0,r.jsx)("div",{className:"md:w-3/4 w-full bg-[#CC3333] text-white p-6 flex items-center justify-center h-56 md:h-72",children:(0,r.jsx)("blockquote",{className:"text-2xl md:text-3xl lg:text-3xl font-serif leading-snug px-6 whitespace-nowrap overflow-hidden text-ellipsis text-center",children:'" Atender nossos clientes com a m\xe1xima qualidade "'})})]})})}),(0,r.jsxs)("div",{className:"mt-2",children:[(0,r.jsx)("h1",{className:"text-3xl md:text-4xl font-bold text-[#CC3333] mb-4",children:"Qualidade"}),(0,r.jsx)("p",{className:"text-sm text-gray-700 leading-7 mb-6",children:"Nestes anos de atividades, a Valman ocupa lugar de destaque entre seus clientes e possui tecnologia pr\xf3pria, adequada ao sistema de garantia de qualidade ISO 9001:2015 avaliado pelas Certificadoras DNV, mantendo assim QUALIDADE e SATISFA\xc7\xc3O dos nossos clientes internos e externos."}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-6",children:e&&e.length?e.map(e=>{let t=a[e.id]||(e&&"string"==typeof e.imageUrl?e.imageUrl:null)||d[e.id]||(Array.isArray(e.images)&&e.images.length?e.images[0]:e.image||e.imagem||"/images/certificado-default.png"),s=e.name||e.title||e.nome||"Certificado",i=async()=>{try{let t=e.pdfUrl||e.pdf||e.file||e.url||e.src||e.arquivo||e.document||e.storagePath;if(!t)return void console.debug("No pdf url available for cert",e.id);let a=window.open("","_blank");if(!a)return void console.warn("Unable to open new window - popup blocked");if(/^https?:\/\//i.test(t)){a.location.href=t;return}try{let e=await (0,n.qk)((0,n.KR)(o.IG,t));a.location.href=e}catch(e){console.error("Failed to resolve pdf storage path for",t,e);try{a.close()}catch(e){}}}catch(t){console.error("Error opening pdf for cert",e.id,t)}};return(0,r.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>i(),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&i()},className:"bg-white rounded-lg border border-gray-200 shadow-sm overflow-hidden cursor-pointer",children:[(0,r.jsx)("div",{className:"p-8 flex items-center justify-center",children:(0,r.jsx)("div",{className:"w-56 h-56 bg-white rounded-md flex items-center justify-center",children:(0,r.jsx)("div",{className:"w-48 h-48 bg-gray-100 flex items-center justify-center",children:(0,r.jsx)("img",{src:t,alt:s,className:"max-h-full object-contain"})})})}),(0,r.jsx)("div",{className:"border-t border-gray-300"}),(0,r.jsx)("div",{className:"bg-[#CC3333] text-white text-center py-4",children:(0,r.jsx)("div",{className:"text-base font-medium",children:s||"Certificado"})})]},e.id)}):(0,r.jsx)("div",{className:"col-span-4 text-center text-gray-600",children:"Nenhum certificado encontrado."})})]})]})}},5873:(e,t,a)=>{Promise.resolve().then(a.bind(a,45))},7301:(e,t,a)=>{"use strict";a.d(t,{My:()=>d,Qh:()=>l,Tt:()=>n,f_:()=>i,nu:()=>c,tk:()=>o});var r=a(2115),s=a(7138);function i(){let[e,t]=(0,r.useState)([]),[a,i]=(0,r.useState)(!0),[l,n]=(0,r.useState)(null);return(0,r.useEffect)(()=>{let e=!1;return(0,s.$3)().then(a=>{e||(t(a),i(!1))}).catch(t=>{e||(n(t),i(!1))}),()=>{e=!0}},[]),{clients:e,isLoading:a,error:l}}function l(){let[e,t]=(0,r.useState)([]),[a,i]=(0,r.useState)(!0),[l,n]=(0,r.useState)(null);return(0,r.useEffect)(()=>{let e=!1;return(0,s.al)().then(a=>{e||(t(a),i(!1))}).catch(t=>{e||(n(t),i(!1))}),()=>{e=!0}},[]),{socialProjects:e,isLoading:a,error:l}}function n(){let[e,t]=(0,r.useState)([]),[a,i]=(0,r.useState)(!0),[l,n]=(0,r.useState)(null);return(0,r.useEffect)(()=>{let e=!1;return(0,s.Dc)().then(a=>{e||(t(a),i(!1))}).catch(t=>{e||(n(t),i(!1))}),()=>{e=!0}},[]),{certificates:e,isLoading:a,error:l}}function o(){let[e,t]=(0,r.useState)([]),[a,i]=(0,r.useState)(!0),[l,n]=(0,r.useState)(null);return(0,r.useEffect)(()=>{let e=!1;return(0,s.jY)().then(a=>{e||(t(a),i(!1))}).catch(t=>{e||(n(t),i(!1))}),()=>{e=!0}},[]),{catalogs:e,isLoading:a,error:l}}function c(){let[e,t]=(0,r.useState)([]),[a,i]=(0,r.useState)(!0),[l,n]=(0,r.useState)(null);return(0,r.useEffect)(()=>{let e=!1;return(0,s.b3)().then(a=>{e||(t(a),i(!1))}).catch(t=>{e||(n(t),i(!1))}),()=>{e=!0}},[]),{carouselItems:e,isLoading:a,error:l}}function d(){let[e,t]=(0,r.useState)([]),[a,i]=(0,r.useState)(!0),[l,n]=(0,r.useState)(null);return(0,r.useEffect)(()=>{let e=!1;return(0,s.Yn)().then(a=>{e||(t(a),i(!1))}).catch(t=>{e||(n(t),i(!1))}),()=>{e=!0}},[]),{news:e,isLoading:a,error:l}}}},e=>{e.O(0,[135,204,31,80,441,255,358],()=>e(e.s=5873)),_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.