PageSourceSearch

https://www.birminghamal.gov/_next/static/chunks/pages/documents-67cfc9bc8a4c267f.js

js birminghamal.gov collected 2026-10-02 02:57:41 UTC 10,696 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[976],{4776:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/documents",function(){return a(3357)}])},9390:function(e,t,a){"use strict";a.d(t,{C:function(){return h}});var n=a(2322),l=a(2784),i=a(9097),r=a.n(i),s=a(1286),o=a(5632),c=a(5705),d=a(6925),u=a(4978);let m="https://content.birminghamal.gov/api/alerts/www";function h(e){var t;let{sidebar:a,children:i,header:h,footer:p,topSection:v}=e,f=(0,o.useRouter)(),{data:x,error:g}=(0,s.ZP)(m,u.C,{refreshInterval:3e4,revalidateOnFocus:!0,revalidateIfStale:!0,dedupingInterval:0,keepPreviousData:!1,revalidateOnReconnect:!0}),j=null!==(t=null==x?void 0:x.alerts)&&void 0!==t?t:[];g&&console.log("Error fetching alerts:",g),(0,l.useEffect)(()=>{let e=()=>(0,s.JG)(m);return f.events.on("routeChangeComplete",e),()=>{f.events.off("routeChangeComplete",e)}},[f.events]);let y=(0,l.useRef)(null);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.n,{}),j.length>0&&j.map(e=>{var t;return(0,n.jsx)("section",{id:"alert-content","aria-label":"Site alert",children:(0,n.jsx)(c.bZ,{id:e.id,severity:e.severity,title:e.title,body:"string"==typeof e.body?e.body:(null===(t=e.body)||void 0===t?void 0:t.processed)||"",icon:"message-exclamation",dismissible:"emergency"!==e.severity})},e.id)}),(0,n.jsx)(r(),{href:"#main-content",className:"absolute overflow-hidden h-[1px] w-[1px] focus:static focus:w-auto focus:h-auto focus:border-2 focus:border-black",onKeyDown:e=>{if("Enter"===e.key||" "===e.key){var t;e.preventDefault(),null===(t=y.current)||void 0===t||t.focus()}},tabIndex:0,children:"Skip to main content"}),(0,n.jsx)(c.h4,{...h}),(0,n.jsxs)("main",{className:"container pb-s",id:"main-content",tabIndex:-1,ref:y,
1children:[v&&(0,n.jsx)("div",{className:"w-full",children:v}),(0,n.jsxs)("div",{className:"md:grid md:grid-cols-4 md:gap-default",children:[a&&(0,n.jsx)("div",{className:"mb-s",children:a}),(0,n.jsxs)("div",{className:a?"md:col-span-3":"md:col-span-4",children:[i?null:(0,n.jsx)(c.Vm,{text:"Main Content"}),i]})]})]}),(0,n.jsx)(c.$_,{...p})]})}},3357:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSG:function(){return m},default:function(){return h}});var n=a(2322),l=a(2784),i=a(5632),r=a(5705),s=a(3881),o=a(9390),c=a(4100),d=a(2876);function u(e){return Array.isArray(e)?e[0]:e||""}var m=!0;function h(e){var t;let{layout:a,departments:m}=e,h=(0,i.useRouter)(),p=h.query,[v,f]=(0,l.useState)([]),[x,g]=(0,l.useState)(0),[j,y]=(0,l.useState)(""),[b,w]=(0,l.useState)(""),[S,N]=(0,l.useState)(""),[k,C]=(0,l.useState)(""),[D,F]=(0,l.useState)(0),[P,_]=(0,l.useState)(0),[E,R]=(0,l.useState)(!1),[I,T]=(0,l.useState)(null),[X,A]=(0,l.useState)(u(p.search)),[O,U]=(0,l.useState)(u(p.department)),[L,z]=(0,l.useState)(u(p.mime)),[M,q]=(0,l.useState)(u(p.date)),[B,K]=(0,l.useState)("true"===p.archival),[W,Z]=(0,l.useState)([]),[G,V]=(0,l.useState)(!1),[H,J]=(0,l.useState)(!1),$=(0,d.useSearchParams)();(0,l.useEffect)(()=>{let e=$.get("department");e&&w(e)},[$]),(0,l.useEffect)(()=>{h.isReady&&(A(u(p.search)),U(u(p.department)),z(u(p.mime)),q(u(p.date)),K("true"===p.archival))},[h.isReady,p]),(0,l.useEffect)(()=>{h.isReady&&(p.search||p.department||p.mime||p.date||p.archival)&&(y(u(p.search)),w(u(p.department)),N(u(p.mime)),C(u(p.date)),R("true"===p.archival),V(!0))},[h.isReady,p]),(0,l.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/search/document-years");if(e.ok){let t=await e.json();Z(t.years||[])}}catch(e){console.error("Failed to fetch available years",e)}})()},[]);let Q=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];J(!0);try{let c=l?"&date=".concat(encodeURIComponent(l)):"",d=await fetch("/api/search/documents?page=".concat(e,"&search=").concat(encodeURIComponent(t),"&department=").concat(a,"&mime=").concat(n).concat(c).concat(i?"&archival=true":""));if(!d.ok){console.error("API response not OK:",d.status,d.statusText),J(!1);return}let u=await d.json(),m=null==u?void 0:u.graphqlDocumentsSearchWww;if(m){var r,s,o;F(null!==(s=null===(r=m.pageInfo)||void 0===r?void 0:r.pageSize)&&void 0!==s?s:0),f(null!==(o=m.results)&&void 0!==o?o:[])}}catch(e){console.error("Failed to fetch documents",e)}finally{J(!1)}},Y=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",l=arguments.length>4&&void 0!==arguments[4]&&arguments[4];try{var i,r;let s=n?"&date=".concat(encodeURIComponent(n)):"",o=await fetch("/api/search/documents?page=0&search=".concat(encodeURIComponent(e),"&department=").concat(t,"&mime=").concat(a).concat(s).concat(l?"&archival=true":"")),c=await o.json(),d=null==c?void 0:null===(r=c.graphqlDocumentsSearchWww)||void 0===r?void 0:null===(i=r.pageInfo)||void 0===i?void 0:i.total;null!=d&&T(d)}catch(e){console.error("Failed to fetch initial total results",e)}};(0,l.useEffect)(()=>{g(0),Y(j,b,S,k,E)},[j,b,S,k,E]),(0,l.useEffect)(()=>{Q(x,j,b,S,k,E)},[x,j,b,S,k,E]),(0,l.useEffect)(()=>{null!==I&&D>0&&_(Math.ceil(I/D))},[I,D]);let ee=null!==(t=a.name)&&void 0!==t?t:"CitizenForward",et=e=>{var t;return e?null!==(t=({"application/msword":"DOC","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"DOCX","application/vnd.ms-powerpoint":"PPT","application/vnd.openxmlformats-officedocument.presentationml.presentation":"PPTX","application/vnd.ms-excel":"XLS","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX","application/pdf":"PDF","image/x-dxf":"DXF","drawing/x-dwf":"DWF","application/postscript":"EPS","image/x-eps":"EPS"})[e])&&void 0!==t?t:e.replace("application/","").toUpperCase():""};return(0,n.jsxs)(o.C,{header:a.header,footer:a.footer,topSection:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.Oo,{links:[{title:"Home",url:"/",internal:!0,__typename:"Link"},{title:"Documents",url:"#",internal:!0,__typename:"Link"}],numberOfItems:3}),(0,n.jsx)(r.mr,{heading:"Document Finder"}),(0,n.jsx)("p",{className:"my-4 dark:text-white",children:"Documents marked as Archival are for research only and not considered accessible."})]}),sidebar:function(e){let t=()=>{y(u(X)),w(u(O)),N(u(L)),C(u(M)),R(B),V(!0),h.push({pathname:"/documents",query:{search:u(X),department:u(O),mime:u(L),date:u(M),...B&&{archival:"true"}}})},a="text-sm font-medium mb-2 block dark:text-white",l="block w-full bg-white border-2 border-[rgb(118_132_141/0.25)] rounded mt-2 min-h-[48px] px-3 py-2 dark:bg-white dark:text-black cursor-pointer";return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(r.Zo,{title:"Filter Documents",children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("label",{className:a,children:"Search"}),(0,n.jsx)("input",{type:"text",value:X,onChange:e=>A(e.target.value),placeholder:"Search by title or summary","aria-label":"Search",onKeyDown:e=>{"Enter"===e.key&&t()},className:l})]}),(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("label",{className:a,htmlFor:"DepartmentTerm",children:"By Department"}),(0,n.jsxs)("select",{name:"Departments",id:"DepartmentTerm",onChange:e=>U(e.target.value),value:O,"aria-label":"Select division",className:l,children:[(0,n.jsx)("option",{value:"",children:"Any"}),null==m?void 0:m.slice().sort((e,t)=>
1e.name.localeCompare(t.name)).map(e=>(0,n.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("label",{className:a,htmlFor:"MimeTerm",children:"File Type"}),(0,n.jsxs)("select",{name:"Mime",id:"MimeTerm",onChange:e=>z(e.target.value),value:L,"aria-label":"Select file type",className:l,children:[(0,n.jsx)("option",{value:"",children:"Any"}),(0,n.jsx)("option",{value:"1",children:"DOC"}),(0,n.jsx)("option",{value:"2",children:"DOCX"}),(0,n.jsx)("option",{value:"3",children:"PPT"}),(0,n.jsx)("option",{value:"4",children:"PPTX"}),(0,n.jsx)("option",{value:"5",children:"XLS"}),(0,n.jsx)("option",{value:"6",children:"XLSX"}),(0,n.jsx)("option",{value:"7",children:"PDF"})]})]}),(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("label",{className:a,htmlFor:"DateTerm",children:"By Date"}),(0,n.jsxs)("select",{name:"Date",id:"DateTerm",onChange:e=>q(e.target.value),value:M,"aria-label":"Select year",className:l,children:[(0,n.jsx)("option",{value:"",children:"Any"}),W.map(e=>(0,n.jsx)("option",{value:e.toString(),children:e},e))]})]}),(0,n.jsxs)("div",{className:"mb-4 flex flex-row items-center gap-2",children:[(0,n.jsx)("input",{type:"checkbox",id:"ArchivalTerm",checked:B,onChange:e=>K(e.target.checked),"aria-label":"Show archival documents only",className:"text-base"}),(0,n.jsx)("label",{htmlFor:"ArchivalTerm",className:"font-medium",children:"Show archival only"})]}),(0,n.jsxs)("div",{className:"mb-2",children:[(0,n.jsx)(r.zx,{onClick:t,title:"Apply","aria-label":"Apply",additionalClasses:"mr-3 rounded",buttonStyle:"tertiary"}),G&&(0,n.jsx)(r.zx,{onClick:()=>{A(""),U(""),z(""),q(""),K(!1),y(""),w(""),N(""),C(""),R(!1),V(!1),h.replace({pathname:h.pathname},void 0,{shallow:!0})},title:"Reset","aria-label":"Reset filters",additionalClasses:"rounded",buttonStyle:"tertiary"})]})]})})}(0),children:[(0,n.jsx)(c.S,{title:"Documents | ".concat(ee),siteName:ee,norobots:"true",description:"View a listing of ".concat(ee," documents that you can filter to find what you need.")}),(0,n.jsx)("div",{children:H?(0,n.jsx)(r.An,{}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"grid gap-s lg:gap-s-desktop mb-s lg:mb-s-desktop",children:v.length>0?(0,n.jsx)("div",{children:v.map(e=>{var t,a;return(0,n.jsx)(r.z4,{title:e.name,path:e.archival?"/archival-document?document="+decodeURI(e.mediaFile.url)+"&ad="+btoa(e.mediaFile.url)+"&title="+decodeURI(e.name):decodeURI(e.mediaFile.url),archival:e.archival,type:et(e.mediaFile.mime),filename:e.mediaFile.name,date:e.created?(0,s.p6)(e.created):"",department:null!==(a=null===(t=e.department)||void 0===t?void 0:t.name)&&void 0!==a?a:"",tags:"",downloadButton:!1},e.id)})}):(0,n.jsx)("p",{className:"text-white dark:text-white",children:"No results were found"})}),(0,n.jsx)("div",{children:(0,n.jsx)(r.uE,{onFirst:()=>g(0),onPrevious:()=>g(e=>e-1),onNext:()=>g(e=>e+1),onLast:()=>g(P-1),totalPages:P,currentPage:x,onPageChange:e=>g(e)})})]})})]})}}},function(e){e.O(0,[538,436,876,335,888,774,179],function(){return e(e.s=4776)}),_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.