1import{r as e,o as s,c as a,e as t,w as r,d as l,J as u,i as n,R as i,aa as o,S as d,ad as c,u as m,V as v,F as p,b as f,t as h,f as y,ae as x,af as q,W as _,D as g,C as b}from"./index-CcZ45_S5.js";import{_ as w}from"./_plugin-vue_export-helper-BCo6x5W8.js";import{F as I}from"./index.es-0vjt-INv.js";import{R as k,g as R}from"./_constants-DDW5cD6T.js";import{u as j}from"./search-CuDkYLOj.js";import{g as N}from"./locationFormatters-B5SIoJWC.js";import{u as F}from"./index-DbTZuWjE.js";import{u as L}from"./useQuery-CfbMjajd.js";import{D}from"./queryKeys-DpAWY-q4.js";import"./useQueryClient-D_RWsVuD.js";const E={key:0,class:"self-start justify-self-start w-full"},H=w({__name:"Nav",props:{requestIds:Array,previousIndex:Number,nextIndex:Number,setNavIs:Function},setup:i=>(o,d)=>{var c;const m=e("RouterLink");return(null==(c=i.requestIds)?void 0:c.length)&&[i.nextIndex,i.previousIndex].some(e=>Number(e)>-1)?(s(),a("nav",E,[t(m,{to:`/data-requests/${i.requestIds[i.previousIndex]}`,class:u({disabled:"number"!=typeof i.previousIndex}),replace:"",onMouseenter:d[0]||(d[0]=e=>i.setNavIs("decrement"))},{default:r(()=>[...d[2]||(d[2]=[l(" PREV ",-1)])]),_:1},8,["to","class"]),d[4]||(d[4]=l(" / ",-1)),t(m,{to:`/data-requests/${i.requestIds[i.nextIndex]}`,class:u({disabled:"number"!=typeof i.nextIndex}),replace:"",onMouseenter:d[1]||(d[1]=e=>i.setNavIs("increment"))},{default:r(()=>[...d[3]||(d[3]=[l(" NEXT ",-1)])]),_:1},8,["to","class"])])):n("",!0)}},[["__scopeId","data-v-343fee7f"]]),$={key:0,class:"flex items-center justify-center h-[80vh] w-full flex-col relative"},z={class:"flex gap-2 items-center"},A={key:0},C={class:"break-words"},M={class:"break-words"},T=["href"],K=w({__name:"[id]",setup(e){const u=i(),w=o(),E=j(),K=b(()=>({id:u.params.id})),P=b(()=>[D,K.value.id]),{isLoading:Q,data:S,error:V}=L({queryKey:P,queryFn:async()=>(await R(u.params.id)).data.data,staleTime:3e5}),W=b(()=>E.mostRecentRequestIds.indexOf(Number(u.params.id))),G=b(()=>W.value<E.mostRecentRequestIds.length-1?W.value+1:null),J=b(()=>W.value>0?W.value-1:null),O=g(!1),X=g(),B=g(),U=g(""),Y=b(()=>{var e,s;return(null==(s=null==(e=V.value)?void 0:e.message)?void 0:s.includes("not found"))?V.value:null}),{direction:Z}=F(B,{onSwipe:()=>{switch(Z.value){case"left":U.value="increment","number"==typeof G.value&&G.value>-1&&w.replace(`/data-requests/${E.mostRecentRequestIds[G.value]}`);break;case"right":U.value="decrement","number"==typeof J.value&&J.value>-1&&w.replace(`/data-requests/${E.mostRecentRequestIds[J.value]}`);break;default:return}}});function ee(){var e,s;(null==(e=X.value)?void 0:e.offsetHeight)<(null==(s=X.value)?void 0:s.scrollHeight)?O.value=!0:O.value=!1}return d(()=>{ee(),window.addEventListener("resize",ee)}),c(()=>{window.removeEventListener("resize",ee)}),(e,i)=>(s(),a("main",{ref_key:"mainRef",ref:B,class:"min-h-[75%] relative"},[t(H,{"request-ids":m(E).mostRecentRequestIds,"previous-index":J.value,"next-index":G.value,"set-nav-is":e=>U.value=e},null,8,["request-ids","previous-index","next-index","set-nav-is"]),t(_,{mode:"out-in",name:U.value},{default:r(()=>[m(Q)?(s(),a("div",$,[t(m(v),{show:m(Q),size:64,text:"Fetching data request..."},null,8,["show"])])):(s(),a("div",{key:m(u).params.id,class:"flex flex-col sm:flex-row sm:flex-wrap mt-6 sm:items-stretch sm:justify-between gap-4 h-full w-full relative [&>*]:w-full"},[!m(Q)&&Y.value?(s(),a(p,{key:0},[i[0]||(i[0]=f("h1",null,"An error occurred loading the data request",-1)),i[1]||(i[1]=f("p",null,"Please refresh the page and try again.",-1))],64)):Y.value||m(S)?(s(),a(p,{key:2},[f("hgroup",null,[f("h1",null,h(m(S).title),1),f("div",z,[m(S).record_types_required?(s(),a("div",A,[(s(!0),a(p,null,y(m(S).record_types_required,e=>(s(),a("p",{key:e.record_types_required,class:"pill w-max"},[t(m(x),{"record-type":e},null,8,["record-type"]),l(" "+h(e),1)]))),128))])):n("",!0)])]),i[5]||(i[5]=f("h4",null,"Locations covered by request",-1)),(s(!0),a(p,null,y(m(S).locations,e=>(s(),a("p",{key:e},h(m(N)(e)),1))),128)),i[6]||(i[6]=f("h4",null,"Coverage Range",-1)),f("p",null,h(m(S).coverage_range),1),i[7]||(i[7]=f("h4",null,"Target date",-1)),f("p",null,h(m(k)[m(S).request_urgency]),1),i[8]||(i[8]=f("h4",null,"Request notes",-1)),f("p",C,h(m(S).submission_notes),1),i[9]||(i[9]=f("h4",null,"Data requirements",-1)),f("p",M,h(m(S).data_requirements),1),m(S).github_issue_url?(s(),a("a",{key:0,href:m(S).github_issue_url,class:"pdap-button-primary mt-2 mb-4",target:"_blank",rel:"noreferrer","data-test":"data-request-github-link"},[i[4]||(i[4]=l(" Help out with this issue on GitHub ",-1)),t(m(I),{icon:m(q)},null,8,["icon"])],8,T)):n("",!0)],64)):(s(),a(p,{key:1},[i[2]||(i[2]=f("h1",null,"Data request not found",-1)),i[3]||(i[3]=f("p",null,"We don't have a record of that request.",-1))],64))]))]),_:1},8,["name"])],512))}},[["__scopeId","data-v-b0c52c7f"]]);export{K 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.