PageSourceSearch

https://aguabranca.al.gov.br/build/assets/Form-CvepFiNh.js

js aguabranca.al.gov.br collected 2026-10-02 18:33:54 UTC 4,467 bytes, 1 lines download raw bytes

1import{c as V,a as X,j as t}from"./app-CTaY8UJf.js";import{B}from"./button-DXCKLHtj.js";import{C as R,a as T,b as $,c as q}from"./card-UxP9oPxk.js";import{I as G}from"./input-7aHhCeCr.js";import{L as H}from"./label-CxCrcTSv.js";import J from"./file-text-jraIksbC.js";import K from"./x-DmP7A1Bz.js";import P from"./upload-C5_Iw0PV.js";import"./app-CNmQMdEi.js";import"./index-fQ3brVpV.js";import"./createLucideIcon-CmjF8lT1.js";function le(M){const e=V.c(51),{item:a,isEdit:I}=M,r=I===void 0?!1:I,L=a?.nome??"",D=r?"put":"post";let b;e[0]!==L||e[1]!==D?(b={nome:L,organica_documento:null,_method:D},e[0]=L,e[1]=D,e[2]=b):b=e[2];const{data:o,setData:s,post:E,processing:y,errors:i}=X(b);let N;e[3]!==r||e[4]!==a||e[5]!==E?(N=_=>{_.preventDefault();const U=r&&a?.id?`/portal/admin/lei-organica/${a.id}`:"/portal/admin/lei-organica";E(U,{forceFormData:!0})},e[3]=r,e[4]=a,e[5]=E,e[6]=N):N=e[6];const z=N;let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(R,{children:t.jsx(T,{children:"Dados da Lei Orgânica"})}),e[7]=v):v=e[7];let C;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(H,{htmlFor:"nome",children:"Nome *"}),e[8]=C):C=e[8];let n;e[9]!==s?(n=_=>s("nome",_.target.value),e[9]=s,e[10]=n):n=e[10];let l;e[11]!==o.nome||e[12]!==n?(l=t.jsx(G,{id:"nome",type:"text",value:o.nome,onChange:n,placeholder:"Ex: Lei Orgânica do Município"}),e[11]=o.nome,e[12]=n,e[13]=l):l=e[13];let c;e[14]!==i.nome?(c=i.nome&&t.jsx("p",{className:"text-sm text-red-600",children:i.nome}),e[14]=i.nome,e[15]=c):c=e[15];let m;e[16]!==c||e[17]!==l?(m=t.jsxs($,{children:[v,t.jsx(q,{className:"grid grid-cols-1 gap-4",children:t.jsxs("div",{className:"space-y-2",children:[C,l,c]})})]}),e[16]=c,e[17]=l,e[18]=m):m=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(R,{children:t.jsx(T,{children:"Documento da Lei"})}),e[19]=w):w=e[19];const O=!r&&"*";let d;e[20]!==O?(d=t.jsxs(H,{htmlFor:"organica_documento",children:["Arquivo ",O]}),e[20]=O,e[21]=d):d=e[21];let S;e[22]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(P,{className:"h-4 w-4 text-gray-500 shrink-0"}),e[22]=S):S=e[22];let u;e[23]!==s?(u=t.jsxs("div",{className:"mt-2 flex items-center gap-2 rounded-md border border-dashed p-3",children:[S,t.jsx("input",{id:"organica_documento",type:"file",className:"block w-full text-sm file:mr-3 file:rounded-md file:border-0 file:bg-primary file:px-3 file:py-1.5 file:text-primary-foreground file:text-sm cursor-pointer",onChange:_=>s("organica_documento",_.target.files?.[0]??null)})]}),e[23]=s,e[24]=u):u=e[24];let f;e[25]!==i.organica_documento?(f=i.organica_documento&&t.jsx("p",{className:"text-sm text-red-600",children:i.organica_documento}),e[25]=i.organica_documento,e[26]=f):f=e[26];let p;e[27]!==o.organica_documento||e[28]!==r||e[29]!==a?(p=r&&a?.documento_url&&!o.organica_documento&&t.jsxs("a",{href:a.documento_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-2 text-sm text-blue-600 hover:underline",children:[t.jsx(J,{className:"h-4 w-4"}),"Visualizar documento atual"]}),e[27]=o.organica_documento,e[28]=r,e[29]=a,e[30]=p):p=e[30];let x;e[31]!==o.organica_documento||e[32]!==s?(x=o.organica_documento&&t.jsxs("div",{className:"flex items-center justify-between rounded-md bg-muted px-3 py-2 text-sm",children:[t.jsx("span",{className:"truncate",children:o.organica_documento.name}),t.jsx(B,{type:"button",variant:"ghost",size:"icon",onClick:()=>s("organica_documento",null),children:t.jsx(K,{className:"h-4 w-4"})})]}),e[31]=o.organica_documento,e[32]=s,e[33]=x):x=e[33];let h;e[34]!==d||e[35]!==u||e[36]!==f||e[37]!==p||e[38]!==x?(h=t.jsxs($,{children:[w,t.jsx(q,{className:"space-y-4",children:t.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[d,u,f,p,x]})})]}),e[34]=d,e[35]=u,e[36]=f,e[37]=p,e[38]=x,e[39]=h):h=e[39];const A=y?"Salvando...":r?"Atualizar":"Cadastrar";let g;e[40]!==y||e[41]!==A?(g=t.jsx(B,{type:"submit",disabled:y,children:A}),e[40]=y,e[41]=A,e[42]=g):g=e[42];let k;e[43]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(B,{type:"button",variant:"outline",onClick:Q,children:"Cancelar"}),e[43]=k):k=e[43];let j;e[44]!==g?(j=t.jsxs("div",{className:"flex flex-wrap gap-3",children:[g,k]}),e[44]=g,e[45]=j):j=e[45];let F;return e[46]!==z||e[47]!==m||e[48]!==h||e[49]!==j?(F=t.jsxs("form",{onSubmit:z,className:"space-y-6",children:[m,h,j]}),e[46]=z,e[47]=m,e[48]=h,e[49]=j,e[50]=F):F=e[50],F}function Q(){return window.history.back()}export{le 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.