1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d3ef54ff-eb77-59ac-8b0d-d0a8553884e9")}catch(e){}}(); 3import{a as gn,d as fi,e as he,f as Ri,g as Ln,h as Ai}from"./chunk-RFXEVZYN.js";import{a as $n,b as Di}from"./chunk-Q5RXZ4IU.js";import{a as hn,b as Oi}from"./chunk-GBY4RRPU.js";import"./chunk-IZYFWM3L.js";import{a as fn,b as Ti,c as Rn,d as Ni}from"./chunk-32AFCRIM.js";import{a as Dn,b as Pi}from"./chunk-M5E33PEE.js";import{a as On,b as Ci}from"./chunk-RIFL3OOI.js";import{c as An,d as ui}from"./chunk-XPIB65IW.js";import"./chunk-XKGQNJCS.js";import{a as Le,b as ci}from"./chunk-6GUPFP5G.js";import{a as Nn,b as Ii}from"./chunk-MHXIWPVP.js";import"./chunk-AQDC6WYX.js";import{a as pn,b as Sn,c as Mn}from"./chunk-MQV5E5DO.js";import{c as Pn,d as Mi}from"./chunk-QAGHCC2P.js";import{a as Cn,b as Si}from"./chunk-HZ3FYHNN.js";import{a as Tn,b as di}from"./chunk-I5DLCAGW.js";import{a as un,b as pi}from"./chunk-BXHIM4XB.js";import"./chunk-LIY5Z5DX.js";import"./chunk-O4WLEERK.js";import"./chunk-GLGWIT7Q.js";import{D as dn,E as Ei,F as In,G as mi,V as ge,W as cn}from"./chunk-HCJKPTGM.js";import"./chunk-XES6EBUH.js";import"./chunk-7IZ7IQFS.js";import"./chunk-U2AYKEFN.js";import"./chunk-7OBMBINE.js";import{Da as mn,Ea as si,R as sn,S as li,o as rn,p as oi,u as ln,v as _i,w as an,x as ri,xa as En,ya as ai}from"./chunk-VAXTQMJG.js";import"./chunk-A7N55BD2.js";import"./chunk-X4TOIQZ5.js";import"./chunk-6CAXAEVI.js";import"./chunk-GNDBXVBS.js";import"./chunk-K7DQ2BDA.js";import{c as Zt,d as Kn,g as Yt,h as Hn,i as tn,j as ei,o as on,p as ii,w as De,x as _n}from"./chunk-TTQKVDQ7.js";import"./chunk-XU2EZIUM.js";import"./chunk-OWUVXM77.js";import"./chunk-LSLVPR72.js";import{c as Gt,e as qt,f as jt}from"./chunk-XPG54CHE.js";import"./chunk-JWWDLNIS.js";import"./chunk-Z2XXL3OC.js";import"./chunk-44QRKRNY.js";import"./chunk-QAM7USJC.js";import"./chunk-QCMZCTJ7.js";import{A as ze,Aa as k,D as qn,Da as Zn,E as Be,Ea as B,F as jn,Fa as Qt,Ta as Ke,Ua as Yn,Va as en,Wa as Qn,e as T,f as Bn,ya as p,za as Wn}from"./chunk-3HOIF7UE.js";import"./chunk-NHBFTOZL.js";import{a as nn,d as ti}from"./chunk-SX3LWQYR.js";import{l as kt,n as Re,o as Ae,p as Oe}from"./chunk-63XPFYYJ.js";import"./chunk-NDUJ7JZN.js";import{b as Te,f as Ne,h as xt,j as c,n as ue,s as Ce,t as Pe,u as fe}from"./chunk-AA5DU7ME.js";import{a as K,b as ni}from"./chunk-KWRIU4RP.js";import{r as x,s as zn}from"./chunk-H7BNAZPX.js";import{b as Bt,c as Kt,d as Ht}from"./chunk-SUGUVUND.js";import{C as Jn,Ja as wt,Ka as Ut,Na as Ft,Oa as Jt,Pa as Xt,Qa as Vt,Ra as zt,Va as Q,Wa as Vn,u as vt,y as Me,z as bt}from"./chunk-RTQW647K.js";import"./chunk-UY2AHKUP.js";import{e as Wt,g as Xn}from"./chunk-LADI2IVP.js";import{H as ht,J as Un,k as Je,l as kn,m as Xe,n as Gn,o as Lt,p as wn,u as Ve}from"./chunk-U3IAJHAB.js";import{q as $t,s as yt,y as Fn}from"./chunk-YA4WYHG7.js";import{$c as Pt,Ac as we,Bc as Ue,Ca as v,Db as r,Fc as Y,Gd as $,Hd as y,Ia as W,J as ct,Ja as Z,Lc as d,N as be,P as xe,Qc as h,S as ke,Sc as N,T as pt,Ub as Ie,Zb as ce,Zd as gt,_ as St,_a as xn,_b as ut,_c as Ct,aa as Mt,ad as ft,cb as Ge,cd as Rt,e as It,ea as Tt,f as $e,fd as O,gd as pe,jd as At,k as ye,ke as Se,la as de,mc as P,oc as f,qa as L,qc as X,ra as bn,rc as V,sc as z,sd as Ot,tc as s,uc as _,v as J,vc as o,wc as I,wd as Dt,x as b,xb as Nt,xd as Fe,y as ve}from"./chunk-7WH55ISQ.js";import"./chunk-HEWAIBKK.js";import"./chunk-VWJE3CXY.js";import{a as mt,e as dt,h as j}from"./chunk-XN77Q2IT.js";var yn,vn=dt(()=>{"use strict";Se();zt();cn();Qt();ti();Oe();fe();Kn();_n();Se();zt();fe();Oe();yn=(()=>{class i extends ge{static open(e,t){return e.open(i,{data:t,panelClass:nn.dialogClassLight});}constructor(){super(),this.matDialogRef=v(wt),this.form=v(Ut),this.metricHint=B.metricDistanceHint,this.imperialHint=B.imperialDistanceShortHint;}static{this.ɵfac=function(t){return new(t||i)();};}static{this.ɵcmp=Ie({type:i,selectors:[["rs-start-values-dialog"]],features:[ce],decls:32,vars:12,consts:()=>{let e;e="Start values";let t;t="Close ";let n;return n="OK ",[e,t,n,["matDialogTitle",""],[3,"placeholder","formControl"],["align","end"],["mat-stroked-button","",3,"click"],["mat-flat-button","","color","primary",3,"click"]];},template:function(t,n){t&1&&(_(0,"div",3),d(1,0),o(),_(2,"mat-dialog-content")(3,"rs-form-field-compat")(4,"rs-form-field-label"),O(5,"Start value (metric)"),o(),I(6,"input",4),o(),_(7,"rs-form-field-compat")(8,"rs-form-field-label"),O(9,"Start increment (metric)"),o(),I(10,"input",4),o(),_(11,"rs-form-field-compat")(12,"rs-form-field-label"),O(13,"Tie-break
3increment (metric)"),o(),I(14,"input",4),o(),_(15,"rs-form-field-compat")(16,"rs-form-field-label"),O(17,"Start value (imperial)"),o(),I(18,"input",4),o(),_(19,"rs-form-field-compat")(20,"rs-form-field-label"),O(21,"Start increment (imperial)"),o(),I(22,"input",4),o(),_(23,"rs-form-field-compat")(24,"rs-form-field-label"),O(25,"Tie-break increment (imperial)"),o(),I(26,"input",4),o()(),_(27,"mat-dialog-actions",5)(28,"button",6),h("click",function(){return n.matDialogRef.close();}),d(29,1),o(),_(30,"button",7),h("click",function(){return n.matDialogRef.close(!0);}),d(31,2),o()()),t&2&&(r(6),s("placeholder",n.metricHint)("formControl",n.form.controls.startValue),r(4),s("placeholder",n.metricHint)("formControl",n.form.controls.startIncrement),r(4),s("placeholder",n.metricHint)("formControl",n.form.controls.tieBreakIncrement),r(4),s("placeholder",n.imperialHint)("formControl",n.form.controls.startValueImperial),r(4),s("placeholder",n.imperialHint)("formControl",n.form.controls.startIncrementImperial),r(4),s("placeholder",n.imperialHint)("formControl",n.form.controls.tieBreakIncrementImperial));},dependencies:[Vt,Ft,Xt,Jt,De,Zt,Ce,Te,Ne,Pe,ue,Ae,Re],styles:[`rs-form-field-compat[_ngcontent-%COMP%]:not(:last-child){margin-bottom:20px} 4/*# sourceMappingURL=start-values-dialog.component-BO6DDYN4.css.map */`],changeDetection:0});}}return i;})();});function vi(i,m){i&1&&(_(0,"th"),d(1,19),o());}function bi(i,m){i&1&&(_(0,"th"),d(1,20),o());}function xi(i,m){i&1&&(_(0,"th"),d(1,21),o());}function ki(i,m){i&1&&(_(0,"th"),d(1,22),o());}function Gi(i,m){i&1&&(_(0,"th"),d(1,23),o());}function wi(i,m){i&1&&(_(0,"th"),d(1,24),o());}function Ui(i,m){i&1&&(_(0,"th"),d(1,25),o());}function Fi(i,m){if(i&1&&(_(0,"tr"),I(1,"td",45),o()),i&2){N(2);let e=ft(12),t=N();r(),s("colSpan",t.resolveColSpan(e));}}function Ji(i,m){if(i&1&&(_(0,"td")(1,"rs-form-field-compat",49),I(2,"input",71),o()()),i&2){let e=N().$implicit;r(2),s("formControl",e.controls.implement);}}function Xi(i,m){if(i&1&&(_(0,"rs-select-option",51),O(1),o()),i&2){let e=m.$implicit;s("value",e.value),r(),pe(e.translation);}}function Vi(i,m){if(i&1&&(_(0,"td")(1,"rs-form-field-compat",49)(2,"rs-select-base",50),V(3,Xi,2,2,"rs-select-option",51,X),o()()()),i&2){let e=N().$implicit,t=N(3);r(2),s("formControlCompat",e.controls.implementUnit),r(),z(t.Units);}}function zi(i,m){if(i&1&&(_(0,"td")(1,"rs-form-field-compat",49),I(2,"input",72),o()()),i&2){let e=N().$implicit;r(2),s("formControl",e.controls.secondaryImplement);}}function Bi(i,m){if(i&1&&(_(0,"rs-select-option",51),O(1),o()),i&2){let e=m.$implicit;s("value",e.value),r(),pe(e.translation);}}function Ki(i,m){if(i&1&&(_(0,"td")(1,"rs-form-field-compat",49)(2,"rs-select-base",50),V(3,Bi,2,2,"rs-select-option",51,X),o()()()),i&2){let e=N().$implicit,t=N(3);r(2),s("formControlCompat",e.controls.secondaryImplementUnit),r(),z(t.Units);}}function Hi(i,m){if(i&1&&(_(0,"td")(1,"rs-form-field-compat",49),I(2,"input",73),o()()),i&2){let e=N().$implicit;r(2),s("formControl",e.controls.tertiaryImplement);}}function qi(i,m){if(i&1&&(_(0,"rs-select-option",51),O(1),o()),i&2){let e=m.$implicit;s("value",e.value),r(),pe(e.translation);}}function ji(i,m){if(i&1&&(_(0,"td")(1,"rs-form-field-compat",49)(2,"rs-select-base",50),V(3,qi,2,2,"rs-select-option",51,X),o()()()),i&2){let e=N().$implicit,t=N(3);r(2),s("formControlCompat",e.controls.tertiaryImplementUnit),r(),z(t.Units);}}function Wi(i,m){i&1&&I(0,"span",75),i&2&&s("innerHTML",m,Nt);}function Zi(i,m){i&1&&(we(0),d(1,30),Ue());}function Yi(i,m){if(i&1){let e=Y();_(0,"td",74),h("click",function(){W(e);let n=N().$implicit,a=N(3);return Z(a.editStartValuesAndIncrements(n));}),P(1,Wi,1,1,"span",75)(2,Zi,2,0,"ng-container"),o();}if(i&2){let e,t=N().$implicit,n=N(3);r(),f((e=n.startValues(t))?1:2,e);}}function Qi(i,m){if(i&1){let e=Y();_(0,"tr")(1,"td",46),I(2,"mat-checkbox",47),o(),_(3,"td"),I(4,"mat-checkbox",47),o(),_(5,"td",48)(6,"rs-form-field-compat",49)(7,"rs-select-base",50)(8,"rs-select-option",51),O(9,"Outdoor"),o(),_(10,"rs-select-option",51),O(11,"Indoor"),o()()()(),_(12,"td",52)(13,"rs-form-field-compat",49)(14,"rs-select-base",50)(15,"rs-select-option",51),d(16,26),o(),_(17,"rs-select-option",51),d(18,27),o(),_(19,"rs-select-option",51),d(20,28),o()()()(),_(21,"td",53)(22,"rs-form-field-compat",49),I(23,"input",54),o()(),_(24,"td",55)(25,"rs-form-field-compat",49),I(26,"input",56),o()(),_(27,"td",55)(28,"rs-form-field-compat",49),I(29,"input",57),o()(),_(30,"td")(31,"rs-form-field-compat",49),I(32,"input",58),o()(),_(33,"td")(34,"rs-form-field-compat",49),I(35,"input",59),o()(),_(36,"td")(37,"rs-form-field-compat",49),I(38,"input",60),o()(),_(39,"td")(40,"rs-form-field-compat",49),I(41,"input",61),o()(),P(42,Ji,3,1,"td"),P(43,Vi,5,1,"td"),P(44,zi,3,1,"td"),P(45,Ki,5,1,"td"),P(46,Hi,3,1,"td"),P(47,ji,5,1,"td"),_(48,"td")(49,"rs-form-field-compat",49),I(50,"input",62),o()(),_(51,"td")(52,"rs-form-field-compat",49),I(53,"input",63),o()(),_(54,"td")(55,"rs-form-field-compat",49),I(56,"input",64),o()(),_(57,"td")(58,"rs-form-field-compat",49),I(59,"input",65),o()(),_(60,"td")(61,"rs-form-field-compat",49),I(62,"input",66),o()(),P(63,Yi,3,1,"td",67),we(64),_(65,"td")(66,"rs-form-field-compat",49),I(67,"input",68),_(68,"rs-form-field-hint"),d(69,29),o()()(),Ue(),_(70,"td",41)(71,"button",69),h("click",function(){let n=W(e).$implicit,a=N(3);return Z(a.delete(n));}),I(72,"mat-icon",70),o()()();}if(i&2){let e=m.$implicit,t=N(2),n=N();Rt("has-errors",n.hasError(e,"nonUnique")),r(),s("rsDirtyIndicator",e.controls.dirty.value),r(),s("formControl",e.controls.fallback),r(2),s("formControl",e.controls.official),r(3),s("formControlCompat",e.controls.season),r(),s("value",n.Season.Outdoor),r(2),s("value",n.Season.Indoor),r(4),s("formControlCompat",e.controls.gender),r(),s("value",n.Gender.Male),r(2),s("value",n.Gender.Female),r(2),s("value",n.Gender.Mixed),r(4),s("formControl",e.controls.tsId),r(3),s("formControl",e.controls.domtelId),r(3),s("formControl",e.controls.domtelIdNum),r(3),s("formControl",e.controls.ukaId),r(3),s("formControl",e.controls.hytekId),r(3),s("formControl",e.controls.athDotNetId),r(3),s("formControl",e.controls.tfrrsId),r(),f(t.hasImplements?42:-1),r(),f(t.hasImplements?43:-1),r(),f(t.hasImplements?44:-1),r(),f(t.hasImplements?45:-1),r(),f(t.hasImplements?46:-1),r(),f(t.hasImplements?47:-1),r(3),s("formControl",e.controls.worldRecord),r(3),s("formControl",e.controls.minResult),r(3),s("formControl",e.controls.maxResult),r(3),s("formControl",e.controls.wbly),r(3),s("formControl",e.controls.priceFactor),r(),f(t.verticalJump?63:-1),r(4),s("formControl",e.controls.basePrice),r(3),s("ngStyle",Fe(35,yi)),r(),s("matTooltipShowDelay",500),r(),s("svgIcon",n.svg.delete);}}function eo(i,m){if(i&1&&(_(0,"tbody",43),P(1,Fi,2,1,"tr"),ut(2,Qi,73,36,"tr",44),o()),i&2){let e=m;r(),f(e.length===0?1:-1),r(),s("cdkVirtualForOf",e);}}function to(i,m){if(i&1){let e=Y();_(0,"cdk-virtual-scroll-viewport",31)(1,"div",36)(2,"table",37)(3,"thead",38)(4,"rs-panel-title-left"),O(5),$(6,"sportEventType"),$(7,"sportEventSubType"),$(8,"sportEventName"),o(),I(9,"rs-panel-title-right"),o(),_(10,"thead",39)(11,"tr",null,0)(13,"th"),d(14,3),o(),_(15,"th"),d(16,4),o(),_(17,"th"),I(18,"rs-sort-filter-table-header",40),o(),_(19,"th"),I(20,"rs-sort-filter-table-header",40),o(),_(21,"th"),d(22,5),o(),_(23,"th"),d(24,6),o(),_(25,"th"),d(26,7),o(),_(27,"th"),d(28,8),o(),_(29,"th"),d(30,9),o(),_(31,"th"),d(32,10),o(),_(33,"th"),d(34,11),o(),P(35,vi,2,0,"th"),P(36,bi,2,0,"th"),P(37,xi,2,0,"th"),P(38,ki,2,0,"th"),P(39,Gi,2,0,"th"),P(40,wi,2,0,"th"),_(41,"th"),d(42,12),o(),_(43,"th"),d(44,13),o(),_(45,"th"),d(46,14),o(),_(47,"th"),d(48,15),o(),_(49,"th"),d(50,16),o(),P(51,Ui,2,0,"th"),_(52,"th"),d(53,17),o(),_(54,"th",41)(55,"button",42),h("click",function(){W(e);let n=N();return Z(n.addImplement());}),d(56,18),o()()()(),P(57,eo,3,2,"tbody",43),$(58,"async"),o()()();}if(i&2){let e,t=m,n=N();s("maxBufferPx",2e3)("minBufferPx",400)("itemSize",66),r(5),At(" ",y(6,21,t.eventType),": ",y(7,23,t.sportEventSubType)," , ",y(8,25,t)," "),r(13),s("sortKey",n.SortToken.Season)("enableSort",!1)("filterOptions",n.SeasonOptions),r(2),s("sortKey",n.SortToken.Gender)("enableSort",!1)("filterOptions",n.GenderOptions),r(15),f(t.hasImplements?35:-1),r(),f(t.hasImplements?36:-1),r(),f(t.hasImplements?37:-1),r(),f(t.hasImplements?38:-1),r(),f(t.hasImplements?39:-1),r(),f(t.hasImplements?40:-1),r(11),f(t.verticalJump?51:-1),r(3),s("ngStyle",Fe(29,$i)),r(3),f((e=y(58,27,n.forms$))?57:-1,e);}}function no(i,m){if(i&1){let e=Y();_(0,"rs-secondary-nav-item",80),$(1,"sportEventName"),h("click",function(){let n=W(e).$implicit,a=N(3);return Z(a.sportEventOrUndefined$.next(n));}),o();}if(i&2){let e=m.$implicit,t=N(3);s("label",Ot(y(1,3,e)))("active",e.eventIdPk===(t.sportEventOrUndefined$.value==null?null:t.sportEventOrUndefined$.value.eventIdPk));}}function io(i,m){if(i&1&&(_(0,"rs-secondary-nav-top-level-item",78),V(1,no,2,5,"rs-secondary-nav-item",79,X),o()),i&2){let e=m.$implicit;s("label",e.label)("canCollapse",!0),r(),z(e.sportEventList);}}function oo(i,m){if(i&1&&(_(0,"div",76),I(1,"rs-search-box-mk2",77),o(),V(2,io,3,2,"rs-secondary-nav-top-level-item",78,X)),i&2){let e=N();r(),s("autoFocus",!0)("formControlCompat",e.filterCtrl),r(),z(m);}}var $i,yi,H,_o,g_,ro=dt(()=>{Jn();Fn();Se();fe();Oe();Mn();Ht();jt();ci();qn();Wn();jn();Zn();si();Xn();Qt();ri();li();Un();Bn();cn();pi();Hn();_n();Ti();Ni();Di();di();Mi();Ii();Ci();ui();ei();ii();Ai();fi();Ri();Si();Pi();Vn();ai();zn();Qn();ni();Gn();wn();oi();Ei();mi();bn();xn();_i();Oi();vn();Yn();kn();Se();Oe();Mn();fe();jt();Ht();$i=()=>({paddingLeft:"0",textAlign:"right"}),yi=()=>({paddingLeft:"0",paddingRight:"0"});H=function(i){return i.Season="Season",i.Gender="Gender",i;}(H||{}),_o=[{value:H.Season,translation:"Season"},{value:H.Gender,translation:"Gender"}],g_=(()=>{class i extends ge{constructor(){super(),this.sortHandler=v(he),this.eventsService=v(mn),this.seImplementFormatter=v(ln),this.resultUtil=v(an),this.sortUtil=v(sn),this.vp=gt(Me,{read:Ge}),this.Units=Wt.enumValues(p,p.None).map(e=>({value:e,translation:this.pipes.implementUnitPipe.transform(e)}
4)),this.SeasonOptions=this.ts.seasons,this.GenderOptions=this.ts.genders3.map(e=>({value:e,translation:this.pipes.genderPipe.transform(e,"header")})),this.filterCtrl=new c(this.tryDecodeQueryParam("fil")??"",{nonNullable:!0}),this.savingAll=!1,this.durationRegExp=new RegExp("^(?:(?:(\\d+)h[ ]*)?(?:([0-5]?[0-9])min[ ]*)?(?:([0-5]?[0-9])s)?)$|^0$"),this.sportEventFilter$=this.filterCtrl.valueChanges.pipe(de(this.filterCtrl.value),ke(500),x()),this.filteredSportEventList$=ve([this.ses.sportEventList$,this.sportEventFilter$]).pipe(b(([e,t])=>(t=Lt(t).toLocaleLowerCase(),t===""?e:ht(e,a=>[this.pipes.sportEventNamePipe.transform(a),this.pipes.sportEventTypePipe.transform(a.eventType),this.pipes.sportEventSubTypePipe.transform(a.sportEventSubType)].join(" "),t))),x()),this.groupedSportEventList$=this.filteredSportEventList$.pipe(b(e=>{let t=[];return e.map(a=>a.eventType).filter(Ke()).forEach(a=>{let l=e.filter(S=>S.eventType===a),M=l.map(S=>S.sportEventSubType).filter(Ke()),u=M.length===1;M.forEach(S=>{let C=l.filter(F=>F.sportEventSubType===S),U=[this.pipes.sportEventTypePipe.transform(a),u?null:this.pipes.sportEventSubTypePipe.transform(S)].filter(Je).join(": ");t.push({label:U,sportEventList:C});});}),t;}),x()),this.sportEventOrUndefined$=new $e(void 0),this.sportEvent$=this.sportEventOrUndefined$.pipe(ct(Je)),this.created$=new $e([]),this.reset$=new It(),this.forms$=ve([this.sportEvent$,this.ses.seImplementList$,this.reset$.pipe(de(!0))]).pipe(b(([e,t])=>(this.clearNamedSubscriptions("forms"),t.filter(l=>l.eventIdFk===e.eventIdPk).sort((l,M)=>this.sortUtil.compareImplements2(l,M)).map(l=>this.seImplementToForm(e,l)))),x()).pipe(xe(this.created$),b(([e,t])=>[...t,...e]),xe(this.sortHandler.activeFilters$),b(([e,t])=>{console.log("active filters",t);let n=e,a=t;return n.filter(l=>{let M=l.controls.season.value,u=l.controls.gender.value;for(let S of Array.from(a.keys())){let C=a.get(S);if(Array.isArray(C)&&C.length>0)switch(S){case H.Season:if(!C.includes(M))return console.log(C,"does not include",M),!1;break;case H.Gender:if(!C.includes(u))return console.log(C,"does not include",u),!1;break;}}return!0;});}),x()),this.dirty=!1,this.dirty$=this.forms$.pipe(Ve(),En(this.sportEvent$),b(([e,t])=>e.map(n=>{let a=this.isDirty(t,n);return this.setFormValue(n.controls.dirty,a),a;}).reduce((n,a)=>n||a,!1)),L(e=>{this.dirty=e,this.cd.markForCheck();}),x()),this.valid$=this.forms$.pipe(Ve(),b(e=>(this.validateUnique(e),e.reduce((t,n)=>t&&n.valid,!0))),L(e=>console.log("valid is",e)),x()),this.SortToken=H,this.Gender=ze,this.Season=Be;}isDirty(e,t){let n=this.implementFromForm(e,t);return n.seImplementIdPk===0||!en(n,t.controls.object.value);}ngOnInit(){super.ngOnInit(),this.sportEvent$.pipe(St("eventIdPk"),L(e=>{this.created$.next([]),this.setQueryParam("seId",e.eventIdPk,!0);}),this.takeUntilDestroyed()).subscribe(),this.filterCtrl.valueChanges.pipe(ke(2e3),L(e=>{let t=Xe(e);this.setQueryParam("fil",t!=null?btoa(t):null,!0);}),this.takeUntilDestroyed()).subscribe(),this.valid$.pipe(this.takeUntilDestroyed()).subscribe(),this.ses.sportEventList$.pipe(L(e=>{if(this.sportEventOrUndefined$.value==null){let t=Q(this.ar.snapshot.queryParamMap.get("seId")),n=e.find(a=>a.eventIdPk===t);this.sportEventOrUndefined$.next(n??e[0]);}}),this.takeUntilDestroyed()).subscribe();}validateUnique(e){this.cd.markForCheck();let t=[];for(let n=0;n<e.length;n++){let a=e[n],l=a.value;for(let M=n+1;M<e.length;M++){let u=e[M],S=u.value;l.season===S.season&&l.gender===S.gender&&l.implement===S.implement&&l.implementUnit===S.implementUnit&&l.secondaryImplement===S.secondaryImplement&&l.secondaryImplementUnit===S.secondaryImplementUnit&&l.tertiaryImplement===S.tertiaryImplement&&l.tertiaryImplementUnit===S.tertiaryImplementUnit&&t.push(a,u);}}e.forEach(n=>{this.setFormError(n,"nonUnique",t.includes(n));});}delete(e){return j(this,null,function*(){if(this.created$.value.includes(e)){this.created$.next(this.created$.value.filter(a=>a!==e));return;}if(yield J(this.dirty$)){this.ss.warnSaveOtherChangesFirst();return;}let n=e.controls.object.value;this.ss.confirmDelete(()=>{this.eventsService.deleteImplement(n).pipe(L(()=>this.ss.infoDeleted()),be(()=>(this.ss.warnDeleteFailed(),ye)),this.takeOneUntilDestroyed()).subscribe();});});}saveAll(){return j(this,null,function*(){let e=yield J(this.sportEvent$),n=(yield J(this.forms$)).filter(a=>a.controls.dirty.value).map(a=>this.implementFromForm(e,a));n.length!==0&&(this.cd.markForCheck(),this.savingAll=!0,this.eventsService.saveImplements(n).pipe(L(()=>{this.created$.next([]),this.ss.infoSaved();}),be(()=>(this.ss.warnSaveFailed(),ye)),Mt(()=>{this.cd.markForCheck(),this.savingAll=!1;}),this.takeUntilDestroyed()).subscribe());});}seImplementToForm(e,t){let n=B.resultInputValidator(e.resultType,k.Metric,!1,e.resultPre
4cision),a=A=>this.resultUtil.formatRecord(A,k.Metric,e),l=A=>this.resultUtil.formatResultInternal(A,2,k.Metric,e.resultType,e.resultPrecision),M=A=>this.resultUtil.formatResultInternal(A,2,k.ImperialHalf,e.resultType,e.resultPrecision),u=A=>D=>{if(D.parent==null)return null;switch(D.parent.controls[A].value){case p.Gram:case p.None:return T.integerZero(D);case p.Kilogram:case p.Ounce:case p.Pound:case p.Centimeter:case p.Meter:case p.Kilometer:case p.Inch:case p.Yard:case p.Mile:return T.pattern(new RegExp("\\d+(\\.\\d{1,2})?"))(D);case p.Time:{let g=T.pattern(this.durationRegExp)(D);return console.log("Validating time",g),g;}}},S=a(t.worldRecord),C=a(t.minResult),U=a(t.maxResult),F=a(t.wbly),ee=l(t.startValue),te=M(t.startValueImperial),ne=l(t.startIncrement),ie=M(t.startIncrementImperial),oe=l(t.tieBreakIncrement),_e=M(t.tieBreakIncrementImperial),re=this.seImplementFormatter.formatImplementValue(t.implement,t.implementUnit),le=this.seImplementFormatter.formatImplementValue(t.secondaryImplement,t.secondaryImplementUnit),ae=this.seImplementFormatter.formatImplementValue(t.tertiaryImplement,t.tertiaryImplementUnit),R=new xt({dirty:new c(!1,{nonNullable:!0}),season:new c(t.season,{nonNullable:!0,validators:[T.required]}),gender:new c(t.gender,{nonNullable:!0,validators:[T.required]}),fallback:new c(t.fallback,{nonNullable:!0}),official:new c(t.official,{nonNullable:!0}),tsId:new c(t.tsId??"",{nonNullable:!0}),domtelId:new c(t.domtelId??"",{nonNullable:!0}),domtelIdNum:new c(t.domtelIdNum?.toString()??"",{nonNullable:!0,validators:[T.integerZero]}),ukaId:new c(t.ukaId??"",{nonNullable:!0}
4),hytekId:new c(t.hytekId??"",{nonNullable:!0}),athDotNetId:new c(t.athDotNetId??"",{nonNullable:!0}),tfrrsId:new c(t.tfrrsId??"",{nonNullable:!0}),implement:new c(re,{nonNullable:!0,validators:[T.required,u("implementUnit")]}),implementUnit:new c(t.implementUnit,{nonNullable:!0,validators:[T.required]}),secondaryImplement:new c(le,{nonNullable:!0,validators:[T.required,u("secondaryImplementUnit")]}),secondaryImplementUnit:new c(t.secondaryImplementUnit,{nonNullable:!0,validators:[T.required]}),tertiaryImplement:new c(ae,{nonNullable:!0,validators:[T.required,u("tertiaryImplementUnit")]}),tertiaryImplementUnit:new c(t.tertiaryImplementUnit,{nonNullable:!0,validators:[T.required]}),worldRecord:new c(S,{nonNullable:!0,validators:[n]}),minResult:new c(C,{nonNullable:!0,validators:[n]}),maxResult:new c(U,{nonNullable:!0,validators:[n]}),wbly:new c(F,{nonNullable:!0,validators:[n]}),priceFactor:new c(t.priceFactor.toString(),{nonNullable:!0,validators:[T.required,T.pattern(new RegExp("\\d+\\.\\d+|1")),T.min(1e-16)]}),basePrice:new c(t.basePrice.toString(),{nonNullable:!0,validators:[T.required,T.integer,T.min(1e4)]}),startValue:new c(ee,{nonNullable:!0,validators:[T.distanceMetric]}),startValueImperial:new c(te,{nonNullable:!0,validators:[T.distanceImperialHalf]}),startIncrement:new c(ne,{nonNullable:!0,validators:[T.distanceMetric]}),startIncrementImperial:new c(ie,{nonNullable:!0,validators:[T.distanceImperialHalf]}),tieBreakIncrement:new c(oe,{nonNullable:!0,validators:[T.distanceMetric]}),tieBreakIncrementImperial:new c(_e,{nonNullable:!0,validators:[T.distanceImperialHalf]}),object:new c(t,{nonNullable:!0})});return B.touchFormGroupDeep(R),[new Le(R.controls.implementUnit,R.controls.implement),new Le(R.controls.secondaryImplementUnit,R.controls.secondaryImplement),new Le(R.controls.tertiaryImplementUnit,R.controls.tertiaryImplement)].forEach(A=>{let D=A.first,G=A.second;D.valueChanges.pipe(de(D.value),Tt(),L(w=>{w[0]!==w[1]&&G.setValue("");}),this.takeUntilCleared("forms")).subscribe();}),R.controls.fallback.valueChanges.pipe(L(A=>j(this,null,function*(){if(!A){R.controls.fallback.setValue(!0);return;}let D=R.controls.gender.value,G=R.controls.season.value;(yield J(this.forms$)).forEach(g=>{if(g===R)return;let se=g.controls.gender.value,Ee=g.controls.season.value,q=g.controls.fallback,me=q.value;se===D&&Ee===G&&me&&q.setValue(!1,{emitEvent:!1});});})),this.takeUntilCleared("forms")).subscribe(),R;}parseImplement(e,t){switch(t){case p.None:return Number(e);case p.Gram:case p.Kilogram:case p.Ounce:case p.Pound:case p.Centimeter:case p.Meter:case p.Kilometer:case p.Inch:case p.Yard:case p.Mile:return Number((100*Number(e)).toFixed());case p.Time:{if(Number(e)===0)return 0;let n=this.durationRegExp.exec(e);if(n==null)return 0;let a=n[1],l=n[2],M=n[3];return 3600*(a.length>0?Number(a):0)+60*(l.length>0?Number(l):0)+(M.length>0?Number(M):0);}}}implementFromForm(e,t){let n=t.getRawValue(),a=t.controls.object.value,l=mt({},a),M=C=>this.resultUtil.parseResult(C,e.resultType,k.Metric).metric,u=C=>this.resultUtil.parseResult(C,e.resultType,k.Metric).metric??void 0,S=C=>this.resultUtil.parseResult(C,e.resultType,k.ImperialHalf).imperial??void 0;return l.season=n.season,l.gender=n.gender,l.fallback=n.fallback,l.official=n.official,l.tsId=K(n.tsId),l.domtelId=K(n.domtelId),l.domtelIdNum=Q(n.domtelIdNum)??void 0,l.ukaId=K(n.ukaId),l.hytekId=K(n.hytekId),l.athDotNetId=K(n.athDotNetId),l.tfrrsId=Xe(n.tfrrsId),l.implementUnit=n.implementUnit,l.implement=this.parseImplement(n.implement,l.implementUnit),l.secondaryImplementUnit=n.secondaryImplementUnit,l.secondaryImplement=this.parseImplement(n.secondaryImplement,l.secondaryImplementUnit),l.tertiaryImplementUnit=n.tertiaryImplementUnit,l.tertiaryImplement=this.parseImplement(n.tertiaryImplement,l.tertiaryImplementUnit),l.worldRecord=M(n.worldRecord)??void 0,l.minResult=M(n.minResult)??void 0,l.maxResult=M(n.maxResult)??void 0,l.wbly=M(n.wbly)??void 0,l.priceFactor=Q(n.priceFactor)??0,l.basePrice=Q(n.basePrice)??0,l.startValue=u(n.startValue),l.startValueImperial=S(n.startValueImperial),l.startIncrement=u(n.startIncrement),l.startIncrementImperial=S(n.startIncrementImperial),l.tieBreakIncrement=u(n.tieBreakIncrement),l.tieBreakIncrementImperial=S(n.tieBreakIncrementImperial),l;}unsavedChanges(){return this.dirty;}addImplement(){return j(this,null,function*(){let e=yield J(this.sportEventOrUndefined$),t={seImplementIdPk:0,version:0,eventIdFk:e.eventIdPk,season:Be.Outdoor,gender:ze.Male,fallback:!1,implement:0,implementUnit:p.None,secondaryImplement:0,secondaryImplementUnit:p.None,tertiaryImplement:0,tertiaryImplementUnit:p.None,priceFactor:1,basePrice:75e5,official:!1,tfrrsId:null},n=this.seImplementToForm(e,t);this.created$.next([...this.created$.value,n]),this.vp()?.nativeElement?.scrollTo({top:0,behavior:"smooth"});});}discardChanges(){this.created$.next([]),this.reset$.next();}startValues(e){let t=e.getRawValue(),n=t.startValue,a=t.startIncrement,l=t.tieBreakIncrement,M=t.startValueImperial,u=t.startIncrementImperial,S=t.tieBreakIncrementImperial;return n===""?"":`${n} \xB7 +${a} \xB7 T+${l}<br />${M} \xB7 +${u} \xB7 T+${S}<br />`;}editStartValuesAndIncrements(e){yn.open(this.matDialog,e).beforeClosed().pipe(pt(1),this.takeUntilDestroyed()).subscribe(()=>this.cd.markForCheck());}usesVirtualScrolling(){return!0;}static{this.ɵfac=function(t){return new(t||i)();};}static{this.ɵcmp=Ie({type:i,selectors:[["rs-se-implements-editor"]],viewQuery:function(t,n){t&1&&Ct(n.vp,Me,5,Ge),t&2&&Pt();},features:[Dt([{provide:gn,useValue:_o},{provide:he,useClass:he}]),ce],decls:12,vars:15,consts:()=>{let e;e="Implements";let t;t="Reset ";let n;n="Save ";let a;a="Std.";let l;l="Official";let M;M="Ts. ID";let u;u="PZLA ID";let S;S="PZLA ID (number)";let C;C="UKA ID";let U;U="HyTek ID";let F;F="Ath.Net ID";let ee;ee="TFRRS ID";let te;te="World Record";let ne;ne="Min result";let ie;ie="Max result";let oe;oe="WBLY";let _e;_e="Price factor";let re;re="Base price";let le;le="Add ";let ae;ae="Impl. ";let R;R="Unit ";let A;A="Sec. impl. ";let D;D="Unit ";let G;G="Ter. impl. ";let w;w="Unit ";let g;g="Start values & increments";let se;se="Ts. ID";let Ee;Ee="PZLA ID";let q;q="PZLA ID (number)";let me;me="UKA ID";let He;He="HyTek ID";let qe;qe="Ath.Net ID";let je;je="TFRRS ID";let We;We="WR";let Ze;Ze="Min";let Ye;Ye="Max";let Qe;Qe="WBLY";let et;et="Price factor";let tt;tt="Base price";let nt;nt="Delete implement - will work only for unused implements";let it;it="Male";let ot;ot="Female";let _t;_t="Mixed";let rt;rt="min. 10000";let lt;lt="Impl.";let at;at="Sec. impl.";let st;st="Ter. impl.";let Et;return Et="Set",[["headRow",""],t,n,a,l,M,u,S,C,U,F,ee,te,ne,ie,oe,_e,re,le,ae,R,A,D,G,w,g,it,ot,_t,rt,Et,["rsVpStickyOffset","",3,"maxBufferPx","minBufferPx","itemSize"],["navHeader",e,3,"toggleAllEnabled"],[3,"display"],["mat-raised-button","",3,"click","disabled"],["color","primary",3,"action","disabled","busy"],[1,"cdk-table-wrapper"],[1,"rs-mat-table-compat"],["rsPanelTableTitle",""],[1,"rs-outline-top"],[3,"sortKey","enableSort","filterOptions"],[3,"ngStyle"],["mat-stroked-button","","color","primary",3,"click"],[1,"rs-outline-bottom"],[3,"has-errors",4,"cdkVirtualFor","cdkVirtualForOf"],[3,"colSpan"],[3,"rsDirtyIndicator"],["color","primary",3,"formControl"],[1,"col-season"],["appearance","normal"],[3,"formControlCompat"],[3,"value"],[1,"col-gender"],[1,"col-ts-id"],["placeholder",se,"rsKillAutocomplete","tsId",3,"formControl"],[1,"col-domtel-id"],["placeholder",Ee,"rsKillAutocomplete","domtelId",3,"formControl"],["placeholder",q,"rsKillAutocomplete","domtelIdNum",3,"formControl"],["placeholder",me,"rsKillAutocomplete","ukaId",3,"formControl"],["placeholder",He,"rsKillAutocomplete","hytekId",3,"formControl"],["placeholder",qe,"rsKillAutocomplete","athDotNetId",3,"formControl"],["placeholder",je,"rsKillAutocomplete","tfrrsId",3,"formControl"],["placeholder",We,"rsKillAutocomplete","worldRecord",3,"formControl"],["placeholder",Ze,"rsKillAutocomplete","minResult",3,"formControl"],["placeholder",Ye,"rsKillAutocomplete","maxResult",3,"formControl"],["placeholder",Qe,"rsKillAutocomplete","wbly",3,"formControl"],["placeholder",et,"rsKillAutocomplete","priceFactor",3,"formControl"],[1,"text-link","start-values"],["placeholder",tt,"rsKillAutocomplete","basePrice",3,"formControl"],["mat-icon-button","","matTooltip",nt,3,"click","matTooltipShowDelay"],[3,"svgIcon"],["placeholder",lt,"rsKillAutocomplete","
4implement",3,"formControl"],["placeholder",at,"rsKillAutocomplete","secondaryImplement",3,"formControl"],["placeholder",st,"rsKillAutocomplete","tertiaryImplement",3,"formControl"],[1,"text-link","start-values",3,"click"],[2,"line-height","1.5","white-space","nowrap",3,"innerHTML"],[1,"rs-search-box-mask",2,"margin-top","-12px","padding-bottom","12px"],["bgColor","off-white",3,"autoFocus","formControlCompat"],[3,"label","canCollapse"],[3,"label","active"],[3,"click","label","active"]];},template:function(t,n){if(t&1&&(P(0,to,59,30,"cdk-virtual-scroll-viewport",31),$(1,"async"),_(2,"rs-secondary-nav-panel",32),P(3,oo,4,2),$(4,"async"),o(),_(5,"rs-actions-bar",33),$(6,"async"),_(7,"button",34),h("click",function(){return n.promptResetChanges();}),d(8,1),o(),_(9,"rs-progress-button",35),$(10,"async"),h("action",function(){return n.saveAll();}),d(11,2),o()()),t&2){let a,l;f((a=y(1,7,n.sportEventOrUndefined$))?0:-1,a),r(2),s("toggleAllEnabled",!1),r(),f((l=y(4,9,n.groupedSportEventList$))?3:-1,l),r(2),s("display",y(6,11,n.dirty$)===!0),r(2),s("disabled",n.savingAll),r(2),s("disabled",y(10,13,n.valid$)!==!0)("busy",n.savingAll);}},dependencies:[Me,vt,fn,Rn,$n,Ln,$t,Ae,Re,kt,bt,un,Sn,pn,Ce,Te,Ne,Pe,ue,De,on,tn,Cn,Yt,qt,Gt,Kt,Bt,On,Pn,An,Nn,hn,Tn,Dn,yt,rn,dn,In],styles:[`[_nghost-%COMP%]{padding-left:248px;display:block}cdk-virtual-scroll-viewport[_ngcontent-%COMP%]{position:fixed;top:64px;left:296px;height:calc(100vh - 64px);width:calc(100% - 296px);overflow-y:scroll!important;overflow-x:visible!important}div.rs-virtual-scroll-weird-fix[_ngcontent-%COMP%]{position:fixed;top:64px;left:296px;height:calc(100vh - 64px);width:calc(100% - 296px);pointer-events:none}div.cdk-table-wrapper[_ngcontent-%COMP%]{padding-top:24px;padding-bottom:24px}div.cdk-table-wrapper[_ngcontent-%COMP%]:has(div.table-header){padding-top:unset}div.table-header[_ngcontent-%COMP%]{box-sizing:border-box;padding-top:24px;height:64px;display:flex;flex-flow:row nowrap;align-items:center;font-size:15px;margin-left:auto;margin-right:auto}[_nghost-%COMP%]{display:flex;flex-flow:row nowrap;justify-content:flex-start;align-items:flex-start;padding-bottom:64px}rs-center-content-mk2[_ngcontent-%COMP%]{z-index:104}td[_ngcontent-%COMP%]:not(:last-child), th[_ngcontent-%COMP%]:not(:last-child){padding-right:8px!important}td[_ngcontent-%COMP%]:not(:first-child), th[_ngcontent-%COMP%]:not(:first-child){padding-left:8px!important}td[_ngcontent-%COMP%], th[_ngcontent-%COMP%]{max-width:70px;text-align:left}td.event-name[_ngcontent-%COMP%], th.event-name[_ngcontent-%COMP%]{max-width:180px}td.start-values[_ngcontent-%COMP%], th.start-values[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;max-width:100px}.progress[_ngcontent-%COMP%]{width:300px}.actions[_ngcontent-%COMP%]{display:flex;flex-flow:row nowrap;justify-content:flex-start;align-items:center;width:80px;max-width:80px}rs-center-content-mk2[_ngcontent-%COMP%]{z-index:100}rs-actions-bar[_ngcontent-%COMP%]{z-index:101}tr.has-errors[_ngcontent-%COMP%], tr.has-errors[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{background-color:#fff7f7} 5/*# sourceMappingURL=se-implements-editor.component-54RRWRON.css.map */`],changeDetection:0});}}return i;})();});ro();export{g_ as SeImplementsEditorComponent};/**i18n:98cd60948f00bf3240ebfd0e064bf0123c90f4a120e09300fa6f8d092a2b7bea*///# sourceMappingURL=chunk-BTSYBRJ6.js.map 6//# debugId=d3ef54ff-eb77-59ac-8b0d-d0a8553884e9
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.