1import{u as ie,a as re}from"./Bub0NX2z.js";import{F as ce}from"./DtNzxgAn.js";import{I as ue}from"./DJ_hF4iI.js";import{F as de}from"./Dy2MRZT6.js";import{F as M}from"./De7vjNJb.js";import{F as me}from"./BV9jmYrA.js";import{F as ge}from"./CT725AQR.js";import{F as pe,I as J}from"./BcVR0BTY.js";import{d as W,i as x,H as ve,o as a,e as n,c,q as N,t as f,f as h,a5 as fe,p as T,z as he,r as _,n as Ce,k as p,D as be,E as Fe,x as _e,u as ye,g as e,j as F,J as k,G as D,l as ke}from"./BKRH0lRf.js";import{T as xe}from"./CxErT5P0.js";import"./DF78nitl.js";import"./BBTesfEn.js";import"./D504vef9.js";import"./DdMIt94q.js";import"./Cj-Q_sCq.js";const Te={class:"flex flex-col justify-center self-stretch"},Ve={class:"flex flex-col gap-lg px-lg"},Se={class:"flex-1 font-montserrat text-md font-medium leading-md tracking-md text-neutral-950"},Me=W({__name:"TechnologicalCollectionFilter",props:{modelValue:{type:Boolean},sectorFilters:{},tempSectorFilters:{},totalCollectionCount:{},totalCollectionCountPending:{type:Boolean}},emits:["close","remove-filters","apply-filters","select-filter"],setup(s,{emit:y}){const u=y;return(v,t)=>(a(),x(pe,{"is-open":s.modelValue,"left-button-text":"Limpar","right-button-text":s.totalCollectionCountPending?"Carregando...":`Mostrar ${s.totalCollectionCount} ${s.totalCollectionCount===1?"inovação":"inovações"}`,onBack:t[0]||(t[0]=i=>u("remove-filters")),onNext:t[1]||(t[1]=i=>u("apply-filters")),onClose:t[2]||(t[2]=i=>u("close"))},{default:ve(()=>[n("div",Te,[n("ul",Ve,[t[3]||(t[3]=n("h1",{class:"py-sm font-montserrat text-lg font-semibold leading-lg tracking-lg text-neutral-900"}," Macrossetor ",-1)),(a(!0),c(T,null,N(s.sectorFilters,i=>(a(),c("li",{key:i.label,class:"flex items-center gap-x-md py-xs"},[n("span",Se,f(i.label),1),h(fe,{"model-value":s.tempSectorFilters.includes(i.value),"onUpdate:modelValue":()=>u("select-filter",i.value)},null,8,["model-value","onUpdate:modelValue"])]))),128))])])]),_:1},8,["is-open","right-button-text"]))}}),Pe=Object.assign(Me,{__name:"TechnologicalCollectionFilter"});function $e(){const s=_(!1);return he(()=>s.value=!0),s}function Ie(s,y){const u=_(1),v=_(0),t=y?.enabled??_(!0),i=p(()=>({...s.value})),P=p(()=>`technologies-count-data:${JSON.stringify({enabled:t.value,limit:u.value,offset:v.value,...i.value})}`),{data:$,error:r,pending:C}=Ce(P,()=>t.value?$fetch("/api/technologies",{query:{limit:u.value,offset:v.value,...i.value}}):Promise.resolve(null),{getCachedData(d,m){return m.isHydrating?m.payload.data[d]:m.static.data[d]}});return{totalCount:p(()=>!t.value||C.value||r.value?0:$.value?.total||0),error:r,pending:C}}const Be={key:0,class:"technological-collection"},De={key:0,class:"technological-collection__feedback"},Ne={class:"text-critical-500"},we={class:"technological-collection__filters"},Ue={key:1,class:"technological-collection__selected-filters"},je={key:2,class:"technological-collection__feedback"},Ae={key:3,class:"technological-collection__feedback"},Le={key:4,class:"technological-collection__feedback"},Re={class:"technological-collection__filters technological-collection__filters--results"},qe={class:"technological-collection__count"},Ee={class:"technological-collection__list"},O="Acervo Tecnológico",z="Conheça as tecnologias e inovações desenvolvidas em Minas Gerais.",K="/images/vitrine-tecnologica.jpg",Ge=W({__name:"index",setup(s){const{setPageData:y}=be();y({title:O,description:z}),Fe({title:O,meta:[{name:"description",content:z}]}),_e({ogImage:K,twitterImage:K});const u=$e(),{isMobile:v}=ye(),{search:t,debouncedSearch:i,total:P,sortedFilters:$,selectedTab:r,selectedSectors:C,tempSectorFilters:V,selectedSorted:d,showFilter:m,modalities:w,sectors:I,handleFilterClick:U,handleRemoveFilters:Q,handleApplyFilters:X,handleSelectFilter:Y,handleRemoveFilter:Z,handleCloseFilter:ee}=ie(),te=_(12),oe=p(()=>({modalidade:r.value!=="Todas"?r.value:void 0,setor:C.value.length>0?C.value.join(","):void 0,order:d.value==="Mais Antigas"?"ASC":void 0,search:t.value.trim()||void 0})),{technologies:j,total:B,tabs:A,error:S,pending:L,isLoadingMore:R,loadMore:le}=re(oe),ae=p(()=>({modalidade:r.value!=="Todas"?r.value:void 0,setor:V.value.length>0?V.value.join(","):void 0,search:i.value.trim()||void 0})),{totalCount:ne,pending:se}=Ie(ae,{enabled:m}),b=_([]),q=p(()=>{const g=A.value.length?A.value:w.value;return[{label:"Todas",value:"Todas",count:g.length?g.reduce((l,H)=>l+(H.count??0),0):P.value},...g]}),E=p(()=>{const g=q.value.find(o=>o.value===r.value);return r.value!=="Todas"?g?.label:""}),G=p(()=>I.value.filter(g=>C.value.includes(g.value)));return(g,o)=>e(u)?(a(),c("main",Be,[e(S)?(a(),c("div",De,[n("p",Ne,f(e(S)),1)])):F("",!0),h(ce,{title:"Tem uma tecnologia para compartilhar?",description:"Cadastre sua tecnologia e contribua para a divulgação das inovações geradas em Minas Gerais.","button-label":"Cadastrar Nova Tecnologia",link:"/difusao-do-conhecimento/vitrine-tecnologica/cadastrar-nova-tecnologia","background-color":"bg-warning-100",icon:ue}),n("section",we,[h(de,{modelValue:e(r),"onUpdate:modelValue":o[0]||(o[0]=l=>k(r)?r.value=l:null),items:e(q),class:"grow"},null,8,["modelValue","items"]),e(v)?F("",!0):(a(),x(M,{key:0,label:"Filtrar por Setor",icon:J,"can-select":!1,onClick:e(U)},null,8,["onClick"]))]),e(v)||e(G).length?(a(),c("section",Ue,[e(v)?(a(),x(M,{key:0,label:"Filtrar por Setor",icon:J,"can-select":!1,onClick:e(U)},null,8,["onClick"])):F("",!0),(a(!0),c(T,null,N(e(G),l=>(a(),x(M,{key:l.value,label:l.label,closable:"",onClose:H=>e(Z)(l.value)},null,8,["label","onClose"]))),128))])):F("",!0),h(me,{modelValue:e(t),"onUpdate:modelValue":o[1]||(o[1]=l=>k(t)?t.value=l:null),placeholder:"Pesquisar por palavra-chave..."},null,8,["modelValue"]),e(L)&&!e(R)?(a(),c("div",je,[...o[5]||(o[5]=[n("p",null,"Carregando tecnologias...",-1)])])):!e(L)&&!e(R)&&e(S)?(a(),c("div",Ae,[n("p",null,"Erro ao carregar tecnologias: "+f(e(S).message),1)])):e(t).trim()&&e(j).length===0?(a(),c("div",Le,[n("p",null,[o[6]||(o[6]=D(" Nenhuma inovação encontrada para ",-1)),n("strong",null,'"'+f(e(t).trim())+'"',1),e(E)?(a(),c(T,{key:0},[D(" na modalidade "+f(e(E)),1)],64)):F("",!0),o[7]||(o[7]=D(". ",-1))])])):(a(),c(T,{key:5},[n("section",Re,[n("span",qe," Exibindo "+f(e(b).length)+" de "+f(e(B))+" inovações ",1),h(M,{modelValue:e(d),"onUpdate:modelValue":o[2]||(o[2]=l=>k(d)?d.value=l:null),label:e(d),options:e($),dropdown:""},null,8,["modelValue","label","options"])]),n("ul",Ee,[(a(!0),c(T,null,N(e(b),l=>(a(),x(xe,{key:l.id,technology:l,modalities:e(w),sectors:e(I),"details-base-path":"/difusao-do-conhecimento/vitrine-tecnologica/acervo-tecnologico/"},null,8,["technology","modalities","sectors"]))),128))]),h(ge,{modelValue:e(b),"onUpdate:modelValue":o[3]||(o[3]=l=>k(b)?b.value=l:null),items:e(j),"items-per-page":e(te),"has-more-pages":e(b).length<e(B),"on-load-more":e(le),"total-items":e(B),"text-pagination-type":"inovações"},null,8,["modelValue","items","items-per-page","has-more-pages","on-load-more","total-items"])],64)),h(Pe,{modelValue:e(m),"onUpdate:modelValue":o[4]||(o[4]=l=>k(m)?m.value=l:null),"sector-filters":e(I),"temp-sector-filters":e(V),"total-collection-count":e(ne),"total-collection-count-pending":e(se),onSelectFilter:e(Y),onRemoveFilters:e(Q),onApplyFilters:e(X),onClose:e(ee)},null,8,["modelValue","sector-filters","temp-sector-filters","total-collection-count","total-collection-count-pending","onSelectFilter","onRemoveFilters","onApplyFilters","onClose"])])):F("",!0)}}),nt=ke(Ge,[["__scopeId","data-v-2e8e227d"]]);export{nt as default};
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.