1import{a as ht}from"./chunk-BQ4ID3YI.js";import"./chunk-SQT6IM6P.js";import"./chunk-FG6OMHX3.js";import{b as tt}from"./chunk-QGUMGARX.js";import"./chunk-TYRUOVV2.js";import{a as mt}from"./chunk-DD4HLYT2.js";import"./chunk-UBZRR66U.js";import"./chunk-VFJS73OR.js";import{a as K,b as Q}from"./chunk-RSITFV5O.js";import{c as ft}from"./chunk-CCINC3EI.js";import"./chunk-VGWBKD7Y.js";import"./chunk-SLKDIVHG.js";import"./chunk-UXJU4RS2.js";import{a as dt}from"./chunk-OD4YFFLE.js";import{c as it,e as et,h as nt,i as ot,n as at,o as pt,q as rt,s as lt,u as ct,w as st}from"./chunk-UNSLFDPH.js";import"./chunk-BUOL5UUF.js";import{a as w,b as W,c as X,y as Z}from"./chunk-JDX4QPGL.js";import{c as V}from"./chunk-LJ2DCKO6.js";import"./chunk-QSIQ3MZK.js";import"./chunk-SKGW52BV.js";import{e as N,g as J}from"./chunk-7SFI2F6K.js";import{$b as P,A as R,Da as b,Ea as B,Eb as I,Hb as L,Hc as h,Ic as _,Nb as g,Ob as U,Qb as z,Rb as O,Sb as r,Tb as c,Ub as k,Vb as $,Wb as q,Yb as F,aa as A,bc as x,d as o,da as y,e as u,f as C,ha as D,i as T,jb as a,na as v,oc as d,qc as m,sa as G,wc as H,xc as Y}from"./chunk-BW4D52FD.js";var ut=(()=>{var e;let t=class t{constructor(){u(this,e,v(Z))}getCurrentApplication(){return o(this,e).get("applications")}getApplicationTypes(){return o(this,e).get("applications/getApplicationTypes")}createApplication(p){return o(this,e).post("applications/createApplication",{applicationType:p})}deleteApplication(p){return o(this,e).delete(`applications/delete/${p}`)}};e=new WeakMap,t.\u0275fac=function(f){return new(f||t)},t.\u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"});let i=t;return i})();var M=(()=>{var e,t,s,p;let f=class f extends X{constructor(){super({isLoading:!0,applicationTypes:[],dataLoaded:!1});u(this,e,void 0);u(this,t,void 0);u(this,s,void 0);u(this,p,void 0);C(this,e,v(ut)),C(this,t,v(V)),C(this,s,v(tt)),C(this,p,v(N)),this.vm=this.selectSignal(n=>n),this.getApplicationList=this.effect(T(y(()=>this.patchState({isLoading:!0})),A(()=>o(this,e).getCurrentApplication().pipe(w({next:n=>{!n.data.currentApplication&&!n.data.allowToSendApplication&&(n.data.enablePortalAccess?(o(this,s).error(o(this,p).translate("application.userNotAllowedToSendApplication")),o(this,t).navigateByUrl("")):o(this,t).navigateByUrl("personal")),this.patchState({application:n.data.currentApplication,dataLoaded:!0}),this.handleCombinedData()},error:({error:n})=>{this.patchState({error:n})},finalize:()=>this.patchState({isLoading:!1})}))))),this.getApplicationTypes=this.effect(T(A(()=>o(this,e).getApplicationTypes().pipe(w({next:n=>{this.patchState({applicationTypes:n.data}),console.log("APPLICATION_TYPES_LIST",n.data)},error:({error:n})=>{this.patchState({error:n})}}))))),this.createApplication=this.effect(T(y(()=>this.patchState({isLoading:!0})),A(n=>o(this,e).createApplication(n).pipe(w({next:l=>{o(this,t).navigateByUrl(`application/start?sessionId=${l.data}`)},error:({error:l})=>{this.patchState({error:l})},finalize:()=>this.patchState({isLoading:!1})}))))),this.deleteApplication=this.effect(T(y(()=>this.patchState({isLoading:!0})),A(n=>o(this,e).deleteApplication(n).pipe(w({next:()=>{this.getApplicationList()},error:({error:l})=>{this.patchState({error:l})},finalize:()=>this.patchState({isLoading:!1})}))))),this.handleCombinedData=this.effect(n=>n.pipe(A(()=>R([this.select(l=>l.application),this.select(l=>l.applicationTypes)]).pipe(y(([l,E])=>{!l&&E.length==1&&this.createApplication(E[0].id)})))))}ngrxOnStateInit(){this.getApplicationTypes(),this.getApplicationList()}};e=new WeakMap,t=new WeakMap,s=new WeakMap,p=new WeakMap,f.\u0275fac=function(l){return new(l||f)},f.\u0275prov=D({token:f,factory:f.\u0275fac});let i=f;return i})();function vt(i,e){i&1&&(r(0,"div",1),k(1,"p-progressSpinner"),c())}function Ct(i,e){if(i&1){let t=F();r(0,"div",2)(1,"table",3)(2,"tr")(3,"td"),d(4),h(5,"transloco"),c(),r(6,"td"),d(7),c()(),r(8,"tr")(9,"td"),d(10),h(11,"transloco"),c(),r(12,"td"),d(13),h(14,"hmswDatePipe"),c()(),r(15,"tr")(16,"td"),d(17),h(18,"transloco"),c(),r(19,"td"),d(20),h(21,"hmswDatePipe"),c()(),r(22,"tr")(23,"td"),d(24),h(25,"transloco"),c(),r(26,"td"),d(27),h(28,"hmswDatePipe"),c()(),r(29,"tr")(30,"td"),d(31),h(32,"transloco"),c(),r(33,"td"),d(34),h(35,"transloco"),c()()()(),r(36,"div",2)(37,"div",4)(38,"button",5),P("click",function(){b(t);let p=x(3);return B(p.editApplication())}),d(39),h(40,"transloco"),c(),r(41,"button",5),P("click",function(){b(t);let p=x(3);return B(p.confirmDeleteApplication())}),d(42),h(43,"transloco"),c()()()}if(i&2){let t=x(2);a(4),m(" ",_(5,12,"city")," "),a(3),m(" ",t.application.hostelCity," "),a(3),m(" ",_(11,14,"application.applicationDate")," "),a(3),m(" ",_(14,16,t.application.applicationDate)," "),a(4),m(" ",_(18,18,"checkInDate")," "),a(3),m(" ",_(21,20,t.application.checkInDate)," "),a(4),m(" ",_(25,22,"checkOutDate")," "),a(3),m(" ",_(28,24,t.application.checkoutDate)," "),a(4),m(" ",_(32,26,"application.step")," "),a(3),m(" ",_(35,28,"application."+t.application.step.toString().toLowerCase()+"Step")," "),a(5),m(" ",_(40,30,"edit")," "),a(3),m(" ",_(43,32,"delete")," ")}}function xt(i,e){if(i&1&&(r(0,"div",2)(1,"label"),k(2,"input",8),d(3),c()()),i&2){let t=e.$implicit;a(2),L("value",t.id),a(),m(" ",t.name," ")}}
1function St(i,e){if(i&1&&k(0,"app-validation-error",7),i&2){let t=x(4);L("errors",t.form.controls.applicationType.errors)}}function At(i,e){if(i&1){let t=F();r(0,"form",6),z(1,xt,4,2,"div",2,U),r(3,"div",2),I(4,St,1,1,"app-validation-error",7),c(),r(5,"div",2)(6,"div",4)(7,"button",5),P("click",function(){b(t);let p=x(3);return B(p.addNewApplication())}),d(8),h(9,"transloco"),c()()()()}if(i&2){let t=x(2),s=x();L("formGroup",s.form),a(),O(t.applicationTypes),a(3),g(4,s.form.invalid&&s.form.controls.applicationType.touched?4:-1),a(4),m(" ",_(9,3,"next")," ")}}function gt(i,e){if(i&1&&($(0),r(1,"h2"),d(2),h(3,"transloco"),c(),I(4,Ct,44,34)(5,At,10,5),q()),i&2){let t=x();a(2),m("",_(3,2,"ApplicationMenu")," "),a(2),g(4,t.application?4:5)}}function Tt(i,e){i&1&&(r(0,"div",2),d(1),h(2,"transloco"),c()),i&2&&(a(),m(" ",_(2,1,"loading"),"... "))}function yt(i,e){if(i&1&&(r(0,"div",0),I(1,vt,2,0,"div",1)(2,gt,6,4,"ng-container")(3,Tt,3,3),c()),i&2){let t=e;a(),g(1,t.isLoading?1:-1),a(),g(2,t.dataLoaded?2:3)}}var ni=(()=>{var e,t,s,p,f;let S=class S{constructor(){u(this,e,void 0);u(this,t,void 0);u(this,s,void 0);u(this,p,void 0);u(this,f,void 0);C(this,e,v(M)),C(this,t,v(ft)),C(this,s,v(N)),C(this,p,v(V)),C(this,f,v(ct)),this.vm=o(this,e).vm,this.form=o(this,f).group({applicationType:[null,et.required]})}addNewApplication(){if(this.form.invalid){this.form.markAllAsTouched();return}let n=this.form.value.applicationType;if(n)o(this,e).createApplication(n);else throw"A problem with application type. Please contact support..."}confirmDeleteApplication(){var n=this.vm().application?.sessionId||"";let l={message:o(this,s).translate("application.deleteApplicationMessage"),onAccept:()=>{o(this,e).deleteApplication(n)}};o(this,t).open(ht,{data:l})}editApplication(){var n=this.vm().application?.sessionId;o(this,p).navigateByUrl("/application/start?sessionId="+n)}};e=new WeakMap,t=new WeakMap,s=new WeakMap,p=new WeakMap,f=new WeakMap,S.\u0275fac=function(l){return new(l||S)},S.\u0275cmp=G({type:S,selectors:[["app-application-list"]],standalone:!0,features:[H([W(M)]),Y],decls:1,vars:1,consts:[[1,"content"],[1,"progress-spinner"],[1,"row"],[1,"hmsw-table","text-nowrap"],[1,"button-wrapper"],[3,"click"],[3,"formGroup"],[3,"errors"],["type","radio","formControlName","applicationType",3,"value"]],template:function(l,E){if(l&1&&I(0,yt,4,2,"div",0),l&2){let j;g(0,(j=E.vm())?0:-1,j)}},dependencies:[J,mt,Q,K,st,at,it,pt,nt,ot,rt,lt,dt],encapsulation:2,changeDetection:0});let i=S;return i})();export{ni 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.