1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3610b5d0-a786-4136-9d77-15f526fa1908",e._sentryDebugIdIdentifier="sentry-dbid-3610b5d0-a786-4136-9d77-15f526fa1908")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2038],{13264:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32zm-622.3-84c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9z"}}]},name:"edit",theme:"filled"}},25797:function(e,t,n){"use strict";var a;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;let i=(a=n(6448))&&a.__esModule?a:{default:a};t.default=i,e.exports=i},6448:function(e,t,n){"use strict";var a=n(46561).default,i=n(24457).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=i(n(59594)),r=a(n(2784)),s=i(n(13264)),d=i(n(96736)),c=r.forwardRef(function(e,t){return r.createElement(d.default,(0,l.default)({},e,{ref:t,icon:s.default}))});t.default=c},34974:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/applications",function(){return n(38526)}])},67322:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var a=n(52322);n(2784);var i=n(93967),l=n.n(i),r=n(51973),s=n.n(r),d=e=>{let{title:t,text:n,topBarColor:i,isDisabled:r,mode:d="bright",className:c,children:o}=e;return(0,a.jsxs)("div",{className:l()(s().tile,c,{[s()["tile--".concat(d)]]:d,[s()["tile--disabled"]]:r}),children:[i?(0,a.jsx)("div",{className:l()(s()["top-bar"],s()["top-bar--".concat(i)])}):null,(0,a.jsxs)("div",{className:s()["tile--container"],children:[(0,a.jsx)("h3",{className:l()(s().title,{[s()["title--".concat(d)]]:d,[s()["title--disabled"]]:r}),children:t}),(0,a.jsx)("p",{className:l()(s().text,{[s()["text--disabled"]]:r}),children:n}),o]})]})},c=n(49233),o=n(21955),p=n.n(o),u=e=>{let{tiles:t}=e;return(0,a.jsx)("div",{className:p().applicationsTiles,children:t.map(e=>{let{id:t,cardTitle:n,cardText:i,isLoading:l,buttonEnabled:r,buttonText:s,buttonAction:o,topBarColor:u,onClick:_}=e;return(0,a.jsx)(d,{title:n,text:i,isDisabled:!r,topBarColor:u,children:(0,a.jsx)(c.Z,{action:o,className:p().applicationsTiles__button,size:"large",isDisabled:!r,onClick:_,isLoading:l,children:s})},t)})})}},84091:function(e,t,n){"use strict";var a=n(52322);n(2784);var i=n(57818),l=n(24615),r=n(38646);t.Z=e=>{let{activeMenuItem:t,leading:n,children:s}=e;return(0,a.jsx)(l.Z,{activeMenuItem:t,children:(0,a.jsx)(i.Z,{children:(0,a.jsx)(r.Z,{position:n?"leading":"default",children:s})})})}},38526:function(e,t,n){"use strict";n.r(t),n.d(t,{PageContent:function(){return ec},default:function(){return eo}});var a,i,l,r,s=n(52322),d=n(23943),c=n(67862),o=n(2784),p=n(6812),u=n(50319),_=n(50456),f=n(5632),b=n.n(f),x=n(84091),y=n(13230),h=n(57e3),g=n(49956),m=n(5811),C=n(24615),T=n(56813),v=n(49233),j=n(62953),E=n(10722),I=n(50822),A=n(26106),P=n.n(A),L=n(17244),Z=n(25797),D=n.n(Z);let S=[{title:"",dataIndex:"status",key:"status",render:L.ks},{title:"Application ID",dataIndex:"applicationId",key:"applicationId"},{title:"Type",dataIndex:"type",key:"type"},{title:"Release date",dataIndex:"released_at",key:"release_date",render:L.ot},{title:"Application Status",dataIndex:"status",key:"application_status"},{title:"Reference",dataIndex:"reference_status",key:"reference_status"},{title:"",dataIndex:"",key:"actions",render:(e,t)=>(0,s.jsx)("div",{className:P().applicantApplicationsTable__actions,children:(0,s.jsx)(E.default,{placement:"bottom",title:"Edit",className:P().applicantApplicationsTable__action,children:(0,s.jsx)(D(),{style:{fontSize:16}})})})}];var w=e=>{let{applications:t}=e;return(0,s.jsx)(I.Z,{onRowClick:e=>{b().push("/applications/[applicationId]","/applications/".concat(e.id))},dataSource:t,columns:S,emptyText:"No Applications"})},k=n(67322),N=n(65151),R=n(57818),Q=n(38646),O=n(59512);function M(){let e=(0,c._)(["\n query getApplicationsPages {\n applicationspage {\n data {\n id\n attributes {\n title\n guidance\n GDLCardTitle\n GDLCardText\n LPCCardTitle\n LPCCardText\n SQECardTitle\n SQECardText\n CPQCardTitle\n CPQCardText\n ApplySectionButtonText\n ApplySectionButtonLink\n }\n }\n }\n }\n"]);return M=function(){return e},e}function q(){let e=(0,c._)(["\nfragment ApplicationEntityFragment on ApplicationEntity {\n id\n attributes {\n applicationId\n status\n coursetype {\n data {\n id\n attributes {\n label\n }\n }\n }\n released_at\n reference {\n data {\n id\n attributes {\n status\n lastRemindedAt\n }\n }\n }\n electronicPaymentReference\n createdAt\n }\n }\n"]);return q=function(){return e},e}function B(){let e=(0,c._)(["\n fragment ApplicationFragment on ApplicationEntityResponse {\n data {\n id\n attributes {\n applicationId\n status\n coursetype {\n data {\n id\n attributes {\n label\n }\n }\n }\n released_at\n reference {\n data {\n id\n attributes {\n status\n lastRemindedAt\n }\n }\n }\n electronicPaymentReference\n createdAt\n }\n }\n }\n"]);return B=function(){return e},e}function W(){let e=(0,c._)(["\n fragment ApplicationFragment on ApplicationEntityResponseCollection {\n data {\n id\n attributes {\n applicationId\n status\n coursetype {\n data {\n id\n attributes {\n label\n }\n }\n }\n released_at\n reference {\n data {\n id\n attributes {\n status\n lastRemindedAt\n }\n }\n }\n electronicPaymentReference\n createdAt\n }\n }\n }\n"]);return W=function(){return e},e}function G(){let e=(0,c._)(["\n query getApplications($applicantsWhere: ApplicantFiltersInput, $applicationsWhere: JSON) {\n applicants(filters: $applicantsWhere) {\n data {\n id\n }\n }\n\n coursetypes {\n data {\n id\n attributes {\n label\n\n }\n }\n }\n\n applications(filters: $applicationsWhere ) {\n ...ApplicationFragment\n }\n\n }\n ","\n"]);return G=function(){return e},e}function F(){let e=(0,c._)(["\n mutation CreateApplicationOfType($courseTypeId: ID) {\n createApplicationOfType(coursetype: $courseTypeId) {\n ...ApplicationEntityFragment\n }\n }\n ","\n"]);return F=function(){return e},e}let $=e=>{g.Z.error(e),j.Z.error("Something went wrong.")},U=(0,_.ZP)(M());(a=l||(l={})).GDL="GDL",a.LPC="LPC",a.SQE="SQE",a.CPQ="CPQ",(i=r||(r={})).REQUESTED="REQUESTED",i.RECEIVED="RECEIVED",i.REJECTED="REJECTED";let z=(0,_.ZP)(q());(0,_.ZP)(B());let J=(0,_.ZP)(W()),V=(0,_.ZP)(G(),J),H=(0,_.ZP)(F(),z),X=e=>{let{id:t,applicationId:n,status:a,coursetype:i,released_at:l,reference:r,electronicPaymentReference:s,created_at:d}=e,c=r&&r.status||"-";return r&&!r.lastRemindedAt&&"REQUESTED"===c&&(c="PENDING SUBMISSION"),{id:t,applicationId:"F"+n,key:t,status:null==a?void 0:a.replace(/_/g," "),type:i&&i.label||"-",reference_status:c,payment_status:s?"Paid":"Required",released_at:l,created_at:d}},Y=e=>{let{GDLCardTitle:t,GDLCardText:n,LPCCardTitle:a,LPCCardText:i,SQECardTitle:l,SQECardText:r,CPQCardTitle:c,CPQCardText:_,ApplySectionButtonText:f,ApplySectionButtonLink:x}=e,{user:y}=(0,d.aC)(),[C,j]=(0,o.useState)({applicants:[],coursetypes:[],applications:[]}),[E,I]=(0,o.useState)(null),{loading:A,error:P,data:L}=(0,p.a)(V,{variables:{applicantsWhere:{user:{id:{eq:y.id}}},applicationsWhere:{applicant:{user:{id:{$eq:y.id}}}}}}),Z=e=>({applicants:(0,h.l)(e.applicants),coursetypes:[...e.coursetypes.data.map(e=>D(e))],applications:(0,h.l)(e.applications)});(0,o.useEffect)(()=>{L&&j(Z(L))},[L]);let D=e=>({id:e.id,label:e.attributes.label}),[S]=(0,u.D)(H,{update:(e,t)=>
1{let{data:{createApplicationOfType:n}}=t,a=e.readQuery({query:V,variables:{applicantsWhere:{user:{id:{eq:y.id}}},applicationsWhere:{applicant:{user:{id:{$eq:y.id}}}}}});try{var i;e.writeQuery({query:V,variables:{applicantsWhere:{user:{id:{eq:y.id}}},applicationsWhere:{applicant:{user:{id:{$eq:y.id}}}}},data:{...a,applications:{data:[...(null==a?void 0:null===(i=a.applications)||void 0===i?void 0:i.data)||[],n],__typename:null==a?void 0:a.applications.__typename}}})}catch(e){$(e)}}}),N=async e=>{if(!C)return $("Data unavailable");if(!C.coursetypes)return $("CourseTypes not loaded");let t=C.coursetypes.find(t=>t.label===e),n=t&&t.id;if(!n)return $("CourseType with label [".concat(e,"] not found."));I(e);try{var a,i;let e=await S({variables:{courseTypeId:n}}),t=null===(i=e.data)||void 0===i?void 0:null===(a=i.createApplicationOfType)||void 0===a?void 0:a.id;t&&await b().push("/applications/".concat(t))}catch(e){g.Z.error(e),(0,m.Z)(e)}I(null)};if(!C)return A?(0,s.jsx)(Q.Z,{children:"Loading..."}):(P&&$(P.message),(0,s.jsx)(Q.Z,{children:(0,s.jsx)(T.Z,{type:"error",message:"Error loading data"})}));C.applicants[0];let R={GDL:!1,LPC:!1,SQE:!1,CPQ:!1},O=C.applications.map(e=>(e.coursetype&&e.coursetype.label&&["NOT_SUBMITTED","SUBMITTED","RELEASED"].includes(e.status)&&(R[e.coursetype.label]=!0),X(e))).sort((e,t)=>new Date(t.created_at).getTime()-new Date(e.created_at).getTime()).filter(e=>"Fnull"!==e.applicationId);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Q.Z,{children:(0,s.jsx)(w,{applications:O})}),(0,s.jsx)(Q.Z,{children:(0,s.jsx)(k.Z,{tiles:[{id:"GDL",buttonEnabled:!R.GDL&&!E,onClick:()=>N("GDL"),isLoading:"GDL"===E,buttonText:"Apply",cardTitle:t,cardText:n,topBarColor:"green"},{id:"LPC",buttonEnabled:!R.LPC&&!E,onClick:()=>N("LPC"),isLoading:"LPC"===E,buttonText:"Apply",cardTitle:a,cardText:i,topBarColor:"blue"},{id:"SQE",buttonEnabled:!R.SQE&&!E,onClick:()=>N("SQE"),isLoading:"SQE"===E,buttonText:"Apply",cardTitle:l,cardText:r,topBarColor:"orange"},{id:"CPQ",buttonEnabled:!1,onClick:()=>N("CPQ"),isLoading:"CPQ"===E,buttonText:"Apply",cardTitle:c,cardText:_,topBarColor:"purple"}]})}),(0,s.jsx)(Q.Z,{textAlign:"centre",children:(0,s.jsx)(v.Z,{action:{model:"nextLink",href:x},size:"large",children:f})})]})};var K=()=>{let{data:e,loading:t,error:n}=(0,p.a)(U);if(t)return(0,s.jsx)(x.Z,{activeMenuItem:y.n.APPLICATIONS,children:(0,s.jsx)(O.T,{height:"85vh"})});let a=(0,h.l)(null==e?void 0:e.applicationspage);return n||!a?(0,s.jsxs)(x.Z,{activeMenuItem:y.n.APPLICATIONS,children:[(0,s.jsx)("h1",{children:"500"}),(0,s.jsx)("h2",{children:"Internal error."})]}):(0,s.jsx)(C.Z,{activeMenuItem:y.n.APPLICATIONS,children:(0,s.jsxs)(R.Z,{children:[(0,s.jsxs)(Q.Z,{position:"leading",children:[(0,s.jsx)("h1",{children:a.title}),(0,s.jsx)(N.Z,{as:(0,s.jsx)("div",{style:{whiteSpace:"pre-wrap",lineHeight:1.4}}),children:a.guidance})]}),(0,s.jsx)(Y,{...a})]})})},ee=n(50151),et=n(44788),en=n(76112),ea=n(73707),ei=n(7956),el=()=>{let{exportProps:e,searchProps:t,tableProps:n,shouldShowLoadingSpinner:a}=(0,ei.o)();return(0,s.jsx)(C.Z,{activeMenuItem:y.n.APPLICATIONS,children:(0,s.jsxs)(R.Z,{children:[(0,s.jsx)(Q.Z,{position:"leading",children:(0,s.jsx)("h1",{className:"text-3xl font-medium",children:"View all applications"})}),(0,s.jsxs)(Q.Z,{children:[(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)(et.O,{...e})}),(0,s.jsx)(en.A,{...t}),(0,s.jsx)("div",{style:{marginBottom:"2rem"},children:a?(0,s.jsx)(O.T,{height:"50vh"}):(0,s.jsx)(ea.b,{...n})})]})]})})},er=n(90429),es=n(58166),ed=n(55891);function ec(){let{user:e}=(0,d.aC)(),t=(0,f.useRouter)();if((0,o.useEffect)(()=>{if((null==e?void 0:e.role.name.toLowerCase())===er.dC.Institution){var n;let a=null===(n=e.institution)||void 0===n?void 0:n.id;a&&t.replace("/institutions/".concat(a))}},[e,t]),(null==e?void 0:e.role.name.toLowerCase())===er.dC.Institution)return(0,s.jsx)(ed.Z,{});switch(null==e?void 0:e.role.name.toLowerCase()){case er.dC.Applicant:return(0,s.jsx)(K,{});case er.dC.Admin:return(0,s.jsx)(el,{});default:return(0,s.jsx)(ee.default,{statusCode:404})}}function eo(){return(0,s.jsx)(es.i,{children:(0,s.jsx)(ec,{})})}},51973:function(e){e.exports={tile:"tile_tile__fgC8S","tile--container":"tile_tile--container__uyVZ_","tile--disabled":"tile_tile--disabled__r98jC","tile--bright":"tile_tile--bright__f6ED5","tile--grey":"tile_tile--grey__3GR3C","tile--dark":"tile_tile--dark__8Pb_E",title:"tile_title__t99s0","title--disabled":"tile_title--disabled__JRV_T","title--dark":"tile_title--dark__5QLrR",text:"tile_text__soNW_","text--disabled":"tile_text--disabled__vgny2","top-bar":"tile_top-bar__04wYA","top-bar--green":"tile_top-bar--green__SJvcm","to
1p-bar--blue":"tile_top-bar--blue__qy3aW","top-bar--orange":"tile_top-bar--orange__c78ku","top-bar--purple":"tile_top-bar--purple__uDRpP"}},21955:function(e){e.exports={applicationsTiles:"applicant-applications-tiles_applicationsTiles__ugI1r",applicationsTiles__button:"applicant-applications-tiles_applicationsTiles__button__AxmU1"}}},function(e){e.O(0,[3661,2182,3677,3351,1499,9681,246,9535,4615,2777,4050,7510,7496,2888,9774,179],function(){return e(e.s=34974)}),_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.