1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9437431b-3ae3-4af6-8079-9081a7e6144c",e._sentryDebugIdIdentifier="sentry-dbid-9437431b-3ae3-4af6-8079-9081a7e6144c")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5159],{5638:(e,n,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/settings/export/jobs",function(){return t(89216)}])},89216:(e,n,t)=>{"use strict";t.r(n),t.d(n,{__N_SSP:()=>V,default:()=>G});var r=t(37876),o=t(31527),a=t(27809),s=t(82077),i=t(24973),l=t(79686),d=t(50869),c=t(15066),u=t(52200),p=t(89028),x=t(94211),h=t(28304),g=t(13677),f=t(52336),b=t(55361),m=t(49535),w=t(14232);let y=t(5646).Ay.div.withConfig({componentId:"sc-229c1fea-0"})(["max-height:200px;opacity:1;overflow:hidden;transform:translateX(0);transition:max-height ","ms ease,opacity ","ms ease,transform ","ms ease;",""],300,300,300,e=>{let{$exiting:n}=e;return n&&"\n max-height: 0;\n opacity: 0;\n transform: translateX(-24px);\n "});var A=t(29023),j=t(99576),_=t(20104),v=t(71763),E=t(96427),I=t(27630),J=t(27250),D=t(78248),N=t(64177);function k(){let e=(0,E._)(["\n fragment ExportJobRow on ExportJob {\n id\n status\n displayName\n exportType\n createdAt\n completedAt\n expiresAt\n deletedAt\n filename\n downloadUrl\n paramsSummary\n}\n "]);return k=function(){return e},e}function C(){let e=(0,E._)(["\n query ExportJobs($orgId: ID!, $first: Int) {\n organization(orgId: $orgId) {\n id\n exportJobs(input: {first: $first}) {\n edges {\n node {\n ...ExportJobRow\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n totalCount\n }\n }\n}\n ",""]);return C=function(){return e},e}function P(){let e=(0,E._)(["\n query ExportJobNode($id: ID!) {\n node(id: $id) {\n id\n ... on ExportJob {\n ...ExportJobRow\n }\n }\n}\n ",""]);return P=function(){return e},e}function O(){let e=(0,E._)(["\n mutation DeleteExportJob($id: ID!) {\n deleteExportJob(id: $id) {\n deletedExportJobId\n userErrors {\n message\n }\n }\n}\n "]);return O=function(){return e},e}let T={},$=(0,I.J1)(k()),S=(0,I.J1)(C(),$),z=(0,I.J1)(P(),$),F=(0,I.J1)(O()),X=()=>(0,r.jsx)(l.A,{light:!0,color:"red",size:"small",startIcon:(0,r.jsx)(p.A,{path:i.lTU}),disabled:!0,children:"Failed"}),M=e=>{let{job:n,onDownload:t}=e;if((e=>!!e.expiresAt&&a.Ay.nowMs()>e.expiresAt)(n))return(0,r.jsx)(l.A,{light:!0,color:"brown",size:"small",startIcon:(0,r.jsx)(p.A,{path:i.NZC}),disabled:!0,children:"Expired"});if((e=>(e.status===s.O_g.Pending||e.status===s.O_g.Processing)&&a.Ay.nowMs()-e.createdAt>6e5)(n))return(0,r.jsx)(X,{});switch(n.status){case s.O_g.Pending:case s.O_g.Processing:return(0,r.jsxs)(x.A,{align:"center",spacing:.5,children:[(0,r.jsx)(m.A,{variant:"body",light:!0,children:"Processing"}),(0,r.jsx)(f.A,{size:"xsmall"})]});case s.O_g.Completed:return(0,r.jsx)(l.A,{light:!0,size:"small",startIcon:(0,r.jsx)(p.A,{path:i.XCd}),onClick:()=>void t(n),children:"Download"});case s.O_g.Failed:return(0,r.jsx)(X,{})}},U=e=>{let n,{job:t,onDownload:o,onDelete:s}=e;return(0,r.jsxs)(g.A,{justify:"space-between",align:"center",top:1,bottom:1,children:[(0,r.jsxs)(x.A,{column:!0,spacing:.25,children:[(0,r.jsx)(m.A,{variant:"body",bold:!0,children:t.displayName}),!!t.paramsSummary&&(0,r.jsx)(m.A,{variant:"body",light:!0,children:t.paramsSummary}),(0,r.jsx)(m.A,{variant:"body",light:!0,children:(n=t.createdAt,(0,a.Ay)(n).fromNow())})]}),(0,r.jsxs)(x.A,{align:"stretch",spacing:1,children:[(0,r.jsx)(M,{job:t,onDownload:o}),(0,r.jsx)(d.A,{onPress:()=>void s(t),children:(0,r.jsx)(p.A,{path:i.y_G,colorOverride:c.Ay.brown[30]})})]})]})},q=()=>{let{jobs:e,isEmpty:n,onDownload:t,onDelete:o}=(()=>{var e,n;let t=(0,v.A)(),{queueSnackbar:r}=(0,_.xt)(),o=(0,j.m)(),{data:a,loading:s}=function(e){let n={...T,...e};return J.IT(S,n)}({fetchPolicy:"cache-and-network",variables:{orgId:t}}),[i]=function(e){let n={...T,...void 0};return N.n(F,n)}(),[l]=function(e){let n={...T,...e};return D._(z,n)}({fetchPolicy:"network-only"}),d=(0,w.useMemo)(()=>{var e,n,t;return(null!=(t=null==a||null==(n=a.organization)||null==(e=n.exportJobs)?void 0:e.edges)?t:[]).map(e=>e.node).filter(e=>!e.deletedAt)},[null==a||null==(n=a.organization)||null==(e=n.exportJobs)?void 0:e.edges]),c=(0,w.useCallback)(e=>{if(!e.downloadUrl)return void r({color:"red",message:"Download not available"});try{var n,t;let r="".concat(null!=(t=null!=(n=e.displayName)?n:e.filename)?t:"ambrook-report",".pdf");(0,A.u)(e.downloadUrl,r)}catch(e){r({color:"red",message:"Failed to download report"})}},[r]),u=(0,w.useCallback)(async e=>{var n;let{data:t}=await i({variables:{id:e.id}});o(null==t||null==(n=t.deleteExportJob)?void 0:n.userErrors)||l({variables:{id:e.id}})},[i,o,l]),p=!s&&0===d.length;return(0,w.useMemo)(()=>({isEmpty:p,jobs:d,loading:s,onDelete:u,onDownload:c}),[p,d,s,u,c])})(),[a,s]=(0,w.useState)(new Set),i=(0,w.useCallback)(e=>{s(n=>{if(n.has(e.id))return n;let t=new Set(n);return t.add(e.id),t}),setTimeout(()=>{o(e)},300)},[o]);return(0,r.jsxs)(x.A,{column:!0,flex:1,children:[(0,r.jsx)(b.A,{title:"Export Downloads",parentHref:"/app/sett
1ings/export",showBack:"always"}),n?(0,r.jsxs)(g.A,{flex:1,column:!0,justify:"center",align:"center",children:[(0,r.jsx)(m.A,{variant:"large",bold:!0,children:"No reports requested yet"}),(0,r.jsx)(m.A,{variant:"body",light:!0,children:"When you export a report, it will appear here."})]}):(0,r.jsx)(h.A,{gutter:"responsive",flex:1,column:!0,children:e.map((n,o)=>{let s=a.has(n.id);return(0,r.jsx)(w.Fragment,{children:(0,r.jsxs)(y,{$exiting:s,children:[(0,r.jsx)(U,{job:n,onDownload:t,onDelete:i}),o<e.length-1&&(0,r.jsx)(u.A,{})]})},n.id)})})]})};var R=t(62867),V=!0;let G=()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(R.bV,{title:"Export Downloads",description:"View and download your exported reports.",openGraph:{description:"View and download your exported reports."},noindex:!0}),(0,r.jsx)(o.A,{activeTab:"export",children:(0,r.jsx)(q,{})})]})}},e=>{e.O(0,[8992,16,4337,6247,8798,4285,6371,8185,3600,815,3246,6109,9117,8681,9479,4212,1792,9973,551,4485,2260,2762,4241,404,4274,7588,9843,5519,2232,6765,636,6593,8792],()=>e(e.s=5638)),_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.