1import{c as es,u as ns,r as g,a as ds,j as t,b as bt,H as ms,L as Wt}from"./app-CTaY8UJf.js";import{c as Ut,b as Bt,C as Ht,a as Xt}from"./card-UxP9oPxk.js";import{B as d}from"./button-DXCKLHtj.js";import{I as ke}from"./input-7aHhCeCr.js";import{L as p}from"./label-CxCrcTSv.js";import{S as fs,a as ps,b as hs,c as xs,d as us}from"./select-BBMYAKnd.js";import{C as Zt}from"./checkbox-BLf4wwbn.js";import{T as js}from"./textarea-0W-7qht9.js";import{D as gs,b as vs,a as bs,c as ys,d as Ns,e as _s}from"./dialog-BKzHwCpL.js";import{u as Ss,A as Cs}from"./AppLayoutWithNotifications-mus8tTbI.js";import Kt from"./file-text-jraIksbC.js";import Ds from"./eye-BixEHFrD.js";import ws from"./download-B2l0YnDe.js";import Fs from"./trash-2-QtamTJOn.js";import Qt from"./x-DmP7A1Bz.js";import Yt from"./upload-C5_Iw0PV.js";import As from"./user-plus-B0yIQYRr.js";import ks from"./arrow-left-CPptMQyl.js";import Es from"./save-tvu6uyS3.js";import Ts from"./triangle-alert-Dd-lbaJ8.js";import $s from"./user-check-JVPUOZoh.js";import"./app-CNmQMdEi.js";import"./index-fQ3brVpV.js";import"./index-CsfSsVkk.js";import"./index-DXg2b8Vm.js";import"./index-CJBlix5Q.js";import"./index-DHUBBKJC.js";import"./index-ClkQdPrn.js";import"./index-BE_AIKwc.js";import"./chevron-down-COTwZrVV.js";import"./createLucideIcon-CmjF8lT1.js";import"./check-COSJjDXC.js";import"./chevron-up-dKr-3op1.js";import"./index-Svmmcv6D.js";import"./index-sraz7nLe.js";import"./circle-alert-CTn79Wf8.js";import"./circle-x-VMcb1sXz.js";import"./circle-check-big-0QGs7tCc.js";import"./app-layout-DHg6PkRO.js";import"./video-CWkR2iFG.js";import"./chevron-right-Dcl2lTY9.js";import"./dropdown-menu-D6OZoFra.js";import"./index-msf3AG1t.js";import"./avatar-BRFzpAWX.js";import"./index-BGC6_Qsa.js";import"./index-C_SHgnPd.js";import"./layers-Cb0hKdx0.js";import"./shield-check-CXJJ4XEh.js";import"./file-check-tR1YCl9R.js";import"./message-square-BtERmk2L.js";import"./users-BYuco8Ea.js";import"./trending-up-CsQX3MuM.js";import"./handshake-ppgb6oUe.js";import"./calendar-CEIt2YqY.js";import"./trending-down-B7TczfdV.js";import"./building-BaJqVYxM.js";import"./list-Dehc_B-t.js";import"./activity-D1Ey-wIS.js";import"./search-BOJp92ky.js";import"./breadcrumbs-ByKSkPWt.js";function qs(){const c=es.c(4),{props:e}=ns(),{addNotification:a}=Ss();let v,f;return c[0]!==a||c[1]!==e.flash?(v=()=>{const Ee=e.flash;Ee&&Object.entries(Ee).forEach(Fe=>{const[h,x]=Fe;x&&typeof x=="string"&&a(x,h)})},f=[e.flash,a],c[0]=a,c[1]=e.flash,c[2]=v,c[3]=f):(v=c[2],f=c[3]),g.useEffect(v,f),null}function Ja(c){const e=es.c(236),{contrato:a,fiscais_list:v,anexos:f,page_title:Ee,page_description:Fe,filters:h}=c;qs();let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[0]=x):x=e[0];const[b,Gt]=g.useState(x);let Te;e[1]===Symbol.for("react.memo_cache_sentinel")?(Te=[],e[1]=Te):Te=e[1];const[n,$e]=g.useState(Te),[ts,yt]=g.useState(!1),[Nt,Ae]=g.useState(!1),[u,qe]=g.useState(null);let Oe;e[2]!==a.fiscais?(Oe=s=>!a.fiscais?.some(o=>o.id===s.id),e[2]=a.fiscais,e[3]=Oe):Oe=e[3];const Rt=v.filter(Oe);let y;e[4]!==a.valor?(y=a.valor?.toString()??"",e[4]=a.valor,e[5]=y):y=e[5];let N;e[6]!==a.tipo?(N=a.tipo?typeof a.tipo=="string"&&a.tipo.includes(",")?a.tipo.split(",").map(Ps):[a.tipo]:[],e[6]=a.tipo,e[7]=N):N=e[7];let ze;e[8]!==a.covid19||e[9]!==a.data_hora||e[10]!==a.modalidade||e[11]!==a.numero||e[12]!==a.objeto||e[13]!==a.orgao||e[14]!==a.status||e[15]!==a.vencedor||e[16]!==y||e[17]!==N?(ze={numero:a.numero,modalidade:a.modalidade,orgao:a.orgao,data_hora:a.data_hora,valor:y,status:a.status,vencedor:a.vencedor,objeto:a.objeto,tipo:N,covid19:a.covid19},e[8]=a.covid19,e[9]=a.data_hora,e[10]=a.modalidade,e[11]=a.numero,e[12]=a.objeto,e[13]=a.orgao,e[14]=a.status,e[15]=a.vencedor,e[16]=y,e[17]=N,e[18]=ze):ze=e[18];const{data:r,setData:i,put:_t,processing:j,errors:l}=ds(ze),Jt=Ms;let Ie;e[19]!==a.valor?(Ie=()=>{const s=Math.round((Number(a.valor)||0)*100);return Jt(String(s))},e[19]=a.valor,e[20]=Ie):Ie=e[20];const[St,ss]=g.useState(Ie),as=Ls;let Ve;e[21]!==i?(Ve=s=>{const o=s.target.value.replace(/\D/g,"");ss(Jt(o)),i("valor",o?(Number(o)/100).toFixed(2):"")},e[21]=i,e[22]=Ve):Ve=e[22];const Ct=Ve;let Le;e[23]!==n?(Le=s=>{const o=Array.from(s.target.files||[]);$e([...n,...o])},e[23]=n,e[24]=Le):Le=e[24];const Dt=Le;let Me;e[25]===Symbol.for("react.memo_cache_sentinel")?(Me=s=>{s.preventDefault(),s.stopPropagation(),s.type==="dragenter"||s.type==="dragover"?yt(!0):s.type==="dragleave"&&yt(!1)},e[25]=Me):Me=e[25];const wt=Me;let Pe;e[26]!==n?(Pe=s=>{if(s.preventDefault(),s.stopPropagation(),yt(!1),s.dataTransfer.files&&s.dataTransfer.files[0]){const o=Array.from(s.dataTransfer.files);$e([...n,...o])}},e[26]=n,e[27]=Pe):Pe=e[27];const Ft=Pe;let Ue;e[28]!==n?(Ue=s=>{const o=n.filter((m,Pt)=>Pt!==s);$e(o)},e[28]=n,e[29]=Ue):Ue=e[29];const At=Ue;let Be;e[30]===Symbol.for("react.memo_cache_sentinel")?(Be=s=>{qe(s),Ae(!0)},e[30]=Be):Be=e[30];const ls=Be;let He;e[31]!==u?(He=()=>{u&&bt.post(`/portal/admin/contratos/attachments/delete/${u.id}`,new FormData,{onSuccess:()=>{Ae(!1),qe(null),window.location.reload()},onError:()=>{Ae(!1),qe(null)}})},e[31]=u,e[32]=He):He=e[32];const kt=He;let Xe;e[33]===Symbol.for("react.memo_cache_sentinel")?(Xe=()=>{Ae(!1),qe(null)},e[33]=Xe):Xe=e[33];const rs=Xe;let Ge;e[34]!==a.id||e[35]!==n?(Ge=async()=>
1{if(n.length===0)return;const s=new FormData;n.forEach((o,m)=>{s.append(`attachments[${m}]`,o)});try{bt.post(`/portal/admin/contratos/attachments/store/${a.id}`,s,{forceFormData:!0,onSuccess:()=>{$e([]),window.location.reload()},onError:Vs})}catch(o){console.error("Erro ao fazer upload dos arquivos:",o)}},e[34]=a.id,e[35]=n,e[36]=Ge):Ge=e[36];const Et=Ge;let Re;e[37]!==a.id||e[38]!==_t?(Re=s=>{s.preventDefault(),_t(`/portal/admin/contratos/update/${a.id}`)},e[37]=a.id,e[38]=_t,e[39]=Re):Re=e[39];const Tt=Re,$t=Cs,qt=`Editar Contrato - ${Ee}`;let _;e[40]!==qt?(_=t.jsx(ms,{title:qt}),e[40]=qt,e[41]=_):_=e[41];const os="space-y-6 p-6";let Je,We;e[42]===Symbol.for("react.memo_cache_sentinel")?(Je=t.jsx(Wt,{href:"/portal/admin/contratos",children:t.jsxs(d,{variant:"outline",size:"sm",className:"flex items-center gap-2",children:[t.jsx(ks,{className:"h-4 w-4"}),"Voltar"]})}),We=t.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Editar Contrato"}),e[42]=Je,e[43]=We):(Je=e[42],We=e[43]);let S;e[44]!==Fe?(S=t.jsxs("div",{className:"flex items-center gap-4",children:[Je,t.jsxs("div",{children:[We,t.jsx("p",{className:"mt-1 text-gray-600",children:Fe})]})]}),e[44]=Fe,e[45]=S):S=e[45];let Ze;e[46]===Symbol.for("react.memo_cache_sentinel")?(Ze=t.jsx(Ht,{children:t.jsx(Xt,{children:"Informações do Contrato"})}),e[46]=Ze):Ze=e[46];let C;e[47]!==r.modalidade?(C=t.jsxs(p,{htmlFor:"modalidade",children:["Modalidade ",r.modalidade]}),e[47]=r.modalidade,e[48]=C):C=e[48];let D;e[49]!==i?(D=s=>i("modalidade",s.target.value),e[49]=i,e[50]=D):D=e[50];let w;e[51]!==r.modalidade||e[52]!==D?(w=t.jsx(ke,{value:r.modalidade,onChange:D,className:"border-2 border-gray-300 focus:border-blue-500"}),e[51]=r.modalidade,e[52]=D,e[53]=w):w=e[53];let F;e[54]!==l.modalidade?(F=l.modalidade&&t.jsx("p",{className:"text-sm text-red-500",children:l.modalidade}),e[54]=l.modalidade,e[55]=F):F=e[55];let A;e[56]!==C||e[57]!==w||e[58]!==F?(A=t.jsxs("div",{className:"space-y-2",children:[C,w,F]}),e[56]=C,e[57]=w,e[58]=F,e[59]=A):A=e[59];let Ke;e[60]===Symbol.for("react.memo_cache_sentinel")?(Ke=t.jsx(p,{htmlFor:"orgao",children:"Ãrgão "}),e[60]=Ke):Ke=e[60];let k;e[61]!==i?(k=s=>i("orgao",s.target.value),e[61]=i,e[62]=k):k=e[62];let E;e[63]!==r.orgao||e[64]!==k?(E=t.jsx(ke,{value:r.orgao,onChange:k,className:"border-2 border-gray-300 focus:border-blue-500"}),e[63]=r.orgao,e[64]=k,e[65]=E):E=e[65];let T;e[66]!==l.orgao?(T=l.orgao&&t.jsx("p",{className:"text-sm text-red-500",children:l.orgao}),e[66]=l.orgao,e[67]=T):T=e[67];let $;e[68]!==E||e[69]!==T?($=t.jsxs("div",{className:"space-y-2",children:[Ke,E,T]}),e[68]=E,e[69]=T,e[70]=$):$=e[70];let Qe;e[71]===Symbol.for("react.memo_cache_sentinel")?(Qe=t.jsx(p,{htmlFor:"data_hora",children:"Data e Hora :"}),e[71]=Qe):Qe=e[71];let q;e[72]!==r.data_hora?(q=as(r.data_hora),e[72]=r.data_hora,e[73]=q):q=e[73];let O;e[74]!==i?(O=s=>i("data_hora",s.target.value),e[74]=i,e[75]=O):O=e[75];let z;e[76]!==q||e[77]!==O?(z=t.jsx(ke,{id:"data_hora",type:"datetime-local",value:q,onChange:O,required:!0,className:"border-2 border-gray-300 focus:border-blue-500"}),e[76]=q,e[77]=O,e[78]=z):z=e[78];let I;e[79]!==l.data_hora?(I=l.data_hora&&t.jsx("p",{className:"text-sm text-red-500",children:l.data_hora}),e[79]=l.data_hora,e[80]=I):I=e[80];let V;e[81]!==z||e[82]!==I?(V=t.jsxs("div",{className:"space-y-2",children:[Qe,z,I]}),e[81]=z,e[82]=I,e[83]=V):V=e[83];let Ye;e[84]===Symbol.for("react.memo_cache_sentinel")?(Ye=t.jsx(p,{htmlFor:"valor",children:"Valor"}),e[84]=Ye):Ye=e[84];let L;e[85]!==Ct||e[86]!==St?(L=t.jsx(ke,{id:"valor",type:"text",inputMode:"numeric",value:St,onChange:Ct,placeholder:"0,00",required:!0,className:"border-2 border-gray-300 focus:border-blue-500"}),e[85]=Ct,e[86]=St,e[87]=L):L=e[87];let M;e[88]!==l.valor?(M=l.valor&&t.jsx("p",{className:"text-sm text-red-500",children:l.valor}),e[88]=l.valor,e[89]=M):M=e[89];let P;e[90]!==L||e[91]!==M?(P=t.jsxs("div",{className:"space-y-2",children:[Ye,L,M]}),e[90]=L,e[91]=M,e[92]=P):P=e[92];let et;e[93]===Symbol.for("react.memo_cache_sentinel")?(et=t.jsx(p,{htmlFor:"status",children:"Status"}),e[93]=et):et=e[93];let U;e[94]!==i?(U=s=>i("status",s),e[94]=i,e[95]=U):U=e[95];let tt;e[96]===Symbol.for("react.memo_cache_sentinel")?(tt=t.jsx(hs,{children:t.jsx(xs,{placeholder:"Selecione o status"})}),e[96]=tt):tt=e[96];let B;e[97]!==h.statuses?(B=t.jsx(fs,{children:Object.entries(h.statuses).map(Is)}),e[97]=h.statuses,e[98]=B):B=e[98];let H;e[99]!==r.status||e[100]!==U||e[101]!==B?(H=t.jsxs(ps,{value:r.status,onValueChange:U,children:[tt,B]}),e[99]=r.status,e[100]=U,e[101]=B,e[102]=H):H=e[102];let X;e[103]!==l.status?(X=l.status&&t.jsx("p",{className:"text-sm text-red-500",children:l.status}),e[103]=l.status,e[104]=X):X=e[104];let G;e[105]!==H||e[106]!==X?(G=t.jsxs("div",{className:"space-y-2",children:[et,H,X]}),e[105]=H,e[106]=X,e[107]=G):G=e[107];let st;e[108]===Symbol.for("react.memo_cache_sentinel")?(st=t.jsx(p,{htmlFor:"vencedor",children:"Vencedor"}),e[108]=st):st=e[108];let R;e[109]!==i?(R=s=>i("vencedor",s.target.value),e[109]=i,e[110]=R):R=e[110];let J;e[111]!==r.vencedor||e[112]!==R?(J=t.jsx(ke,{id:"vencedor",value:r.vencedor,onChange:R,placeholder:"Nome da empresa vencedora",className:"border-2 border-gray-300 focus:border-blue-500"}),e[111]=r.vencedor,e[112]=R,e[113]=J):J=e[113];let W;e[114]!==l.vencedor?(W=l.vencedor&&t.jsx("p",{className:"text-sm text-red-500",children:l.vencedor}),e[114]=l.vencedor,e[115]=W):W=e[115];let Z;e[116]!==J||e[117]!==W?(Z=t.jsxs("div",{className:"space-y-2",children:[st,J,W]}),e[116]=J,e[117]=W,e[118]=Z):Z=e[118];let at;e[119]===Symbol.for("react.memo_cache_sentinel")?(at=t.jsx(p,{children:"Tipos (selecione um ou mais)"}),e[119]=at):at=e[119];let K;e[120]!==r.tipo||e[121]!==h.types||e[122]!==i?(K=t.jsx("div",{className:"grid grid-cols-2 gap-2 rounded-md border p-4",children:Object.entries(h.types).map(s=>{const[o,m]=s;return t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(Zt,{id:`t
1ipo-${o}`,checked:r.tipo.includes(o),onCheckedChange:Pt=>{Pt?i("tipo",[...r.tipo,o]):i("tipo",r.tipo.filter(cs=>cs!==o))}}),t.jsx(p,{htmlFor:`tipo-${o}`,className:"text-sm font-normal cursor-pointer",children:m})]},o)})}),e[120]=r.tipo,e[121]=h.types,e[122]=i,e[123]=K):K=e[123];let Q;e[124]!==l.tipo?(Q=l.tipo&&t.jsx("p",{className:"text-sm text-red-500",children:l.tipo}),e[124]=l.tipo,e[125]=Q):Q=e[125];let Y;e[126]!==K||e[127]!==Q?(Y=t.jsxs("div",{className:"space-y-2 lg:col-span-3",children:[at,K,Q]}),e[126]=K,e[127]=Q,e[128]=Y):Y=e[128];let ee;e[129]!==A||e[130]!==$||e[131]!==V||e[132]!==P||e[133]!==G||e[134]!==Z||e[135]!==Y?(ee=t.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:[A,$,V,P,G,Z,Y]}),e[129]=A,e[130]=$,e[131]=V,e[132]=P,e[133]=G,e[134]=Z,e[135]=Y,e[136]=ee):ee=e[136];let lt;e[137]===Symbol.for("react.memo_cache_sentinel")?(lt=t.jsx(p,{htmlFor:"objeto",children:"Objeto do Contrato"}),e[137]=lt):lt=e[137];let te;e[138]!==i?(te=s=>i("objeto",s.target.value),e[138]=i,e[139]=te):te=e[139];let se;e[140]!==r.objeto||e[141]!==te?(se=t.jsx(js,{id:"objeto",value:r.objeto,onChange:te,placeholder:"Descreva o objeto do contrato...",rows:4,required:!0,className:"border-2 border-gray-300 focus:border-blue-500"}),e[140]=r.objeto,e[141]=te,e[142]=se):se=e[142];let ae;e[143]!==l.objeto?(ae=l.objeto&&t.jsx("p",{className:"text-sm text-red-500",children:l.objeto}),e[143]=l.objeto,e[144]=ae):ae=e[144];let le;e[145]!==se||e[146]!==ae?(le=t.jsxs("div",{className:"space-y-2",children:[lt,se,ae]}
1),e[145]=se,e[146]=ae,e[147]=le):le=e[147];let re;e[148]!==i?(re=s=>i("covid19",s),e[148]=i,e[149]=re):re=e[149];let oe;e[150]!==r.covid19||e[151]!==re?(oe=t.jsx(Zt,{id:"covid19",className:"border",checked:r.covid19,onCheckedChange:re}),e[150]=r.covid19,e[151]=re,e[152]=oe):oe=e[152];let rt;e[153]===Symbol.for("react.memo_cache_sentinel")?(rt=t.jsx(p,{htmlFor:"covid19",children:"Contrato relacionado ao COVID-19"}),e[153]=rt):rt=e[153];let ie;e[154]!==oe?(ie=t.jsxs("div",{className:"flex items-center space-x-2",children:[oe,rt]}),e[154]=oe,e[155]=ie):ie=e[155];let ot;e[156]===Symbol.for("react.memo_cache_sentinel")?(ot=t.jsx(Wt,{href:"/portal/admin/contratos",children:t.jsx(d,{variant:"outline",type:"button",children:"Cancelar"})}),e[156]=ot):ot=e[156];let it;e[157]===Symbol.for("react.memo_cache_sentinel")?(it=t.jsx(Es,{className:"h-4 w-4"}),e[157]=it):it=e[157];const Ot=j?"Salvando...":"Salvar";let ce;e[158]!==j||e[159]!==Ot?(ce=t.jsxs("div",{className:"flex justify-end gap-4",children:[ot,t.jsxs(d,{type:"submit",disabled:j,className:"flex items-center gap-2",children:[it,Ot]})]}),e[158]=j,e[159]=Ot,e[160]=ce):ce=e[160];let ne;e[161]!==Tt||e[162]!==ee||e[163]!==le||e[164]!==ie||e[165]!==ce?(ne=t.jsxs(Bt,{children:[Ze,t.jsx(Ut,{children:t.jsxs("form",{onSubmit:Tt,className:"space-y-6",children:[ee,le,ie,ce]})})]}),e[161]=Tt,e[162]=ee,e[163]=le,e[164]=ie,e[165]=ce,e[166]=ne):ne=e[166];let ct;e[167]===Symbol.for("react.memo_cache_sentinel")?(ct=t.jsx(Ht,{children:t.jsx(Xt,{children:"Gerenciar Anexos"})}),e[167]=ct):ct=e[167];let de;e[168]!==f?(de=f&&f.length>0&&t.jsxs("div",{children:[t.jsx("h4",{className:"mb-3 text-sm font-medium text-gray-900",children:"Anexos Existentes"}),t.jsx("div",{className:"space-y-2",children:f.map((s,o)=>t.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded bg-blue-100",children:t.jsx(Kt,{className:"h-4 w-4 text-blue-600"})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-gray-900",children:s?.original_name??`Arquivo ${o+1}`}),t.jsx("p",{className:"text-xs text-gray-500",children:s?.path??"Caminho não disponÃvel"})]})]}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(d,{variant:"outline",size:"sm",onClick:()=>{s.path&&window.open(`${s.path}`,"_blank")},children:t.jsx(Ds,{className:"h-3 w-3"})}),t.jsx(d,{variant:"outline",size:"sm",onClick:()=>{if(s.path){const m=document.createElement("a");m.href=`/storage/${s.path}`,m.download=s.original_name||`arquivo-${o+1}`,document.body.appendChild(m),m.click(),document.body.removeChild(m)}},children:t.jsx(ws,{className:"h-3 w-3"})}),t.jsx(d,{variant:"destructive",size:"sm",onClick:()=>ls(s),children:t.jsx(Fs,{className:"h-3 w-3"})})]})]},s?.id??o))})]}),e[168]=f,e[169]=de):de=e[169];let nt;e[170]===Symbol.for("react.memo_cache_sentinel")?(nt=t.jsx("h4",{className:"mb-3 text-sm font-medium text-gray-900",children:"Adicionar Novos Anexos"}),e[170]=nt):nt=e[170];const zt=`relative rounded-lg border-2 border-dashed p-6 text-center transition-colors ${ts?"border-blue-400 bg-blue-50":"border-gray-300 hover:border-gray-400"}`;let me;e[171]!==Dt?(me=t.jsx("input",{type:"file",multiple:!0,onChange:Dt,className:"absolute inset-0 h-full w-full cursor-pointer opacity-0"}),e[171]=Dt,e[172]=me):me=e[172];let dt;e[173]===Symbol.for("react.memo_cache_sentinel")?(dt=t.jsx(Yt,{className:"mx-auto h-12 w-12 text-gray-400"}),e[173]=dt):dt=e[173];let mt,ft;e[174]===Symbol.for("react.memo_cache_sentinel")?(mt=t.jsxs("p",{className:"mt-2 text-sm text-gray-600",children:["Arraste e solte arquivos aqui, ou"," ",t.jsx("span",{className:"font-medium text-blue-600 hover:text-blue-500",children:"clique para selecionar"})]}),ft=t.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"PDF, DOC, DOCX, XLS, XLSX, PNG, JPG até 10MB"}),e[174]=mt,e[175]=ft):(mt=e[174],ft=e[175]);let fe;e[176]!==Ft||e[177]!==zt||e[178]!==me?(fe=t.jsxs("div",{className:zt,onDragEnter:wt,onDragLeave:wt,onDragOver:wt,onDrop:Ft,children:[me,dt,mt,ft]}
1),e[176]=Ft,e[177]=zt,e[178]=me,e[179]=fe):fe=e[179];let pe;e[180]!==Et||e[181]!==j||e[182]!==At||e[183]!==n?(pe=n.length>0&&t.jsxs("div",{className:"mt-4",children:[t.jsxs("h5",{className:"mb-2 text-sm font-medium text-gray-900",children:["Arquivos para Upload (",n.length,")"]}),t.jsx("div",{className:"space-y-2",children:n.map((s,o)=>t.jsxs("div",{className:"flex items-center justify-between rounded-lg border bg-gray-50 p-3",children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded bg-green-100",children:t.jsx(Kt,{className:"h-4 w-4 text-green-600"})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-gray-900",children:s.name}),t.jsxs("p",{className:"text-xs text-gray-500",children:[(s.size/1024/1024).toFixed(2)," ","MB"]})]})]}),t.jsx(d,{variant:"outline",size:"sm",onClick:()=>At(o),children:t.jsx(Qt,{className:"h-3 w-3"})})]},o))}),t.jsx("div",{className:"mt-4 flex justify-end",children:t.jsxs(d,{onClick:Et,disabled:j,className:"flex items-center gap-2",children:[t.jsx(Yt,{className:"h-4 w-4"}),j?"Enviando...":`Enviar ${n.length} arquivo(s)`]})})]}),e[180]=Et,e[181]=j,e[182]=At,e[183]=n,e[184]=pe):pe=e[184];let he;e[185]!==fe||e[186]!==pe?(he=t.jsxs("div",{children:[nt,fe,pe]}),e[185]=fe,e[186]=pe,e[187]=he):he=e[187];let xe;e[188]!==de||e[189]!==he?(xe=t.jsxs(Bt,{children:[ct,t.jsxs(Ut,{className:"space-y-6",children:[de,he]})]}),e[188]=de,e[189]=he,e[190]=xe):xe=e[190];let pt;e[191]===Symbol.for("react.memo_cache_sentinel")?(pt=t.jsxs(gs,{className:"flex items-center gap-2",children:[t.jsx(Ts,{className:"h-5 w-5 text-red-600"}),"Confirmar Exclusão de Anexo"]}),e[191]=pt):pt=e[191];let ht;e[192]===Symbol.for("react.memo_cache_sentinel")?(ht=t.jsx("p",{children:"Tem certeza que deseja excluir este anexo? Esta ação não pode ser desfeita."}),e[192]=ht):ht=e[192];let xt;e[193]===Symbol.for("react.memo_cache_sentinel")?(xt=t.jsx("p",{className:"font-semibold text-sm",children:"Detalhes do Anexo:"}),e[193]=xt):xt=e[193];let ut;e[194]===Symbol.for("react.memo_cache_sentinel")?(ut=t.jsx("span",{className:"font-medium",children:"Nome:"}),e[194]=ut):ut=e[194];const It=u?.original_name||"N/A";let ue;e[195]!==It?(ue=t.jsxs("p",{children:[ut," ",It]}),e[195]=It,e[196]=ue):ue=e[196];let jt;e[197]===Symbol.for("react.memo_cache_sentinel")?(jt=t.jsx("span",{className:"font-medium",children:"Caminho:"}),e[197]=jt):jt=e[197];let je;e[198]!==u?.path?(je=u?.path?.substring(0,50)+"..."||"N/A",e[198]=u?.path,e[199]=je):je=e[199];let ge;e[200]!==je?(ge=t.jsxs("p",{className:"text-wrap",children:[jt," ",je]}),e[200]=je,e[201]=ge):ge=e[201];let ve;e[202]!==ue||e[203]!==ge?(ve=t.jsxs(vs,{children:[pt,t.jsxs(bs,{className:"space-y-2",children:[ht,t.jsxs("div",{className:"mt-3 p-3 max-w-lg bg-gray-50 rounded-md border",children:[xt,t.jsxs("div",{className:"mt-2 space-y-1 text-sm",children:[ue,ge]})]})]})]}),e[202]=ue,e[203]=ge,e[204]=ve):ve=e[204];let gt;e[205]===Symbol.for("react.memo_cache_sentinel")?(gt=t.jsx(d,{variant:"outline",onClick:rs,children:"Cancelar"}),e[205]=gt):gt=e[205];let be;e[206]!==kt?(be=t.jsxs(ys,{children:[gt,t.jsx(d,{variant:"destructive",onClick:kt,children:"Excluir"})]}),e[206]=kt,e[207]=be):be=e[207];let ye;e[208]!==ve||e[209]!==be?(ye=t.jsxs(Ns,{children:[ve,be]}),e[208]=ve,e[209]=be,e[210]=ye):ye=e[210];let Ne;e[211]!==Nt||e[212]!==ye?(Ne=t.jsx(_s,{open:Nt,onOpenChange:Ae,children:ye}),e[211]=Nt,e[212]=ye,e[213]=Ne):Ne=e[213];const Vt=Bt;let _e;e[214]===Symbol.for("react.memo_cache_sentinel")?(_e=t.jsx(Ht,{children:t.jsxs(Xt,{className:"flex items-center gap-2",children:[t.jsx($s,{className:"h-5 w-5"}),"Fiscais do Contrato"]})}),e[214]=_e):_e=e[214];const Lt=Ut,is="space-y-4";let Se;e[215]!==a.fiscais||e[216]!==a.id?(Se=a.fiscais&&a.fiscais.length>0?t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-sm font-medium text-gray-700",children:"Fiscais vinculados"}),a.fiscais.map(s=>t.jsxs("div",{className:"flex items-center justify-between rounded-md border px-3 py-2",children:[t.jsx("span",{className:"text-sm",children:s.nome}),t.jsx(d,{type:"button",variant:"ghost",size:"sm",className:"text-red-600 hover:text-red-700",onClick:()=>bt.delete(`/portal/admin/contratos/${a.id}/fiscais/${s.id}`,{preserveScroll:!0}),children:t.jsx(Qt,{className:"h-4 w-4"})})]},s.id))]}):t.jsx("p",{className:"text-sm text-gray-500",children:"Nenhum fiscal vinculado ainda."}
1),e[215]=a.fiscais,e[216]=a.id,e[217]=Se):Se=e[217];const Mt=Rt.length>0&&t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-sm font-medium text-gray-700",children:"Vincular fiscais"}),t.jsxs("div",{className:"space-y-3",children:[t.jsx("select",{id:"add_fiscal_select",multiple:!0,value:b,onChange:s=>Gt(Array.from(s.target.selectedOptions,zs)),className:"flex min-h-[140px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm",children:Rt.map(Os)}),t.jsxs("p",{className:"text-xs text-gray-500",children:["Segure Ctrl para selecionar vários fiscais. ",b.length>0&&`${b.length} selecionado(s).`]}),t.jsxs(d,{type:"button",disabled:b.length===0,onClick:()=>{b.length!==0&&bt.post(`/portal/admin/contratos/${a.id}/fiscais`,{id_fiscais:b},{preserveScroll:!0,onSuccess:()=>Gt([])})},children:[t.jsx(As,{className:"mr-2 h-4 w-4"}),"Vincular selecionados"]})]})]});let Ce;e[218]!==Lt||e[219]!==Se||e[220]!==Mt?(Ce=t.jsxs(Lt,{className:is,children:[Se,Mt]}),e[218]=Lt,e[219]=Se,e[220]=Mt,e[221]=Ce):Ce=e[221];let De;e[222]!==Vt||e[223]!==_e||e[224]!==Ce?(De=t.jsxs(Vt,{children:[_e,Ce]}),e[222]=Vt,e[223]=_e,e[224]=Ce,e[225]=De):De=e[225];let we;e[226]!==Ne||e[227]!==De||e[228]!==S||e[229]!==ne||e[230]!==xe?(we=t.jsxs("div",{className:os,children:[S,ne,xe,Ne,De]}),e[226]=Ne,e[227]=De,e[228]=S,e[229]=ne,e[230]=xe,e[231]=we):we=e[231];let vt;return e[232]!==$t||e[233]!==we||e[234]!==_?(vt=t.jsxs($t,{children:[_,we]}),e[232]=$t,e[233]=we,e[234]=_,e[235]=vt):vt=e[235],vt}function Os(c){return t.jsx("option",{value:c.id,children:c.nome},c.id)}function zs(c){return c.value}function Is(c){const[e,a]=c;return t.jsx(us,{value:e,children:a},e)}function Vs(c){console.error("Erro ao fazer upload:",c)}function Ls(c){return c.replace("Z","").slice(0,16)}function Ms(c){if(!c)return"";const e=Number(c)/100;return new Intl.NumberFormat("pt-BR",{minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}function Ps(c){return c.trim()}export{Ja 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.