1import{b as Xe,c as Je}from"./chunk-WASMRTOP.js";import{a as Ze}from"./chunk-GKHNVRY5.js";import{$c as Ye,Aa as Le,Dd as O,Ed as Qe,Fd as B,Hd as He,Ja as je,Mc as Ve,Md as We,Nc as Ne,Rb as at,Rd as qe,Tc as Y,Wc as Ke,Yc as Ue,_c as ze,ad as oe,c as we,d as Z,da as ie,f as A,fd as Ge,g as ee,kc as Be,m as rt,me as G,o as Te,q as De,s as ne,za as Ee,zc as Pe}from"./chunk-2F3NTPNC.js";import{$b as xe,Ab as F,Bc as ve,Cb as v,Db as ge,Fb as X,Fc as Se,Gb as J,Hb as C,Hc as $,Hd as Me,Ib as _,Ic as I,Jb as d,Kb as L,M as de,N,Ob as he,Pb as be,Rb as j,Tb as R,Td as te,Vb as s,Wd as Re,Xc as $e,Xd as Ae,Zb as ye,Zd as Oe,_b as Ce,ab as l,d as me,fc as Fe,gb as S,ia as ue,ic as g,id as Ie,jc as k,k as ce,kb as fe,kc as M,lb as z,md as ke,oa as _e,pa as K,qb as q,sa as U,v as T,ya as D,za as E}from"./chunk-4F6QVQ3R.js";import{a as H,b as W,f as le,j as pe}from"./chunk-BJTZK3ZY.js";var V=pe(rt()),nt=pe(at());var lt=(t,i,e,n,o,a)=>({step:t,formSections:i,openKeys:e,submitted:n,loading:o,submitting:a}),pt=t=>({dashboard:t}),mt=(t,i)=>i.key;function ct(t,i){t&1&&L(0,"elm-tabs-content-loader")}function dt(t,i){if(t&1&&(_(0,"h3",2),g(1),d()),t&2){let e=s(3).ngLet;l(),k(e.step.description)}}function ut(t,i){if(t&1){let e=j();_(0,"button",16),R("click",function(){D(e);let o=s().$implicit,a=s(2).$implicit,c=s(4);
1return E(c.editItem(a.key,o.weight))}),g(1),d()}if(t&2){let e=s(4).$implicit;l(),M(" ",e("select")," ")}}function _t(t,i){if(t&1&&(_(0,"div",9)(1,"div",13)(2,"span",14),g(3),d(),F(4,ut,2,1,"button",15),d()()),t&2){let e=i.$implicit,n=i.$index,o=s(2).$implicit,a=s(3).ngLet;l(3),k(o.repeaterItemLabels[n]),l(),v(!a.submitted&&e.weight!=null?4:-1)}}function ft(t,i){if(t&1){let e=j();_(0,"button",17),R("click",function(){D(e);let o=s(2).$implicit,a=s(4);return E(a.addNewItem(o.key))}),L(1,"elm-icon",18),g(2),d()}if(t&2){let e=s(2).$implicit;l(2),M(" ",e.repeaterField.label," ")}}function gt(t,i){if(t&1){let e=j();_(0,"button",19),R("click",function(){D(e);let o=s(2).$implicit,a=s(4);return E(a.cancelSection(o.key))}),g(1),d()}if(t&2){let e=s(3).$implicit;l(),M(" ",e("cancelEdit")," ")}}function ht(t,i){if(t&1&&(_(0,"div",5)(1,"div",6)(2,"h4",7),g(3),d(),_(4,"p",8),g(5),d(),X(6,_t,5,2,"div",9,ge),d(),F(8,ft,3,1,"button",10),d(),_(9,"div",11),L(10,"lum-df-form",4),F(11,gt,2,1,"button",12),d()),t&2){let e=s().$implicit,n=s().$implicit,o=s(2).ngLet,a=s();C("hidden",o.openKeys[e.key]),l(3),k(e.repeaterField.label),l(2),k(n("repeaterHelpText")),l(),J(e.repeaterItems),l(2),v(o.submitted?-1:8),l(),C("hidden",!o.openKeys[e.key]),l(),C("form",e.formData)("data",e.data)("options",a.formOptions),l(),v(o.submitted?-1:11)}}function bt(t,i){if(t&1&&L(0,"lum-df-form",4),t&2){let e=s().$implicit,n=s(4);C("form",e.formData)("data",e.data)("options",n.formOptions)}}function yt(t,i){if(t&1&&F(0,ht,12,9)(1,bt,1,3,"lum-df-form",4),t&2){let e=i.$implicit;v(e.repeaterField?0:1)}}function Ct(t,i){if(t&1&&(_(0,"p",20)(1,"strong"),g(2),d()(),_(3,"p",21),g(4),d()),t&2){let e=s().$implicit;l(2),k(e("alreadySubmittedMessage")),l(2),M(" ",e("returnToDashboardHint",ve(2,pt,e("dashboardLinkLabel")))," ")}}function xt(t,i){if(t&1){let e=j();_(0,"div"),F(1,dt,2,1,"h3",2),X(2,yt,2,1,null,null,mt),_(4,"button",3),R("click",function(){D(e);let o=s(2).ngLet,a=s();return E(a.submit(o.step.item_id))}),g(5),d(),F(6,Ct,5,4),d()}if(t&2){let e=i.$implicit,n=s(2).ngLet;C("@enterAnimation",void 0),l(),v(n.step.description?1:-1),l(),J(n.formSections),l(2),Fe("elm-dynamic-bg-primary",!n.submitted)("elm-margin-bottom-form-element",n.submitted),C("disabled",n.submitted||n.submitting),l(),M(" ",n.submitted?e("formSubmitted"):n.submitting?e("submitting"):e("submitButtonLabel")," "),l(),v(n.submitted?6:-1)}}function Ft(t,i){t&1&&q(0,xt,7,9,"div",1),t&2&&C("translocoRead","supplementalForms")}function vt(t,i){if(t&1&&(he(0),F(1,ct,1,0,"elm-tabs-content-loader")(2,Ft,1,1,"div"),be()),t&2){let e=i.ngLet;l(),v(e.loading?1:e.step?2:-1)}}var P=class re{constructor(i,e,n,o,a,c){this.supplementalForms=i,this.userApplications=e,this.cdr=n,this.site=o,this.title=a,this.transloco=c,this.sectionsState$=new me(new Map),this.openKeys$=this.sectionsState$.pipe(T(r=>{let m={};return r.forEach((p,h)=>m[h]=!0),m})),this.step$=this.supplementalForms.selectedStep$.pipe(Ee),this.submitted$=this.step$.pipe(T(r=>r.status===Te.SupplementalFormStatus.Done)),this.submitting$=this.supplementalForms.submitting$,this.normalizedData$=this.step$.pipe(T(r=>({userData:Mt(r.field.user_data),formData:r.field.form_data}))),this.formSections$=this.normalizedData$.pipe(T(({userData:r,formData:m})=>{let w=m,{fields:p}=w,h=le(w,["fields"]),f=It(p),b=new Set(kt(f,r).map(u=>u.slug||u.name)),y=[];for(let u of f){let se=u.slug||u.name;if(b.has(se)){let x=B([u],r,!0);y.push({key:se,formData:W(H({},h),{fields:[u]}),data:null,repeaterItems:x,repeaterItemLabels:x.map(ot=>St(ot,u)),repeaterField:u})}else{let x=y[y.length-1];x&&!x.repeaterField?(x.formData.fields.push(u),x.data=B(x.formData.fields,r,!1)):y.push({key:`_non_repeater_${y.length}`,formData:W(H({},h),{fields:[u]}),data:B([u],r,!1),repeaterItems:[],repeaterItemLabels:[],repeaterField:null})}}return y}),ue(r=>this._sections=r)),this._sections=[],this.loading$=this.supplementalForms.singleLoading$,this.formOptions={uploadConfig:{appendNameToUrl:!0,accept:De.DOCUMENT_SUPPORTED_EXTENSIONS}}}ngOnInit(){this.site.clientName$.pipe(Le(this.site.loaded$),N(1),oe(this)).subscribe(i=>Ze(this.title,this.transloco,i,"a11y.pageTitleSupplementalForm"))}ngAfterViewInit(){this.submitted$.pipe(de(0),oe(this)).subscribe(i=>{i&&this.sectionsState$.next(new Map),this.formInstances?.forEach(e
1=>{e.disabled!==i&&e.setDisabledState(i)}),this.cdr.markForCheck()})}editItem(i,e){let n=new Map(this.sectionsState$.value);n.set(i,{mode:"editing",weight:e}),this.sectionsState$.next(n),this.prepopulateRepeaterForm(i,e)}addNewItem(i){let e=new Map(this.sectionsState$.value);e.set(i,{mode:"adding",weight:null}),this.sectionsState$.next(e),this.resetFormByKey(i)}cancelSection(i){this.resetFormByKey(i);let e=new Map(this.sectionsState$.value);e.delete(i),this.sectionsState$.next(e)}resetFormByKey(i){this.getFormByKey(i)?.formGroup?.reset(void 0,{onlySelf:!0})}getFormByKey(i){if(!this.formInstances)return;let e=this.formInstances.toArray(),n=this._sections.findIndex(o=>o.key===i);return n>=0?e[n]:void 0}prepopulateRepeaterForm(i,e){let n=this.getFormByKey(i);n&&(n.formGroup?.reset(void 0,{onlySelf:!0}),this.normalizedData$.pipe(N(1)).subscribe(({userData:o,formData:a})=>{let c=a.fields.find(p=>(p.slug||p.name)===i);if(!c||!(0,V.isArray)(o[i]))return;let r=o[i].find(p=>!!p&&typeof p=="object"&&"weight"in p&&p.weight===e);if(!r)return;let m=B([c],{[i]:r},!1);n.reset(m)}))}submit(i){let e=this.formInstances?.toArray()??[],n=this.sectionsState$.value,o=e.filter((r,m)=>{let p=this._sections[m];return p?.repeaterField&&n.has(p.key)}),c=[...e.filter((r,m)=>!this._sections[m]?.repeaterField),...o];c.forEach(r=>r.handleSubmit()),!c.some(r=>r.invalid)&&this.userApplications.activeRegistrationId$.pipe(N(1)).subscribe(r=>{let m=c.flatMap(f=>f.valueWithFiles.fields),h=c.flatMap(f=>f.valueWithFiles.files).map(f=>({name:f.key,file:f.file}));this.supplementalForms.save(r,i,{fields:m,files:h})})}static{this.\u0275fac=function(e){return new(e||re)(S(G),S(We),S($e),S(Ge),S(Me),S(Re))}}static{this.\u0275cmp=fe({type:re,selectors:[["elm-app-supplemental-forms"]],viewQuery:function(e,n){if(e&1&&ye(Y,5),e&2){let o;Ce(o=xe())&&(n.formInstances=o)}},standalone:!1,decls:7,vars:20,consts:[[4,"ngLet"],[4,"transloco","translocoRead"],[1,"elm-title"],["type","button",1,"elm-app-block-form-button","elm-app451-bg-normal-gray",3,"click","disabled"],[3,"form","data","options"],[3,"hidden"],[1,"elm-supplemental-repeater-list"],[1,"elm-app451-display-4"],[1,"elm-app451-body-2","elm-supplemental-help-text"],[1,"elm-supplemental-repeater-item"],["type","button",1,"elm-app451-btn-dotted","add-item"],[1,"elm-block-form",3,"hidden"],["type","button",1,"elm-app-block-form-button","elm-app451-bg-normal-gray"],[1,"elm-supplemental-repeater-item-header"],[1,"elm-app451-body-1","elm-no-margin"],["type","button",1,"elm-app-block-action-button"],["type","button",1,"elm-app-block-action-button",3,"click"],["type","button",1,"elm-app451-btn-dotted","add-item",3,"click"],["icon","add-circle-1",1,"elm-size-icon-m"],["type","button",1,"elm-app-block-form-button","elm-app451-bg-normal-gray",3,"click"],[1,"elm-app451-body-2","elm-supplemental-submitted-message"],[1,"elm-app451-body-2","elm-supplemental-submitted-hint"]],template:function(e,n){e&1&&(q(0,vt,3,1,"ng-container",0),$(1,"async"),$(2,"async"),$(3,"async"),$(4,"async"),$(5,"async"),$(6,"async")),e&2&&C("ngLet",Se(13,lt,I(1,1,n.step$),I(2,3,n.formSections$),I(3,5,n.openKeys$),I(4,7,n.submitted$),I(5,9,n.loading$),I(6,11,n.submitting$)))},dependencies:[Ae,Pe,Y,Ue,Xe,Ve,Ie],styles:[`[_nghost-%COMP%]{display:block;padding:32px;margin:32px;background-color:#fff;border:2px solid #42a5f5;border-radius:5px}.elm-supplemental-repeater-list[_ngcontent-%COMP%]{margin-bottom:16px}.elm-supplemental-repeater-item[_ngcontent-%COMP%]{padding:16px;border-radius:5px;border:1px solid #e0e0e0;background-color:#fafafa}.elm-supplemental-repeater-item[_ngcontent-%COMP%]:not(:last-child){margin-bottom:16px}.elm-supplemental-repeater-item-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}.elm-block-form[_ngcontent-%COMP%]{background-color:#fff;border:2px dashed #42a5f5;border-radius:5px;padding:32px;margin-bottom:32px}.elm-supplemental-help-text[_ngcontent-%COMP%]{color:#757575;margin-bottom:16px}.add-item[_ngcontent-%COMP%]{margin-bottom:32px} 2/*# sourceMappingURL=supplemental-forms.component-6AYMTYDC.css.map */`],data:{animation:[we("enterAnimation",[ee(":enter",[A({opacity:0}
2),Z("250ms",A({opacity:1}))]),ee(":leave",[A({opacity:1}),Z("0ms",A({opacity:0}))])])]}})}};P=ce([Ye()],P);function St(t,i){if(!t.subfields?.length)return t.label||t.name;let e=new Map(t.subfields.filter(b=>b.value!=null).map(b=>[b.name,b.value])),n=i.name,o=`${n}-type`,a=`${n}-date`;if(e.has(o)){let b=String(e.get(o)),y=et(b,i,o),w=e.get(a);if(w){let u=$t(w);return u?`${y} - ${u}`:y}return y}let c=`${n}-first_name`,r=`${n}-last_name`;if(e.has(c)||e.has(r))return[e.get(c),e.get(r)].filter(Boolean).join(" ");let m=`${n}-name`;if(e.has(m))return String(e.get(m));let p=`${n}-companyname`;if(e.has(p))return String(e.get(p));let h=`${n}-sport`;if(e.has(h))return et(String(e.get(h)),i,h);let f=t.subfields.find(b=>b.value!=null);return f?String(f.value):t.label||t.name}function et(t,i,e){let n=i.subfields?.find(a=>a.name===e),o=n?.data_source_settings;if(o?.length){let a=n.data_source_text||"text",c=n.data_source_value||"value",r=o.find(m=>m[c]===t);if(r)return String(r[a])}return t}function $t(t){if(!t)return null;let i=(0,nt.default)(String(t));return i.isValid()?i.format("MMM D, YYYY"):null}function It(t){return ie(t,i=>{Be(i,e=>{ne.convertAsyncUploadsToSyncUploads(e),ne.applyPhoneVerification(e),He(e)})})}function kt(t,i){return i?t.filter(e=>{if(!e.subfields?.length)return!1;let n=e.slug||e.name,o=i[n];return(0,V.isArray)(o)&&o.length>0}):[]}function Mt(t){return t&&ie(t,i=>{if(i[O]){let e=i[O];delete i[O],i[O]=Object.keys(e).reduce((n,o)=>{let a=Qe[o];return n[a]=e[o],n},{})}for(let e of Object.keys(i)){let n=i[e];if((0,V.isArray)(n))for(let o=0;o<n.length;o++)tt(n[o],o);else n&&typeof n=="object"&&tt(n)}})}function tt(t,i){if(!t||typeof t!="object")return;"index_weight"in t?t.weight=t.index_weight:i!=null&&(t.weight=i+1);let e=t.type?`${String(t.type).toLowerCase()}_`:"";for(let n of["scores","properties"])if((0,V.isArray)(t[n])){for(let o of t[n])o&&typeof o=="object"&&"key"in o&&o.key!=null&&(t[`${e}${o.key}`]=o.value);delete t[n]}}var Q=(()=>{class t{constructor(e,n,o){this.supplementalForms=e,this.dashboardRouting=n,this.platform=o}resolve(e){let n=e.paramMap.get("supplementalStepId");this.platform.isBrowser&&n&&this.dashboardRouting.withRegistrationId(o=>{this.supplementalForms.get(o,n)})}static{this.\u0275fac=function(n){return new(n||t)(U(G),U(qe),U(je))}}static{this.\u0275prov=_e({token:t,factory:t.\u0275fac})}}return t})();var wt=[{path:":supplementalStepId",component:P,resolve:{SupplementalFormResolver:Q}}],it=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275mod=z({type:t})}static{this.\u0275inj=K({providers:[Q],imports:[te.forChild(wt),te]})}}return t})();var Cn=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275mod=z({type:t})}static{this.\u0275inj=K({imports:[ke,Oe,Ke,ze,Je,Ne,it]})}}return t})();export{Cn as SupplementalFormsModule}; 3//# sourceMappingURL=chunk-YHMSOMAF.js.map
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.