PageSourceSearch

https://craibas.al.gov.br/build/assets/Create-Caf69_6g.js

js craibas.al.gov.br collected 2026-10-02 23:56:01 UTC 11,892 bytes, 1 lines download raw bytes

1import{c as Oe,a as Ee,r as Ie,j as t,H as Te,b as Ve}from"./app-CTaY8UJf.js";import{C as ke,a as Ae,b as He,c as $e}from"./card-UxP9oPxk.js";import{B as Le}from"./button-DXCKLHtj.js";import{I as J}from"./input-7aHhCeCr.js";import{L as o}from"./label-CxCrcTSv.js";import{T as Pe}from"./textarea-0W-7qht9.js";import{S as Me,a as We,c as Xe,b as qe,d as ze}from"./select-BBMYAKnd.js";import{A as Ge}from"./AppLayoutWithNotifications-mus8tTbI.js";import Je from"./arrow-left-CPptMQyl.js";import Ke from"./x-DmP7A1Bz.js";import Qe from"./save-tvu6uyS3.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"./circle-alert-CTn79Wf8.js";import"./circle-x-VMcb1sXz.js";import"./circle-check-big-0QGs7tCc.js";import"./app-layout-DHg6PkRO.js";import"./index-sraz7nLe.js";import"./index-Svmmcv6D.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-text-jraIksbC.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 Zt(G){const e=Oe.c(134),{page_title:i,page_description:pe,situacoes:ue}=G;let K;e[0]===Symbol.for("react.memo_cache_sentinel")?(K={objeto:"",valor:"",empresa_contratada:"",data_inicio:"",data_prevista:"",percentual_concluido:"0",situacao:"planejamento"},e[0]=K):K=e[0];const{data:s,setData:l,post:xe,processing:Q,errors:a}=Ee(K),[fe,Re]=Ie.useState("");let U;e[1]!==l?(U=r=>{const Be=r.target.value.replace(/\D/g,"");if(!Be){Re(""),l("valor","");return}const De=parseInt(Be,10)/100,we=De.toLocaleString("pt-BR",{style:"currency",currency:"BRL"});Re(we),l("valor",String(De))},e[1]=l,e[2]=U):U=e[2];const he=U;let Y;e[3]!==xe?(Y=r=>{r.preventDefault(),xe("/admin/obras",{onSuccess:et,onError:Ze})},e[3]=xe,e[4]=Y):Y=e[4];const je=Y,Fe=Ye;let c;e[5]!==i?(c=t.jsx(Te,{title:i}),e[5]=i,e[6]=c):c=e[6];let n;e[7]!==i?(n=t.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:i}),e[7]=i,e[8]=n):n=e[8];let d;e[9]!==pe?(d=t.jsx("p",{className:"mt-1 text-gray-600",children:pe}),e[9]=pe,e[10]=d):d=e[10];let m;e[11]!==n||e[12]!==d?(m=t.jsxs("div",{children:[n,d]}),e[11]=n,e[12]=d,e[13]=m):m=e[13];let Z;e[14]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsxs(Le,{variant:"outline",onClick:Fe,className:"flex items-center gap-2",children:[t.jsx(Je,{className:"h-4 w-4"}),"Voltar"]}),e[14]=Z):Z=e[14];let p;e[15]!==m?(p=t.jsxs("div",{className:"flex items-center justify-between",children:[m,Z]}),e[15]=m,e[16]=p):p=e[16];let ee;e[17]===Symbol.for("react.memo_cache_sentinel")?(ee=t.jsx(ke,{children:t.jsx(Ae,{children:"Cadastrar Nova Obra"})}),e[17]=ee):ee=e[17];let te;e[18]===Symbol.for("react.memo_cache_sentinel")?(te=t.jsxs(o,{htmlFor:"objeto",children:["Objeto da Obra ",t.jsx("span",{className:"text-red-500",children:"*"})]}),e[18]=te):te=e[18];let u;e[19]!==l?(u=r=>l("objeto",r.target.value),e[19]=l,e[20]=u):u=e[20];const _e=a.objeto?"border-red-500":"";let x;e[21]!==s.objeto||e[22]!==u||e[23]!==_e?(x=t.jsx(Pe,{id:"objeto",value:s.objeto,onChange:u,placeholder:"Descreva detalhadamente o objeto da obra...",rows:4,className:_e}),e[21]=s.objeto,e[22]=u,e[23]=_e,e[24]=x):x=e[24];let f;e[25]!==a.objeto?(f=a.objeto&&t.jsx("p",{className:"text-sm text-red-500",children:a.objeto}),e[25]=a.objeto,e[26]=f):f=e[26];let h;e[27]!==x||e[28]!==f?(h=t.jsx("div",{className:"lg:col-span-2",children:t.jsxs("div",{className:"space-y-2",children:[te,x,f]})}),e[27]=x,e[28]=f,e[29]=h):h=e[29];let ae;e[30]===Symbol.for("react.memo_cache_sentinel")?(ae=t.jsxs(o,{htmlFor:"empresa_contratada",children:["Empresa Contratada ",t.jsx("span",{className:"text-red-500",children:"*"})]}),e[30]=ae):ae=e[30];let j;e[31]!==l?(j=r=>l("empresa_contratada",r.target.value),e[31]=l,e[32]=j):j=e[32];const ve=a.empresa_contratada?"border-red-500":"";let _;e[33]!==s.empresa_contratada||e[34]!==j||e[35]!==ve?(_=t.jsx(J,{id:"empresa_contratada",value:s.empresa_contratada,onChange:j,placeholder:"Nome da empresa contratada...",className:ve}),e[33]=s.empresa_contratada,e[34]=j,e[35]=ve,e[36]=_):_=e[36];let v;e[37]!==a.empresa_contratada?(v=a.empresa_contratada&&t.jsx("p",{className:"text-sm text-red-500",children:a.empresa_contratada}),e[37]=a.empresa_contratada,e[38]=v):v=e[38];let b;e[39]!==_||e[40]!==v?(b=t.jsx("div",{children:t.jsxs("div",{className:"space-y-2",children:[ae,_,v]})}),e[39]=_,e[40]=v,e[41]=b):b=e[41];let se;e[42]===Symbol.for("react.memo_cache_sentinel")?(se=t.jsxs(o,{htmlFor:"valor",children:["Valor (R$) ",t.jsx("span",{className:"text-red-500",children:"*"})]}),e[42]=se):se=e[42];const be=a.valor?"border-red-500":"";let N;e[43]!==he||e[44]!==be||e[45]!==fe?(N=t.jsx(J,{id:"valor",type:"text",inputMode:"numeric",value:fe,onChange:he,placeholder:"R$ 0,00",className:be}),e[43]=he,e[44]=be,e[45]=fe,e[46]=N):N=e[46];let y;e[47]!==a.valor?(y=a.valor&&t.jsx("p",{className:"text-sm text-red-500",children:a.valor}),e[47]=a.valor,e[48]=y):y=e[48];let g;e[49]!==N||e[50]!==y?(g=t.jsx("div",{children:t.jsxs("div",{className:"space-y-2",children:[se,N,y]})}),e[49]=N,e[50]=y,e[51]=g):g=e[51];let le;e[52]===Symbol.for("react.memo_cache_sentinel")?(le=t.jsxs(o,{htmlFor:"data_inicio",children:["Data de Início ",t.jsx("span",{className:"text-red-500",children:"*"})]}),e[52]=le):le=e[52];let S;e[53]!==l?(S=r=>l("data_inicio",r.target.value),e[53]=l,e[54]=S):S=e[54];const Ne=a.data_inicio?"border-red-500":"";let C;e[55]!==s.data_inicio||e[56]!==S||e[57]!==Ne?(C=t.jsx(J,{id:"data_inicio",type:"date",value:s.data_inicio,onChange:S,className:Ne}),e[55]=s.data_inicio,e[56]=S,e[57]=Ne,e[58]=C):C=e[58];let L;e[59]!==a.data_inicio?(L=a.data_inicio&&t.jsx("p",{className:"text-sm text-red-500",children:a.data_inicio}),e[59]=a.data_inicio,e[60]=L):L=e[60];let R;e[61]!==C||e[62]!==L?(R=t.jsx("div",{children:t.jsxs("div",{className:"space-y-2",children:[le,C,L]})}),e[61]=C,e[62]=L,e[63]=R):R=e[63];let re;e[64]===Symbol.for("react.memo_cache_sentinel")?(re=t.jsxs(o,{htmlFor:"data_prevista",children:["Data Prevista ",t.jsx("span",{className:"text-red-500",children:"*"})]}),e[64]=re):re=e[64];let F;e[65]!==l?(F=r=>l("data_prevista",r.target.value),e[65]=l,e[66]=F):F=e[66];const ye=a.data_prevista?"border-red-500":"";let B;e[67]!==s.data_inicio||e[68]!==s.data_prevista||e[69]!==F||e[70]!==ye?(B=t.jsx(J,{id:"data_prevista",type:"date",value:s.data_prevista,onChange:F,min:s.data_inicio,className:ye}),e[67]=s.data_inicio,e[68]=s.data_prevista,e[69]=F,e[70]=ye,e[71]=B):B=e[71];let D;e[72]!==a.data_prevista?(D=a.data_prevista&&t.jsx("p",{className:"text-sm text-red-500",children:a.data_prevista}),e[72]=a.data_prevista,e[73]=D):D=e[73];let V;e[74]!==B||e[75]!==D?(V=t.jsx("div",{children:t.jsxs("div",{className:"space-y-2",children:[re,B,D]})}),e[74]=B,e[75]=D,e[76]=V):V=e[76];let ie;e[77]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsxs(o,{htmlFor:"percentual_concluido",children:["Percentual Concluído (%) ",t.jsx("span",{className:"text-red-500",children:"*"})]}),e[77]=ie):ie=e[77];let w;e[78]!==l?(w=r=>l("percentual_concluido",r.target.value),e[78]=l,e[79]=w):w=e[79];const ge=a.percentual_concluido?"border-red-500":"";let O;e[80]!==s.percentual_concluido||e[81]!==w||e[82]!==ge?(O=t.jsx(J,{id:"percentual_concluido",type:"number",step:"0.01",min:"0",max:"100",value:s.percentual_concluido,onChange:w,placeholder:"0",className:ge}),e[80]=s.percentual_concluido,e[81]=w,e[82]=ge,e[83]=O):O=e[83];let E;e[84]!==a.percentual_concluido?(E=a.percentual_concluido&&t.jsx("p",{className:"text-sm text-red-500",children:a.percentual_concluido}),e[84]=a.percentual_concluido,e[85]=E):E=e[85];let I;e[86]!==s.percentual_concluido||e[87]!==s.valor?(I=s.valor&&s.percentual_concluido&&Number(s.valor)>0&&Number(s.percentual_concluido)>0&&t.jsxs("div",{className:"mt-2 rounded-md border border-blue-200 bg-blue-50 px-3 py-2",children:[t.jsx("p",{className:"text-xs text-blue-600 font-medium",children:"💰 Valor já executado"}),t.jsx("p",{className:"text-sm font-bold text-blue-800",children:(Number(s.valor)*Number(s.percentual_concluido)/100).toLocaleStr
1ing("pt-BR",{style:"currency",currency:"BRL"})}),t.jsxs("p",{className:"text-xs text-blue-500",children:[Number(s.percentual_concluido).toFixed(2),"% de"," ",Number(s.valor).toLocaleString("pt-BR",{style:"currency",currency:"BRL"})]})]}),e[86]=s.percentual_concluido,e[87]=s.valor,e[88]=I):I=e[88];let T;e[89]!==O||e[90]!==E||e[91]!==I?(T=t.jsx("div",{children:t.jsxs("div",{className:"space-y-2",children:[ie,O,E,I]})}),e[89]=O,e[90]=E,e[91]=I,e[92]=T):T=e[92];let oe;e[93]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsxs(o,{htmlFor:"situacao",children:["Situação ",t.jsx("span",{className:"text-red-500",children:"*"})]}),e[93]=oe):oe=e[93];let k;e[94]!==l?(k=r=>l("situacao",r),e[94]=l,e[95]=k):k=e[95];const Se=a.situacao?"border-red-500":"";let ce;e[96]===Symbol.for("react.memo_cache_sentinel")?(ce=t.jsx(Xe,{placeholder:"Selecione a situação..."}),e[96]=ce):ce=e[96];let A;e[97]!==Se?(A=t.jsx(qe,{className:Se,children:ce}),e[97]=Se,e[98]=A):A=e[98];let H;e[99]!==ue?(H=t.jsx(Me,{children:Object.entries(ue).map(Ue)}),e[99]=ue,e[100]=H):H=e[100];let $;e[101]!==s.situacao||e[102]!==k||e[103]!==A||e[104]!==H?($=t.jsxs(We,{value:s.situacao,onValueChange:k,children:[A,H]}),e[101]=s.situacao,e[102]=k,e[103]=A,e[104]=H,e[105]=$):$=e[105];let P;e[106]!==a.situacao?(P=a.situacao&&t.jsx("p",{className:"text-sm text-red-500",children:a.situacao}),e[106]=a.situacao,e[107]=P):P=e[107];let M;e[108]!==$||e[109]!==P?(M=t.jsx("div",{children:t.jsxs("div",{className:"space-y-2",children:[oe,$,P]})}),e[108]=$,e[109]=P,e[110]=M):M=e[110];let W;e[111]!==h||e[112]!==b||e[113]!==g||e[114]!==R||e[115]!==V||e[116]!==T||e[117]!==M?(W=t.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[h,b,g,R,V,T,M]}),e[111]=h,e[112]=b,e[113]=g,e[114]=R,e[115]=V,e[116]=T,e[117]=M,e[118]=W):W=e[118];let ne;e[119]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsxs(Le,{type:"button",variant:"outline",onClick:Fe,className:"flex items-center gap-2",children:[t.jsx(Ke,{className:"h-4 w-4"}),"Cancelar"]}),e[119]=ne):ne=e[119];let de;e[120]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx(Qe,{className:"h-4 w-4"}),e[120]=de):de=e[120];const Ce=Q?"Salvando...":"Cadastrar Obra";let X;e[121]!==Q||e[122]!==Ce?(X=t.jsxs("div",{className:"flex items-center justify-end gap-4 pt-6 border-t",children:[ne,t.jsxs(Le,{type:"submit",disabled:Q,className:"flex items-center gap-2",children:[de,Ce]})]}),e[121]=Q,e[122]=Ce,e[123]=X):X=e[123];let q;e[124]!==je||e[125]!==W||e[126]!==X?(q=t.jsxs(He,{children:[ee,t.jsx($e,{children:t.jsxs("form",{onSubmit:je,className:"space-y-6",children:[W,X]})})]}),e[124]=je,e[125]=W,e[126]=X,e[127]=q):q=e[127];let z;e[128]!==q||e[129]!==p?(z=t.jsxs("div",{className:"space-y-6 p-4",children:[p,q]}),e[128]=q,e[129]=p,e[130]=z):z=e[130];let me;return e[131]!==c||e[132]!==z?(me=t.jsxs(Ge,{children:[c,z]}),e[131]=c,e[132]=z,e[133]=me):me=e[133],me}function Ue(G){const[e,i]=G;return t.jsx(ze,{value:e,children:i},e)}function Ye(){Ve.visit("/admin/obras")}function Ze(G){console.error("Validation errors:",G)}function et(){Ve.visit("/admin/obras")}export{Zt 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.