1import{a as G}from"./chunk-L5ZOOU2J.js";import{c as X,e as re,f as ct}from"./chunk-KOPGZV6B.js";import{a as ae,b as oe}from"./chunk-BTQPKA7U.js";import{a as ne}from"./chunk-IPNZ22E3.js";import{B as Lt,Be as Qt,Ce as Xt,D as Mt,Gb as Gt,Hd as Yt,Ia as lt,Kb as st,Mb as dt,Od as jt,Sc as qt,Vb as V,Yb as mt,Zb as W,a as kt,b as nt,d as at,eg as Jt,k as ot,kh as ie,m as Vt,sg as Kt,ve as Ht,vg as zt,wg as Zt,x as Ot,xa as F,xb as Wt,xg as te,yg as ee,za as bt}from"./chunk-X5J6QTCG.js";import{$ as J,$a as c,Ad as yt,Db as It,Fa as s,Fb as gt,Hb as M,Ib as t,Jb as D,Ka as $,Kb as E,Lb as tt,Ma as K,Na as z,Ni as Q,Qb as P,Ra as Tt,Rb as R,Sa as Z,Sb as A,U as B,Uc as Ft,Wc as Nt,Xa as L,_ as wt,bb as p,ca as Dt,cb as N,cc as Pt,d as vt,dc as ht,eb as T,ec as Rt,fa as x,fb as I,fi as $t,ga as u,gb as _,hb as r,ib as l,jb as C,kd as H,lc as j,ma as Y,mc as At,nb as Ct,nc as et,ob as ft,pj as rt,qb as g,qc as it,ra as Et,sb as f,tb as m,vd as Bt,yd as Ut}from"./chunk-SMW7PHYX.js";import{a as xt,b as ut}from"./chunk-BMIYOSOG.js";var q=(()=>{let n=class n{constructor(){this.webAPI=Dt($t)}getPlanMetadata(){return this.webAPI.getData("admin/registration-agent/plan-metadata")}startSession(i,o){return this.webAPI.postData("admin/registration-agent/sessions",{prompt:i,sourceProgramId:o})}startSessionFromDocument(i,o){return this.webAPI.postFileAndBody("admin/registration-agent/sessions/from-document",i,i.name,{prompt:o})}getSessions(){return this.webAPI.getData("admin/registration-agent/sessions")}getSession(i){return this.webAPI.getData(`admin/registration-agent/sessions/${i}`)}getSessionStatus(i){return this.webAPI.getData(`admin/registration-agent/sessions/${i}/status`)}sendMessage(i,o,d=null){return this.webAPI.postData(`admin/registration-agent/sessions/${i}/messages`,{message:o,selections:d})}approveOutline(i){return this.webAPI.postData(`admin/registration-agent/sessions/${i}/outline/approve`,{})}updateDraftPlan(i,o){return this.webAPI.putData(`admin/registration-agent/drafts/${i}/plan`,{plan:o})}applyDraft(i){return this.webAPI.postData(`admin/registration-agent/drafts/${i}/apply`,{})}discardDraft(i){return this.webAPI.postData(`admin/registration-agent/drafts/${i}/discard`,{})}undoDraft(i){return this.webAPI.postData(`admin/registration-agent/drafts/${i}/undo`,{})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275prov=wt({token:n,factory:n.\u0275fac});let a=n;return a})();var v=(function(a){return a[a.QUEUED=1]="QUEUED",a[a.RUNNING=2]="RUNNING",a[a.AWAITING_REVIEW=3]="AWAITING_REVIEW",a[a.NEEDS_INPUT=4]="NEEDS_INPUT",a[a.APPLIED=5]="APPLIED",a[a.DISCARDED=6]="DISCARDED",a[a.FAILED=7]="FAILED",a[a.UNDONE=8]="UNDONE",a[a.AWAITING_OUTLINE_APPROVAL=9]="AWAITING_OUTLINE_APPROVAL",a})(v||{});var k=(function(a){return a[a.PENDING_REVIEW=1]="PENDING_REVIEW",a[a.APPLIED=2]="APPLIED",a[a.DISCARDED=3]="DISCARDED",a[a.SUPERSEDED=4]="SUPERSEDED",a[a.UNDONE=5]="UNDONE",a})(k||{}),St=(function(a){return a[a.ASSISTANT=1]="ASSISTANT",a[a.USER=2]="USER",a})(St||{}),U=(function(a){return a[a.FIXED=1]="FIXED",a[a.VARIABLE=2]="VARIABLE",a[a.UNLIMITED=3]="UNLIMITED",a[a.SUBSCRIPTION=4]="SUBSCRIPTION",a})(U||{}),se=["Before I continue, I need a few answers:"],Yn=[{label:"Core",value:F.TEAM},{label:"Tryouts",value:F.TRYOUTS},{label:"Supplemental",value:F.SUPPLEMENTAL},{label:"Other",value:F.OTHER},{label:"Tournament",value:F.TOURNAMENT},{label:"League",value:F.LEAGUE},{label:"Sessions",value:F.TRAINING_SESSIONS},{label:"Subscription",value:F.SUBSCRIPTION},{label:"Camps & Clinics",value:F.CAMPS_AND_CLINICS}],jn=[{label:"Any",value:null},{label:"Male",value:G.MALE},{label:"Female",value:G.FEMALE}],de={get_club_setup_context:"Reviewed your club's setup",list_programs:"Looked through your existing programs",get_program_details:"Studied a program's configuration",find_reusable_registrations:"Looked for existing forms to reuse",propose_plan_outline:"Outlined a plan of action",propose_registration_plan:"Drafted your registration plan"},me={[v.QUEUED]:"Queued",[v.RUNNING]:"Working",[v.AWAITING_REVIEW]:"Ready for review",[v.NEEDS_INPUT]:"Needs your input",[v.APPLIED]:"Applied",[v.DISCARDED]:"Discarded",[v.FAILED]:"Failed",[v.UNDONE]:"Undone",[v.AWAITING_OUTLINE_APPROVAL]:"Plan ready to review"}
1,ce={[k.PENDING_REVIEW]:"Pending review",[k.APPLIED]:"Applied",[k.DISCARDED]:"Discarded",[k.SUPERSEDED]:"Superseded",[k.UNDONE]:"Undone"},pe={[v.QUEUED]:"info",[v.RUNNING]:"info",[v.AWAITING_REVIEW]:"warning",[v.NEEDS_INPUT]:"warning",[v.APPLIED]:"success",[v.DISCARDED]:"disabled",[v.FAILED]:"error",[v.UNDONE]:"default",[v.AWAITING_OUTLINE_APPROVAL]:"warning"},_e={[k.PENDING_REVIEW]:"warning",[k.APPLIED]:"success",[k.DISCARDED]:"disabled",[k.SUPERSEDED]:"default",[k.UNDONE]:"default"};var xe=a=>["/admin/programs",a,"basic-info"],ve=(a,n)=>["/admin/programs",a,"registrations",n],we=()=>["/admin/programs"],De=(a,n)=>n.controlName,Ee=(a,n)=>n.index;function Te(a,n){if(a&1&&(t(0," "),r(1,"span"),t(2),j(3,"date"),l(),t(4," ")),a&2){let e=m(3);s(2),E(" \u2014 applied ",et(3,1,e.draft.appliedOn,"medium"))}}function Ie(a,n){if(a&1&&(t(0,` 2 `),r(1,"a",19),t(2,` 3 `),C(3,"i",20),t(4),l(),t(5,` 4 `)),a&2){let e=m(),i=e.$implicit,o=e.$index,d=m(4);s(),_("routerLink",Rt(2,ve,d.draft.appliedProgramID,d.draft.appliedRegistrationIDs[o])),s(3),E("",i.name,` 5 `)}}function Pe(a,n){if(a&1&&(t(0,` 6 `),r(1,"span",21),t(2,` 7 `),C(3,"i",20),t(4),l(),t(5,` 8 `)),a&2){let e=m().$implicit;s(4),E("",e.name,` 9 `)}}function Re(a,n){if(a&1&&(t(0,` 10 `),r(1,"li",18),t(2,` 11 `),c(3,Ie,6,5)(4,Pe,6,1),l(),t(5,` 12 `)),a&2){let e=n.$index,i=m(4);s(3),p(i.draft.appliedRegistrationIDs!=null&&i.draft.appliedRegistrationIDs[e]?3:4)}}function Ae(a,n){if(a&1&&(t(0,` 13 `),r(1,"ul",17),t(2,` 14 `),T(3,Re,6,1,null,null,N),l(),t(5,` 15 `)),a&2){let e=m(3);s(3),I(e.plan.registrations)}}function Fe(a,n){if(a&1&&(t(0,` 16 `),r(1,"div",11),t(2,` 17 `),r(3,"p",12),t(4,` 18 `),C(5,"i",13),t(6,` 19 Your program and registrations are live`),c(7,Te,5,4),t(8,`. 20 `),l(),t(9,` 21 `),r(10,"a",14),t(11,` 22 `),C(12,"i",15),t(13),C(14,"i",16),t(15,` 23 `),l(),t(16,` 24 `),c(17,Ae,6,0),l(),t(18,` 25 `)),a&2){let e=m(2);s(7),p(e.draft.appliedOn?7:-1),s(3),_("routerLink",ht(4,xe,e.draft.appliedProgramID)),s(3),E("",e.plan.program==null?null:e.plan.program.name,` 26 `),s(4),p(e.plan.registrations!=null&&e.plan.registrations.length?17:-1)}}function Ne(a,n){if(a&1&&(t(0,` 27 `),r(1,"span"),t(2),j(3,"date"),l(),t(4,` 28 `)),a&2){let e=m(4);s(2),D(et(3,1,e.plan.program.endDate,"MMM d, y"))}}function ke(a,n){a&1&&(t(0,` 29 `),r(1,"span"),t(2,"ongoing"),l(),t(3,` 30 `))}function Ve(a,n){if(a&1&&(t(0,` 31 `),r(1,"div",23),t(2,` 32 `),r(3,"span",24),t(4,"Runs"),l(),t(5,` 33 `),r(6,"span"),t(7),j(8,"date"),c(9,Ne,5,4)(10,ke,4,0),l(),t(11,` 34 `),l(),t(12,` 35 `)),a&2){let e=m(3);s(7),E("",et(8,2,e.plan.program.startDate,"MMM d, y"),` \u2013 36 `),s(2),p(e.plan.program.endDate?9:10)}}function Oe(a,n){if(a&1&&(t(0,` 37 `),r(1,"div",23),t(2,` 38 `),r(3,"span",24),t(4,"New teams"),l(),t(5,` 39 `),r(6,"span",3),t(7),l(),t(8,` 40 `),l(),t(9,` 41 `)),a&2){let e=m(3);s(7),D(e.plan.newTeams.length)}}function Le(a,n){if(a&1&&(t(0,` 42 `),r(1,"div",23),t(2,` 43 `),r(3,"span",24),t(4,"Payment plans"),l(),t(5,` 44 `),r(6,"span",3),t(7),l(),t(8,` 45 `),l(),t(9,` 46 `)),a&2){let e=m(3);s(7),D(e.paymentPlanCount)}}function Me(a,n){if(a&1&&(t(0,` 47 `),r(1,"div",23),t(2,` 48 `),r(3,"span",24),t(4,"To fix"),l(),t(5,` 49 `),r(6,"span",25),t(7),l(),t(8,` 50 `),l(),t(9,` 51 `)),a&2){let e=m(3);s(7),D(e.planValidationErrors.length)}}function Be(a,n){if(a&1&&(t(0,` 52 `),r(1,"div",22),t(2,` 53 `),r(3,"div",23),t(4,` 54 `),r(5,"span",24),t(6,"Program"),l(),t(7,` 55 `),r(8,"span",3),t(9),l(),t(10,` 56 `),l(),t(11,` 57 `),c(12,Ve,13,5),r(13,"div",23),t(14,`
58 `),r(15,"span",24),t(16,"Registrations"),l(),t(17,` 59 `),r(18,"span",3),t(19),l(),t(20,` 60 `),l(),t(21,` 61 `),c(22,Oe,10,1),c(23,Le,10,1),c(24,Me,10,1),l(),t(25,` 62 `)),a&2){let e=m(2);s(9),D((e.plan.program==null?null:e.plan.program.name)||"Untitled program"),s(3),p(e.plan.program!=null&&e.plan.program.startDate?12:-1),s(7),D(e.registrationCount),s(3),p(e.plan.newTeams!=null&&e.plan.newTeams.length?22:-1),s(),p(e.paymentPlanCount?23:-1),s(),p(e.hasValidationErrors?24:-1)}}function Ue(a,n){a&1&&t(0,` 63 Confirm the program, registrations, pricing, dates and eligibility. Presentation and emails come next. 64 `)}function $e(a,n){a&1&&(t(0,` 65 `),r(1,"span"),t(2,"Use "),r(3,"span",3),t(4,"Apply to other registrations"),l(),t(5," to copy a setting onto every form in one pass."),l(),t(6,` 66 `))}function We(a,n){if(a&1&&(t(0,` 67 Fine-tune how each registration is displayed, its form, and its emails. Your basics are saved from step 1. 68 `),c(1,$e,7,0)),a&2){let e=m(3);s(),p(e.canBulkApply?1:-1)}}function Ge(a,n){if(a&1){let e=g();t(0,` 69 `),r(1,"div",26),t(2,` 70 `),r(3,"button",27),f("click",function(){x(e);let o=m(2);return u(o.goToStep(1))}),t(4,` 71 `),C(5,"i",28),t(6,`Basics 72 `),l(),t(7,` 73 `),C(8,"i",29),t(9,` 74 `),r(10,"button",30),f("click",function(){x(e);let o=m(2);return u(o.goToStep(2))}),t(11,` 75 `),C(12,"i",31),t(13,`Details & communications 76 `),l(),t(14,` 77 `),l(),t(15,` 78 `),r(16,"p",32),t(17,` 79 `),c(18,Ue,1,0)(19,We,2,1),l(),t(20,` 80 `)}if(a&2){let e=m(2);s(3),gt("btn-primary",e.onBasicsStep)("btn-naked",!e.onBasicsStep),L("aria-selected",e.onBasicsStep),s(7),gt("btn-primary",!e.onBasicsStep)("btn-naked",e.onBasicsStep),L("aria-selected",!e.onBasicsStep),s(8),p(e.onBasicsStep?18:19)}}function qe(a,n){if(a&1){let e=g();t(0,` 81 `),r(1,"button",37),f("click",function(){x(e);let o=m().$implicit,d=m(3);return u(d.goToError(o))}),t(2,` 82 Go to it`),C(3,"i",38),t(4,` 83 `),l(),t(5,` 84 `)}}function Ye(a,n){if(a&1&&(t(0,` 85 `),r(1,"li",36),t(2),t(3,` 86 `),c(4,qe,6,0),l(),t(5,` 87 `)),a&2){let e=n.$implicit;s(2),E(` 88 `,e.message,` 89 `),s(2),p(e.registrationIndex!==null||e.paymentPlanIndex!==null?4:-1)}}function je(a,n){if(a&1&&(t(0,` 90 `),r(1,"app-inline-alert",33),t(2,` 91 `),r(3,"span",34),t(4,"Fix these before applying:"),l(),t(5,` 92 `),r(6,"ul",35),t(7,` 93 `),T(8,Ye,6,2,null,null,N),l(),t(10,` 94 `),l(),t(11,` 95 `)),a&2){let e=m(2);s(),_("isInline",!1),s(7),I(e.planValidationErrors)}}function He(a,n){a&1&&(t(0,` 96 `),r(1,"app-loader"),t(2,"Loading review form..."),l(),t(3,` 97 `))}function Qe(a,n){a&1&&(t(0,` 98 `),r(1,"app-inline-alert",33),t(2,` 99 The review form could not be loaded. Refresh the page to try again. 100 `),l(),t(3,` 101 `)),a&2&&(s(),_("isInline",!0))}function Xe(a,n){if(a&1){let e=g();t(0,` 102 `),t(1,` 103 `),r(2,"div",39),t(3,` 104 `),r(4,"div",40),t(5,` 105 `),r(6,"div",41),t(7,` 106 `),C(8,"i",15),t(9,`Program 107 `),l(),t(10,` 108 `),l(),t(11,` 109 `),r(12,"div",42),t(13,` 110 `),r(14,"app-dynamic-form",43),f("valueChanges",function(o){x(e);let d=m(2);return u(d.onProgramChange(o))})("fieldExplainClick",function(o){x(e);let d=m(2);return u(d.onFieldExplain("program",-1,o))}),t(15,` 111 `),l(),t(16,` 112 `),l(),t(17,` 113 `),l(),t(18,` 114 `)}if(a&2){let e=m(2);s(14),_("fields",e.programFields)("entity",e.plan.program)("saveBlankFields",!0)("showSubmitButton",!1)("showCancelButton",!1)("subscribeToFormServiceErrors",!1)}}function Je(a,n){a&1&&(t(0,` 115 `),r(1,"th",48)(2,"span",49),t(3,"Remove"),l()(),t(4,` 116 `))}function Ke(a,n){if(a&1){let e=g();t(0,` 117 `),r(1,"td",53),t(2,` 118 `),r(3,"button",54),f("click",function(){x(e);let o=m().$index,d=m(3);return u(d.removeNewTeam(o))}),t(4,` 119 `),C(5,"i",55),t(6,` 120 `),l(),t(7,` 121 `),l(),t(8,` 122 `)}if(a&2){let e=m().$index,i=m(3);s(3),_("disabled",i.busy),L("aria-label","Remove new team "+(e+1))}}function ze(a,n){if(a&1){let e=g();t(0,` 123 `),r(1,"tr"),t(2,` 124 `),r(3,"td"),t(4,` 125 `),r(5,"label",50),t(6,"Team name"),l(),t(7,` 126 `),r(8,"input",51),A("ngModelChange",function(o){let d=x(e).$implicit;return R(d.name,o)||(d.name=o),u(o)}),f("blur",function(){x(e);let o=m(3);return u(o.refreshTeamsFieldSets())}),l(),t(9,`
127 `),l(),t(10,` 128 `),r(11,"td"),t(12,` 129 `),r(13,"label",50),t(14,"Short name"),l(),t(15,` 130 `),r(16,"input",52),A("ngModelChange",function(o){let d=x(e).$implicit;return R(d.shortName,o)||(d.shortName=o),u(o)}),l(),t(17,` 131 `),l(),t(18,` 132 `),c(19,Ke,9,2),l(),t(20,` 133 `)}if(a&2){let e=n.$implicit,i=n.$index,o=m(3);s(5),_("for","new-team-"+i+"-name"),s(3),_("id","new-team-"+i+"-name"),P("ngModel",e.name),_("disabled",!o.editable||o.busy),L("maxlength",o.newTeamNameMaxLength),s(5),_("for","new-team-"+i+"-short"),s(3),_("id","new-team-"+i+"-short"),P("ngModel",e.shortName),_("disabled",!o.editable||o.busy),L("maxlength",o.newTeamShortNameMaxLength),s(3),p(o.editable?19:-1)}}function Ze(a,n){if(a&1){let e=g();t(0,` 134 `),r(1,"button",56),f("click",function(){x(e);let o=m(3);return u(o.addNewTeam())}),t(2,` 135 `),C(3,"i",57),t(4,`Add another team 136 `),l(),t(5,` 137 `)}if(a&2){let e=m(3);s(),_("disabled",e.busy)}}function ti(a,n){if(a&1&&(t(0,` 138 `),r(1,"div",44),t(2,` 139 `),r(3,"div",40),t(4,` 140 `),r(5,"span",3),C(6,"i",45),t(7),l(),t(8,` 141 `),l(),t(9,` 142 `),r(10,"div",42),t(11,` 143 `),r(12,"p",12),t(13,` 144 These teams don't exist in your club yet \u2014 they will be created and attached to the program 145 when you apply. Verify each name is exactly what you want in the system (club prefix, coach, 146 season). Assign them to registrations below under each registration's Teams. 147 `),l(),t(14,` 148 `),r(15,"div",46),t(16,` 149 `),r(17,"table",47),t(18,` 150 `),r(19,"thead"),t(20,` 151 `),r(21,"tr"),t(22,` 152 `),r(23,"th",48),t(24,"Team Name"),l(),t(25,` 153 `),r(26,"th",48),t(27,"Short Name"),l(),t(28,` 154 `),c(29,Je,5,0),l(),t(30,` 155 `),l(),t(31,` 156 `),r(32,"tbody"),t(33,` 157 `),T(34,ze,21,11,null,null,N),l(),t(36,` 158 `),l(),t(37,` 159 `),l(),t(38,` 160 `),c(39,Ze,6,1),l(),t(40,` 161 `),l(),t(41,` 162 `)),a&2){let e=m(2);s(7),E("New teams (",e.plan.newTeams.length,")"),s(22),p(e.editable?29:-1),s(5),I(e.plan.newTeams),s(5),p(e.editable?39:-1)}}function ei(a,n){if(a&1){let e=g();t(0,` 163 `),r(1,"div",62),t(2,` 164 `),r(3,"app-sidebar-nav-tabs",63),f("tabClick",function(o){x(e);let d=m(3);return u(d.selectPaymentPlan(o))}),t(4,` 165 `),l(),t(5,` 166 `),l(),t(6,` 167 `)}if(a&2){let e=m(3);s(3),_("tabs",e.paymentPlanTabs)("activeTab",e.activePaymentPlanIndex)}}function ii(a,n){if(a&1&&(t(0,` 168 `),r(1,"span",67),t(2),l(),t(3,` 169 `)),a&2){let e=m(4);s(2),tt("\u2014 ",e.activePaymentPlanIndex+1," of ",e.paymentPlanCount)}}function ni(a,n){if(a&1){let e=g();t(0,` 170 `),r(1,"button",54),f("click",function(){x(e);let o=m(4);return u(o.removePaymentPlan(o.activePaymentPlanIndex))}),t(2,` 171 `),C(3,"i",55),t(4,` 172 `),l(),t(5,` 173 `)}if(a&2){let e=m(4);s(),_("disabled",e.busy),L("aria-label","Remove payment plan "+(e.activePaymentPlanIndex+1))}}function ai(a,n){if(a&1){let e=g();t(0,` 174 `),r(1,"button",54),f("click",function(){x(e);let o=m(2),d=m(3);return u(d.addPaymentPlanInstallment(o))}),t(2,` 175 `),C(3,"i",57),t(4,`Add payment 176 `),l(),t(5,` 177 `)}if(a&2){let e=m(5);s(),_("disabled",e.busy)}}function oi(a,n){a&1&&(t(0,` 178 `),r(1,"th",48)(2,"span",49),t(3,"Remove"),l()(),t(4,` 179 `))}function ri(a,n){if(a&1){let e=g();t(0,` 180 `),r(1,"td",53),t(2,` 181 `),r(3,"button",54),f("click",function(){x(e);let o=m().$index,d=m(2),h=m(3);return u(h.removePaymentPlanInstallment(d,o))}),t(4,` 182 `),C(5,"i",55),t(6,` 183 `),l(),t(7,` 184 `),l(),t(8,` 185 `)}if(a&2){let e=m().$index,i=m(5);s(3),_("disabled",i.busy),L("aria-label","Remove payment "+(e+1))}}function li(a,n){if(a&1){let e=g();t(0,` 186 `),r(1,"tr"),t(2,` 187 `),r(3,"td"),t(4,` 188 `),r(5,"label",50),t(6,"Due date"),l(),t(7,` 189 `),r(8,"input",69),A("ngModelChange",function(o){let d=x(e).$implicit;return R(d.dueDate,o)||(d.dueDate=o),u(o)}),l(),t(9,`
190 `),l(),t(10,` 191 `),r(11,"td"),t(12,` 192 `),r(13,"label",50),t(14,"Amount due"),l(),t(15,` 193 `),r(16,"input",70),A("ngModelChange",function(o){let d=x(e).$implicit;return R(d.amountDue,o)||(d.amountDue=o),u(o)}),l(),t(17,` 194 `),l(),t(18,` 195 `),r(19,"td",71),t(20,` 196 `),r(21,"label",50),t(22,"Due at time of registration"),l(),t(23,` 197 `),r(24,"input",72),A("ngModelChange",function(o){let d=x(e).$implicit;return R(d.dueAtTimeOfRegistration,o)||(d.dueAtTimeOfRegistration=o),u(o)}),l(),t(25,` 198 `),l(),t(26,` 199 `),c(27,ri,9,2),l(),t(28,` 200 `)}if(a&2){let e=n.$implicit,i=n.$index,o=m(5);s(5),_("for","pp-"+o.activePaymentPlanIndex+"-pay-"+i+"-due"),s(3),_("id","pp-"+o.activePaymentPlanIndex+"-pay-"+i+"-due"),P("ngModel",e.dueDate),_("disabled",!o.editable||o.busy||e.dueAtTimeOfRegistration),s(5),_("for","pp-"+o.activePaymentPlanIndex+"-pay-"+i+"-amount"),s(3),_("id","pp-"+o.activePaymentPlanIndex+"-pay-"+i+"-amount"),P("ngModel",e.amountDue),_("disabled",!o.editable||o.busy),s(5),_("for","pp-"+o.activePaymentPlanIndex+"-pay-"+i+"-at-reg"),s(3),_("id","pp-"+o.activePaymentPlanIndex+"-pay-"+i+"-at-reg"),P("ngModel",e.dueAtTimeOfRegistration),_("disabled",!o.editable||o.busy),s(3),p(o.editable?27:-1)}}function si(a,n){a&1&&(t(0,` 201 `),r(1,"tr"),t(2,` 202 `),r(3,"td",73),t(4,"No payments scheduled yet."),l(),t(5,` 203 `),l(),t(6,` 204 `))}function di(a,n){if(a&1&&(t(0,` 205 `),r(1,"div",68),t(2,` 206 `),r(3,"div",64),t(4,` 207 `),r(5,"span",65),t(6,"Payment schedule"),l(),t(7,` 208 `),c(8,ai,6,1),l(),t(9,` 209 `),r(10,"div",46),t(11,` 210 `),r(12,"table",47),t(13,` 211 `),r(14,"thead"),t(15,` 212 `),r(16,"tr"),t(17,` 213 `),r(18,"th",48),t(19,"Due Date"),l(),t(20,` 214 `),r(21,"th",48),t(22,"Amount Due ($)"),l(),t(23,` 215 `),r(24,"th",48),t(25,"Due at Registration"),l(),t(26,` 216 `),c(27,oi,5,0),l(),t(28,` 217 `),l(),t(29,` 218 `),r(30,"tbody"),t(31,` 219 `),T(32,li,29,13,null,null,N,!1,si,7,0),l(),t(35,` 220 `),l(),t(36,` 221 `),l(),t(37,` 222 `),l(),t(38,` 223 `)),a&2){let e=m(),i=m(3);s(8),p(i.editable?8:-1),s(19),p(i.editable?27:-1),s(5),I(e.payments)}}function mi(a,n){if(a&1){let e=g();t(0,` 224 `),r(1,"div",64),t(2,` 225 `),r(3,"span",65),t(4),c(5,ii,4,2),l(),t(6,` 226 `),c(7,ni,6,2),l(),t(8,` 227 `),r(9,"app-dynamic-form",66),f("valueChanges",function(o){x(e);let d=m(3);return u(d.onPaymentPlanChange(d.activePaymentPlanIndex,o))}),t(10,` 228 `),l(),t(11,` 229 230 `),c(12,di,39,3)}if(a&2){let e=n,i=m(3);s(4),E(` 231 `,i.paymentPlanName(i.activePaymentPlanIndex),` 232 `),s(),p(i.paymentPlanCount>1?5:-1),s(2),p(i.editable?7:-1),s(2),_("formID","plan-payment-plan-"+i.activePaymentPlanIndex)("fields",i.paymentPlanFieldSets[i.activePaymentPlanIndex])("entity",e)("saveBlankFields",!0)("showSubmitButton",!1)("showCancelButton",!1)("subscribeToFormServiceErrors",!1),s(3),p(i.isFixedPaymentPlan(e)?12:-1)}}function ci(a,n){if(a&1){let e=g();t(0,` 233 `),r(1,"button",74),f("click",function(){x(e);let o=m(3);return u(o.addPaymentPlan())}),t(2,` 234 `),C(3,"i",57),t(4,`Add another payment plan 235 `),l(),t(5,` 236 `)}if(a&2){let e=m(3);s(),_("disabled",e.busy)}}function pi(a,n){if(a&1&&(t(0,` 237 `),r(1,"div",58),t(2,` 238 `),r(3,"div",40),t(4,` 239 `),r(5,"span",3),C(6,"i",59),t(7),l(),t(8,` 240 `),l(),t(9,` 241 `),r(10,"div",42),t(11,` 242 `),r(12,"p",32),t(13,` 243 These payment plans will be created and offered on this program's registrations when you 244 apply. Dynamic plans compute each registrant's schedule automatically; fixed plans charge 245 the exact dates and amounts below.
246 `),l(),t(14,` 247 248 `),r(15,"div",60),t(16,` 249 `),t(17,` 250 `),c(18,ei,7,2),r(19,"div",61),t(20,` 251 `),c(21,mi,13,11),c(22,ci,6,1),l(),t(23,` 252 `),l(),t(24,` 253 `),l(),t(25,` 254 `),l(),t(26,` 255 `)),a&2){let e,i=m(2);s(),_("id",i.PaymentPlansSectionID),s(6),E("Payment plans (",i.paymentPlanCount,")"),s(11),p(i.paymentPlanCount>1?18:-1),s(3),p((e=i.activePaymentPlan)?21:-1,e),s(),p(i.editable?22:-1)}}function _i(a,n){if(a&1){let e=g();t(0,` 256 `),r(1,"div",62),t(2,` 257 `),r(3,"app-sidebar-nav-tabs",63),f("tabClick",function(o){x(e);let d=m(3);return u(d.selectRegistration(o))}),t(4,` 258 `),l(),t(5,` 259 `),l(),t(6,` 260 `)}if(a&2){let e=m(3);s(3),_("tabs",e.registrationTabs)("activeTab",e.activeRegistrationIndex)}}function xi(a,n){if(a&1&&(t(0,` 261 `),r(1,"span",76),t(2),r(3,"span",67),t(4),l(),t(5,` 262 `),l(),t(6,` 263 `)),a&2){let e=m(4);s(2),E(` 264 `,e.registrationName(e.activeRegistrationIndex),` 265 `),s(2),tt("\u2014 ",e.activeRegistrationIndex+1," of ",e.registrationCount)}}function ui(a,n){a&1&&(r(0,"span"),t(1,", "),l())}function Ci(a,n){if(a&1&&(t(0,` 266 `),r(1,"span",3),t(2),l(),c(3,ui,2,0,"span")),a&2){let e=n.$implicit,i=n.$index,o=n.$count;s(2),D(e),s(),p(i!==o-1?3:-1)}}function fi(a,n){if(a&1&&(t(0,` 267 `),r(1,"p",80),t(2,` 268 Also mutually exclusive with (from this plan): 269 `),T(3,Ci,4,2,null,null,N),l(),t(5,` 270 `)),a&2){let e=m(6);s(3),I(e.siblingExclusionNames(e.activeRegistrationIndex))}}function gi(a,n){if(a&1){let e=g();t(0,` 271 `),r(1,"div",78),t(2,` 272 `),r(3,"span",79),t(4,"Exclusions"),l(),t(5,` 273 `),r(6,"app-dynamic-form",77),f("valueChanges",function(o){x(e);let d=m(5);return u(d.onSectionChange(d.activeRegistrationIndex,"exclusions",o))})("fieldExplainClick",function(o){x(e);let d=m(5);return u(d.onFieldExplain("exclusions",d.activeRegistrationIndex,o))}),t(7,` 274 `),l(),t(8,` 275 `),c(9,fi,6,0),l(),t(10,` 276 `)}if(a&2){let e=m(2),i=m(3);s(6),_("formID","plan-reg-"+i.activeRegistrationIndex+"-exclusions")("fields",i.exclusionsFieldSets[i.activeRegistrationIndex])("entity",e.exclusions)("saveBlankFields",!0)("showSubmitButton",!1)("showCancelButton",!1)("subscribeToFormServiceErrors",!1),s(3),p(i.siblingExclusionNames(i.activeRegistrationIndex).length?9:-1)}}function hi(a,n){if(a&1){let e=g();t(0,` 277 `),r(1,"app-dynamic-form",77),f("valueChanges",function(o){x(e);let d=m(4);return u(d.onRegistrationChange(d.activeRegistrationIndex,o))})("fieldExplainClick",function(o){x(e);let d=m(4);return u(d.onFieldExplain("registration",d.activeRegistrationIndex,o))}),t(2,` 278 `),l(),t(3,` 279 280 `),t(4,` 281 `),r(5,"div",78),t(6,` 282 `),r(7,"span",79),t(8,"Teams"),l(),t(9,` 283 `),r(10,"app-dynamic-form",77),f("valueChanges",function(o){x(e);let d=m(4);return u(d.onSectionChange(d.activeRegistrationIndex,"teams",o))})("fieldExplainClick",function(o){x(e);let d=m(4);return u(d.onFieldExplain("teams",d.activeRegistrationIndex,o))}),t(11,` 284 `),l(),t(12,` 285 `),l(),t(13,` 286 287 `),t(14,` 288 `),c(15,gi,11,8)}if(a&2){let e=m(),i=m(3);s(),_("formID","plan-reg-"+i.activeRegistrationIndex)("fields",i.registrationFieldSets[i.activeRegistrationIndex])("entity",e)("saveBlankFields",!0)("showSubmitButton",!1)("showCancelButton",!1)("subscribeToFormServiceErrors",!1),s(9),_("formID","plan-reg-"+i.activeRegistrationIndex+"-teams")("fields",i.teamsFieldSets[i.activeRegistrationIndex])("entity",e.teams)("saveBlankFields",!0)("showSubmitButton",!1)("showCancelButton",!1)("subscribeToFormServiceErrors",!1),s(5),p(i.isInvitational?-1:15)}}function yi(a,n){if(a&1){let e=g();t(0,` 289 `),r(1,"button",54),f("click",function(){x(e);let o=m(5);return u(o.openApplyTo(o.activeRegistrationIndex,"display"))}),t(2,` 290 `),C(3,"i",83),t(4,`Apply to other registrations
291 `),l(),t(5,` 292 `)}if(a&2){let e=m(5);s(),_("disabled",e.busy)}}function bi(a,n){if(a&1&&(t(0,` 293 `),r(1,"span"),t(2," named "),r(3,"span",3),t(4),l()(),t(5,` 294 `)),a&2){let e=m(3);s(4),D(e.form.newName)}}function Si(a,n){if(a&1&&(t(0,` 295 `),r(1,"li"),t(2),l(),t(3,` 296 `)),a&2){let e=n.$implicit;s(2),D(e)}}function vi(a,n){if(a&1&&(t(0,` 297 `),r(1,"div",78),t(2,` 298 `),r(3,"span",79),t(4,"Registration Form"),l(),t(5,` 299 `),r(6,"p",84),t(7,` 300 Creates a tailored copy of the selected form 301 `),c(8,bi,6,1),t(9,` 302 \u2014 the original form is not changed: 303 `),l(),t(10,` 304 `),r(11,"ul",85),t(12,` 305 `),T(13,Si,4,1,null,null,N),l(),t(15,` 306 `),l(),t(16,` 307 `)),a&2){let e=m(2),i=m(3);s(8),p(e.form.newName?8:-1),s(5),I(i.formChangeSummaries(i.activeRegistrationIndex))}}function wi(a,n){if(a&1){let e=g();t(0,` 308 `),r(1,"button",54),f("click",function(){x(e);let o=m(5);return u(o.openApplyTo(o.activeRegistrationIndex,"emailSettings"))}),t(2,` 309 `),C(3,"i",83),t(4,`Apply to other registrations 310 `),l(),t(5,` 311 `)}if(a&2){let e=m(5);s(),_("disabled",e.busy)}}function Di(a,n){if(a&1){let e=g();t(0,` 312 313 `),t(1,` 314 `),r(2,"div",78),t(3,` 315 `),r(4,"div",81),t(5,` 316 `),r(6,"span",65),t(7,"Display Options"),l(),t(8,` 317 `),c(9,yi,6,1),l(),t(10,` 318 `),r(11,"app-dynamic-form",77),f("valueChanges",function(o){x(e);let d=m(4);return u(d.onSectionChange(d.activeRegistrationIndex,"display",o))})("fieldExplainClick",function(o){x(e);let d=m(4);return u(d.onFieldExplain("display",d.activeRegistrationIndex,o))}),t(12,` 319 `),l(),t(13,` 320 `),l(),t(14,` 321 322 `),t(15,` 323 `),c(16,vi,17,1),r(17,"div",78),t(18,` 324 `),r(19,"div",82),t(20,` 325 `),r(21,"span",65),t(22,"Email Settings"),l(),t(23,` 326 `),c(24,wi,6,1),l(),t(25,` 327 `),r(26,"app-dynamic-form",77),f("valueChanges",function(o){x(e);let d=m(4);return u(d.onSectionChange(d.activeRegistrationIndex,"emailSettings",o))})("fieldExplainClick",function(o){x(e);let d=m(4);return u(d.onFieldExplain("emailSettings",d.activeRegistrationIndex,o))}),t(27,` 328 `),l(),t(28,` 329 `),l(),t(29,` 330 `)}if(a&2){let e=m(),i=m(3);s(9),p(i.canBulkApply?9:-1),s(2),_("formID","plan-reg-"+i.activeRegistrationIndex+"-display")("fields",i.displayFieldSets[i.activeRegistrationIndex])("entity",e.display)("saveBlankFields",!0)("showSubmitButton",!1)("showCancelButton",!1)("subscribeToFormServiceErrors",!1),s(5),p((e.form==null?null:e.form.mode)==="CLONE_AND_TAILOR"?16:-1),s(8),p(i.canBulkApply?24:-1),s(2),_("formID","plan-reg-"+i.activeRegistrationIndex+"-email")("fields",i.emailFieldSets[i.activeRegistrationIndex])("entity",e.emailSettings)("saveBlankFields",!0)("showSubmitButton",!1)("showCancelButton",!1)("subscribeToFormServiceErrors",!1)}}function Ei(a,n){a&1&&(t(0,` 331 `),r(1,"th",48)(2,"span",49),t(3,"Remove"),l()(),t(4,` 332 `))}function Ti(a,n){if(a&1){let e=g();t(0,` 333 `),r(1,"td",53),t(2,` 334 `),r(3,"button",54),f("click",function(){x(e);let o=m().$index,d=m(2),h=m(3);return u(h.removePriceOverride(d,o))}),t(4,` 335 `),C(5,"i",55),t(6,` 336 `),l(),t(7,` 337 `),l(),t(8,` 338 `)}if(a&2){let e=m().$index,i=m(5);s(3),_("disabled",i.busy),L("aria-label","Remove price override "+(e+1))}}function Ii(a,n){if(a&1){let e=g();t(0,` 339 `),r(1,"tr"),t(2,` 340 `),r(3,"td"),t(4,` 341 `),r(5,"label",50),t(6,"Label"),l(),t(7,` 342 `),r(8,"input",87),A("ngModelChange",function(o){let d=x(e).$implicit;return R(d.label,o)||(d.label=o),u(o)}),l(),t(9,`
343 `),l(),t(10,` 344 `),r(11,"td"),t(12,` 345 `),r(13,"label",50),t(14,"Price"),l(),t(15,` 346 `),r(16,"input",88),A("ngModelChange",function(o){let d=x(e).$implicit;return R(d.price,o)||(d.price=o),u(o)}),l(),t(17,` 347 `),l(),t(18,` 348 `),r(19,"td"),t(20,` 349 `),r(21,"label",50),t(22,"Start date"),l(),t(23,` 350 `),r(24,"input",89),A("ngModelChange",function(o){let d=x(e).$implicit;return R(d.startDate,o)||(d.startDate=o),u(o)}),l(),t(25,` 351 `),l(),t(26,` 352 `),r(27,"td"),t(28,` 353 `),r(29,"label",50),t(30,"End date"),l(),t(31,` 354 `),r(32,"input",89),A("ngModelChange",function(o){let d=x(e).$implicit;return R(d.endDate,o)||(d.endDate=o),u(o)}),l(),t(33,` 355 `),l(),t(34,` 356 `),c(35,Ti,9,2),l(),t(36,` 357 `)}if(a&2){let e=n.$implicit,i=n.$index,o=m(5);s(5),_("for","reg-"+o.activeRegistrationIndex+"-ov-"+i+"-label"),s(3),_("id","reg-"+o.activeRegistrationIndex+"-ov-"+i+"-label"),P("ngModel",e.label),_("disabled",!o.editable||o.busy),s(5),_("for","reg-"+o.activeRegistrationIndex+"-ov-"+i+"-price"),s(3),_("id","reg-"+o.activeRegistrationIndex+"-ov-"+i+"-price"),P("ngModel",e.price),_("disabled",!o.editable||o.busy),s(5),_("for","reg-"+o.activeRegistrationIndex+"-ov-"+i+"-start"),s(3),_("id","reg-"+o.activeRegistrationIndex+"-ov-"+i+"-start"),P("ngModel",e.startDate),_("disabled",!o.editable||o.busy),s(5),_("for","reg-"+o.activeRegistrationIndex+"-ov-"+i+"-end"),s(3),_("id","reg-"+o.activeRegistrationIndex+"-ov-"+i+"-end"),P("ngModel",e.endDate),_("disabled",!o.editable||o.busy),s(3),p(o.editable?35:-1)}}function Pi(a,n){if(a&1&&(t(0,` 358 `),r(1,"div",86),t(2,` 359 `),r(3,"div",64),t(4,` 360 `),r(5,"span",65),t(6,"Price overrides (early bird, late fees\u2026)"),l(),t(7,` 361 `),l(),t(8,` 362 `),r(9,"div",46),t(10,` 363 `),r(11,"table",47),t(12,` 364 `),r(13,"thead"),t(14,` 365 `),r(15,"tr"),t(16,` 366 `),r(17,"th",48),t(18,"Label"),l(),t(19,` 367 `),r(20,"th",48),t(21,"Price ($)"),l(),t(22,` 368 `),r(23,"th",48),t(24,"Starts"),l(),t(25,` 369 `),r(26,"th",48),t(27,"Ends"),l(),t(28,` 370 `),c(29,Ei,5,0),l(),t(30,` 371 `),l(),t(31,` 372 `),r(32,"tbody"),t(33,` 373 `),T(34,Ii,37,17,null,null,N),l(),t(36,` 374 `),l(),t(37,` 375 `),l(),t(38,` 376 `),l(),t(39,` 377 `)),a&2){let e=m(),i=m(3);s(29),p(i.editable?29:-1),s(5),I(e.priceOverrides)}}function Ri(a,n){if(a&1){let e=g();t(0,` 378 `),r(1,"div",90),t(2,` 379 `),r(3,"button",54),f("click",function(){x(e);let o=m(4);return u(o.selectRegistration(o.activeRegistrationIndex-1))}),t(4,` 380 `),C(5,"i",91),t(6,`Previous 381 `),l(),t(7,` 382 `),r(8,"button",54),f("click",function(){x(e);let o=m(4);return u(o.selectRegistration(o.activeRegistrationIndex+1))}),t(9,` 383 Next registration`),C(10,"i",38),t(11,` 384 `),l(),t(12,` 385 `),l(),t(13,` 386 `)}if(a&2){let e=m(4);s(3),_("disabled",e.activeRegistrationIndex===0),s(5),_("disabled",e.activeRegistrationIndex>=e.registrationCount-1)}}function Ai(a,n){if(a&1&&(t(0,` 387 `),r(1,"div",42),t(2,` 388 389 `),c(3,xi,7,3),c(4,hi,16,15),c(5,Di,30,17),c(6,Pi,40,1),l(),t(7,` 390 391 `),t(8,` 392 `),c(9,Ri,14,2)),a&2){let e=n,i=m(3);s(3),p(i.registrationCount>1?3:-1),s(),p(i.onBasicsStep?4:-1),s(),p(i.onBasicsStep?-1:5),s(),p(i.onBasicsStep&&(e.priceOverrides!=null&&e.priceOverrides.length)?6:-1),s(3),p(i.registrationCount>1?9:-1)}}function Fi(a,n){if(a&1&&(t(0,` 393 `),r(1,"div",75),t(2,` 394 `),r(3,"div",40),t(4,` 395 `),r(5,"div",41),t(6,` 396 `),C(7,"i",20),t(8),l(),t(9,`
397 `),l(),t(10,` 398 399 `),r(11,"div",60),t(12,` 400 `),t(13,` 401 `),c(14,_i,7,2),r(15,"div",61),t(16,` 402 `),c(17,Ai,10,5),l(),t(18,` 403 `),l(),t(19,` 404 `),l(),t(20,` 405 `)),a&2){let e,i=m(2);s(),_("id",i.RegistrationsSectionID),s(7),E("Registrations (",i.registrationCount,`) 406 `),s(6),p(i.registrationCount>1?14:-1),s(3),p((e=i.activeRegistration)?17:-1,e)}}function Ni(a,n){if(a&1){let e=g();t(0,` 407 `),r(1,"p",32),t(2,` 408 Not sure what a setting in this draft does? 409 `),r(3,"button",37),f("click",function(){x(e);let o=m(2);return u(o.openSetupGuide())}),t(4,` 410 `),C(5,"i",92),t(6,`Ask the Setup Guide 411 `),l(),t(7,` 412 `),l(),t(8,` 413 `)}}function ki(a,n){a&1&&(t(0,` 414 `),r(1,"p",93),t(2,` 415 `),C(3,"i",94),t(4,`The assistant is revising this draft \u2014 editing is paused. 416 `),l(),t(5,` 417 `))}function Vi(a,n){if(a&1){let e=g();t(0,` 418 `),r(1,"button",97),f("click",function(){x(e);let o=m(3);return u(o.goToStep(1))}),t(2,` 419 `),C(3,"i",91),t(4,`Back to basics 420 `),l(),t(5,` 421 `)}if(a&2){let e=m(3);s(),_("disabled",e.busy)}}function Oi(a,n){if(a&1){let e=g();t(0,` 422 `),r(1,"button",98),f("click",function(){x(e);let o=m(3);return u(o.goToStep(2))}),t(2,` 423 Next: details & communications`),C(3,"i",38),t(4,` 424 `),l(),t(5,` 425 `)}if(a&2){let e=m(3);s(),_("disabled",e.busy)}}function Li(a,n){if(a&1){let e=g();t(0,` 426 `),r(1,"button",98),f("click",function(){x(e);let o=m(3);return u(o.showApplyConfirm=!0)}),t(2,` 427 `),C(3,"i"),t(4),l(),t(5,` 428 `)}if(a&2){let e=m(3);s(),_("disabled",!e.canApply),s(2),M(e.applying?"fa fa-spinner fa-spin mr-1":"fa-regular fa-circle-check mr-1"),s(),E(` 429 `,e.applying?"Applying\u2026":"Apply to live",` 430 `)}}function Mi(a,n){if(a&1){let e=g();t(0,` 431 `),c(1,Vi,6,1),r(2,"button",95),f("click",function(){x(e);let o=m(2);return u(o.save())}),t(3,` 432 `),C(4,"i"),t(5),l(),t(6,` 433 `),c(7,Oi,6,1)(8,Li,6,4),r(9,"button",96),f("click",function(){x(e);let o=m(2);return u(o.showDiscardConfirm=!0)}),t(10,` 434 Discard 435 `),l(),t(11,` 436 `)}if(a&2){let e=m(2);s(),p(e.onBasicsStep?-1:1),s(),_("disabled",e.busy),s(2),M(e.saving?"fa fa-spinner fa-spin mr-1":"fa-regular fa-floppy-disk mr-1"),s(),E(` 437 `,e.saving?"Saving\u2026":"Save edits",` 438 `),s(2),p(e.onBasicsStep?7:8),s(2),_("disabled",e.busy)}}function Bi(a,n){if(a&1){let e=g();t(0,` 439 `),r(1,"button",101),f("click",function(){x(e);let o=m(3);return u(o.showUndoConfirm=!0)}),t(2,` 440 `),C(3,"i"),t(4),l(),t(5,` 441 `)}if(a&2){let e=m(3);s(),_("disabled",e.busy),s(2),M(e.undoing?"fa fa-spinner fa-spin mr-1":"fa-regular fa-rotate-left mr-1"),s(),E(` 442 `,e.undoing?"Undoing\u2026":"Undo",` 443 `)}}function Ui(a,n){if(a&1&&(t(0,` 444 `),r(1,"a",99),t(2,` 445 `),C(3,"i",100),t(4,`View program 446 `),l(),t(5,` 447 `),c(6,Bi,6,4)),a&2){let e=m(2);s(),_("routerLink",e.draft.appliedProgramID?ht(2,xe,e.draft.appliedProgramID):Pt(4,we)),s(5),p(e.draft.canUndo?6:-1)}}function $i(a,n){if(a&1&&(t(0,` 448 Want the same on your other registrations? Pick what to copy from 449 `),r(1,"span",3),t(2),l(),t(3,` \u2014 one pass, no retyping. 450 `)),a&2){let e=m(3);s(2),D(e.applyTo.sourceName)}}function Wi(a,n){if(a&1&&(t(0),j(1,"lowercase"),r(2,"span",3),t(3),l(),t(4,` 451 onto the registrations you pick. 452 `)),a&2){let e=m(3);E(` 453 Copy `,At(1,2,e.applyTo.sectionLabel)," from "),s(3),D(e.applyTo.sourceName)}}function Gi(a,n){a&1&&(t(0,` 454 `),C(1,"app-pill",111),t(2,` 455 `))}function qi(a,n){if(a&1){let e=g();t(0,` 456 `),r(1,"li",107),t(2,` 457 `),r(3,"label",108),t(4,` 458 `),r(5,"input",109),A("ngModelChange",function(o){let d=x(e).$implicit;return R(d.selected,o)||(d.selected=o),u(o)}),l(),t(6,` 459 `),r(7,"span"),t(8,` 460 `),r(9,"span",110),t(10,` 461 `),r(11,"span",3),t(12),l(),t(13,` 462 `),c(14,Gi,3,0),l(),t(15,` 463 `),r(16,"span",21),t(17),l(),t(18,`
464 `),l(),t(19,` 465 `),l(),t(20,` 466 `),l(),t(21,` 467 `)}if(a&2){let e=n.$implicit;s(5),P("ngModel",e.selected),L("aria-label","Copy "+e.label),s(7),D(e.label),s(2),p(e.edited?14:-1),s(3),D(e.valuePreview)}}function Yi(a,n){a&1&&(t(0,` 468 `),r(1,"p",32),t(2,` 469 Copied email content brings the email mode along with it, so overrides take effect on every form. 470 `),l(),t(3,` 471 `))}function ji(a,n){if(a&1){let e=g();t(0,` 472 `),r(1,"li",107),t(2,` 473 `),r(3,"label",112),t(4,` 474 `),r(5,"input",113),A("ngModelChange",function(o){let d=x(e).$implicit;return R(d.selected,o)||(d.selected=o),u(o)}),l(),t(6,` 475 `),r(7,"span"),t(8),l(),t(9,` 476 `),l(),t(10,` 477 `),l(),t(11,` 478 `)}if(a&2){let e=n.$implicit;s(5),P("ngModel",e.selected),L("aria-label","Apply to "+e.name),s(3),D(e.name)}}function Hi(a,n){if(a&1){let e=g();t(0,` 479 `),r(1,"app-dialog-footer"),t(2,` 480 `),Ct(3,114),t(4,` 481 `),r(5,"button",115),f("click",function(){x(e);let o=m(3);return u(o.cancelApplyTo())}),t(6,"Cancel"),l(),t(7,` 482 `),ft(),t(8,` 483 `),Ct(9,116),t(10,` 484 `),r(11,"button",117),f("click",function(){x(e);let o=m(3);return u(o.confirmApplyTo())}),t(12,` 485 `),C(13,"i",83),t(14),l(),t(15,` 486 `),ft(),t(16,` 487 `),l(),t(17,` 488 `)}if(a&2){let e=m(3);s(11),_("disabled",!e.applyToCanConfirm),s(3),tt(` 489 Apply to `,e.applyToSelectedTargetCount,` 490 registration`,e.applyToSelectedTargetCount===1?"":"s",` 491 `)}}function Qi(a,n){if(a&1){let e=g();t(0,` 492 `),r(1,"p-dialog",102),t(2,` 493 494 `),r(3,"p",103),t(4,` 495 `),c(5,$i,4,1)(6,Wi,5,4),l(),t(7,` 496 497 `),r(8,"span",76),t(9,"Settings to copy"),l(),t(10,` 498 `),r(11,"ul",104),t(12,`
499 `),T(13,qi,22,5,null,null,De),l(),t(15,` 500 `),c(16,Yi,4,0),r(17,"div",105),t(18,` 501 `),r(19,"span",65),t(20,"Apply to"),l(),t(21,` 502 `),r(22,"button",37),f("click",function(){x(e);let o=m(2);return u(o.toggleAllApplyToTargets())}),t(23),l(),t(24,` 503 `),l(),t(25,` 504 `),r(26,"ul",104),t(27,` 505 `),T(28,ji,12,3,null,null,Ee),l(),t(30,` 506 507 `),r(31,"p",80),t(32,` 508 `),C(33,"i",106),t(34,`Copies update this draft only \u2014 use 509 `),r(35,"span",3),t(36,"Save edits"),l(),t(37,` to keep them. 510 `),l(),t(38,` 511 512 `),Z(39,Hi,18,3,"ng-template",null,0,it),t(41,` 513 `),l(),t(42,` 514 `)}if(a&2){let e=m(2);s(),_("visible",!0)("modal",!0)("closable",!1)("header","Apply "+e.applyTo.sectionLabel+" to other registrations"),s(4),p(e.applyTo.autoOpened?5:6),s(8),I(e.applyTo.fields),s(3),p(e.applyTo.section==="emailSettings"?16:-1),s(7),E(` 515 `,e.allApplyToTargetsSelected?"Clear all":"Select all",` 516 `),s(5),I(e.applyTo.targets)}}function Xi(a,n){if(a&1){let e=g();t(0,` 517 `),r(1,"app-yes-no-modal",118),f("onYesSelect",function(){x(e);let o=m(2);return u(o.apply())})("onNoSelect",function(){x(e);let o=m(2);return u(o.showApplyConfirm=!1)}),l(),t(2,` 518 `)}if(a&2){let e=m(2);s(),_("loading",e.applying)}}function Ji(a,n){if(a&1){let e=g();t(0,` 519 `),r(1,"app-yes-no-modal",119),f("onYesSelect",function(){x(e);let o=m(2);return u(o.discard())})("onNoSelect",function(){x(e);let o=m(2);return u(o.showDiscardConfirm=!1)}),l(),t(2,` 520 `)}if(a&2){let e=m(2);s(),_("loading",e.discarding)}}function Ki(a,n){if(a&1){let e=g();t(0,` 521 `),r(1,"app-yes-no-modal",120),f("onYesSelect",function(){x(e);let o=m(2);return u(o.undo())})("onNoSelect",function(){x(e);let o=m(2);return u(o.showUndoConfirm=!1)}),l(),t(2,` 522 `)}if(a&2){let e=m(2);s(),_("loading",e.undoing)}}function zi(a,n){if(a&1&&(t(0,` 523 524 `),t(1,` 525 `),r(2,"div",1),t(3,` 526 `),r(4,"div",2),t(5,` 527 `),r(6,"span",3),C(7,"i",4),t(8,"Draft plan"),l(),t(9,` 528 `),r(10,"span",5),t(11,` 529 `),C(12,"app-pill",6),t(13,` 530 `),C(14,"app-pill",7),t(15,` 531 `),l(),t(16,` 532 `),l(),t(17,` 533 `),r(18,"div",8),t(19,` 534 `),r(20,"p",9),t(21),l(),t(22,` 535 536 `),t(23,` 537 `),c(24,Fe,19,6),l(),t(25,` 538 `),l(),t(26,` 539 540 `),t(27,` 541 `),c(28,Be,26,6),c(29,Ge,21,11),c(30,je,12,1),c(31,He,4,0),c(32,Qe,4,1),c(33,Xe,19,6),c(34,ti,42,3),c(35,pi,27,5),c(36,Fi,21,4),c(37,Ni,9,0),r(38,"div",10),t(39,` 542 `),c(40,ki,6,0),c(41,Mi,12,7),c(42,Ui,7,5),l(),t(43,` 543 544 `),t(44,` 545 `),c(45,Qi,43,7),c(46,Xi,3,1),c(47,Ji,3,1),c(48,Ki,3,1)),a&2){let e=m();s(12),_("text","v"+e.draft.version),s(2),_("status",e.statusPill(e.draft.statusID))("text",e.statusLabel(e.draft.statusID)),s(7),D(e.draft.summary),s(3),p(e.draft.statusID===e.DraftStatus.APPLIED&&e.draft.appliedProgramID?24:-1),s(4),p(e.formsReady?28:-1),s(),p(e.formsReady?29:-1),s(),p(e.hasValidationErrors?30:-1),s(),p(e.metadataLoading?31:-1),s(),p(e.metadataError?32:-1),s(),p(e.formsReady&&e.onBasicsStep?33:-1),s(),p(e.formsReady&&e.onBasicsStep&&(e.plan.newTeams!=null&&e.plan.newTeams.length)?34:-1),s(),p(e.formsReady&&e.onBasicsStep&&e.paymentPlanCount?35:-1),s(),p(e.formsReady&&e.registrationCount?36:-1),s(),p(e.showSetupGuideLink?37:-1),s(3),p(e.locked&&e.draft.statusID===e.DraftStatus.PENDING_REVIEW?40:-1),s(),p(e.editable?41:-1),s(),p(e.draft.statusID===e.DraftStatus.APPLIED?42:-1),s(3),p(e.applyTo?45:-1),s(),p(e.showApplyConfirm?46:-1),s(),p(e.showDiscardConfirm?47:-1),s(),p(e.showUndoConfirm?48:-1)}}var S=class S{constructor(n,e){this.registrationAgentService=n,this.siteDataService=e,this.unsubscribe$=new vt,this.locked=!1,this.draftChange=new Y,this.applied=new Y,this.discarded=new Y,this.undone=new Y,this.metadataLoading=!1,this.metadataError=!1,this.registrationFieldSets=[],this.teamsFieldSets=[],this.exclusionsFieldSets=[],this.displayFieldSets=[],this.emailFieldSets=[],this.paymentPlanFieldSets=[],this.activeRegistrationIndex=0,this.activePaymentPlanIndex=0,this.registrationTabs=[],this.paymentPlanTabs=[],this.planValidationErrors=[],this.saving=!1,this.applying=!1,this.discarding=!1,this.undoing=!1,this.showApplyConfirm=!1,this.showDiscardConfirm=!1,this.showUndoConfirm=!1,this.applyTo=null,this.sectionEdits=[],this.applyToDeclined={display:!1,emailSettings:!1},this.step=1,this.RegistrationsSectionID=S.RegistrationsSectionID,this.PaymentPlansSectionID=S.PaymentPlansSectionID,this.DraftStatus=k,this.showSetupGuideLink=!1,this.explainInFlight=!1}ngOnInit(){this.siteDataService.getClubOptions([Q.ENABLE_SETUP_GUIDE]).pipe(B(this.unsubscribe$)).subscribe({next:n=>{this.showSetupGuideLink=n?.find(e=>e.optionID===Q.ENABLE_SETUP_GUIDE)?.boolValue===!0,this.buildFieldSets()},error:()=>{this.showSetupGuideLink=!1}})}openSetupGuide(){this.siteDataService.openSetupGuide()}onFieldExplain(n,e,i){if(!this.showSetupGuideLink||!this.draft||!i?.helpKey||this.explainInFlight)return;this.explainInFlight=!0,window.setTimeout(()=>this.explainInFlight=!1,S.ExplainCooldownMs);let o=this.plainText(i.label),d=`registration-agent:${this.draft.draftID}:${n}:${e}:${i.controlName}`;this.siteDataService.openSetupGuide(i.helpKey,`What does the "${o}" setting do, and what is it currently set to in this draft?`,d)}plainText(n){if(!n)return"";let e=document.createElement("div");return e.innerHTML=n,(e.textContent||"").trim()}ngOnChanges(n){n.draft&&this.draft&&this.draftRenderChanged(n.draft)?(this.plan=this.clonePlan(this.draft.plan),this.step=S.StepBasics,this.activeRegistrationIndex=0,this.activePaymentPlanIndex=0,this.resetApplyToState(),this.attributeValidationErrors(),this.buildRailTabs(),this.metadata?this.buildFieldSets():this.loadMetadata()):n.locked&&!n.locked.firstChange&&this.buildFieldSets()}draftRenderChanged(n){let e=n.previousValue,i=n.currentValue;return!e||!i?!0:e.draftID!==i.draftID||e.version!==i.version||e.statusID!==i.statusID||e.updatedOn!==i.updatedOn}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}get editable(){return!this.locked&&this.draft?.statusID===k.PENDING_REVIEW}get busy(){return this.saving||this.applying||this.discarding||this.undoing}get hasValidationErrors(){return(this.draft?.validation?.errors?.length??0)>0}get canApply(){return this.editable&&this.draft?.canApply===!0&&!this.hasValidationErrors&&!this.busy}get formsReady(){return!!this.plan&&!!this.programFields&&!this.metadataLoading}get onBasicsStep(){return this.step===S.StepBasics}get isInvitational(){return this.plan?.program?.programInvitationTypeID===bt.INVITATIONAL_WITH_REGISTRATION}goToStep(n){this.step!==n&&(this.step=n,typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"}))}statusLabel(n){return ce[n]??"Unknown"}statusPill(n){return _e[n]??"default"}get registrationCount(){return this.plan?.registrations?.length??0}get paymentPlanCount(){return this.plan?.paymentPlans?.length??0}get activeRegistration(){return this.plan?.registrations?.[this.activeRegistrationIndex]??null}get activePaymentPlan(){return this.plan?.paymentPlans?.[this.activePaymentPlanIndex]??null}registrationName(n){return this.plan?.registrations?.[n]?.name?.trim()||`Registration ${n+1}`}paymentPlanName(n){return this.plan?.paymentPlans?.[n]?.internalName?.trim()||`Payment plan ${n+1}`}selectRegistration(n){n<0||n>=this.registrationCount||n===this.activeRegistrationIndex||(this.activeRegistrationIndex=n,this.buildFieldSets(),this.buildRailTabs(),this.scrollSectionIntoView(S.RegistrationsSectionID))}selectPaymentPlan(n){n<0||n>=this.paymentPlanCount||n===this.activePaymentPlanIndex||(this.activePaymentPlanIndex=n,this.buildFieldSets(),this.buildRailTabs(),this.scrollSectionIntoView(S.PaymentPlansSectionID))}buildRailTabs(){this.registrationTabs=(this.plan?.registrations??[]).map((n,e)=>this.buildRailTab(this.registrationName(e),e,this.planValidationErrors.filter(i=>i.registrationIndex===e).length)),this.paymentPlanTabs=(this.plan?.paymentPlans??[]).map((n,e)=>this.buildRailTab(this.paymentPlanName(e),e,this.planValidationErrors.filter(i=>i.paymentPlanIndex===e).length))}buildRailTab(n,e,i){return{label:n,clickData:e,icon:i?"fa-solid fa-triangle-exclamation":null,badge:i?`${i} issue${i===1?"":"s"}`:null,badgeClass:"d-block text-small",ariaLabel:i?`${n} \u2014 ${i} issue${i===1?"":"s"}`:n}}attributeValidationErrors(){let n=this.draft?.validation?.errors??[],e=this.draft?.plan?.registrations??[],i=this.draft?.plan?.paymentPlans??[];this.planValidationErrors=n.map(o=>({message:o,registrationIndex:this.matchLabelledIndex(o,e.map(d=>d?.name),"Registration"),paymentPlanIndex:this.matchLabelledIndex(o,i.map(d=>d?.internalName),"Payment plan")}))}matchLabelledIndex(n,e,i){if(!n)return null;let o=e.findIndex((d,h)=>{let y=d?.trim();return(y?[`${i} "${d}"`,`${i} "${y}"`]:[`${i} ${h+1}`]).some(b=>n.startsWith(b))});return o===-1?null:o}goToError(n){n.registrationIndex!==null?(this.selectRegistration(n.registrationIndex),this.scrollSectionIntoView(S.RegistrationsSectionID)):n.paymentPlanIndex!==null&&(this.goToStep(S.StepBasics),this.selectPaymentPlan(n.paymentPlanIndex),this.scrollSectionIntoView(S.PaymentPlansSectionID))}scrollSectionIntoView(n){typeof document>"u"||document.getElementById(n)?.scrollIntoView({behavior:"smooth",block:"start"})}onProgramChange(n){if(n&&this.plan?.program){let e=this.plan.program.programTypeID,i=this.plan.program.programInvitationTypeID;Object.assign(this.plan.program,n),this.normalizeDates(this.plan.program,S.ProgramDateFields),this.plan.program.programTypeID!==e?(this.programFields=this.buildProgramFields(!this.editable||this.busy),this.rebuildRegistrationFieldSets()):this.plan.program.programInvitationTypeID!==i&&this.rebuildRegistrationFieldSets()}}onRegistrationChange(n,e){let i=this.plan?.registrations?.[n];if(e&&i){let o="registrationCostTypeID"in e&&e.registrationCostTypeID!==i.registrationCostTypeID||"genderID"in e&&e.genderID!==i.genderID,d="name"in e&&e.name!==i.name;Object.assign(i,e),this.normalizeDates(i,S.RegistrationDateFields),o&&(this.registrationFieldSets[n]=this.buildRegistrationFields(i,n,!this.editable||this.busy)),d&&this.buildRailTabs()}}onSectionChange(n,e,i){let o=this.plan?.registrations?.[n];if(!i||!o?.[e])return;let d=e==="display"||e==="emailSettings"?this.trackSectionEdits(n,e,i):[];Object.assign(o[e],i),d.length&&this.maybeAutoOpenApplyTo(n,e,d)}formChangeSummaries(n){let e=this.plan?.registrations?.[n]?.form;if(!e||e.mode!=="CLONE_AND_TAILOR")return[];let i={ENABLE:"Add",DISABLE:"Remove",REQUIRE:"Require",OPTIONAL:"Make optional"},o=(e.fieldChanges??[]).map(d=>{let h=d.labelOverride||d.fieldName||`field #${d.registrationFieldID}`,y=d.labelOverride&&d.fieldName&&d.labelOverride!==d.fieldName?` (${d.fieldName})`:"";return`${i[d.action]??d.action} \u201C${h}\u201D${y}`});return e.waiverIDs?.length&&o.push(`Attach ${e.waiverIDs.length} waiver${e.waiverIDs.length===1?"":"s"}`),e.includeDonations!==null&&e.includeDonations!==void 0&&o.push(e.includeDonations?"Enable donations":"Disable donations"),o}siblingExclusionNames(n){return(this.plan?.registrations?.[n]?.exclusions?.excludedSiblingIndexes??[]).filter(i=>i>=0&&i<(this.plan?.registrations?.length??0)&&i!==n).map(i=>this.plan.registrations[i]?.name||`Registration ${i+1}`)}loadMetadata(){this.metadataLoading=!0,this.metadataError=!1,this.registrationAgentService.getPlanMetadata().pipe(B(this.unsubscribe$)).subscribe({next:n=>{this.metadata=n,this.metadataLoading=!1,this.buildFieldSets()},error:()=>{this.metadataLoading=!1,this.metadataError=!0,this.siteDataService.showSiteErrorAlert("There was a problem loading the review form. Please refresh and try again.")}})}buildFieldSets(){if(!this.metadata||!this.plan)return;let n=!this.editable||this.busy;this.programFields=this.buildProgramFields(n),this.registrationFieldSets=(this.plan.registrations??[]).map((e,i)=>this.buildRegistrationFields(e,i,n)),this.teamsFieldSets=(this.plan.registrations??[]).map((e,i)=>this.buildTeamsFields(i,n)),this.paymentPlanFieldSets=(this.plan.paymentPlans??[]).map((e,i)=>this.buildPaymentPlanFields(e,i,n)),this.exclusionsFieldSets=(this.plan.registrations??[]).map((e,i)=>this.cloneFields(this.metadata.exclusions.fields,n,`excl-${i}`)),this.displayFieldSets=(this.plan.registrations??[]).map((e,i)=>this.cloneFields(this.metadata.display.fields,n,`disp-${i}`)),this.emailFieldSets=(this.plan.registrations??[]).map((e,i)=>this.cloneFields(this.metadata.emailSettings.fields,n,`email-${i}`))}cloneFields(n,e,i){let o=JSON.parse(JSON.stringify(n??[]));return e&&o.forEach(d=>d.viewOnly=!0),i&&o.forEach(d=>d.key=`${d.key}-${i}`),this.showSetupGuideLink||o.forEach(d=>d.helpKey=null),o}buildProgramFields(n){let e=this.cloneFields(this.metadata.program.fields,n);return this.applyProgramFieldRules(e),e}applyProgramFieldRules(n){let e=this.plan?.program?.programTypeID,i=e===F.SUBSCRIPTION,o=!i&&e!==F.CAMPS_AND_CLINICS,d=this.findField(n,"endDate");d&&i&&W(d),["accrualStartDate","accrualEndDate"].forEach(h=>{let y=this.findField(n,h);y&&!o&&(y.hidden=!0,W(y))})}buildRegistrationFields(n,e,i){let o=this.cloneFields(this.metadata.registration.fields,i,`reg-${e}`);return this.applyRegistrationFieldRules(o,n),o}buildTeamsFields(n,e){let i=this.cloneFields(this.metadata.teams.fields,e,`teams-${n}
545`),o=this.findField(i,"newTeamIndexes");if(o){let d=this.plan?.newTeams??[];o.hidden=d.length===0,o.options=d.map((h,y)=>({label:h.name?.trim()||`New team ${y+1}`,value:y}))}return i}refreshTeamsFieldSets(){if(!this.metadata||!this.plan)return;let n=!this.editable||this.busy;this.teamsFieldSets=(this.plan.registrations??[]).map((e,i)=>this.buildTeamsFields(i,n))}buildPaymentPlanFields(n,e,i){let o=this.cloneFields(this.metadata.paymentPlan.fields,i,`pp-${e}`),d=this.findField(o,"registrationIndexes");d&&(d.options=(this.plan?.registrations??[]).map((w,b)=>({label:w.name||`Registration ${b+1}`,value:b})));let h=n.paymentInstallmentPlanTypeID!==X.FIXED_DATES_AND_AMOUNTS,y=["excludeAdminFeeFromInitialPayment","paymentInstallmentPlanInitialPaymentTypeID","amountDueAtRegistration","numberOfSubsequentPayments","paymentInstallmentPlanSubsequentPaymentDueDateOptionID","subsequentPaymentDueDay","subsequentPaymentDueDaysAfterRegistration","finalDueDate","paymentInstallmentPlanOverageOptionID","monthsToSkip","skipRegistrationMonth"];if(!h)y.forEach(w=>{let b=this.findField(o,w);b&&(b.hidden=!0,W(b))});else{let w=(n.paymentInstallmentPlanSubsequentPaymentDueDateOptionID??ct.DAY_OF_MONTH)===ct.DAY_OF_MONTH,b=this.findField(o,"subsequentPaymentDueDay");b&&(b.hidden=!w,(w?mt:W)(b));let O=this.findField(o,"subsequentPaymentDueDaysAfterRegistration");O&&(O.hidden=w,(w?W:mt)(O)),this.setFieldHidden(o,"skipRegistrationMonth",!w)}return o}onPaymentPlanChange(n,e){let i=this.plan?.paymentPlans?.[n];if(!e||!i)return;let o="paymentInstallmentPlanTypeID"in e&&e.paymentInstallmentPlanTypeID!==i.paymentInstallmentPlanTypeID||"paymentInstallmentPlanSubsequentPaymentDueDateOptionID"in e&&e.paymentInstallmentPlanSubsequentPaymentDueDateOptionID!==i.paymentInstallmentPlanSubsequentPaymentDueDateOptionID,d="internalName"in e&&e.internalName!==i.internalName;Object.assign(i,e),this.normalizeDates(i,S.PaymentPlanDateFields),o&&(this.paymentPlanFieldSets[n]=this.buildPaymentPlanFields(i,n,!this.editable||this.busy)),d&&this.buildRailTabs()}addPaymentPlan(){!this.editable||this.busy||!this.plan||(this.plan.paymentPlans=this.plan.paymentPlans??[],this.plan.paymentPlans.push(this.defaultPaymentPlan()),this.paymentPlanFieldSets.push(this.buildPaymentPlanFields(this.plan.paymentPlans[this.plan.paymentPlans.length-1],this.plan.paymentPlans.length-1,!1)),this.activePaymentPlanIndex=this.plan.paymentPlans.length-1,this.buildRailTabs())}removePaymentPlan(n){if(!this.editable||this.busy||!this.plan?.paymentPlans?.[n])return;this.plan.paymentPlans.splice(n,1);let e=!this.editable||this.busy;this.paymentPlanFieldSets=this.plan.paymentPlans.map((i,o)=>this.buildPaymentPlanFields(i,o,e)),this.activePaymentPlanIndex=Math.max(0,Math.min(this.activePaymentPlanIndex,this.plan.paymentPlans.length-1)),this.buildRailTabs()}addPaymentPlanInstallment(n){n.payments=n.payments??[],n.payments.push({dueDate:null,amountDue:0,dueAtTimeOfRegistration:!1})}removePaymentPlanInstallment(n,e){n.payments.splice(e,1)}isFixedPaymentPlan(n){return n?.paymentInstallmentPlanTypeID===X.FIXED_DATES_AND_AMOUNTS}defaultPaymentPlan(){return{internalName:"",shortName:"",paymentInstallmentPlanTypeID:X.DYNAMIC_DATES_AND_AMOUNTS,startDate:null,endDate:null,notes:null,adminFee:null,excludeAdminFeeFromInitialPayment:!1,paymentInstallmentPlanInitialPaymentTypeID:null,amountDueAtRegistration:null,numberOfSubsequentPayments:null,paymentInstallmentPlanSubsequentPaymentDueDateOptionID:ct.DAY_OF_MONTH,subsequentPaymentDueDay:null,subsequentPaymentDueDaysAfterRegistration:null,finalDueDate:null,paymentInstallmentPlanOverageOptionID:re.SPREAD_ACROSS_SUBSEQUENT_PAYMENTS,monthsToSkip:[],skipRegistrationMonth:!1,priceDiscountCreditApplicationTypeID:ae.EQUALLY_DISTRIBUTE,priceDiscountPercentageCreditCalculationTypeID:oe.DEFAULT_PER_PAYMENT,payments:[],registrationIndexes:[]}}get newTeamNameMaxLength(){return this.findField(this.metadata?.newTeam?.fields??[],"name")?.maxLength??null}get newTeamShortNameMaxLength(){return this.findField(this.metadata?.newTeam?.fields??[],"shortName")?.maxLength??null}addNewTeam(){!this.editable||this.busy||!this.plan||(this.plan.newTeams=this.plan.newTeams??[],this.plan.newTeams.push({name:"",shortName:null}),this.refreshTeamsFieldSets())}removeNewTeam(n){!this.editable||this.busy||!this.plan?.newTeams?.[n]||(this.plan.newTeams.splice(n,1),this.remapNewTeamIndexe
545s(this.plan,[n]),this.refreshTeamsFieldSets())}remapNewTeamIndexes(n,e){if(!e.length)return;let i=new Set(e);(n.registrations??[]).forEach(o=>{o.teams?.newTeamIndexes?.length&&(o.teams.newTeamIndexes=o.teams.newTeamIndexes.filter(d=>!i.has(d)).map(d=>d-e.filter(h=>h<d).length))})}rebuildRegistrationFieldSets(){if(!this.metadata||!this.plan)return;let n=!this.editable||this.busy;this.registrationFieldSets=(this.plan.registrations??[]).map((e,i)=>this.buildRegistrationFields(e,i,n))}applyRegistrationFieldRules(n,e){let i=this.plan?.program?.programTypeID,o=i===F.TRAINING_SESSIONS,d=i===F.CAMPS_AND_CLINICS,h=e?.registrationCostTypeID??U.FIXED;this.setFieldHidden(n,"registrationCostTypeID",!o);let y=this.findField(n,"numberOfSessions");if(y){let O=o&&(h===U.FIXED||h===U.SUBSCRIPTION);y.hidden=!O,y.label=h===U.SUBSCRIPTION?"Number of Time Slots Per Month":"Number of Sessions",(O?mt:W)(y)}let w=this.findField(n,"price");w&&(w.hidden=o&&h===U.VARIABLE,w.label=d?"Session Price":o&&h===U.SUBSCRIPTION?"Monthly Price":"Price"),this.setFieldHidden(n,"secondaryPrice",!d);let b=this.isInvitational;["birthDateFrom","birthDateTo","genderID","ageClasses","gradeIDs","graduationYearFrom","graduationYearTo","maxCapacity","enableWaitlist"].forEach(O=>this.setFieldHidden(n,O,b)),this.setFieldHidden(n,"includeOtherGender",b||e?.genderID!==G.MALE&&e?.genderID!==G.FEMALE)}findField(n,e){return n?.find(i=>i.controlName===e)}setFieldHidden(n,e,i){let o=this.findField(n,e);o&&(o.hidden=i)}removePriceOverride(n,e){n.priceOverrides.splice(e,1)}get canBulkApply(){return this.editable&&(this.plan?.registrations?.length??0)>1}get applyToSelectedFieldCount(){return this.applyTo?.fields.filter(n=>n.selected).length??0}get applyToSelectedTargetCount(){return this.applyTo?.targets.filter(n=>n.selected).length??0}get allApplyToTargetsSelected(){return(this.applyTo?.targets.length??0)>0&&this.applyTo.targets.every(n=>n.selected)}get applyToCanConfirm(){return this.editable&&!this.busy&&this.applyToSelectedFieldCount>0&&this.applyToSelectedTargetCount>0}toggleAllApplyToTargets(){if(this.applyTo){let n=!this.allApplyToTargetsSelected;this.applyTo.targets.forEach(e=>e.selected=n)}}openApplyTo(n,e,i=!1){let o=this.plan?.registrations?.[n]?.[e],d=this.sectionMetadataFields(e).filter(b=>!b.hidden);if(!this.canBulkApply||!o||!d.length)return;let h=this.sectionEdits[n]?.[e]??new Set,y=d.map(b=>({controlName:b.controlName,label:this.plainText(b.label),valuePreview:this.applyToValuePreview(b,o[b.controlName]),edited:h.has(b.controlName),selected:h.has(b.controlName)})),w=(this.plan.registrations??[]).map((b,O)=>({index:O,name:b.name||`Registration ${O+1}`,selected:!0})).filter(b=>b.index!==n);i&&!this.applyToWouldChangeAnything(e,n,y,w)||(this.applyTo={sourceIndex:n,section:e,sectionLabel:e==="display"?"Display Options":"Email Settings",sourceName:this.plan.registrations[n].name||`Registration ${n+1}`,autoOpened:i,fields:y,targets:w})}cancelApplyTo(){this.applyTo?.autoOpened&&(this.applyToDeclined[this.applyTo.section]=!0),this.applyTo=null}confirmApplyTo(){let n=this.applyTo;if(!n||!this.applyToCanConfirm)return;let e=this.plan.registrations[n.sourceIndex][n.section],i=n.fields.filter(h=>h.selected).map(h=>h.controlName),o=n.targets.filter(h=>h.selected);n.section==="emailSettings"&&!i.includes("mode")&&e.mode==="OVERRIDE"&&i.push("mode"),o.forEach(h=>{let y=this.plan.registrations[h.index][n.section];i.forEach(w=>y[w]=e[w])});let d=!this.editable||this.busy;n.section==="display"?this.displayFieldSets=(this.plan.registrations??[]).map((h,y)=>this.cloneFields(this.metadata.display.fields,d,`disp-${y}`)):this.emailFieldSets=(this.plan.registrations??[]).map((h,y)=>this.cloneFields(this.metadata.emailSettings.fields,d,`email-${y}`)),this.applyTo=null,this.siteDataService.showSiteSuccessAlert(`${n.sectionLabel} copied to ${o.length} registration${o.length===1?"":"s"}. Use \u201CSave edits\u201D to keep the changes.`)}trackSectionEdits(n,e,i){let o=this.plan.registrations[n][e];if(!o)return[];let d=Object.keys(i).filter(y=>!this.sectionValuesEqual(i[y],o[y])),h=this.sectionEdits[n]?.[e];return h&&d.forEach(y=>h.add(y)),d}sectionValuesEqual(n,e){let i=n==null||n===""?null:n,o=e==null||e===""?null:e;return i===o||i===!1&&o===null||i===null&&o===!1?!0:Array.isArray(i)&&Array.isArray(o)?JSON.stringify(i)===JSON.stringify(o):typeof i=="string"&&typeof o=="str
545ing"&&(i.includes("<")||o.includes("<"))?this.plainText(i)===this.plainText(o):!1}maybeAutoOpenApplyTo(n,e,i){if(!this.canBulkApply||this.applyTo||this.applyToDeclined[e])return;let o=this.sectionMetadataFields(e);i.some(h=>{let y=o.find(w=>w.controlName===h);return!!y&&S.DiscreteFieldTypes.includes(y.dynamicFormFieldTypeID)})&&this.openApplyTo(n,e,!0)}applyToWouldChangeAnything(n,e,i,o){let d=this.plan.registrations[e][n],h=i.filter(y=>y.selected).map(y=>y.controlName);return o.some(y=>{let w=this.plan.registrations[y.index][n];return!!w&&h.some(b=>!this.sectionValuesEqual(d[b],w[b]))})}sectionMetadataFields(n){return(n==="display"?this.metadata?.display?.fields:this.metadata?.emailSettings?.fields)??[]}applyToValuePreview(n,e){if(n.dynamicFormFieldTypeID===V.CHECKBOX||n.dynamicFormFieldTypeID===V.INPUT_SWITCH)return e?"Yes":"No";if(n.dynamicFormFieldTypeID===V.DROPDOWN||n.dynamicFormFieldTypeID===V.RADIO_GROUP){let o=(n.options??[]).find(d=>d.value===e);if(o)return o.label}let i=typeof e=="string"?this.plainText(e):e==null?"":String(e);return i?i.length>80?`${i.slice(0,80)}\u2026`:i:"Not set"}resetApplyToState(){this.sectionEdits=(this.draft?.plan?.registrations??[]).map(()=>({display:new Set,emailSettings:new Set})),this.applyToDeclined={display:!1,emailSettings:!1},this.applyTo=null}save(){!this.editable||this.busy||(this.setBusy("saving",!0),this.registrationAgentService.updateDraftPlan(this.draft.draftID,this.cleanPlan()).pipe(B(this.unsubscribe$)).subscribe({next:n=>{this.setBusy("saving",!1),this.draftChange.emit(n)},error:n=>{this.setBusy("saving",!1),this.siteDataService.showSiteErrorAlert(this.extractErrorMessage(n)||"There was a problem saving your edits. Please try again.")}}))}apply(){this.setBusy("applying",!0),this.registrationAgentService.applyDraft(this.draft.draftID).pipe(B(this.unsubscribe$)).subscribe({next:n=>{this.setBusy("applying",!1),this.showApplyConfirm=!1,this.applied.emit(n?.programID)},error:n=>{this.setBusy("applying",!1),this.showApplyConfirm=!1,this.siteDataService.showSiteErrorAlert(this.extractErrorMessage(n)||"There was a problem applying the draft. Please try again.")}})}discard(){this.setBusy("discarding",!0),this.registrationAgentService.discardDraft(this.draft.draftID).pipe(B(this.unsubscribe$)).subscribe({next:()=>{this.setBusy("discarding",!1),this.showDiscardConfirm=!1,this.discarded.emit()},error:n=>{this.setBusy("discarding",!1),this.showDiscardConfirm=!1,this.siteDataService.showSiteErrorAlert(this.extractErrorMessage(n)||"There was a problem discarding the draft. Please try again.")}})}undo(){this.setBusy("undoing",!0),this.registrationAgentService.undoDraft(this.draft.draftID).pipe(B(this.unsubscribe$)).subscribe({next:()=>{this.setBusy("undoing",!1),this.showUndoConfirm=!1,this.undone.emit()},error:n=>{this.setBusy("undoing",!1),this.showUndoConfirm=!1,this.siteDataService.showSiteErrorAlert(this.extractErrorMessage(n)||"There was a problem undoing the applied draft. Please try again.")}})}setBusy(n,e){this[n]=e,this.buildFieldSets()}clonePlan(n){let e=JSON.parse(JSON.stringify(n??{}));return e.program&&(e.program.startDate=this.toFormDate(e.program.startDate),e.program.endDate?.startsWith("9999")&&(e.program.endDate=null),e.program.endDate=this.toFormDate(e.program.endDate),e.program.accrualStartDate=this.toFormDate(e.program.accrualStartDate),e.program.accrualEndDate=this.toFormDate(e.program.accrualEndDate),e.program.effectiveDate=this.datePart(e.program.effectiveDate),e.program.eligibilityEndDate=this.datePart(e.program.eligibilityEndDate)),e.registrations=(e.registrations??[]).map(i=>(i.startDate=this.toFormDate(i.startDate),i.endDate=this.toFormDate(i.endDate),i.birthDateFrom=this.toFormDate(i.birthDateFrom),i.birthDateTo=this.toFormDate(i.birthDateTo),i.priceOverrides=(i.priceOverrides??[]).map(o=>(o.startDate=this.datePart(o.startDate),o.endDate=this.datePart(o.endDate),o)),i.ageClasses=i.ageClasses??[],i.gradeIDs=i.gradeIDs??[],i.teams=i.teams??{teamIDs:[],newTeamIndexes:[]},i.teams.teamIDs=i.teams.teamIDs??[],i.teams.newTeamIndexes=i.teams.newTeamIndexes??[],i.exclusions=i.exclusions??{preventSeasonOverlap:!1,excludedReg
545istrationIDs:[],excludedSiblingIndexes:[]},i.exclusions.excludedRegistrationIDs=i.exclusions.excludedRegistrationIDs??[],i.exclusions.excludedSiblingIndexes=i.exclusions.excludedSiblingIndexes??[],i.display=i.display??{hideInOpenPrograms:!1,registerButtonText:null,continueRegistrationButtonText:null,confirmationText:null},i.emailSettings=i.emailSettings??{mode:"INHERIT",subject:null,header:null,body:null,bccEmail:null,includeReceipt:null,incompleteSubject:null,incompleteHeader:null,incompleteBody:null},i.emailSettings.mode=i.emailSettings.mode??"INHERIT",i)),e.newTeams=e.newTeams??[],e.paymentPlans=(e.paymentPlans??[]).map(i=>(i.startDate=this.toFormDate(i.startDate),i.endDate=this.toFormDate(i.endDate),i.finalDueDate=this.toFormDate(i.finalDueDate),i.monthsToSkip=i.monthsToSkip??[],i.registrationIndexes=i.registrationIndexes??[],i.payments=(i.payments??[]).map(o=>(o.dueDate=this.datePart(o.dueDate),o)),i)),e}cleanPlan(){let n=JSON.parse(JSON.stringify(this.plan));n.newTeams=n.newTeams??[];let e=n.newTeams.map((i,o)=>({team:i,index:o})).filter(i=>!i.team.name?.trim()&&!i.team.shortName?.trim()).map(i=>i.index);return e.length&&(n.newTeams=n.newTeams.filter((i,o)=>!e.includes(o)),this.remapNewTeamIndexes(n,e)),n.newTeams.forEach(i=>{i.name=(i.name??"").trim(),i.shortName=this.nullIfEmpty(i.shortName?.trim()??null)}),n.paymentPlans=(n.paymentPlans??[]).filter(i=>i.internalName?.trim()||i.shortName?.trim()).map(i=>(i.internalName=(i.internalName??"").trim(),i.shortName=(i.shortName??"").trim(),i.startDate=this.nullIfEmpty(i.startDate),i.endDate=this.nullIfEmpty(i.endDate),i.finalDueDate=this.nullIfEmpty(i.finalDueDate),i.notes=this.nullIfEmpty(i.notes),i.paymentInstallmentPlanTypeID===X.DYNAMIC_DATES_AND_AMOUNTS?i.payments=[]:i.payments=(i.payments??[]).map(o=>(o.dueDate=this.nullIfEmpty(o.dueDate),o)),i)),n.program&&(n.program.endDate=this.nullIfEmpty(n.program.endDate),n.program.effectiveDate=this.nullIfEmpty(n.program.effectiveDate),n.program.accrualStartDate=this.nullIfEmpty(n.program.accrualStartDate),n.program.accrualEndDate=this.nullIfEmpty(n.program.accrualEndDate),n.program.eligibilityEndDate=this.nullIfEmpty(n.program.eligibilityEndDate),n.program.shortDescription=this.nullIfEmpty(n.program.shortDescription),n.program.details=this.nullIfEmpty(n.program.details)),n.registrations=(n.registrations??[]).map(i=>{i.endDate=this.nullIfEmpty(i.endDate),i.birthDateFrom=this.nullIfEmpty(i.birthDateFrom),i.birthDateTo=this.nullIfEmpty(i.birthDateTo),i.shortDescription=this.nullIfEmpty(i.shortDescription),i.registrationCostTypeID=i.registrationCostTypeID??U.FIXED;let o=n.program?.programTypeID;if(o!==F.CAMPS_AND_CLINICS&&(i.secondaryPrice=null),o!==F.TRAINING_SESSIONS&&(i.numberOfSessions=null),n.program?.programInvitationTypeID===bt.INVITATIONAL_WITH_REGISTRATION&&(i.birthDateFrom=null,i.birthDateTo=null,i.genderID=null,i.includeOtherGender=!1,i.ageClasses=[],i.gradeIDs=[],i.graduationYearFrom=null,i.graduationYearTo=null,i.maxCapacity=null,i.enableWaitlist=!1,i.exclusions=null),i.priceOverrides=(i.priceOverrides??[]).map(d=>(d.label=this.nullIfEmpty(d.label),d.endDate=this.nullIfEmpty(d.endDate),d)),i.teams&&!i.teams.teamIDs?.length&&!i.teams.newTeamIndexes?.length&&(i.teams=null),i.exclusions&&!i.exclusions.preventSeasonOverlap&&!i.exclusions.excludedRegistrationIDs?.length&&!i.exclusions.excludedSiblingIndexes?.length&&(i.exclusions=null),i.display&&(i.display.registerButtonText=this.nullIfEmpty(i.display.registerButtonText),i.display.continueRegistrationButtonText=this.nullIfEmpty(i.display.continueRegistrationButtonText),i.display.confirmationText=this.nullIfEmpty(i.display.confirmationText),!i.display.hideInOpenPrograms&&!i.display.registerButtonText&&!i.display.continueRegistrationButtonText&&!i.display.confirmationText&&(i.display=null)),i.emailSettings){let d=i.emailSettings;d.subject=this.nullIfEmpty(d.subject),d.header=this.nullIfEmpty(d.header),d.body=this.nullIfEmpty(d.body),d.bccEmail=this.nullIfEmpty(d.bccEmail),d.incompleteSubject=this.nullIfEmpty(d.incompleteSubject),d.incompleteHeader=this.nullIfEmpty(d.incompleteHeader),d.incompleteBody=this.nullIfEmpty(d.incompleteBody),(d.mode??"INHERIT")==="INHERIT"&&(i.emailSettings=null)}return i}),n}toFormDate(n){let e=this.datePart(n);return e?`${e}T00:00:00`:null}toStoredDate(n){if(!n)return null;if(n instanceof Date)return isNaN(n.getTime())?null:this.formatLocalDate(n);let e=this.datePart(n);if(e)return e;let i=new Date(n);return isNaN(i.getTime())?null:this.formatLocalDate(i)}normalizeDates(n,e){e.forEach(i=>
545{n[i]!==void 0&&(n[i]=this.toStoredDate(n[i]))})}datePart(n){let e=n?/^(\d{4}-\d{2}-\d{2})/.exec(String(n)):null;return e?e[1]:null}formatLocalDate(n){let e=i=>String(i).padStart(2,"0");return`${n.getFullYear()}-${e(n.getMonth()+1)}-${e(n.getDate())}`}nullIfEmpty(n){return n||null}extractErrorMessage(n){return typeof n?.error=="string"&&n.error?n.error:n?.error?.message?n.error.message:null}};S.DiscreteFieldTypes=[V.CHECKBOX,V.DROPDOWN,V.RADIO_GROUP,V.MULTISELECT,V.CHECKBOX_GROUP,V.SELECT_BUTTON,V.INPUT_SWITCH,V.CHECKBOX_GROUP_PILLS],S.StepBasics=1,S.StepDetails=2,S.RegistrationsSectionID="plan-registrations",S.PaymentPlansSectionID="plan-payment-plans",S.ExplainCooldownMs=1500,S.ProgramDateFields=["startDate","endDate","accrualStartDate","accrualEndDate"],S.RegistrationDateFields=["startDate","endDate","birthDateFrom","birthDateTo"],S.PaymentPlanDateFields=["startDate","endDate","finalDueDate"],S.\u0275fac=function(e){return new(e||S)($(q),$(rt))},S.\u0275cmp=K({type:S,selectors:[["app-registration-agent-draft-review"]],inputs:{draft:"draft",locked:"locked"},outputs:{draftChange:"draftChange",applied:"applied",discarded:"discarded",undone:"undone"},standalone:!1,features:[Et],decls:1,vars:1,consts:[["footer",""],[1,"card","bg-secondary","mb-3","p-0"],[1,"card-header","border-bottom","p-3","d-flex","align-items-center","justify-content-between"],[1,"fw-600"],[1,"fa-regular","fa-clipboard-check","mr-1"],[1,"d-flex","align-items-center"],["status","default","styleClass","mr-1",3,"text"],[3,"status","text"],[1,"card-body","px-3","pb-3","text-small"],[1,"text-default","mb-0"],[1,"d-flex","flex-wrap","align-items-center","border-top","pt-3"],[1,"border-top","mt-3","pt-3"],[1,"text-small","text-grey","mb-2"],[1,"fa-regular","fa-circle-check","text-green","mr-1"],[1,"fw-600","text-medium",3,"routerLink"],[1,"fa-regular","fa-layer-group","mr-1"],[1,"fa-regular","fa-external-link","ml-1","text-small"],[1,"no-bullets","p-0","m-0","mt-2"],[1,"mb-1"],[1,"text-small",3,"routerLink"],[1,"fa-regular","fa-clipboard-list","mr-1"],[1,"text-small","text-grey"],[1,"d-flex","flex-wrap","border-all","border-radius","bg-secondary","p-3","mb-3"],[1,"mr-4"],[1,"small-label","d-block"],[1,"fw-600","text-red"],["role","tablist","aria-label","Review steps",1,"d-flex","align-items-center","mb-3"],["type","button","role","tab",1,"btn","btn-sm","mr-2",3,"click"],[1,"fa-regular","fa-1","mr-1"],["aria-hidden","true",1,"fa-regular","fa-chevron-right","text-grey","text-small","mr-2"],["type","button","role","tab",1,"btn","btn-sm",3,"click"],[1,"fa-regular","fa-2","mr-1"],[1,"text-small","text-grey","mb-3"],["alertType","error",1,"d-block","mb-3",3,"isInline"],[1,"fw-700","d-block","mb-1"],[1,"m-0","pl-3"],[1,"line-height-1"],["type","button",1,"btn","btn-naked","btn-sm",3,"click"],[1,"fa-regular","fa-arrow-right","ml-1"],[1,"border-bottom","mb-3"],[1,"card-header"],[1,"text-h4","mt-4"],[1,"card-body"],["formID","plan-program",3,"valueChanges","fieldExplainClick","fields","entity","saveBlankFields","showSubmitButton","showCancelButton","subscribeToFormServiceErrors"],[1,"card","box-shadow-sm","border-radius-lg","mb-3"],[1,"fa-regular","fa-people-group","mr-1"],[1,"table-responsive"],[1,"table","table-sm","mb-0"],["scope","col"],[1,"sr-only"],[1,"sr-only",3,"for"],["type","text","placeholder","Full team name",1,"form-control",3,"ngModelChange","blur","id","ngModel","disabled"],["type","text",1,"form-control",3,"ngModelChange","id","ngModel","disabled"],[1,"align-middle"],["type","button",1,"btn","btn-naked","btn-sm",3,"click","disabled"],[1,"fa-regular","fa-trash"],["type","button",1,"btn","btn-naked","btn-sm","mt-2",3,"click","disabled"],[1,"fa-regular","fa-plus","mr-1"],[1,"card","box-shadow-sm","border-radius-lg","mb-3",3,"id"],[1,"fa-regular","fa-money-check-dollar","mr-1"],[1,"row"],[1,"col-md"],[1,"col-md-auto"],[3,"tabClick","tabs","activeTab"],[1,"d-flex","align-items-center","justify-content-between","mb-2"],[1,"small-label"],[3,"valueChanges","formID","fields","entity","saveBlankFields","showSubmitButton","showCancelButton","subscribeToFormServiceErrors"],[1,"text-grey"],[1,"mt-2"],["type","date",1,"form-control",3,"ngModelChange","id","ngModel","disabled"],["type","number","min","1","step","0.01",1,"form-control",3,"ngModelChange","id","ngModel","disabled"],[1,"align-middle","text-center"],["type","checkbox",3,"ngModelChange","id","ngModel","disabled"],["colspan","4",1,"text-small","text-grey"],["type","button",1,"btn","btn-naked","btn-sm","mt-3",3,"click","disabled"],[1,"border-bottom","mb-3",3,"id"],[1,"small-label","d-block","mb-2"],[3,"valueChanges","fieldExplainClick","formID","fields","entity","saveBlankFields","showSubmitButton","showCancelButton","subscribeToFormServiceErrors"],[1,"mb-3"],[1,"small-label","d-block","mb-2","border-bottom","full-width","mt-5"],[1,"text-small","text-grey","mb-0"],[1,"d-flex","align-items-center","justify-content-between","d-block","border-bottom","full-width","mt-5"],[1,"d-flex","align-items-center","justify-content-between","mb-2","mb-2","border-bottom","full-width","mt-5"],[1,"fa-regular","fa-copy","mr-1"],[1,"text-small","mb-1"],[1,"text-small","m-0","pl-3"],[1,"border-top","pt-2"],["type","text","placeholder","Early bird",1,"form-control","col-auto",3,"ngModelChange","id","ngModel","disabled"],["type","number","min","0","step","0.01",1,"form-control","col-auto",3,"ngModelChange","id","ngModel","disabled"],["type","date",1,"form-control","col-auto",3,"ngModelChange","id","ngModel","disabled"],[1,"d-flex","align-items-center","justify-content-between","border-top","pt-2"],[1,"fa-regular","fa-arrow-left","mr-1"],[1,"fa-regular","fa-circle-question","mr-1"],["role","status",1,"text-small","text-grey","mb-2"],[1,"fa","fa-spinner","fa-spin","mr-1"],["type","button",1,"btn","btn-secondary","mr-2","mb-2",3,"click","disabled"],["type","button",1,"btn","btn-naked","mb-2",3,"click","disabled"],["type","button",1,"btn","btn-naked","mr-2","mb-2",3,"click","disabled"],["type","button",1,"btn","btn-primary","mr-2","mb-2",3,"click","disabled"],[1,"mr-3","mb-2",3,"routerLink"],[1,"fa-regular","fa-external-link","mr-1"],["type","button",1,"btn","btn-red","mb-2",3,"click","disabled"],["appendTo","body","styleClass","standardWidthDialog",3,"visible","modal","closable","header"],[1,"text-medium","mb-3"],[1,"no-bullets","p-0","m-0","mb-3"],[1,"d-flex","align-items-center","justify-content-between","border-top","pt-3","mb-2"],[1,"fa-regular","fa-circle-info","mr-1"],[1,"mb-2"],[1,"d-flex","align-items-start","mb-0"],["type","checkbox",1,"mt-1","mr-2",3,"ngModelChange","ngModel"],[1,"d-block"],["status","info","text","edited","styleClass","ml-1"],[1,"d-flex","align-items-center","mb-0"],["type","checkbox",1,"mr-2",3,"ngModelChange","ngModel"],["slot","secondary"],["type","button",1,"btn","btn-lg","btn-naked",3,"click"],["slot","primary"],["type","button",1,"btn","btn-lg","btn-primary",3,"click","disabled"],["headerText","Apply to live","modalText","This will create the program and registrations on your live site, attributed to the AI assistant.","yesButtonText","Yes, Apply","yesButtonLoadingText","Applying...","noButtonText","Cancel","alertType","info",3,"onYesSelect","onNoSelect","loading"],["headerText","Discard draft","modalText","Are you sure you want to discard this draft? This cannot be undone.","yesButtonText","Yes, Discard","yesButtonLoadingText","Discarding...","noButtonText","Cancel","alertType","warning",3,"onYesSelect","onNoSelect","loading"],["headerText","Undo applied draft","modalText","This will remove the program, registrations, payment plans, and any new teams the assistant created (teams already in use are kept). Not available once players have registered.","yesButtonText","Yes, Undo","yesButtonLoadingText","Undoing...","noButtonText","Cancel","alertType","warning",3,"onYesSelect","onNoSelect","loading"]],template:function(e,i){e&1&&c(0,zi,49,22),e&2&&p(i.draft&&i.plan?0:-1)},dependencies:[Yt,nt,Vt,kt,at,Ot,ot,lt,Ut,st,dt,Xt,Jt,qt,Gt,Ft,Nt],encapsulation:2});var _t=S;var tn=(a,n)=>n.sequence;function en(a,n){if(a&1){let e=g();t(0,`
546 `),r(1,"label",5),t(2,"Recent sessions"),l(),t(3,` 547 `),r(4,"p-select",6),f("ngModelChange",function(o){x(e);let d=m(2);return u(d.openSession(o))}),t(5,` 548 `),l(),t(6,` 549 `)}if(a&2){let e=m(2);s(4),_("options",e.sessionOptions)("ngModel",e.selectedSessionID)}}function nn(a,n){if(a&1){let e=g();t(0,` 550 `),r(1,"button",7),f("click",function(){x(e);let o=m(2);return u(o.startOver())}),t(2,` 551 `),C(3,"i",8),t(4,`New Draft 552 `),l(),t(5,` 553 `)}}function an(a,n){if(a&1&&(t(0,` 554 `),r(1,"span",4),t(2,` 555 `),c(3,en,7,2),c(4,nn,6,0),l(),t(5,` 556 `)),a&2){let e=m();s(3),p(e.sessionOptions.length?3:-1),s(),p(e.session?4:-1)}}function on(a,n){a&1&&(t(0,` 557 `),r(1,"app-inline-alert",9),t(2,` 558 The AI Registration Setup Assistant is not enabled for your club. Contact Sprocket Sports support if you would 559 like to join the beta. 560 `),l(),t(3,` 561 `)),a&2&&(s(),_("isInline",!0))}function rn(a,n){a&1&&(t(0,` 562 `),r(1,"div",14),t(2,` 563 `),r(3,"div"),t(4,` 564 `),r(5,"h2",15),t(6,"Run it again for next season"),l(),t(7,` 565 `),l(),t(8,` 566 `),l(),t(9,` 567 `))}function ln(a,n){if(a&1&&(t(0,` 568 `),c(1,rn,10,0)),a&2){let e=m(2);s(),p(e.sourceProgramId?1:-1)}}function sn(a,n){a&1&&(t(0,` 569 `),r(1,"app-loader"),t(2,"Loading session..."),l(),t(3,` 570 `))}function dn(a,n){if(a&1){let e=g();t(0,` 571 `),r(1,"div"),t(2,` 572 `),r(3,"app-registration-agent-draft-review",16),f("draftChange",function(o){x(e);let d=m(2);return u(d.onDraftChange(o))})("applied",function(o){x(e);let d=m(2);return u(d.onApplied(o))})("discarded",function(){x(e);let o=m(2);return u(o.onDiscarded())})("undone",function(){x(e);let o=m(2);return u(o.onUndone())}),t(4,` 573 `),l(),t(5,` 574 `),l(),t(6,` 575 `)}if(a&2){let e=m(2);s(),M(e.workColumnClass),s(2),_("draft",e.session.draft)("locked",e.isProcessing(e.session.statusID))}}function mn(a,n){if(a&1&&(t(0," "),r(1,"span",26),t(2),l(),t(3," ")),a&2){let e=m(4);s(2),D(e.sourceProgramName)}}function cn(a,n){a&1&&t(0," this program ")}function pn(a,n){if(a&1){let e=g();t(0,` 576 `),t(1,` 577 `),r(2,"div",17),t(3,` 578 579 `),r(4,"p",18),t(5,` 580 The assistant will rebuild 581 `),c(6,mn,4,1)(7,cn,1,0),t(8,` 582 for the upcoming season \u2014 same registrations, pricing tiers and eligibility \u2014 and roll every 583 date forward a year. Tell it anything that should change, or leave it blank to duplicate as-is. 584 Nothing goes live until you approve the draft. 585 `),l(),t(9,` 586 `),l(),t(10,` 587 588 `),r(11,"div",19),t(12,` 589 `),r(13,"label",20),t(14,"Any changes for next season? "),r(15,"span",21),t(16,"(optional)"),l()(),t(17,` 590 `),r(18,"textarea",22),A("ngModelChange",function(o){x(e);let d=m(3);return R(d.prompt,o)||(d.prompt=o),u(o)}),l(),t(19,` 591 `),l(),t(20,` 592 593 `),r(21,"div",23),t(22,` 594 `),r(23,"button",24),f("click",function(){x(e);let o=m(3);return u(o.clearSourceProgram())}),t(24,` 595 Start from scratch instead 596 `),l(),t(25,` 597 `),r(26,"button",25),f("click",function(){x(e);let o=m(3);return u(o.startSession())}),t(27,` 598 `),C(28,"i"),t(29),l(),t(30,` 599 `),l(),t(31,` 600 `)}if(a&2){let e=m(3);s(6),p(e.sourceProgramName?6:7),s(12),P("ngModel",e.prompt),s(8),_("disabled",e.starting),s(2),M(e.starting?"fa fa-spinner fa-spin mr-1":"fa-duotone fa-sparkles mr-1"),s(),E(` 601 `,e.starting?"Starting\u2026":"Draft next season",` 602 `)}}function _n(a,n){if(a&1){let e=g();t(0,` 603 `),r(1,"app-checkbox-row",35),A("ngModelChange",function(o){x(e);let d=m(4);return R(d.prompt,o)||(d.prompt=o),u(o)}),t(2,` 604 `),l(),t(3,` 605 `)}if(a&2){let e=n.$implicit,i=n.$index,o=m(4);s(),_("compact",!0)("inputId","examplePrompt-"+i)("optionValue",e),P("ngModel",o.prompt),_("label",e)}}function xn(a,n){if(a&1){let e=g();t(0,` 606 `),r(1,"input",36,1),f("change",function(o){x(e);let d=m(4);return u(d.onFileSelected(o))}),l(),t(3,` 607 `),r(4,"button",37),f("click",function(){x(e);let o=It(2);return u(o.click())}),t(5,` 608 `),C(6,"i",38),t(7,`Choose a document
609 `),l(),t(8,` 610 `)}if(a&2){let e=m(4);s(),_("accept",e.acceptedDocumentTypes)}}function un(a,n){if(a&1){let e=g();t(0,` 611 `),r(1,"div",39),t(2,` 612 `),r(3,"span",40),C(4,"i",41),t(5),l(),t(6,` 613 `),r(7,"button",42),f("click",function(){x(e);let o=m(4);return u(o.clearSelectedFile())}),t(8,` 614 Remove 615 `),l(),t(9,` 616 `),r(10,"button",43),f("click",function(){x(e);let o=m(4);return u(o.startFromDocument())}),t(11,` 617 `),C(12,"i"),t(13),l(),t(14,` 618 `),l(),t(15,` 619 `)}if(a&2){let e=m(4);s(5),D(e.selectedFile.name),s(2),_("disabled",e.uploading),s(3),_("disabled",e.uploading),s(2),M(e.uploading?"fa fa-spinner fa-spin mr-1":"fa-duotone fa-sparkles mr-1"),s(),E(` 620 `,e.uploading?"Reading\u2026":"Set up from this document",` 621 `)}}function Cn(a,n){if(a&1){let e=g();t(0,` 622 623 624 625 626 `),r(1,"div",27),t(2,` 627 `),C(3,"hr",28),t(4,` 628 `),r(5,"span",29),t(6,"Set up a registration with AI"),l(),t(7,` 629 `),C(8,"hr",28),t(9,` 630 `),l(),t(10,` 631 632 `),r(11,"div",30),t(12,` 633 `),r(13,"strong"),t(14,"Describe the registration"),l(),t(15," you want to set up \u2014 "),r(16,"strong"),t(17,`programs, pricing, early-bird discounts, 634 eligibility`),l(),t(18," \u2014 and the assistant will draft it for your review. "),r(19,"strong"),t(20,`Nothing goes live until you 635 approve it`),l(),t(21,`. 636 `),l(),t(22,` 637 638 `),r(23,"div",31),t(24,"Try an example \u2014 pick a prompt that matches the registration you'd like to create."),l(),t(25,` 639 `),r(26,"div",32),t(27,` 640 `),T(28,_n,4,5,null,null,N),l(),t(30,` 641 642 `),r(31,"div",19),t(32,` 643 `),r(33,"label",20),t(34,"What would you like to set up?"),l(),t(35,` 644 `),r(36,"textarea",33),A("ngModelChange",function(o){x(e);let d=m(3);return R(d.prompt,o)||(d.prompt=o),u(o)}),l(),t(37,` 645 `),l(),t(38,` 646 647 `),r(39,"div"),t(40,` 648 `),r(41,"button",25),f("click",function(){x(e);let o=m(3);return u(o.startSession())}),t(42,` 649 `),C(43,"i"),t(44),l(),t(45,` 650 `),l(),t(46,` 651 652 `),t(47,` 653 `),r(48,"div",27),t(49,` 654 `),C(50,"hr",28),t(51,` 655 `),r(52,"span",29),t(53,"Or set up from a document"),l(),t(54,` 656 `),C(55,"hr",28),t(56,` 657 `),l(),t(57,` 658 659 `),r(58,"div",34),t(59,` 660 Upload your internal setup sheet \u2014 Excel, Word or CSV \u2014 and the assistant will read it and draft 661 the registrations it describes. Anything you type above is used as extra instruction. 662 `),l(),t(60,` 663 `),c(61,xn,9,1)(62,un,16,6)}if(a&2){let e=m(3);s(28),I(e.examplePrompts),s(8),P("ngModel",e.prompt),s(5),_("disabled",e.starting||!e.prompt.trim()),s(2),M(e.starting?"fa fa-spinner fa-spin mr-1":"fa-duotone fa-sparkles mr-1"),s(),E(` 664 `,e.starting?"Starting\u2026":"Draft my registration",` 665 `),s(17),p(e.selectedFile?62:61)}}function fn(a,n){if(a&1&&(t(0,` 666 `),c(1,pn,32,6)(2,Cn,63,6)),a&2){let e=m(2);s(),p(e.sourceProgramId?1:2)}}function gn(a,n){a&1&&(t(0," "),C(1,"app-pill",56),t(2," "))}function hn(a,n){a&1&&(t(0," "),C(1,"app-pill",57),t(2," "))}function yn(a,n){a&1&&(t(0," "),C(1,"app-pill",58),t(2," "))}function bn(a,n){if(a&1&&(t(0,` 667 `),r(1,"span",59),t(2),l(),t(3,` 668 `)),a&2){let e=m().$implicit;s(2),D(e.rationale)}}function Sn(a,n){if(a&1&&(t(0,` 669 `),r(1,"tr"),t(2,` 670 `),r(3,"td",26),t(4),l(),t(5,` 671 `),r(6,"td"),t(7,` 672 `),c(8,gn,3,0)(9,hn,3,0)(10,yn,3,0),t(11,`
673 `),l(),t(12,` 674 `),r(13,"td",55),t(14),c(15,bn,4,1),l(),t(16,` 675 `),l(),t(17,` 676 `)),a&2){let e,i=n.$implicit;s(4),D(i.name),s(4),p((e=i.basis)==="REUSE"?8:e==="CLONE_AND_TAILOR"?9:10),s(6),E(` 677 `,i.keyDetails,` 678 `),s(),p(i.rationale?15:-1)}}function vn(a,n){if(a&1&&(t(0,` 679 `),r(1,"li"),t(2),l(),t(3,` 680 `)),a&2){let e=n.$implicit;s(2),D(e)}}function wn(a,n){if(a&1&&(t(0,` 681 `),r(1,"app-inline-alert",60),t(2,` 682 `),r(3,"span",61),t(4,"The assistant still needs to know"),l(),t(5,` 683 `),r(6,"ul",62),t(7,` 684 `),T(8,vn,4,1,null,null,N),l(),t(10,` 685 `),l(),t(11,` 686 `)),a&2){let e=m(4);s(),_("isInline",!0),s(7),I(e.session.outline.outline.openQuestions)}}function Dn(a,n){if(a&1){let e=g();t(0,` 687 `),r(1,"div",47),t(2,` 688 `),r(3,"span",48),C(4,"i",49),t(5,"Plan of action"),l(),t(6,` 689 `),r(7,"p",50),t(8,` 690 Here's what the assistant plans to build. Approve it to continue, or tell it what to change below. 691 `),l(),t(9,` 692 `),r(10,"div",51),t(11,` 693 `),r(12,"table",52),t(13,` 694 `),r(14,"thead"),t(15,` 695 `),r(16,"tr"),t(17,` 696 `),r(18,"th",53),t(19,"Registration"),l(),t(20,` 697 `),r(21,"th",53),t(22,"Form"),l(),t(23,` 698 `),r(24,"th",53),t(25,"Details"),l(),t(26,` 699 `),l(),t(27,` 700 `),l(),t(28,` 701 `),r(29,"tbody"),t(30,` 702 `),T(31,Sn,18,4,null,null,N),l(),t(33,` 703 `),l(),t(34,` 704 `),l(),t(35,` 705 `),c(36,wn,12,1),r(37,"button",54),f("click",function(){x(e);let o=m(3);return u(o.approveOutline())}),t(38,` 706 `),C(39,"i"),t(40),l(),t(41,` 707 `),l(),t(42,` 708 `)}if(a&2){let e=m(3);s(31),I(e.session.outline.outline.registrations),s(5),p(e.session.outline.outline.openQuestions!=null&&e.session.outline.outline.openQuestions.length?36:-1),s(),_("disabled",e.approvingOutline),s(2),M(e.approvingOutline?"fa fa-spinner fa-spin mr-1":"fa-regular fa-check mr-1"),s(),E(` 709 `,e.approvingOutline?"Building\u2026":"Approve & build",` 710 `)}}function En(a,n){if(a&1&&(t(0,` 711 `),r(1,"li"),t(2),l(),t(3,` 712 `)),a&2){let e=n.$implicit;s(2),D(e)}}function Tn(a,n){if(a&1&&(t(0,` 713 `),r(1,"app-inline-alert",63),t(2,` 714 `),r(3,"span",61),t(4,"Assumptions the assistant made"),l(),t(5,` 715 `),r(6,"ul",62),t(7,` 716 `),T(8,En,4,1,null,null,N),l(),t(10,` 717 `),l(),t(11,` 718 `)),a&2){let e=m(3);s(),_("isInline",!0),s(7),I(e.session.draft.plan.assumptions)}}function In(a,n){if(a&1&&(t(0,` 719 `),r(1,"li"),t(2),l(),t(3,` 720 `)),a&2){let e=n.$implicit;s(2),D(e)}}function Pn(a,n){if(a&1&&(t(0,` 721 `),r(1,"li"),t(2),l(),t(3,` 722 `)),a&2){let e=n.$implicit;s(2),D(e)}}function Rn(a,n){if(a&1&&(t(0,` 723 `),r(1,"app-inline-alert",64),t(2,` 724 `),r(3,"span",61),t(4,"Worth a look"),l(),t(5,` 725 `),r(6,"ul",62),t(7,` 726 `),T(8,In,4,1,null,null,N),T(10,Pn,4,1,null,null,N),l(),t(12,` 727 `),l(),t(13,` 728 `)),a&2){let e=m(3);s(),_("isInline",!0),s(7),I(e.session.draft==null||e.session.draft.plan==null?null:e.session.draft.plan.warnings),s(2),I(e.session.draft==null||e.session.draft.validation==null?null:e.session.draft.validation.warnings)}}function An(a,n){a&1&&(t(0,` 729 `),r(1,"div",65),t(2,` 730 `),C(3,"i",66),t(4,` 731 `),r(5,"span",67),t(6,"The assistant is working on your draft\u2026"),l(),t(7,`
732 `),l(),t(8,` 733 `))}function Fn(a,n){if(a&1){let e=g();t(0,` 734 `),r(1,"app-agent-question-panel",69),f("answeredChange",function(o){x(e);let d=m(4);return u(d.questionsAnswered=o)})("quickAnswer",function(){x(e);let o=m(4);return u(o.onQuickAnswer())}),t(2,` 735 `),l(),t(3,` 736 `)}if(a&2){let e=m(4);s(),_("questions",e.activeQuestions)("questionKey",e.activeQuestionMessageID)("disabled",e.sendingReply)}}function Nn(a,n){if(a&1){let e=g();t(0,` 737 `),r(1,"div",47),t(2,` 738 739 `),t(3,` 740 `),c(4,Fn,4,3),r(5,"app-agent-reply-composer",68),A("valueChange",function(o){x(e);let d=m(3);return R(d.reply,o)||(d.reply=o),u(o)}),f("send",function(){x(e);let o=m(3);return u(o.submitReply())}),t(6,` 741 `),l(),t(7,` 742 `),l(),t(8,` 743 `)}if(a&2){let e=m(3);s(4),p(e.showQuestionPanel?4:-1),s(),_("label",e.composerLabel)("placeholder",e.composerPlaceholder)("hint",e.composerHint)("sending",e.sendingReply)("canSend",e.canSubmit)("sendLabel",e.sendLabel),P("value",e.reply)}}function kn(a,n){a&1&&(t(0,` 744 `),r(1,"p",70),t(2,` 745 This draft has been applied. Fine-tune the live program from the links on the left, 746 or start a new draft to set up something else. 747 `),l(),t(3,` 748 `))}function Vn(a,n){if(a&1){let e=g();t(0,` 749 `),r(1,"app-inline-alert",71),t(2),l(),t(3,` 750 `),r(4,"div",72),t(5,` 751 `),r(6,"button",73),f("click",function(){x(e);let o=m(3);return u(o.startOver())}),t(7,` 752 `),C(8,"i",74),t(9,`Start over 753 `),l(),t(10,` 754 `),l(),t(11,` 755 `)}if(a&2){let e=m(3);s(),_("isInline",!0),s(),E(` 756 `,e.session.errorMessage||"Something went wrong while drafting your registration.",` 757 `)}}function On(a,n){if(a&1&&(t(0,` 758 `),r(1,"li",78),t(2,` 759 `),C(3,"i",79),t(4),l(),t(5,` 760 `)),a&2){let e=n.$implicit,i=m(4);s(4),E("",i.friendlyAction(e),` 761 `)}}function Ln(a,n){if(a&1&&(t(0,` 762 `),r(1,"div",75),t(2,` 763 `),r(3,"span",76),t(4,"Agent activity"),l(),t(5,` 764 `),r(6,"ul",77),t(7,` 765 `),T(8,On,6,1,null,null,tn),l(),t(10,` 766 `),l(),t(11,` 767 `)),a&2){let e=m(3);s(8),I(e.session.actions)}}function Mn(a,n){if(a&1){let e=g();t(0,` 768 `),r(1,"app-agent-chat-panel",44),A("collapsedChange",function(o){x(e);let d=m(2);return R(d.chatCollapsed,o)||(d.chatCollapsed=o),u(o)}),t(2,` 769 `),C(3,"app-pill",45),t(4,` 770 771 `),t(5,` 772 `),C(6,"app-agent-chat-transcript",46),t(7,` 773 774 `),t(8,` 775 `),c(9,Dn,43,5),c(10,Tn,12,1),c(11,Rn,14,1),c(12,An,9,0),c(13,Nn,9,8),c(14,kn,4,0),c(15,Vn,12,2),c(16,Ln,12,0),l(),t(17,` 776 `)}if(a&2){let e=m(2);s(),_("canCollapse",e.canHideChat),P("collapsed",e.chatCollapsed),s(2),_("status",e.statusPill(e.session.statusID))("text",e.statusLabel(e.session.statusID)),s(3),_("messages",e.transcriptMessages)("selections",e.transcriptSelections),s(3),p(e.reviewingOutline&&e.session.outline?9:-1),s(),p(!(e.session.draft==null||e.session.draft.plan==null||e.session.draft.plan.assumptions==null)&&e.session.draft.plan.assumptions.length?10:-1),s(),p(!(e.session.draft==null||e.session.draft.plan==null||e.session.draft.plan.warnings==null)&&e.session.draft.plan.warnings.length||!(e.session.draft==null||e.session.draft.validation==null||e.session.draft.validation.warnings==null)&&e.session.draft.validation.warnings.length?11:-1),s(),p(e.isProcessing(e.session.statusID)?12:-1),s(),p(e.canReply?13:-1),s(),p(e.session.statusID===e.SessionStatus.APPLIED?14:-1),s(),p(e.session.statusID===e.SessionStatus.FAILED?15:-1),s(),p(e.session.actions!=null&&e.session.actions.length?16:-1)}}function Bn(a,n){if(a&1&&(t(0,` 777 778 `),r(1,"app-inline-alert",10),t(2,` 779 `),C(3,"app-pill",11),t(4,` 780 `),r(5,"span",12),t(6,` 781 Drafts are staged for your review \u2014 nothing goes live until you approve it.
782 `),l(),t(7,` 783 `),l(),t(8,` 784 785 786 `),t(9,` 787 `),c(10,ln,2,1),c(11,sn,4,0),r(12,"div",13),t(13,` 788 789 `),t(14,` 790 `),c(15,dn,7,4),r(16,"div"),t(17,` 791 792 `),t(18,` 793 `),c(19,fn,3,1),c(20,Mn,18,14),l(),t(21,` 794 795 `),l(),t(22,` 796 `)),a&2){let e=m();s(),_("alertType","info")("isInline",!1),s(9),p(!e.session&&!e.loadingSession?10:-1),s(),p(e.loadingSession?11:-1),s(4),p(e.session!=null&&e.session.draft?15:-1),s(),M(e.chatColumnClass),s(3),p(!e.session&&!e.loadingSession?19:-1),s(),p(e.session?20:-1)}}var ue=(()=>{let n=class n extends ne{get api(){return this.registrationAgentService}constructor(i,o,d){super(i),this.registrationAgentService=o,this.route=d,this.display={statusLabels:me,statusPills:pe,toolActionLabels:de},this.copy={workingReading:"Reading your request and reviewing your programs\u2026",retryNarrowerAsk:"one program, one registration, or a simpler question.",retryFirstHint:"Narrowing it down usually does it: fewer registrations, or one request at a time. Your conversation and anything already staged are kept."},this.transcriptMessages=[],this.transcriptSelections={},this.sourceProgramId=null,this.sourceProgramName="",this.acceptedDocumentTypes=".csv,.tsv,.txt,.md,.xlsx,.docx",this.selectedFile=null,this.uploading=!1,this.approvingOutline=!1,this.SessionStatus=v,this.MessageRole=St,this.examplePrompts=["Set up Fall 2026 recreational soccer for boys and girls born 2014\u20132018, $175 with a $25 early-bird discount through July 31, capacity 200 with waitlist","Create a Summer 2026 camps & clinics program with a weekly skills camp registration at $95, open to players born 2012\u20132016, promo codes enabled","Set up 2026\u20132027 competitive tryouts for U12 and U14 girls, free to register, registration closes May 15 with offline payment allowed"]}ngOnInit(){let i=this.route.snapshot.queryParamMap,o=Number(i.get("sourceProgramId"));o>0&&(this.sourceProgramId=o,this.sourceProgramName=i.get("sourceProgramName")||""),this.checkFeature(Q.ENABLE_AI_REGISTRATION_AGENT,()=>this.loadSessions())}applySessionDerivedState(){this.prepareTranscript()}clearAgentState(){this.transcriptMessages=[],this.transcriptSelections={},this.sourceProgramId=null,this.sourceProgramName="",this.selectedFile=null}clearSourceProgram(){this.sourceProgramId=null,this.sourceProgramName=""}onFileSelected(i){let o=i.target,d=o.files?.[0]??null;if(o.value="",!!d){if(d.size>n.MaxDocumentBytes){this.siteDataService.showSiteErrorAlert("That file is too large. Please upload a document under 10 MB.");return}this.selectedFile=d}}clearSelectedFile(){this.selectedFile=null}startFromDocument(){!this.selectedFile||this.uploading||(this.uploading=!0,this.registrationAgentService.startSessionFromDocument(this.selectedFile,(this.prompt||"").trim()).pipe(B(this.unsubscribe$)).subscribe({next:i=>{this.uploading=!1,this.prompt="",this.selectedFile=null,this.setSession(i),this.loadSessions()},error:i=>{if(this.uploading=!1,i?.status===H.TooManyRequests)this.siteDataService.showSiteWarnAlert(this.extractErrorMessage(i)||"You have reached the assistant usage limit. Please try again later.");else{let o=i?.status===H.BadRequest?this.extractErrorMessage(i):null;this.siteDataService.showSiteErrorAlert(o||"There was a problem reading that document. Please try again.")}}}))}startSession(){let i=(this.prompt||"").trim();!i&&!this.sourceProgramId||this.starting||this.startWith(this.registrationAgentService.startSession(i,this.sourceProgramId??void 0))}get canReply(){return super.canReply||this.session?.statusID===v.AWAITING_OUTLINE_APPROVAL}questionsRemainAnswerable(){return this.session?.statusID===v.NEEDS_INPUT}get reviewingOutline(){return this.session?.statusID===v.AWAITING_OUTLINE_APPROVAL&&this.session?.outline?.canApprove===!0}approveOutline(){!this.session||this.approvingOutline||(this.approvingOutline=!0,this.registrationAgentService.approveOutline(this.session.sessionID).pipe(B(this.unsubscribe$)).subscribe({next:i=>{this.approvingOutline=!1,this.setSession(i)},error:i=>{this.approvingOutline=!1;let o=[H.BadRequest,H.Conflict].includes(i?.status)?this.extractErrorMessage(i):null;this.siteDataService.showSiteErrorAlert(o||"There was a problem approving the plan. Please try again.")}}))}get composerLabel(){return this.soleOpenQuestion?this.soleOpenQuestion.question:this.showQuestionPanel?"Anything else the assistant should know?":this.session?.statusID===v.AWAITING_OUTLINE_APPROVAL?"Want to change the plan? Tell the assistant":this.replyingToDraft?"Want anything changed? Tell the assistant":"The assistant needs a little more information"}get composerPlaceholder(){return this.showQuestionPanel?"Optional \u2014 anything the questions above don't cover\u2026":this.soleOpenQuestion?"Type your answer\u2026":this.session?.statusID===v.AWAITING_OUTLINE_APPROVAL?"e.g. Split the U12s into a separate registration with the tournament waiver\u2026":this.replyingToDraft?"e.g. Add a U10 division at $125 and extend the early-bird discount through August 15\u2026":"Type your answer\u2026"}
796get composerHint(){return this.showQuestionPanel?"Sent together with the answers you picked above.":this.session?.statusID===v.AWAITING_OUTLINE_APPROVAL?"The assistant will revise the plan of action \u2014 nothing is built until you approve it.":this.replyingToDraft?"The assistant will revise the draft for your review \u2014 nothing goes live until you apply it. Save any manual edits first so the assistant keeps them.":null}prepareTranscript(){this.transcriptMessages=(this.session?.messages??[]).map(o=>ut(xt({},o),{message:this.transcriptText(o)}));let i={};for(let o of this.session?.messages??[])o.selections?.selections?.length&&(i[o.messageID]=o.selections);this.transcriptSelections=i}transcriptText(i){return!i?.message||!this.isActiveQuestionMessage(i)?i?.message:Kt(i.message,se)}onDraftChange(i){this.session&&(this.session=ut(xt({},this.session),{draft:i})),this.siteDataService.showSiteSuccessAlert("Draft saved.")}onApplied(i){this.siteDataService.showSiteSuccessAlert("Your program and registrations are live! You can review them under Programs."),this.refreshSession()}onDiscarded(){this.siteDataService.showSiteSuccessAlert("Draft discarded."),this.refreshSession()}onUndone(){this.siteDataService.showSiteSuccessAlert("The assistant's changes were removed."),this.refreshSession()}};n.MaxDocumentBytes=10*1024*1024,n.\u0275fac=function(o){return new(o||n)($(rt),$(q),$(Bt))},n.\u0275cmp=K({type:n,selectors:[["ng-component"]],standalone:!1,features:[Tt],decls:11,vars:3,consts:[["customButtonContent",""],["docInput",""],["role","main"],["pageTitle","AI Registration Setup","parentLinkUrl","/admin/programs","parentLinkText","Programs",3,"showBackButton"],[1,"nowrap"],["for","sessionSelect",1,"sr-only"],["inputId","sessionSelect","placeholder","Recent sessions",1,"flex-grow-1",3,"ngModelChange","options","ngModel"],["type","button",1,"btn","btn-secondary","ml-2","text-nowrap",3,"click"],[1,"fa-regular","fa-plus","mr-1"],["alertType","warning",1,"mt-3",3,"isInline"],[1,"d-inline-block","my-3","full-width",3,"alertType","isInline"],["status","color1","text","Beta","styleClass","mr-2"],[1,"text-small","text-grey"],[1,"row"],[1,"ml-auto","d-flex","align-items-center","justify-content-between","border-bottom","pb-2","mb-3"],[1,"mb-0"],[3,"draftChange","applied","discarded","undone","draft","locked"],[1,"mb-3"],[1,"text-medium","text-grey","mb-0"],[1,"form-group"],["for","agentPrompt",1,"fw-600"],[1,"text-grey","fw-400"],["id","agentPrompt","rows","4","maxlength","2000","placeholder","e.g. Raise all prices by 5%, move the season to start September 8, and add a U15 division\u2026",1,"form-control","auto-grow",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","justify-content-between"],["type","button",1,"btn","btn-naked","btn-sm",3,"click"],["type","button",1,"btn","btn-primary",3,"click","disabled"],[1,"fw-600"],[1,"d-flex","align-items-center","my-4"],[1,"flex-grow-1"],[1,"small-label","mx-3"],[1,"border-all","border-radius","text-grey","p-3","mb-5","bg-secondary"],[1,"text-medium","fw-600","mb-1"],[1,"mb-5"],["id","agentPrompt","rows","4","maxlength","2000","placeholder","e.g. Set up Spring 2027 recreational soccer for boys and girls born 2015\u20132019, $150 with early-bird pricing\u2026",1,"form-control","auto-grow",3,"ngModelChange","ngModel"],[1,"border-all","border-radius","text-grey","p-3","mb-3","bg-secondary"],["styleClass","mb-2 mx-0","controlGroupName","examplePrompt",3,"ngModelChange","compact","inputId","optionValue","ngModel","label"],["type","file",1,"d-none",3,"change","accept"],["type","button",1,"btn",3,"click"],[1,"fa-regular","fa-upload","mr-1"],[1,"d-flex","align-items-center","flex-wrap"],[1,"fw-600","mr-2","mb-2"],[1,"fa-regular","fa-file","mr-1"],["type","button",1,"btn","btn-naked","btn-sm","mr-2","mb-2",3,"click","disabled"],["type","button",1,"btn","btn-primary","btn-sm","mb-2",3,"click","disabled"],["cardClass","box-shadow-sm border-radius-lg",1,"d-block","agent-chat-sticky",3,"collapsedChange","canCollapse","collapsed"],["slot","status",3,"status","text"],["data-testid","agent-transcript",3,"messages","selections"],[1,"border-top","pt-3","mt-3"],[1,"small-label","d-block","mb-2"],[1,"fa-regular","fa-list-check","mr-1"],[1,"text-small","text-grey","mb-2"],[1,"table-responsive"],[1,"table","table-sm","mb-2"],["scope","col"],["type","button",1,"btn","btn-primary","btn-sm",3,"click","disabled"],[1,"text-small"],["status","success","text","Reuse existing"],["status","info","text","Copy & adjust"],["status","default","text","New form"],[1,"text-grey","d-block"],["alertType","info",1,"d-block","mb-2",3,"isInline"],[1,"fw-600","d-block","mb-1"],[1,"m-0","pl-3"],["alertType","info",1,"d-block","mt-3",3,"isInline"],["alertType","warning",1,"d-block","mt-3",3,"isInline"],["role","status",1,"d-flex","align-items-center","text-grey","mt-2"],[1,"fa","fa-spinner","fa-spin","mr-2"],[1,"text-medium"],[3,"valueChange","send","label","placeholder","hint","sending","canSe
796nd","sendLabel","value"],["heading","A few answers first","hint","Pick the answers that fit, or write your own. Anything you skip, the assistant decides for you.",1,"d-block","mb-3",3,"answeredChange","quickAnswer","questions","questionKey","disabled"],[1,"text-small","text-grey","border-top","pt-3","mt-3","mb-0"],["alertType","error",1,"d-block","mt-3",3,"isInline"],[1,"mt-2"],["type","button",1,"btn","btn-secondary",3,"click"],[1,"fa-regular","fa-rotate-right","mr-1"],[1,"border-top","pt-2","mt-3"],[1,"small-label"],[1,"no-bullets","p-0","m-0","mt-1"],[1,"text-small","text-grey","mb-1"],[1,"fa-regular","fa-circle-check","text-green","mr-1"]],template:function(o,d){o&1&&(r(0,"main",2),t(1,` 797 798 `),r(2,"app-admin-header",3),t(3,` 799 `),Z(4,an,6,2,"ng-template",null,0,it),t(6,` 800`),l(),t(7,` 801 802 `),c(8,on,4,1),c(9,Bn,23,9),l(),t(10,` 803`)),o&2&&(s(2),_("showBackButton",!0),s(6),p(d.featureChecked&&!d.featureEnabled?8:-1),s(),p(d.featureEnabled?9:-1))},dependencies:[nt,at,Lt,ot,lt,st,dt,Ht,Qt,zt,Zt,te,ee,jt,Wt,_t],styles:["@media(min-width:992px){.agent-chat-sticky[_ngcontent-%COMP%]{position:-webkit-sticky;position:sticky;top:1rem;max-height:calc(100vh - 2rem);overflow-y:auto}}"]});let a=n;return a})();var Ce=(()=>{let n=class n{};n.\u0275fac=function(o){return new(o||n)},n.\u0275mod=z({type:n}),n.\u0275inj=J({imports:[yt.forChild([{path:"",component:ue}]),yt]});let a=n;return a})();var Qa=(()=>{let n=class n{};n.\u0275fac=function(o){return new(o||n)},n.\u0275mod=z({type:n}),n.\u0275inj=J({providers:[q],imports:[ie,Mt,Ce]});let a=n;return a})();export{Qa as RegistrationAgentModule};
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.