PageSourceSearch

https://carreirasgalegas.com/900.8bb99ddf805d4b3e.js

js carreirasgalegas.com collected 2026-09-25 18:38:26 UTC 219,223 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkRaces_Web=self.webpackChunkRaces_Web||[]).push([[900],{5953:(Dr,re,g)=>{g.r(re),g.d(re,{EventsModule:()=>Ir});var m=g(6814),T=g(7878),ke=g(707),d=g(1180),O=g(6825),e=g(5879),E=g(5219),b=g(2076),se=g(5232),le=g(7778),ce=g(4713),k=g(2332);let de=(()=>{var n;class a extends ce.s{constructor(...t){super(...t),(0,d.Z)(this,"pathId",void 0)}ngOnInit(){this.pathId="url(#"+(0,k.Th)()+")"}}return n=a,(0,d.Z)(a,"\u0275fac",function(){let i;return function(o){return(i||(i=e.n5z(n)))(o||n)}}()),(0,d.Z)(a,"\u0275cmp",e.Xpm({type:n,selectors:[["WindowMaximizeIcon"]],standalone:!0,features:[e.qOj,e.jDz],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M7 14H11.8C12.3835 14 12.9431 13.7682 13.3556 13.3556C13.7682 12.9431 14 12.3835 14 11.8V2.2C14 1.61652 13.7682 1.05694 13.3556 0.644365C12.9431 0.231785 12.3835 0 11.8 0H2.2C1.61652 0 1.05694 0.231785 0.644365 0.644365C0.231785 1.05694 0 1.61652 0 2.2V7C0 7.15913 0.063214 7.31174 0.175736 7.42426C0.288258 7.53679 0.44087 7.6 0.6 7.6C0.75913 7.6 0.911742 7.53679 1.02426 7.42426C1.13679 7.31174 1.2 7.15913 1.2 7V2.2C1.2 1.93478 1.30536 1.68043 1.49289 1.49289C1.68043 1.30536 1.93478 1.2 2.2 1.2H11.8C12.0652 1.2 12.3196 1.30536 12.5071 1.49289C12.6946 1.68043 12.8 1.93478 12.8 2.2V11.8C12.8 12.0652 12.6946 12.3196 12.5071 12.5071C12.3196 12.6946 12.0652 12.8 11.8 12.8H7C6.84087 12.8 6.68826 12.8632 6.57574 12.9757C6.46321 13.0883 6.4 13.2409 6.4 13.4C6.4 13.5591 6.46321 13.7117 6.57574 13.8243C6.68826 13.9368 6.84087 14 7 14ZM9.77805 7.42192C9.89013 7.534 10.0415 7.59788 10.2 7.59995C10.3585 7.59788 10.5099 7.534 10.622 7.42192C10.7341 7.30985 10.798 7.15844 10.8 6.99995V3.94242C10.8066 3.90505 10.8096 3.86689 10.8089 3.82843C10.8079 3.77159 10.7988 3.7157 10.7824 3.6623C10.756 3.55552 10.701 3.45698 10.622 3.37798C10.5099 3.2659 10.3585 3.20202 10.2 3.19995H7.00002C6.84089 3.19995 6.68828 3.26317 6.57576 3.37569C6.46324 3.48821 6.40002 3.64082 6.40002 3.79995C6.40002 3.95908 6.46324 4.11169 6.57576 4.22422C6.68828 4.33674 6.84089 4.39995 7.00002 4.39995H8.80006L6.19997 7.00005C6.10158 7.11005 6.04718 7.25246 6.04718 7.40005C6.04718 7.54763 6.10158 7.69004 6.19997 7.80005C6.30202 7.91645 6.44561 7.98824 6.59997 8.00005C6.75432 7.98824 6.89791 7.91645 6.99997 7.80005L9.60002 5.26841V6.99995C9.6021 7.15844 9.66598 7.30985 9.77805 7.42192ZM1.4 14H3.8C4.17066 13.9979 4.52553 13.8498 4.78763 13.5877C5.04973 13.3256 5.1979 12.9707 5.2 12.6V10.2C5.1979 9.82939 5.04973 9.47452 4.78763 9.21242C4.52553 8.95032 4.17066 8.80215 3.8 8.80005H1.4C1.02934 8.80215 0.674468 8.95032 0.412371 9.21242C0.150274 9.47452 0.00210008 9.82939 0 10.2V12.6C0.00210008 12.9707 0.150274 13.3256 0.412371 13.5877C0.674468 13.8498 1.02934 13.9979 1.4 14ZM1.25858 10.0586C1.29609 10.0211 1.34696 10 1.4 10H3.8C3.85304 10 3.90391 10.0211 3.94142 10.0586C3.97893 10.0961 4 10.147 4 10.2V12.6C4 12.6531 3.97893 12.704 3.94142 12.7415C3.90391 12.779 3.85304 12.8 3.8 12.8H1.4C1.34696 12.8 1.29609 12.779 1.25858 12.7415C1.22107 12.704 1.2 12.6531 1.2 12.6V10.2C1.2 10.147 1.22107 10.0961 1.25858 10.0586Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(t,o){1&t&&(e.O4$(),e.TgZ(0,"svg",0)(1,"g"),e._UZ(2,"path",1),e.qZA(),e.TgZ(3,"defs")(4,"clipPath",2),e._UZ(5,"rect",3),e.qZA()()()),2&t&&(e.Tol(o.getClassNames()),e.uIk("aria-label",o.ariaLabel)("aria-hidden",o.ariaHidden)("role",o.role),e.xp6(1),e.uIk("clip-path",o.pathId),e.xp6(3),e.Q6J("id",o.pathId))},encapsulation:2})),a})(),pe=(()=>{var n;class a extends ce.s{constructor(...t){super(...t),(0,d.Z)(this,"pathId",void 0)}ngOnInit(){this.pathId="url(#"+(0,k.Th)()+")"}}return n=a,(0,d.Z)(a,"\u0275fac",function(){let i;return function(o){return(i||(i=e.n5z(n)))(o||n)}}()),(0,d.Z)(a,"\u0275cmp",e.Xpm({type:n,selectors:[["WindowMinimizeIcon"]],standalone:!0,features:[e.qOj,e.jDz],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M11.8 0H2.2C1.616
152 0 1.05694 0.231785 0.644365 0.644365C0.231785 1.05694 0 1.61652 0 2.2V7C0 7.15913 0.063214 7.31174 0.175736 7.42426C0.288258 7.53679 0.44087 7.6 0.6 7.6C0.75913 7.6 0.911742 7.53679 1.02426 7.42426C1.13679 7.31174 1.2 7.15913 1.2 7V2.2C1.2 1.93478 1.30536 1.68043 1.49289 1.49289C1.68043 1.30536 1.93478 1.2 2.2 1.2H11.8C12.0652 1.2 12.3196 1.30536 12.5071 1.49289C12.6946 1.68043 12.8 1.93478 12.8 2.2V11.8C12.8 12.0652 12.6946 12.3196 12.5071 12.5071C12.3196 12.6946 12.0652 12.8 11.8 12.8H7C6.84087 12.8 6.68826 12.8632 6.57574 12.9757C6.46321 13.0883 6.4 13.2409 6.4 13.4C6.4 13.5591 6.46321 13.7117 6.57574 13.8243C6.68826 13.9368 6.84087 14 7 14H11.8C12.3835 14 12.9431 13.7682 13.3556 13.3556C13.7682 12.9431 14 12.3835 14 11.8V2.2C14 1.61652 13.7682 1.05694 13.3556 0.644365C12.9431 0.231785 12.3835 0 11.8 0ZM6.368 7.952C6.44137 7.98326 6.52025 7.99958 6.6 8H9.8C9.95913 8 10.1117 7.93678 10.2243 7.82426C10.3368 7.71174 10.4 7.55913 10.4 7.4C10.4 7.24087 10.3368 7.08826 10.2243 6.97574C10.1117 6.86321 9.95913 6.8 9.8 6.8H8.048L10.624 4.224C10.73 4.11026 10.7877 3.95982 10.7849 3.80438C10.7822 3.64894 10.7192 3.50063 10.6093 3.3907C10.4994 3.28077 10.3511 3.2178 10.1956 3.21506C10.0402 3.21232 9.88974 3.27002 9.776 3.376L7.2 5.952V4.2C7.2 4.04087 7.13679 3.88826 7.02426 3.77574C6.91174 3.66321 6.75913 3.6 6.6 3.6C6.44087 3.6 6.28826 3.66321 6.17574 3.77574C6.06321 3.88826 6 4.04087 6 4.2V7.4C6.00042 7.47975 6.01674 7.55862 6.048 7.632C6.07656 7.70442 6.11971 7.7702 6.17475 7.82524C6.2298 7.88029 6.29558 7.92344 6.368 7.952ZM1.4 8.80005H3.8C4.17066 8.80215 4.52553 8.95032 4.78763 9.21242C5.04973 9.47452 5.1979 9.82939 5.2 10.2V12.6C5.1979 12.9707 5.04973 13.3256 4.78763 13.5877C4.52553 13.8498 4.17066 13.9979 3.8 14H1.4C1.02934 13.9979 0.674468 13.8498 0.412371 13.5877C0.150274 13.3256 0.00210008 12.9707 0 12.6V10.2C0.00210008 9.82939 0.150274 9.47452 0.412371 9.21242C0.674468 8.95032 1.02934 8.80215 1.4 8.80005ZM3.94142 12.7415C3.97893 12.704 4 12.6531 4 12.6V10.2C4 10.147 3.97893 10.0961 3.94142 10.0586C3.90391 10.0211 3.85304 10 3.8 10H1.4C1.34696 10 1.29609 10.0211 1.25858 10.0586C1.22107 10.0961 1.2 10.147 1.2 10.2V12.6C1.2 12.6531 1.22107 12.704 1.25858 12.7415C1.29609 12.779 1.34696 12.8 1.4 12.8H3.8C3.85304 12.8 3.90391 12.779 3.94142 12.7415Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(t,o){1&t&&(e.O4$(),e.TgZ(0,"svg",0)(1,"g"),e._UZ(2,"path",1),e.qZA(),e.TgZ(3,"defs")(4,"clipPath",2),e._UZ(5,"rect",3),e.qZA()()()),2&t&&(e.Tol(o.getClassNames()),e.uIk("aria-label",o.ariaLabel)("aria-hidden",o.ariaHidden)("role",o.role),e.xp6(1),e.uIk("clip-path",o.pathId),e.xp6(3),e.Q6J("id",o.pathId))},encapsulation:2})),a})();var ue=g(4480);const Je=["titlebar"],Fe=["content"],Se=["footer"];function Qe(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"div",11),e.NdJ("mousedown",function(o){e.CHM(i);const r=e.oxw(3);return e.KtG(r.initResize(o))}),e.qZA()}}function Ye(n,a){if(1&n&&(e.TgZ(0,"span",18),e._uU(1),e.qZA()),2&n){const i=e.oxw(4);e.Q6J("id",i.getAriaLabelledBy()),e.xp6(1),e.Oqu(i.header)}}function Le(n,a){if(1&n&&(e.TgZ(0,"span",18),e.Hsn(1,1),e.qZA()),2&n){const i=e.oxw(4);e.Q6J("id",i.getAriaLabelledBy())}}function ze(n,a){1&n&&e.GkF(0)}function Be(n,a){if(1&n&&e._UZ(0,"span",22),2&n){const i=e.oxw(5);e.Q6J("ngClass",i.maximized?i.minimizeIcon:i.maximizeIcon)}}function Ve(n,a){1&n&&e._UZ(0,"WindowMaximizeIcon",24),2&n&&e.Q6J("styleClass","p-dialog-header-maximize-icon")}function Ge(n,a){1&n&&e._UZ(0,"WindowMinimizeIcon",24),2&n&&e.Q6J("styleClass","p-dialog-header-maximize-icon")}function He(n,a){if(1&n&&(e.ynx(0),e.YNc(1,Ve,1,1,"WindowMaximizeIcon",23),e.YNc(2,Ge,1,1,"WindowMinimizeIcon",23),e.BQk()),2&n){const i=e.oxw(5);e.xp6(1),e.Q6J("ngIf",!i.maximized&&!i.maximizeIconTemplate),e.xp6(1),e.Q6J("ngIf",i.maximized&&!i.minimizeIconTemplate)}}function je(n,a){}function $e(n,a){1&n&&e.YNc(0,je,0,0,"ng-template")}function Ke(n,a){if(1&n&&(e.ynx(0),e.YNc(1,$e,1,0,null,9),e.BQk()),2&n){const i=e.oxw(5);e.xp6(1),e.Q6J("ngTemplateOutlet",i.maximizeIconTemplate)}}function We(n,a){}function Xe(n,a){1&n&&e.YNc(0,We,0,0,"ng-template")}function et(n,a){if(1&n&&(e.ynx(0),e.YNc(1,Xe,1,0,null,9),e.BQk()),2&n){const i=e.oxw(5);e.xp6(1),e.Q6J("ngTemplateOutlet",i.minimizeIconTemplate)}}const tt=function(){return{"p-dialog-header-icon p-dialog-header-maximize p-link":!0}};function nt(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"button",19),e.NdJ("click",function(){e.CHM(i);const o=e.oxw(4);return e.KtG(o.maximize())})("keydown.enter",function(){e.CHM(i);const o=e.oxw(4);return e.KtG(o.maximize())}),e.YNc(1,Be,1,1,"span",20),e.YNc(2,He,3,2,"ng-container",21),e.YNc(3,Ke,2,1,"ng-container",21),e.YNc(4,et,2,1,"ng-container",21),e.qZA()}if(2&n){const i=e.oxw(4);e.Q6J("ngClass",e.DdM(5,tt)),e.xp6(1),e.Q6J("ngIf",i.maximizeIcon&&!i.maximizeIconTemplate&&!i.minimizeIconTemplate),e.xp6(1),e.Q6J("ngIf",!i.maximizeIcon),e.xp6(1),e.Q6J("ngIf",!i.maximized),e.xp6(1),e.Q6J("ngIf",i.maximized)}}function it(n,a){if(1&n&&e._UZ(0,"span",27),2&n){const i=e.oxw(6);e.Q6J("ngClass",i.closeIcon)}}function ot(n,a){1&n&&e._UZ(0,"TimesIcon",24),2&n&&e.Q6J("styleClass","p-dialog-header-close-icon")}function at(n,a){if(1&n&&(e.ynx(0),e.YNc(1,it,1,1,"span",26),e.YNc(2,ot,1,1,"TimesIcon",23),e.BQk()),2&n){const i=e.oxw(5);e.xp6(1),e.Q6J("ngIf",i.closeIcon),e.xp6(1),e.Q6J("ngIf",!i.closeIcon)}}function rt(n,a){}function st(n,a){1&n&&e.YNc(0,rt,0,0,"ng-template")}function lt(n,a){if(1&n&&(e.TgZ(0,"span"),e.YNc(1,st,1,0,null,9),e.qZA()),2&n){const i=e.oxw(5);e.xp6(1),e.Q6J("ngTemplateOutlet",i.closeIconTemplate)}}const ct=function(){return{"p-dialog-header-icon p-dialog-header-close p-link":!0}};function dt(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"button",25),e.NdJ("click",function(o){e.CHM(i);const r=e.oxw(4);return e.KtG(r.close(o))})("keydown.enter",function(o){e.CHM(i);const r=e.oxw(4);return e.KtG(r.close(o))}),e.YNc(1,at,3,2,"ng-container",21),e.YNc(2,lt,2,1,"span",21),e.qZA()}if(2&n){const i=e.oxw(4);e.Q6J("ngClass",e.DdM(5,ct)),e.uIk("aria-label",i.closeAriaLabel)("tabindex",i.closeTabindex),e.xp6(1),e.Q6J("ngIf",!i.closeIconTemplate),e.xp6(1),e.Q6J("ngIf",i.closeIconTemplate)}}function pt(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"div",12,13),e.NdJ("mousedown",function(o){e.CHM(i);const r=e.oxw(3);return e.KtG(r.initDrag(o))}),e.YNc(2,Ye,2,2,"span",14),e.YNc(3,Le,2,1,"span",14),e.YNc(4,ze,1,0,"ng-container",9),e.TgZ(5,"div",15),e.YNc(6,nt,5,6,"button",16),e.YNc(7,dt,3,6,"button",17),e.qZA()()}if(2&n){const i=e.oxw(3);e.xp6(2),e.Q6J("ngIf",!i.headerFacet&&!i.headerTemplate),e.xp6(1),e.Q6J("ngIf",i.headerFacet),e.xp6(1),e.Q6J("ngTemplateOutlet",i.headerTemplate),e.xp6(2),e.Q6J("ngIf",i.maximizable),e.xp6(1),e.Q6J("ngIf",i.closable)}}function ut(n,a){1&n&&e.GkF(0)}function gt(n,a){1&n&&e.GkF(0)}function mt(n,a){if(1&n&&(e.TgZ(0,"div",28,29),e.Hsn(2,2),e.YNc(3,gt,1,0,"ng-container",9),e.qZA()),2&n){const i=e.oxw(3);e.xp6(3),e.Q6J("ngTemplateOutlet",i.footerTemplate)}}const _t=function(n,a,i,t){return{"p-dialog p-component":!0,"p-dialog-rtl":n,"p-dialog-draggable":a,"p-dialog-resizable":i,"p-dialog-maximized":t}},ht=function(n,a){return{transform:n,transition:a}},ft=function(n){return{value:"visible",params:n}};function vt(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"div",3,4),e.NdJ("@animation.start",function(o){e.CHM(i);const r=e.oxw(2);return e.KtG(r.onAnimationStart(o))})("@animation.done",function(o){e.CHM(i);const r=e.oxw(2);return e.KtG(r.onAnimationEnd(o))}),e.YNc(2,Qe,1,0,"div",5),e.YNc(3,pt,8,5,"div",6),e.TgZ(4,"div",7,8),e.Hsn(6),e.YNc(7,ut,1,0,"ng-container",9),e.qZA(),e.YNc(8,mt,4,1,"div",10),e.qZA()}if(2&n){const i=e.oxw(2);e.Tol(i.styleClass),e.Q6J("ngClass",e.l5B(16,_t,i.rtl,i.draggable,i.resizable,i.maximized))("ngStyle",i.style)("pFocusTrapDisabled",!1===i.focusTrap)("@animation",e.VKq(24,ft,e.WLB(21,ht,i.transformOptions,i.transitionOptions))),e.uIk("aria-labelledby",i.ariaLabelledBy)("aria-modal",!0),e.xp6(2),e.Q6J("ngIf",i.resizable),e.xp6(1),e.Q6J("ngIf",i.showHeader),e.xp6(1),e.Tol(i.contentStyleClass),e.Q6J("ngClass","p-dialog-content")("ngStyle",i.contentStyle),e.xp6(3),e.Q6J("ngTemplateOutlet",i.contentTemplate),e.xp6(1),e.Q6J("ngIf",i.footerFacet||i.footerTemplate)}}const xt=function(n,a,i,t,o,r,s,l,c,u){return{"p-dialog-mask":!0,"p-component-overlay p-component-overlay-enter":n,"p-dialog-mask-scrollblocker":a,"p-dialog-left":i,"p-dialog-right":t,"p-dialog-top":o,"p-dialog-top-left":r,"p-dialog-top-right":s,"p-dialog-bottom":l,"p-dialog-bottom-left":c,"p-dialog-bottom-right":u}};function bt(n,a){if(1&n&&(e.TgZ(0,"div",1),e.YNc(1,vt,9,26,"div",2),e.qZA()),2&n){const i=e.oxw();e.Tol(i.maskStyleClass),e.Q6J("ngClass",e.rFY(4,xt,[i.modal,i.modal||i.blockScroll,"left"===i.position,"right"===i.position,"top"===i.position,"topleft"===i.position||"top-left"===i.position,"topright"===i.position||"top-right"===i.position,"bottom"===i.position,"bottomleft"===i.position||"bottom-left"===i.position,"bottomright"===i.position||"bottom-right"===i.position])),e.xp6(1),e.Q6J("ngIf",i.visible)}}const Ct=["*",[["p-header"]],[["p-footer"]]],Zt=["*","p-header","p-footer"],Tt=(0,O.oQ)([(0,O.oB)({transform:"{{transform}}",opacity:0}
1),(0,O.jt)("{{transition}}")]),yt=(0,O.oQ)([(0,O.jt)("{{transition}}",(0,O.oB)({transform:"{{transform}}",opacity:0}))]);let wt=(()=>{var n;class a{get positionLeft(){return 0}set positionLeft(t){console.log("positionLeft property is deprecated.")}get positionTop(){return 0}set positionTop(t){console.log("positionTop property is deprecated.")}get responsive(){return!1}set responsive(t){console.log("Responsive property is deprecated.")}get breakpoint(){return 649}set breakpoint(t){console.log("Breakpoint property is not utilized and deprecated, use breakpoints or CSS media queries instead.")}get visible(){return this._visible}set visible(t){this._visible=t,this._visible&&!this.maskVisible&&(this.maskVisible=!0)}get style(){return this._style}set style(t){t&&(this._style={...t},this.originalStyle=t)}get position(){return this._position}set position(t){switch(this._position=t,t){case"topleft":case"bottomleft":case"left":this.transformOptions="translate3d(-100%, 0px, 0px)";break;case"topright":case"bottomright":case"right":this.transformOptions="translate3d(100%, 0px, 0px)";break;case"bottom":this.transformOptions="translate3d(0px, 100%, 0px)";break;case"top":this.transformOptions="translate3d(0px, -100%, 0px)";break;default:this.transformOptions="scale(0.7)"}}constructor(t,o,r,s,l,c,u){(0,d.Z)(this,"document",void 0),(0,d.Z)(this,"platformId",void 0),(0,d.Z)(this,"el",void 0),(0,d.Z)(this,"renderer",void 0),(0,d.Z)(this,"zone",void 0),(0,d.Z)(this,"cd",void 0),(0,d.Z)(this,"config",void 0),(0,d.Z)(this,"header",void 0),(0,d.Z)(this,"draggable",!0),(0,d.Z)(this,"resizable",!0),(0,d.Z)(this,"contentStyle",void 0),(0,d.Z)(this,"contentStyleClass",void 0),(0,d.Z)(this,"modal",!1),(0,d.Z)(this,"closeOnEscape",!0),(0,d.Z)(this,"dismissableMask",!1),(0,d.Z)(this,"rtl",!1),(0,d.Z)(this,"closable",!0),(0,d.Z)(this,"appendTo",void 0),(0,d.Z)(this,"breakpoints",void 0),(0,d.Z)(this,"styleClass",void 0),(0,d.Z)(this,"maskStyleClass",void 0),(0,d.Z)(this,"showHeader",!0),(0,d.Z)(this,"blockScroll",!1),(0,d.Z)(this,"autoZIndex",!0),(0,d.Z)(this,"baseZIndex",0),(0,d.Z)(this,"minX",0),(0,d.Z)(this,"minY",0),(0,d.Z)(this,"focusOnShow",!0),(0,d.Z)(this,"maximizable",!1),(0,d.Z)(this,"keepInViewport",!0),(0,d.Z)(this,"focusTrap",!0),(0,d.Z)(this,"transitionOptions","150ms cubic-bezier(0, 0, 0.2, 1)"),(0,d.Z)(this,"closeIcon",void 0),(0,d.Z)(this,"closeAriaLabel",void 0),(0,d.Z)(this,"closeTabindex","-1"),(0,d.Z)(this,"minimizeIcon",void 0),(0,d.Z)(this,"maximizeIcon",void 0),(0,d.Z)(this,"onShow",new e.vpe),(0,d.Z)(this,"onHide",new e.vpe),(0,d.Z)(this,"visibleChange",new e.vpe),(0,d.Z)(this,"onResizeInit",new e.vpe),(0,d.Z)(this,"onResizeEnd",new e.vpe),(0,d.Z)(this,"onDragEnd",new e.vpe),(0,d.Z)(this,"onMaximize",new e.vpe),(0,d.Z)(this,"headerFacet",void 0),(0,d.Z)(this,"footerFacet",void 0),(0,d.Z)(this,"templates",void 0),(0,d.Z)(this,"headerViewChild",void 0),(0,d.Z)(this,"contentViewChild",void 0),(0,d.Z)(this,"footerViewChild",void 0),(0,d.Z)(this,"headerTemplate",void 0),(0,d.Z)(this,"contentTemplate",void 0),(0,d.Z)(this,"footerTemplate",void 0),(0,d.Z)(this,"maximizeIconTemplate",void 0),(0,d.Z)(this,"closeIconTemplate",void 0),(0,d.Z)(this,"minimizeIconTemplate",void 0),(0,d.Z)(this,"_visible",!1),(0,d.Z)(this,"maskVisible",void 0),(0,d.Z)(this,"container",void 0),(0,d.Z)(this,"wrapper",void 0),(0,d.Z)(this,"dragging",void 0),(0,d.Z)(this,"ariaLabelledBy",void 0),(0,d.Z)(this,"documentDragListener",void 0),(0,d.Z)(this,"documentDragEndListener",void 0),(0,d.Z)(this,"resizing",void 0),(0,d.Z)(this,"documentResizeListener",void 0),(0,d.Z)(this,"documentResizeEndListener",void 0),(0,d.Z)(this,"documentEscapeListener",void 0),(0,d.Z)(this,"maskClickListener",void 0),(0,d.Z)(this,"lastPageX",void 0),(0,d.Z)(this,"lastPageY",void 0),(0,d.Z)(this,"preventVisibleChangePropagation",void 0),(0,d.Z)(this,"maximized",void 0),(0,d.Z)(this,"preMaximizeContentHeight",void 0),(0,d.Z)(this,"preMaximizeContainerWidth",void 0),(0,d.Z)(this,"preMaximizeContainerHeight",void 0),(0,d.Z)(this,"preMaximizePageX",void 0),(0,d.Z)(this,"preMaximizePageY",void 0),(0,d.Z)(this,"id",(0,k.Th)()),(0,d.Z)(this,"_style",{}),(0,d.Z)(this,"_position","center"),(0,d.Z)(this,"originalStyle",void 0),(0,d.Z)(this,"transformOptions","scale(0.7)"),(0,d.Z)(this,"styleElement",void 0),(0,d.Z)(this,"window",void 0),this.document=t,this.platformId=o,this.el=r,this.renderer=s,this.zone=l,this.cd=c,this.config=u,this.window=this.document.defaultView}ngAfterContentInit(){this.templates?.forEach(t=>{switch(t.getType()){case"header":this.headerTemplate=t.template;break;case"content":default:this.contentTemplate=t.template;break;case"footer":this.footerTemplate=t.template;break;case"closeicon":this.closeIconTemplate=t.template;break;case"maximizeicon":this.maximizeIconTemplate=t.template;break;case"minimizeicon":this.minimizeIconTemplate=t.template}})}ngOnInit(){this.breakpoints&&this.createStyle()}getAriaLabelledBy(){return null!==this.header?(0,k.Th)()+"_header":null}focus(){let t=b.p.findSingle(this.container,"[autofocus]");t&&this.zone.runOutsideAngular(()=>{setTimeout(()=>t.focus(),5)})}close(t){this.visibleChange.emit(!1),t.preventDefault()}enableModality(){this.closable&&this.dismissableMask&&(this.maskClickListener=this.renderer.listen(this.wrapper,"mousedown",t=>{this.wrapper&&this.wrapper.isSameNode(t.target)&&this.close(t)})),this.modal&&b.p.blockBodyScroll()}disableModality(){this.wrapper&&(this.dismissableMask&&this.unbindMaskClickListener(),this.modal&&b.p.unblockBodyScroll(),this.cd.destroyed||this.cd.detectChanges())}maximize(){this.maximized=!this.maximized,!this.modal&&!this.blockScroll&&(this.maximized?b.p.blockBodyScroll():b.p.unblockBodyScroll()),this.onMaximize.emit({maximized:this.maximized})}unbindMaskClickListener(){this.maskClickListener&&(this.maskClickListener(),this.maskClickListener=null)}moveOnTop(){this.autoZIndex&&(k.P9.set("modal",this.container,this.baseZIndex+this.config.zIndex.modal),this.wrapper.style.zIndex=String(parseInt(this.container.style.zIndex,10)-1))}createStyle(){if((0,m.NF)(this.platformId)&&!this.styleElement){this.styleElement=this.renderer.createElement("style"),this.styleElement.type="text/css",this.renderer.appendChild(this.document.head,this.styleElement);let t="";for(let o in this.breakpoints)t+=`\n                        @media screen and (max-width: ${o}) {\n                            .p-dialog[${this.id}]:not(.p-dialog-maximized) {\n                                width: ${this.breakpoints[o]} !important;\n                            }\n                        }\n                    `;this.renderer.setProperty(this.styleElement,"innerHTML",t)}}initDrag(t){b.p.hasClass(t.target,"p-dialog-header-icon")||b.p.hasClass(t.target.parentElement,"p-dialog-header-icon")||this.draggable&&(this.dragging=!0,this.lastPageX=t.pageX,this.lastPageY=t.pageY,this.container.style.margin="0",b.p.addClass(this.document.body,"p-unselectable-text"))}onKeydown(t){if(this.focusTrap&&9===t.which){t.preventDefault();let o=b.p.getFocusableElements(this.container);if(o&&o.length>0)if(o[0].ownerDocument.activeElement){let r=o.indexOf(o[0].ownerDocument.activeElement);t.shiftKey?-1==r||0===r?o[o.length-1].focus():o[r-1].focus():-1==r||r
1===o.length-1?o[0].focus():o[r+1].focus()}else o[0].focus()}}onDrag(t){if(this.dragging){const o=b.p.getOuterWidth(this.container),r=b.p.getOuterHeight(this.container),s=t.pageX-this.lastPageX,l=t.pageY-this.lastPageY,c=this.container.getBoundingClientRect(),u=getComputedStyle(this.container),v=parseFloat(u.marginLeft),Z=parseFloat(u.marginTop),y=c.left+s-v,D=c.top+l-Z,w=b.p.getViewport();this.container.style.position="fixed",this.keepInViewport?(y>=this.minX&&y+o<w.width&&(this._style.left=`${y}px`,this.lastPageX=t.pageX,this.container.style.left=`${y}px`),D>=this.minY&&D+r<w.height&&(this._style.top=`${D}px`,this.lastPageY=t.pageY,this.container.style.top=`${D}px`)):(this.lastPageX=t.pageX,this.container.style.left=`${y}px`,this.lastPageY=t.pageY,this.container.style.top=`${D}px`)}}endDrag(t){this.dragging&&(this.dragging=!1,b.p.removeClass(this.document.body,"p-unselectable-text"),this.cd.detectChanges(),this.onDragEnd.emit(t))}resetPosition(){this.container.style.position="",this.container.style.left="",this.container.style.top="",this.container.style.margin=""}center(){this.resetPosition()}initResize(t){this.resizable&&(this.resizing=!0,this.lastPageX=t.pageX,this.lastPageY=t.pageY,b.p.addClass(this.document.body,"p-unselectable-text"),this.onResizeInit.emit(t))}onResize(t){if(this.resizing){let o=t.pageX-this.lastPageX,r=t.pageY-this.lastPageY,s=b.p.getOuterWidth(this.container),l=b.p.getOuterHeight(this.container),c=b.p.getOuterHeight(this.contentViewChild?.nativeElement),u=s+o,v=l+r,Z=this.container.style.minWidth,y=this.container.style.minHeight,D=this.container.getBoundingClientRect(),w=b.p.getViewport();(!parseInt(this.container.style.top)||!parseInt(this.container.style.left))&&(u+=o,v+=r),(!Z||u>parseInt(Z))&&D.left+u<w.width&&(this._style.width=u+"px",this.container.style.width=this._style.width),(!y||v>parseInt(y))&&D.top+v<w.height&&(this.contentViewChild.nativeElement.style.height=c+v-l+"px",this._style.height&&(this._style.height=v+"px",this.container.style.height=this._style.height)),this.lastPageX=t.pageX,this.lastPageY=t.pageY}}resizeEnd(t){this.resizing&&(this.resizing=!1,b.p.removeClass(this.document.body,"p-unselectable-text"),this.onResizeEnd.emit(t))}bindGlobalListeners(){this.draggable&&(this.bindDocumentDragListener(),this.bindDocumentDragEndListener()),this.resizable&&this.bindDocumentResizeListeners(),this.closeOnEscape&&this.closable&&this.bindDocumentEscapeListener()}unbindGlobalListeners(){this.unbindDocumentDragListener(),this.unbindDocumentDragEndListener(),this.unbindDocumentResizeListeners(),this.unbindDocumentEscapeListener()}bindDocumentDragListener(){this.documentDragListener||this.zone.runOutsideAngular(()=>{this.documentDragListener=this.renderer.listen(this.window,"mousemove",this.onDrag.bind(this))})}unbindDocumentDragListener(){this.documentDragListener&&(this.documentDragListener(),this.documentDragListener=null)}bindDocumentDragEndListener(){this.documentDragEndListener||this.zone.runOutsideAngular(()=>{this.documentDragEndListener=this.renderer.listen(this.window,"mouseup",this.endDrag.bind(this))})}unbindDocumentDragEndListener(){this.documentDragEndListener&&(this.documentDragEndListener(),this.documentDragEndListener=null)}bindDocumentResizeListeners(){!this.documentResizeListener&&!this.documentResizeEndListener&&this.zone.runOutsideAngular(()=>{this.documentResizeListener=this.renderer.listen(this.window,"mousemove",this.onResize.bind(this)),this.documentResizeEndListener=this.renderer.listen(this.window,"mouseup",this.resizeEnd.bind(this))})}unbindDocumentResizeListeners(){this.documentResizeListener&&this.documentResizeEndListener&&(this.documentResizeListener(),this.documentResizeEndListener(),this.documentResizeListener=null,this.documentResizeEndListener=null)}bindDocumentEscapeListener(){this.documentEscapeListener=this.renderer.listen(this.el?this.el.nativeElement.ownerDocument:"document","keydown",o=>{27==o.which&&this.close(o)})}unbindDocumentEscapeListener(){this.documentEscapeListener&&(this.documentEscapeListener(),this.documentEscapeListener=null)}appendContainer(){this.appendTo&&("body"===this.appendTo?this.renderer.appendChild(this.document.body,this.wrapper):b.p.appendChild(this.wrapper,this.appendTo))}restoreAppend(){this.container&&this.appendTo&&this.renderer.appendChild(this.el.nativeElement,this.wrapper)}onAnimationStart(t){switch(t.toState){case"visible":this.container=t.element,this.wrapper=this.container?.parentElement,this.appendContainer(),this.moveOnTop(),this.bindGlobalListeners(),this.container?.setAttribute(this.id,""),this.modal&&this.enableModality(),!this.modal&&this.blockScroll&&b.p.addClass(this.document.body,"p-overflow-hidden"),this.focusOnShow&&this.focus();break;case"void":this.wrapper&&this.modal&&b.p.addClass(this.wrapper,"p-component-overlay-leave")}}onAnimationEnd(t){switch(t.toState){case"void":this.onContainerDestroy(),this.onHide.emit({}),this.cd.markForCheck();break;case"visible":this.onShow.emit({})}}onContainerDestroy(){this.unbindGlobalListeners(),this.dragging=!1,this.maskVisible=!1,this.maximized&&(b.p.removeClass(this.document.body,"p-overflow-hidden"),this.document.body.style.removeProperty("--scrollbar-width"),this.maximized=!1),this.modal&&this.disableModality(),this.blockScroll&&b.p.removeClass(this.document.body,"p-overflow-hidden"),this.container&&this.autoZIndex&&k.P9.clear(this.container),this.container=null,this.wrapper=null,this._style=this.originalStyle?{...this.originalStyle}:{}}destroyStyle(){this.styleElement&&(this.renderer.removeChild(this.document.head,this.styleElement),this.styleElement=null)}ngOnDestroy(){this.container&&(this.restoreAppend(),this.onContainerDestroy()),this.destroyStyle()}}return n=a,(0,d.Z)(a,"\u0275fac",function(t){return new(t||n)(e.Y36(m.K0),e.Y36(e.Lbi),e.Y36(e.SBq),e.Y36(e.Qsj),e.Y36(e.R0b),e.Y36(e.sBO),e.Y36(E.b4))}),(0,d.Z)(a,"\u0275cmp",e.Xpm({type:n,selectors:[["p-dialog"]],contentQueries:function(t,o,r){if(1&t&&(e.Suo(r,
1E.h4,5),e.Suo(r,E.$_,5),e.Suo(r,E.jx,4)),2&t){let s;e.iGM(s=e.CRH())&&(o.headerFacet=s.first),e.iGM(s=e.CRH())&&(o.footerFacet=s.first),e.iGM(s=e.CRH())&&(o.templates=s)}},viewQuery:function(t,o){if(1&t&&(e.Gf(Je,5),e.Gf(Fe,5),e.Gf(Se,5)),2&t){let r;e.iGM(r=e.CRH())&&(o.headerViewChild=r.first),e.iGM(r=e.CRH())&&(o.contentViewChild=r.first),e.iGM(r=e.CRH())&&(o.footerViewChild=r.first)}},hostAttrs:[1,"p-element"],inputs:{header:"header",draggable:"draggable",resizable:"resizable",positionLeft:"positionLeft",positionTop:"positionTop",contentStyle:"contentStyle",contentStyleClass:"contentStyleClass",modal:"modal",closeOnEscape:"closeOnEscape",dismissableMask:"dismissableMask",rtl:"rtl",closable:"closable",responsive:"responsive",appendTo:"appendTo",breakpoints:"breakpoints",styleClass:"styleClass",maskStyleClass:"maskStyleClass",showHeader:"showHeader",breakpoint:"breakpoint",blockScroll:"blockScroll",autoZIndex:"autoZIndex",baseZIndex:"baseZIndex",minX:"minX",minY:"minY",focusOnShow:"focusOnShow",maximizable:"maximizable",keepInViewport:"keepInViewport",focusTrap:"focusTrap",transitionOptions:"transitionOptions",closeIcon:"closeIcon",closeAriaLabel:"closeAriaLabel",closeTabindex:"closeTabindex",minimizeIcon:"minimizeIcon",maximizeIcon:"maximizeIcon",visible:"visible",style:"style",position:"position"},outputs:{onShow:"onShow",onHide:"onHide",visibleChange:"visibleChange",onResizeInit:"onResizeInit",onResizeEnd:"onResizeEnd",onDragEnd:"onDragEnd",onMaximize:"onMaximize"},ngContentSelectors:Zt,decls:1,vars:1,consts:[[3,"class","ngClass",4,"ngIf"],[3,"ngClass"],["pFocusTrap","","role","dialog",3,"ngClass","ngStyle","class","pFocusTrapDisabled",4,"ngIf"],["pFocusTrap","","role","dialog",3,"ngClass","ngStyle","pFocusTrapDisabled"],["container",""],["class","p-resizable-handle","style","z-index: 90;",3,"mousedown",4,"ngIf"],["class","p-dialog-header",3,"mousedown",4,"ngIf"],[3,"ngClass","ngStyle"],["content",""],[4,"ngTemplateOutlet"],["class","p-dialog-footer",4,"ngIf"],[1,"p-resizable-handle",2,"z-index","90",3,"mousedown"],[1,"p-dialog-header",3,"mousedown"],["titlebar",""],["class","p-dialog-title",3,"id",4,"ngIf"],[1,"p-dialog-header-icons"],["role","button","type","button","tabindex","-1","pRipple","",3,"ngClass","click","keydown.enter",4,"ngIf"],["type","button","pRipple","",3,"ngClass","click","keydown.enter",4,"ngIf"],[1,"p-dialog-title",3,"id"],["role","button","type","button","tabindex","-1","pRipple","",3,"ngClass","click","keydown.enter"],["class","p-dialog-header-maximize-icon",3,"ngClass",4,"ngIf"],[4,"ngIf"],[1,"p-dialog-header-maximize-icon",3,"ngClass"],[3,"styleClass",4,"ngIf"],[3,"styleClass"],["type","button","pRipple","",3,"ngClass","click","keydown.enter"],["class","p-dialog-header-close-icon",3,"ngClass",4,"ngIf"],[1,"p-dialog-header-close-icon",3,"ngClass"],[1,"p-dialog-footer"],["footer",""]],template:function(t,o){1&t&&(e.F$t(Ct),e.YNc(0,bt,2,15,"div",0)),2&t&&e.Q6J("ngIf",o.maskVisible)},dependencies:function(){return[m.mk,m.O5,m.tP,m.PC,se.i,ue.H,le.q,de,pe]},styles:["@layer primeng{.p-dialog-mask{position:fixed;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;pointer-events:none}.p-dialog-mask.p-component-overlay{pointer-events:auto}.p-dialog{display:flex;flex-direction:column;pointer-events:auto;max-height:90%;transform:scale(1);position:relative}.p-dialog-content{overflow-y:auto;flex-grow:1}.p-dialog-header{display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.p-dialog-draggable .p-dialog-header{cursor:move}.p-dialog-footer{flex-shrink:0}.p-dialog .p-dialog-header-icons{display:flex;align-items:center}.p-dialog .p-dialog-header-icon{display:flex;align-items:center;justify-content:center;overflow:hidden;position:relative}.p-fluid .p-dialog-footer .p-button{width:auto}.p-dialog-top .p-dialog,.p-dialog-bottom .p-dialog,.p-dialog-left .p-dialog,.p-dialog-right .p-dialog,.p-dialog-top-left .p-dialog,.p-dialog-top-right .p-dialog,.p-dialog-bottom-left .p-dialog,.p-dialog-bottom-right .p-dialog{margin:.75rem;transform:translateZ(0)}.p-dialog-maximized{transition:none;transform:none;width:100vw!important;height:100vh!important;top:0!important;left:0!important;max-height:100%;height:100%}.p-dialog-maximized .p-dialog-content{flex-grow:1}.p-dialog-left{justify-content:flex-start}.p-dialog-right{justify-content:flex-end}.p-dialog-top{align-items:flex-start}.p-dialog-top-left{justify-content:flex-start;align-items:flex-start}.p-dialog-top-right{justify-content:flex-end;align-items:flex-start}.p-dialog-bottom{align-items:flex-end}.p-dialog-bottom-left{justify-content:flex-start;align-items:flex-end}.p-dialog-bottom-right{justify-content:flex-end;align-items:flex-end}.p-dialog .p-resizable-handle{position:absolute;font-size:.1px;
1display:block;cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.p-confirm-dialog .p-dialog-content{display:flex;align-items:center}}\n"],encapsulation:2,data:{animation:[(0,O.X$)("animation",[(0,O.eR)("void => visible",[(0,O._7)(Tt)]),(0,O.eR)("visible => void",[(0,O._7)(yt)])])]},changeDetection:0})),a})(),It=(()=>{var n;class a{}return n=a,(0,d.Z)(a,"\u0275fac",function(t){return new(t||n)}),(0,d.Z)(a,"\u0275mod",e.oAB({type:n})),(0,d.Z)(a,"\u0275inj",e.cJS({imports:[m.ez,se.o,ue.T,le.q,de,pe,E.m8]})),a})();var I=g(3525),J=g(2980),_=g(553),V=g(9030),W=g(9862);let Y=(()=>{var n;class a{constructor(t){this.http=t}getEnrollments(t,o){let r=V.s.fromLazyEvent(o);return this.http.get(`${_.N.api}/competitions/${t}/enrollments`,{params:r})}getBibs(t,o){let r=V.s.fromLazyEvent(o);return console.log("params",r),this.http.get(`${_.N.api}/competitions/${t}/bibs`,{params:r})}getBib(t,o){let r=V.s.fromLazyEvent(o);return console.log("params",r),this.http.get(`${_.N.api}/competitions/${t}/collect-bibs`,{params:r})}getCollectedBibs(t,o){let r=V.s.fromLazyEvent(o);return console.log("params",r),this.http.get(`${_.N.api}/competitions/${t}/collected-bibs`,{params:r})}updateEnrollment(t,o){return this.http.put(`${_.N.api}/competitions/${t}/enrollments/${o.id}`,o)}}return(n=a).\u0275fac=function(t){return new(t||n)(e.LFG(W.eN))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),a})();var q=g(9264),F=g(289),p=g(95),R=g(3714),G=g(4322);function Dt(n,a){if(1&n&&(e.TgZ(0,"div",20)(1,"h4"),e._uU(2),e.ALo(3,"date"),e.qZA(),e.TgZ(4,"h4"),e._uU(5),e.qZA()()),2&n){const i=e.oxw();e.xp6(2),e.AsE("",i.competition.place,", ",e.xi3(3,3,i.competition.date,"longDate"),""),e.xp6(3),e.Oqu(i.competition.name)}}function At(n,a){1&n&&(e.TgZ(0,"div"),e._uU(1,"Error "),e.qZA())}function Mt(n,a){if(1&n&&(e.TgZ(0,"a",21),e._uU(1,"Dorsais en PDF"),e.qZA()),2&n){const i=e.oxw();e.s9C("href",i.storageBibs+i.competition.bibsUrl,e.LSH)}}function Nt(n,a){1&n&&(e.TgZ(0,"div",7),e._uU(1," Non hai dorsais "),e.qZA())}function Ot(n,a){if(1&n&&(e.ynx(0),e.TgZ(1,"tr",33)(2,"td",34),e._uU(3),e.qZA(),e.TgZ(4,"td",34),e._uU(5),e.ALo(6,"titlecase"),e.qZA(),e.TgZ(7,"td",35),e._uU(8),e.ALo(9,"titlecase"),e.qZA(),e.TgZ(10,"td",35),e._uU(11),e.qZA(),e.TgZ(12,"td",35),e._uU(13),e.qZA()(),e.BQk()),2&n){const i=a.$implicit,t=e.oxw(2);e.xp6(3),e.Oqu(i.bib),e.xp6(2),e.Oqu(e.lcZ(6,5,i.name)),e.xp6(3),e.Oqu(e.lcZ(9,7,i.lastName)),e.xp6(3),e.Oqu(t.getCategory(i)),e.xp6(2),e.hij(" ",i.race," ")}}function qt(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"div",22)(1,"div",23)(2,"table",24)(3,"thead")(4,"tr")(5,"th",25),e._UZ(6,"i",26),e._uU(7," Dorsal "),e.qZA(),e.TgZ(8,"th",25),e._UZ(9,"i",27),e._uU(10," Nome "),e.qZA(),e.TgZ(11,"th",25),e._uU(12," Apelidos "),e.qZA(),e.TgZ(13,"th",25),e._UZ(14,"i",28),e._uU(15," Categor\xeda "),e.qZA(),e.TgZ(16,"th",25),e._UZ(17,"i",29),e._uU(18," Carreira "),e.qZA()()(),e.TgZ(19,"tbody"),e.YNc(20,Ot,14,9,"ng-container",30),e.qZA()()(),e.TgZ(21,"div",31)(22,"p-paginator",32),e.NdJ("onPageChange",function(o){e.CHM(i);const r=e.oxw();return e.KtG(r.paginate(o))}),e.qZA(),e.TgZ(23,"span"),e._uU(24),e.qZA()()()}if(2&n){const i=e.oxw();e.xp6(20),e.Q6J("ngForOf",i.enrollments),e.xp6(2),e.Q6J("rows",i.size)("totalRecords",i.totalRecords),e.xp6(2),e.Oqu(i.infoRecords)}}const Ut=function(){return{standalone:!0}};let Pt=(()=>{var n;class a{constructor(t,o,r,s,l){this.enrollemntsService=t,this.eventService=o,this.router=r,this.route=s,this.toastNotifier=l,this.totalRecords=0,this.infoRecords="",this.actualIndex=0,this.size=50,this.races=[],this.enrollments=[],this.categories=[],this.genderType=J.Y,this.storageBibs="",this.route.params.subscribe(c=>{this.eventId=c.eventId})}ngOnInit(){this.eventService.getEvent(this.eventId).subscribe({next:t=>{this.competition=t[0],this.storageBibs=`${_.N.storage.basicUrl}/${_.N.storage.competitions}/${this.competition.id}/${_.N.storage.bibsDocuments}/`,this.paginate({first:this.actualIndex,rows:this.size})}})}paginate(t){this.actualIndex=t.first,this.loading=!0,this.setFilter(t),this.enrollemntsService.getEnrollments(this.eventId,t).subscribe({next:o=>{this.enrollments=o.items,this.totalRecords=o.count,this.infoRecords=(0,I.f8)(this.actualIndex,this.size,this.totalRecords,"dorsales"),this.loading=!1},error:o=>{this.loading=!1}})}search(){this.paginate({first:0,rows:this.size})}setFilter(t){t.globalFilter=this.searchTerm,t.sortField="bibNumber",t.sortOrder=1,t.filters={hasBib:{value:!0}}}getCategory(t){return`${t.category}
1 ${J.d.getShortLabel(t.gender)}`}}return(n=a).\u0275fac=function(t){return new(t||n)(e.Y36(Y),e.Y36(q.P),e.Y36(T.F0),e.Y36(T.gz),e.Y36(F.o))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-bibs"]],decls:22,vars:8,consts:[[1,"mb-3","mb-xl-5","s-enrollments"],[1,"container"],[1,"title","mt-4","mt-lg-0"],[1,"mb-4","text-center"],["src","assets/img/cg-separator.png","alt",""],["class","pb-2 mb-3",4,"ngIf"],[4,"ngIf"],[1,"event-enrollments","mb-2"],[1,"section-title-wrap"],[1,"records-table-filter"],[1,"row"],[1,"col-md-8"],["class","btn pdf","target","_blank",3,"href",4,"ngIf"],[1,"col-md-4","align-items-end","justify-content-end"],[1,"search"],[1,"fa","fa-search"],["title","search","type","text","pInputText","","placeholder","Buscar",1,"form-control",3,"ngModel","ngModelOptions","ngModelChange"],[1,"d-none","d-xl-block","section-title-separator"],["class","event-enrollments  mb-2",4,"ngIf"],["class","mb-2 mt-2",4,"ngIf"],[1,"pb-2","mb-3"],["target","_blank",1,"btn","pdf",3,"href"],[1,"mb-2","mt-2"],[1,"table-responsive"],[1,"table","table-striped","table-condensed"],[1,"text-xl-start"],[1,"fa","fa-id-card"],[1,"fa-solid","fa-person-running"],[1,"fa","fa-list"],[1,"fa","fa-arrows-h"],[4,"ngFor","ngForOf"],[1,"pagination","mb-5"],[3,"rows","totalRecords","onPageChange"],[1,"main-tr"],[1,"col-md-2","text-center","text-xl-start"],[1,"d-xl-table-cell","col-md-2"]],template:function(t,o){1&t&&(e.TgZ(0,"section",0)(1,"div",1)(2,"h2",2)(3,"span"),e._uU(4,"Dorsais"),e.qZA()(),e.TgZ(5,"div",3),e._UZ(6,"img",4),e.qZA(),e.YNc(7,Dt,6,6,"div",5),e.YNc(8,At,2,0,"div",6),e.TgZ(9,"div",7)(10,"div",8)(11,"div",9)(12,"div",10)(13,"div",11),e.YNc(14,Mt,2,1,"a",12),e.qZA(),e.TgZ(15,"div",13)(16,"div",14),e._UZ(17,"i",15),e.TgZ(18,"input",16),e.NdJ("ngModelChange",function(s){return o.searchTerm=s})("ngModelChange",function(){return o.search()}),e.qZA()()(),e._UZ(19,"div",17),e.qZA()()(),e.YNc(20,Nt,2,0,"div",18),e.YNc(21,qt,25,4,"div",19),e.qZA()()()),2&t&&(e.xp6(7),e.Q6J("ngIf",o.competition),e.xp6(1),e.Q6J("ngIf",o.error),e.xp6(6),e.Q6J("ngIf",o.competition.bibsUrl),e.xp6(4),e.Q6J("ngModel",o.searchTerm)("ngModelOptions",e.DdM(7,Ut)),e.xp6(2),e.Q6J("ngIf",0==o.totalRecords),e.xp6(1),e.Q6J("ngIf",o.totalRecords>0))},dependencies:[m.sg,m.O5,p.Fj,p.JJ,p.On,R.o,G.D,m.rS,m.uU],styles:[".s-enrollments[_ngcontent-%COMP%]{padding-top:150px;font-size:16px;color:#333}input[type=text][_ngcontent-%COMP%], input[type=search][_ngcontent-%COMP%]{height:41px}.search[_ngcontent-%COMP%]{position:relative}.search[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{text-indent:25px}.search[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus{box-shadow:none}.search[_ngcontent-%COMP%]   .fa-search[_ngcontent-%COMP%]{position:absolute;top:11px;left:12px}.search[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{position:absolute;top:0;right:0}"]}),a})();var ge=g(8180),me=g(5861);const Rt=["input"];function Et(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"span")(1,"input",1,2),e.NdJ("click",function(o){e.CHM(i);const r=e.oxw();return e.KtG(r.onClick(o))})("paste",function(o){const s=e.CHM(i).index,l=e.oxw();return e.KtG(l.onPaste(o,s))})("input",function(o){const s=e.CHM(i).index,l=e.oxw();return e.KtG(l.onInput(o,s))})("keydown",function(o){const s=e.CHM(i).index,l=e.oxw();return e.KtG(l.onKeydown(o,s))}),e.qZA()()}if(2&n){const i=e.oxw();e.ekj("code-hidden",i.isCodeHidden),e.xp6(1),e.Q6J("type",i.inputType)("disabled",i.disabled),e.uIk("inputmode",i.inputMode)("autocapitalize",i.autocapitalize)}}const _e=new e.OlP("CodeInputComponentConfig"),he={codeLength:4,inputType:"tel",inputMode:"numeric",initialFocusField:void 0,isCharsCode:!1,isCodeHidden:!1,isPrevFocusableAfterClearing:!0,isFocusingOnLastByClickIfFilled:!1,code:void 0,disabled:!1,autocapitalize:void 0};var S=function(n){return n[n.ready=0]="ready",n[n.reset=1]="reset",n}(S||{});let kt=(()=>{var n;class a{constructor(t){if(this.isNonDigitsCode=!1,this.codeChanged=new e.vpe,this.codeCompleted=new e.vpe,this.placeholders=[],this.inputs=[],this.inputsStates=[],this.state={isFocusingAfterAppearingCompleted:!1,isInitialFocusFieldEnabled:!1},Object.assign(this,he),t)for(const o in t)t.hasOwnProperty(o)&&he.hasOwnProperty(o)&&(this[o]=t[o
1])}ngOnInit(){this.state.isInitialFocusFieldEnabled=!this.isEmpty(this.initialFocusField),this.onCodeLengthChanges()}ngAfterViewInit(){this.inputsListSubscription=this.inputsList.changes.subscribe(this.onInputsListChanges.bind(this)),this.onInputsListChanges(this.inputsList)}ngAfterViewChecked(){this.focusOnInputAfterAppearing()}ngOnChanges(t){t.code&&this.onInputCodeChanges(),t.codeLength&&this.onCodeLengthChanges()}ngOnDestroy(){this.inputsListSubscription&&this.inputsListSubscription.unsubscribe()}reset(t=!1){this.onInputCodeChanges(),this.state.isInitialFocusFieldEnabled&&this.focusOnField(this.initialFocusField),t&&this.emitChanges()}focusOnField(t){if(t>=this._codeLength)throw new Error("The index of the focusing input box should be less than the codeLength.");this.inputs[t].focus()}onClick(t){if(!this.isFocusingOnLastByClickIfFilled)return;const r=this.inputs[this._codeLength-1];t.target===r||!(this.getCurrentFilledCode().length>=this._codeLength)||setTimeout(()=>r.focus())}onInput(t,o){const r=t.target,s=t.data||r.value;if(this.isEmpty(s))return;if(!this.canInputValue(s))return t.preventDefault(),t.stopPropagation(),this.setInputValue(r,null),void this.setStateForInput(r,S.reset);const l=s.toString().trim().split("");for(let u=0;u<l.length;u++){const v=u+o;if(v>this._codeLength-1)break;this.setInputValue(this.inputs[v],l[u])}this.emitChanges();const c=o+l.length;c>this._codeLength-1?r.blur():this.inputs[c].focus()}onPaste(t,o){t.preventDefault(),t.stopPropagation();const r=t.clipboardData?t.clipboardData.getData("text").trim():void 0;if(this.isEmpty(r))return;const s=r.split("");let l=0;for(let c=o;c<this.inputs.length&&l!==s.length;c++){const u=this.inputs[c],v=s[l];if(!this.canInputValue(v))return this.setInputValue(u,null),void this.setStateForInput(u,S.reset);this.setInputValue(u,v.toString()),l++}this.inputs[o].blur(),this.emitChanges()}onKeydown(t,o){var r=this;return(0,me.Z)(function*(){const s=t.target,l=r.isEmpty(s.value),c=o-1,u=yield r.isBackspaceKey(t),v=r.isDeleteKey(t);!u&&!v||(t.preventDefault(),r.setInputValue(s,null),l||r.emitChanges(),!(c<0||v)&&(l||r.isPrevFocusableAfterClearing)&&r.inputs[c].focus())})()}onInputCodeChanges(){if(!this.inputs.length)return;if(this.isEmpty(this.code))return void this.inputs.forEach(r=>{this.setInputValue(r,null)});const t=this.code.toString().trim().split("");let o=!0;for(const r of t)if(!this.canInputValue(r)){o=!1;break}this.inputs.forEach((r,s)=>{this.setInputValue(r,o?t[s]:null)})}onCodeLengthChanges(){if(this.codeLength)if(this._codeLength=this.codeLength,this._codeLength>this.placeholders.length){const t=Array(this._codeLength-this.placeholders.length).fill(1);this.placeholders.splice(this.placeholders.length-1,0,...t)}else this._codeLength<this.placeholders.length&&this.placeholders.splice(this._codeLength)}onInputsListChanges(t){if(t.length>this.inputs.length){const o=t.filter((s,l)=>l>this.inputs.length-1);this.inputs.splice(this.inputs.length,0,...o.map(s=>s.nativeElement));const r=Array(o.length).fill(S.ready);this.inputsStates.splice(this.inputsStates.length,0,...r)}else t.length<this.inputs.length&&(this.inputs.splice(t.length),this.inputsStates.splice(t.length));this.onInputCodeChanges()}focusOnInputAfterAppearing(){this.state.isInitialFocusFieldEnabled&&(this.state.isFocusingAfterAppearingCompleted||(this.focusOnField(this.initialFocusField),this.state.isFocusingAfterAppearingCompleted=document.activeElement===this.inputs[this.initialFocusField]))}emitChanges(){setTimeout(()=>this.emitCode(),50)}emitCode(){const t=this.getCurrentFilledCode();this.codeChanged.emit(t),t.length>=this._codeLength&&this.codeCompleted.emit(t)}getCurrentFilledCode(){let t="";for(const o of this.inputs)this.isEmpty(o.value)||(t+=o.value);return t}isBackspaceKey(t){return t.key&&"backspace"===t.key.toLowerCase()||t.keyCode&&8===t.keyCode?Promise.resolve(!0):t.keyCode&&229===t.keyCode?new Promise(r=>{setTimeout(()=>{const s=t.target,l=this.getStateForInput(s)===S.reset;l&&this.setStateForInput(s,S.ready),r(0===s.selectionStart&&!l)})}):Promise.resolve(!1)}isDeleteKey(t){return t.key&&"delete"===t.key.toLowerCase()||t.keyCode&&46===t.keyCode}setInputValue(t,o){const s="has-value",l="empty";this.isEmpty(o)?(t.value="",t.classList.remove(s),t.parentElement.classList.add(l)):(t.value=o,t.classList.add(s),t.parentElement.classList.remove(l))}canInputValue(t){return!this.isEmpty(t)&&(/^[0-9]+$/.test(t.toString())||this.isCharsCode||this.isNonDigitsCode)}setStateForInput(t,o){const r=this.inputs.indexOf(t);r<0||(this.inputsStates[r]=o)}getStateForInput(t){const o=this.inputs.indexOf(t);return this.inputsStates[o]}isEmpty(t){return null==t||!t.toString().length}}return(n=a).\u0275fac=function(t){return new(t||n)(e.Y36(_e,8))},n.\u0275cmp=e.Xpm({type:n,selectors:[["code-input"]],viewQuery:function(t,o){if(1&t&&e.Gf(Rt,5),2&t){let r;e.iGM(r=e.CRH())&&(o.inputsList=r)}},inputs:{codeLength:"codeLength",inputType:"inputType",inputMode:"inputMode",initialFocusField:"initialFocusField",isNonDigitsCode:"isNonDigitsCode",isCharsCode:"isCharsCode",isCodeHidden:"isCodeHidden",isPrevFocusableAfterClearing:"isPrevFocusableAfterClearing",isFocusingOnLastByClickIfFilled:"isFocusingOnLastByClickIfFilled",code:"code",disabled:"disabled",autocapitalize:"autocapitalize"},outputs:{codeChanged:"codeChanged",codeCompleted:"codeCompleted"},features:[e.TTD],decls:1,vars:1,consts:[[3,"code-hidden",4,"ngFor","ngForOf"],["autocomplete","one-time-code",3,"type","disabled","click","paste","input","keydown"],["input",""]],template:function(t,o){1&t&&e.YNc(0,Et,3,6,"span",0),2&t&&e.Q6J("ngForOf",o.placeholders)},dependencies:[m.sg],styles:["[_nghost-%COMP%]{--text-security-type: disc;--item-spacing: 4px;--item-height: 4.375em;--item-border: 1px solid #dddddd;--item-border-bottom: 1px solid #dddddd;--item-border-has-value: 1px solid #dddddd;--item-border-bottom-has-value: 1px solid #dddddd;--item-border-focused: 1px solid #dddddd;--item-border-bottom-focused: 1px solid #dddddd;--item-shadow-focused: 0px 1px 5px rgba(221, 221, 221, 1);--item-border-radius: 5px;--item-background: transparent;
1--item-font-weight: 300;--color: #171516;display:flex;transform:translateZ(0);font-size:inherit;color:var(--color)}[_nghost-%COMP%]   span[_ngcontent-%COMP%]{display:block;flex:1;padding-right:var(--item-spacing)}[_nghost-%COMP%]   span[_ngcontent-%COMP%]:first-child{padding-left:var(--item-spacing)}[_nghost-%COMP%]   span.code-hidden[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{text-security:var(--text-security-type);-webkit-text-security:var(--text-security-type);-moz-text-security:var(--text-security-type)}[_nghost-%COMP%]   input[_ngcontent-%COMP%]{width:100%;height:var(--item-height);color:inherit;background:var(--item-background);text-align:center;font-size:inherit;font-weight:var(--item-font-weight);border:var(--item-border);border-bottom:var(--item-border-bottom);border-radius:var(--item-border-radius);-webkit-appearance:none;transform:translateZ(0);-webkit-transform:translate3d(0,0,0);outline:none}[_nghost-%COMP%]   input.has-value[_ngcontent-%COMP%]{border:var(--item-border-has-value);border-bottom:var(--item-border-bottom-has-value)}[_nghost-%COMP%]   input[_ngcontent-%COMP%]:focus{border:var(--item-border-focused);border-bottom:var(--item-border-bottom-focused);box-shadow:var(--item-shadow-focused)}"]}),a})(),Jt=(()=>{var n;class a{static forRoot(t){return{ngModule:a,providers:[{provide:_e,useValue:t}]}}}return(n=a).\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[m.ez]}),a})();function Ft(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"section",1)(1,"div",2)(2,"h2",3)(3,"span"),e._uU(4,"Introduce el c\xf3digo de acceso"),e.qZA()(),e.TgZ(5,"code-input",4),e.NdJ("codeChanged",function(o){e.CHM(i);const r=e.oxw();return e.KtG(r.onCodeChanged(o))})("codeCompleted",function(o){e.CHM(i);const r=e.oxw();return e.KtG(r.onCodeCompleted(o))}),e.qZA()()()}2&n&&(e.xp6(5),e.Q6J("isCodeHidden",!0)("codeLength",4))}function St(n,a){if(1&n&&(e.TgZ(0,"div",24)(1,"h4"),e._uU(2),e.ALo(3,"date"),e.qZA(),e.TgZ(4,"h4"),e._uU(5),e.qZA()()),2&n){const i=e.oxw(2);e.xp6(2),e.AsE("",i.competition.place,", ",e.xi3(3,3,i.competition.date,"longDate"),""),e.xp6(3),e.Oqu(i.competition.name)}}function Qt(n,a){1&n&&(e.TgZ(0,"div"),e._uU(1,"Error "),e.qZA())}function Yt(n,a){if(1&n&&(e.TgZ(0,"a",25),e._uU(1,"Dorsais en PDF"),e.qZA()),2&n){const i=e.oxw(2);e.s9C("href",i.storageBibs+i.competition.bibsUrl,e.LSH)}}function Lt(n,a){1&n&&(e.TgZ(0,"div",9),e._uU(1," Non hai dorsais "),e.qZA())}function zt(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"td"),e._uU(1),e.ALo(2,"date"),e.TgZ(3,"a",40),e.NdJ("click",function(){e.CHM(i);const o=e.oxw().$implicit,r=e.oxw(3);return e.KtG(r.cancel(o))}),e._UZ(4,"i",41),e.qZA()()}if(2&n){const i=e.oxw().$implicit;e.xp6(1),e.Oqu(e.xi3(2,1,i.collectedDate,"dd/MM/yyyy HH:mm"))}}function Bt(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"td")(1,"a",42),e.NdJ("click",function(){e.CHM(i);const o=e.oxw().$implicit,r=e.oxw(3);return e.KtG(r.confirm(o))}),e._uU(2,"Confirmar"),e.qZA()()}}function Vt(n,a){if(1&n&&(e.ynx(0),e.TgZ(1,"tr",37)(2,"td",38),e._uU(3),e.qZA(),e.TgZ(4,"td",38),e._uU(5),e.ALo(6,"titlecase"),e.qZA(),e.TgZ(7,"td",39),e._uU(8),e.ALo(9,"titlecase"),e.qZA(),e.TgZ(10,"td",39),e._uU(11),e.qZA(),e.TgZ(12,"td",39),e._uU(13),e.qZA(),e.TgZ(14,"td",39),e._uU(15),e.qZA(),e.YNc(16,zt,5,4,"td",8),e.YNc(17,Bt,3,0,"td",8),e.qZA(),e.BQk()),2&n){const i=a.$implicit,t=e.oxw(3);e.xp6(3),e.Oqu(i.bib),e.xp6(2),e.Oqu(e.lcZ(6,8,i.name)),e.xp6(3),e.Oqu(e.lcZ(9,10,i.lastName)),e.xp6(3),e.Oqu(t.getCategory(i)),e.xp6(2),e.Oqu(i.tShirtSize),e.xp6(2),e.hij(" ",i.race,""),e.xp6(1),e.Q6J("ngIf",i.collectedBib),e.xp6(1),e.Q6J("ngIf",!i.collectedBib)}}function Gt(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"div",26)(1,"div",27)(2,"table",28)(3,"thead")(4,"tr")(5,"th",29),e._UZ(6,"i",30),e._uU(7," Dorsal "),e.qZA(),e.TgZ(8,"th",29),e._UZ(9,"i",31),e._uU(10," Nome "),e.qZA(),e.TgZ(11,"th",29),e._uU(12," Apelidos "),e.qZA(),e.TgZ(13,"th",29),e._UZ(14,"i",32),e._uU(15," Categor\xeda "),e.qZA(),e.TgZ(16,"th",29),e._UZ(17,"i",32),e._uU(18," Talla de Camiseta "),e.qZA(),e.TgZ(19,"th",29),e._UZ(20,"i",33),e._uU(21," Carreira "),e.qZA(),e.TgZ(22,"th"),e._uU(23,"Recogida"),e.qZA()()(),e.TgZ(24,"tbody"),e.YNc(25,Vt,18,12,"ng-container",34),e.qZA()()(),e.TgZ(26,"div",35)(27,"p-paginator",36),e.NdJ("onPageChange",function(o){e.CHM(i);const r=e.oxw(2);return e.KtG(r.paginate(o))}),e.qZA(),e.TgZ(28,"span"),e._uU(29),e.qZA()()()}if(2&n){const i=e.oxw(2);e.xp6(25),e.Q6J("ngForOf",i.enrollments),e.xp6(2),e.Q6J("rows",i.size)("totalRecords",i.totalRecords),e.xp6(2),e.Oqu(i.infoRecords)}}const fe=function(){return{standalone:!0}};function Ht(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"section",1)(1,"div",2)(2,"h2",3)(3,"span"),e._uU(4,"Recollida de dorsais"),e.qZA()(),e.TgZ(5,"div",5),e._UZ(6,"img",6),e.qZA(),e.YNc(7,St,6,6,"div",7),e.YNc(8,Qt,2,0,"div",8),e.TgZ(9,"div",9)(10,"div",10)(11,"div",11)(12,"div",12)(13,"div",13)(14,"div",14),e._UZ(15,"i",15),e.TgZ(16,"input",16),e.NdJ("ngModelChange",function(o){e.CHM(i);const r=e.oxw();return e.KtG(r.searchBibTerm=o)})("ngModelChange",function(){e.CHM(i);const o=e.oxw();
1return e.KtG(o.searchByBib())}),e.qZA()()(),e.TgZ(17,"div",17),e.YNc(18,Yt,2,1,"a",18),e.qZA(),e.TgZ(19,"div",19)(20,"div",14),e._UZ(21,"i",15),e.TgZ(22,"input",20),e.NdJ("ngModelChange",function(o){e.CHM(i);const r=e.oxw();return e.KtG(r.searchTerm=o)})("ngModelChange",function(){e.CHM(i);const o=e.oxw();return e.KtG(o.search())}),e.qZA()()(),e._UZ(23,"div",21),e.qZA()()(),e.YNc(24,Lt,2,0,"div",22),e.YNc(25,Gt,30,4,"div",23),e.qZA()()()}if(2&n){const i=e.oxw();e.xp6(7),e.Q6J("ngIf",i.competition),e.xp6(1),e.Q6J("ngIf",i.error),e.xp6(8),e.Q6J("ngModel",i.searchBibTerm)("ngModelOptions",e.DdM(9,fe)),e.xp6(2),e.Q6J("ngIf",i.competition&&i.competition.bibsUrl),e.xp6(4),e.Q6J("ngModel",i.searchTerm)("ngModelOptions",e.DdM(10,fe)),e.xp6(2),e.Q6J("ngIf",0==i.totalRecords),e.xp6(1),e.Q6J("ngIf",i.totalRecords>0)}}let jt=(()=>{var n;class a{constructor(t,o,r,s){this.enrollemntsService=t,this.eventService=o,this.toasterNotifier=r,this.route=s,this.totalRecords=0,this.infoRecords="",this.actualIndex=0,this.size=50,this.races=[],this.enrollments=[],this.categories=[],this.genderType=J.Y,this.storageBibs="",this.askCode=!0,this.confirming=!1,this.countCollectedBibs=0,this.route.params.subscribe(l=>{this.eventId=l.eventId})}ngOnInit(){localStorage.getItem("code")==_.N.collectCode&&(this.askCode=!1),this.enrollemntsService.getCollectedBibs(this.eventId,{first:0,rows:this.size}).subscribe({next:o=>{this.countCollectedBibs=o.count,console.log("this.countCollectedBibs",this.countCollectedBibs)},error:o=>{}}),this.eventService.getEvent(this.eventId).subscribe({next:o=>{this.competition=o[0],this.storageBibs=`${_.N.storage.basicUrl}/${_.N.storage.competitions}/${this.competition.id}/${_.N.storage.bibsDocuments}/`,this.paginate({first:this.actualIndex,rows:this.size})}})}paginate(t){this.actualIndex=t.first,this.loading=!0,this.setFilter(t),console.log("event",t),this.enrollemntsService.getBibs(this.eventId,t).subscribe({next:o=>{this.enrollments=o.items,this.totalRecords=o.count,this.infoRecords=(0,I.f8)(this.actualIndex,this.size,this.totalRecords,"dorsales"),this.loading=!1},error:o=>{this.loading=!1}})}paginateBib(t){this.actualIndex=t.first,this.loading=!0,this.setFilterBib(t),console.log("event",t),this.enrollemntsService.getBib(this.eventId,t).subscribe({next:o=>{this.enrollments=o.items,this.totalRecords=o.count,this.infoRecords=(0,I.f8)(this.actualIndex,this.size,this.totalRecords,"dorsales"),this.loading=!1},error:o=>{this.loading=!1}})}search(){console.log("searchTerm",this.searchTerm),this.paginate({first:0,rows:this.size})}searchByBib(){console.log("searchBibTerm",this.searchBibTerm),this.paginateBib({first:0,rows:this.size})}setFilter(t){t.globalFilter=this.searchTerm,t.sortField="bibNumber",t.sortOrder=1,t.filters={hasBib:{value:!0}}}setFilterBib(t){t.globalFilter=this.searchBibTerm,t.sortField="bibNumber",t.sortOrder=1,t.filters={hasBib:{value:!0}}}getCategory(t){return`${t.category} ${J.d.getShortLabel(t.gender)}`}confirm(t){this.confirming||(this.confirming=!0,t.key=null,this.enrollemntsService.updateEnrollment(this.eventId,t).pipe((0,ge.q)(1)).subscribe({next:o=>{this.toasterNotifier.success("Dorsal confirmado"),t.collectedBib=!0,t.collectedDate=new Date,this.confirming=!1},error:o=>{this.toasterNotifier.fail("Error al confirmar dorsal"),this.confirming=!1}}))}cancel(t){this.confirming||(this.confirming=!0,t.key=null,this.enrollemntsService.updateEnrollment(this.eventId,t).pipe((0,ge.q)(1)).subscribe({next:o=>{this.toasterNotifier.success("Cancelada confirmaci\xf3n"),t.collectedBib=!1,t.collectedDate=new Date,this.confirming=!1},error:o=>{this.toasterNotifier.fail("Error al confirmar dorsal"),this.confirming=!1}}))}onCodeChanged(t){console.log(t)}onCodeCompleted(t){console.log(t),t==_.N.collectCode&&(console.log("C\xf3digo correcto"),this.askCode=!1,localStorage.setItem("code",t))}}return(n=a).\u0275fac=function(t){return new(t||n)(e.Y36(Y),e.Y36(q.P),e.Y36(F.o),e.Y36(T.gz))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-collect-bibs"]],decls:2,vars:2,consts:[["class","mb-3 mb-xl-5 s-enrollments ",4,"ngIf"],[1,"mb-3","mb-xl-5","s-enrollments"],[1,"container"],[1,"title","mt-4","mt-lg-0"],["
1initialFocusField","0",3,"isCodeHidden","codeLength","codeChanged","codeCompleted"],[1,"mb-4","text-center"],["src","assets/img/cg-separator.png","alt",""],["class","pb-2 mb-3",4,"ngIf"],[4,"ngIf"],[1,"event-enrollments","mb-2"],[1,"section-title-wrap"],[1,"records-table-filter"],[1,"row"],[1,"col-md-2"],[1,"search"],[1,"fa","fa-search"],["title","search","type","text","pInputText","","placeholder","Dorsal",1,"form-control",3,"ngModel","ngModelOptions","ngModelChange"],[1,"col-md-6"],["class","btn pdf","target","_blank",3,"href",4,"ngIf"],[1,"col-md-4","align-items-end","justify-content-end"],["title","search","type","text","pInputText","","placeholder","Buscar",1,"form-control",3,"ngModel","ngModelOptions","ngModelChange"],[1,"d-none","d-xl-block","section-title-separator"],["class","event-enrollments  mb-2",4,"ngIf"],["class","mb-2 mt-2",4,"ngIf"],[1,"pb-2","mb-3"],["target","_blank",1,"btn","pdf",3,"href"],[1,"mb-2","mt-2"],[1,"table-responsive"],[1,"table","table-striped","table-condensed"],[1,"text-xl-start"],[1,"fa","fa-id-card"],[1,"fa-solid","fa-person-running"],[1,"fa","fa-list"],[1,"fa","fa-arrows-h"],[4,"ngFor","ngForOf"],[1,"pagination","mb-5"],[3,"rows","totalRecords","onPageChange"],[1,"main-tr"],[1,"col-md-2","text-center","text-xl-start"],[1,"d-xl-table-cell","col-md-2"],[1,"cancel",3,"click"],[1,"fa-solid","fa-rectangle-xmark"],[1,"btn",3,"click"]],template:function(t,o){1&t&&(e.YNc(0,Ft,6,2,"section",0),e.YNc(1,Ht,26,11,"section",0)),2&t&&(e.Q6J("ngIf",o.askCode),e.xp6(1),e.Q6J("ngIf",!o.askCode))},dependencies:[m.sg,m.O5,p.Fj,p.JJ,p.On,R.o,G.D,kt,m.rS,m.uU],styles:[".s-enrollments[_ngcontent-%COMP%]{padding-top:150px;font-size:16px;color:#333}input[type=text][_ngcontent-%COMP%], input[type=search][_ngcontent-%COMP%]{height:41px}.search[_ngcontent-%COMP%]{position:relative}.search[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{text-indent:25px}.search[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus{box-shadow:none}.search[_ngcontent-%COMP%]   .fa-search[_ngcontent-%COMP%]{position:absolute;top:11px;left:12px}.search[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{position:absolute;top:0;right:0}.cancel[_ngcontent-%COMP%]{color:red;font-size:16px;margin-left:10px;cursor:pointer}"]}),a})();var L=function(n){return n.Draft="draft",n.Published="published",n.Disabled="disabled",n}(L||{}),Kt=g(1537),xe=g(6593),be=g(7248);function Wt(n,a){if(1&n&&(e.TgZ(0,"h3"),e._uU(1),e.qZA()),2&n){const i=e.oxw();e.xp6(1),e.Oqu(null==i.event.circuits[0]?null:i.event.circuits[0].name)}}function Xt(n,a){if(1&n&&(e.TgZ(0,"div",38)(1,"span",39)(2,"a",40)(3,"span",41),e._uU(4),e.qZA()()()()),2&n){const i=e.oxw().$implicit,t=e.oxw(3);e.xp6(2),e.Q6J("href",t.getEventLink(t.event)+"/races/"+i.id+"/enrollments",e.LSH),e.xp6(2),e.hij(" ",i.count," inscritos")}}function en(n,a){if(1&n&&(e.TgZ(0,"div",42)(1,"div",38)(2,"div",43)(3,"div",44),e._uU(4," Sa\xedda "),e.qZA(),e.TgZ(5,"div"),e._UZ(6,"i",45),e._uU(7),e.ALo(8,"date"),e.qZA()()()()),2&n){const i=e.oxw().$implicit,t=e.oxw(3);e.xp6(7),e.hij(" ",e.xi3(8,1,t.convertTimeStringToDate(i.time),"HH:mm"),"")}}function tn(n,a){if(1&n&&(e.TgZ(0,"div",42)(1,"div",38)(2,"div",43)(3,"div",44),e._uU(4," Distancia "),e.qZA(),e.TgZ(5,"div"),e._UZ(6,"i",46),e._uU(7),e.qZA()()()()),2&n){const i=e.oxw().$implicit,t=e.oxw(3);e.xp6(7),e.hij(" ",t.getDistance(i)," ")}}function nn(n,a){if(1&n&&(e.ynx(0),e.TgZ(1,"div",47)(2,"div",48)(3,"div",43)(4,"div",49),e._uU(5),e.ALo(6,"date"),e.qZA(),e.TgZ(7,"div",50),e._uU(8),e.ALo(9,"currency"),e.qZA()()()(),e.BQk()),2&n){const i=a.$implicit,t=a.index;e.xp6(2),e.Q6J("ngClass",0==t?"bg-green":1==t?"bg-blue":"bg-red"),e.xp6(3),e.Oqu(e.xi3(6,3,i.priceEnd,"dd/MM/yy HH:mm:ss")),e.xp6(3),e.Oqu(e.gM2(9,6,i.price,"EUR",!0,"1.2-2"))}}function on(n,a){if(1&n&&(e.TgZ(0,"div",51)(1,"div",52),e._UZ(2,"i",53),e.TgZ(3,"span",50),e._uU(4),e.qZA()()()),2&n){const i=e.oxw().$implicit;e.xp6(4),e.hij(" L\xedmite de prazas: ",i.participantsLimit,"")}}function an(n,a){if(1&n&&(e.ynx(0),e.TgZ(1,"div",22)(2,"div",23)(3,"div",24)(4,"div",25)(5,"div",26)(6,"div",27)(7,"span",28),e._UZ(8,"i",29)(9,"i",30),e.qZA(),e._uU(10),e.qZA()(),e.TgZ(11,"div",31),e.YNc(12,Xt,5,2,"div",32),e.qZA(),e.TgZ(13,"div",33)(14,"div",34),e.YNc(15,en,9,4,"div",35),e.YNc(16,tn,8,1,"div",35),e.qZA()()()()(),e.TgZ(17,"div",33)(18,"div",36),e.YNc(19,nn,10,11,"ng-container",12),e.qZA(),e.YNc(20,on,5,1,"div",37),e.qZA()(),e.BQk()),2&n){const i=a.$implicit,t=e.oxw().$implicit,o=e.oxw(2);e.xp6(1),e.ekj("last-row",o.isLastRace(i,t)),e.xp6(9),e.hij(" ",i.name," "),e.xp6(2),e.Q6J("ngIf",!i.hideEnrollments),e.xp6(3),e.Q6J("ngIf",!i.hideTime),e.xp6(1),e.Q6J("ngIf",!i.hideDistance),e.xp6(3),e.Q6J("ngForOf",i.rates),e.xp6(1),e.Q6J("ngIf",i.participantsLimit&&i.participantsLimit>0)}}const rn=function(){return{circuit:"true"}},sn=function(){return{}};function ln(n,a){if(1&n&&(e.TgZ(0,"a",54),e._UZ(1,"i",55),e._uU(2," Inscribirme"),e.qZA()),2&n){const i=e.oxw().$implicit,t=e.oxw(2);e.Q6J("routerLink","/events/"+t.event.normalizedName+"/"+t.event.i
1d+"/race/"+i.races[0].group+"/race-registration/step-1")("queryParams",i.isCircuit?e.DdM(2,rn):e.DdM(3,sn))}}function cn(n,a){1&n&&(e.TgZ(0,"span",56),e._UZ(1,"i",55),e._uU(2," Inscrici\xf3n Pechada"),e.qZA())}function dn(n,a){if(1&n&&(e.TgZ(0,"div",17)(1,"a",57),e._UZ(2,"i",58),e._uU(3," Inscribir Grupo"),e.qZA()()),2&n){const i=e.oxw().$implicit,t=e.oxw(2);e.xp6(1),e.Q6J("routerLink","/events/"+t.event.normalizedName+"/"+t.event.id+"/race/"+i.races[0].group+"/race-registration/multiple")}}function pn(n,a){if(1&n&&(e.TgZ(0,"div",17)(1,"a",59),e._UZ(2,"i",60),e._uU(3," Inscrici\xf3n de Club"),e.qZA()()),2&n){const i=e.oxw().$implicit,t=e.oxw(2);e.xp6(1),e.Q6J("routerLink","/events/"+t.event.normalizedName+"/"+t.event.id+"/race/"+i.races[0].group+"/race-multiple-registration")}}function un(n,a){if(1&n&&(e.ynx(0),e.TgZ(1,"div",13),e.YNc(2,an,21,8,"ng-container",12),e.TgZ(3,"div",14)(4,"div",15)(5,"div",16)(6,"div",17),e.YNc(7,ln,3,4,"a",18),e.YNc(8,cn,3,0,"span",19),e.qZA(),e.YNc(9,dn,4,1,"div",20),e.YNc(10,pn,4,1,"div",20),e.qZA()(),e.TgZ(11,"div",21)(12,"div",10),e._uU(13),e.qZA()()()(),e.BQk()),2&n){const i=a.$implicit,t=e.oxw(2);e.xp6(2),e.Q6J("ngForOf",i.races),e.xp6(5),e.Q6J("ngIf",!t.isClub&&i.showEnroll&&!t.event.isClosed),e.xp6(1),e.Q6J("ngIf",!i.showEnroll||t.event.isClosed),e.xp6(1),e.Q6J("ngIf",!t.isClub&&i.showEnroll&&!t.event.isClosed),e.xp6(1),e.Q6J("ngIf",t.isClub&&i.showEnroll&&!t.event.isClosed),e.xp6(3),e.hij("Total: ",t.getTotalCount(i.races)," inscritos ")}}function gn(n,a){if(1&n&&(e.ynx(0),e.TgZ(1,"div",8)(2,"div",9)(3,"h6",10),e._uU(4,"Escolle a t\xfaa proba"),e.qZA()(),e.TgZ(5,"div",11)(6,"h6",10),e._uU(7,"Prezo da inscrici\xf3n ata o d\xeda"),e.qZA()()(),e.YNc(8,un,14,6,"ng-container",12),e.BQk()),2&n){const i=e.oxw();e.xp6(8),e.Q6J("ngForOf",i.groups)}}function mn(n,a){if(1&n&&(e.TgZ(0,"a",62),e._UZ(1,"i",63),e._uU(2," Ir \xe1 web de inscrici\xf3ns da carreira"),e.qZA()),2&n){const i=e.oxw(2);e.Q6J("href",i.event.enrollmentUrl,e.LSH)}}function _n(n,a){1&n&&(e.TgZ(0,"p"),e._uU(1," Pr\xf3ximamente"),e.qZA())}function hn(n,a){if(1&n&&(e.ynx(0),e.TgZ(1,"div",6),e.YNc(2,mn,3,1,"a",61),e.YNc(3,_n,2,0,"p",2),e.qZA(),e.BQk()),2&n){const i=e.oxw();e.xp6(2),e.Q6J("ngIf",i.event.enrollmentUrl),e.xp6(1),e.Q6J("ngIf",!(i.event.enrollmentUrl||i.event.description||i.event.enrollmentInfo||i.event.bibPickup||i.event.awards))}}function fn(n,a){1&n&&(e.TgZ(0,"ul",64)(1,"li",65)(2,"a",66),e._uU(3,"Informaci\xf3n da Carreira"),e.qZA()()())}function vn(n,a){if(1&n&&(e.TgZ(0,"div",67)(1,"h4"),e._uU(2,"Informaci\xf3n xeral"),e.qZA(),e._UZ(3,"div",68),e.qZA()),2&n){const i=e.oxw();e.xp6(3),e.Q6J("innerHtml",i.event.description,e.oJD)}}function xn(n,a){if(1&n&&(e.TgZ(0,"div",67)(1,"h4"),e._uU(2,"Inscrici\xf3n"),e.qZA(),e._UZ(3,"div",68),e.qZA()),2&n){const i=e.oxw();e.xp6(3),e.Q6J("innerHtml",i.event.enrollmentInfo,e.oJD)}}function bn(n,a){if(1&n&&(e.TgZ(0,"div",67)(1,"h4"),e._uU(2,"Recollida de dorsais"),e.qZA(),e._UZ(3,"div",68),e.qZA()),2&n){const i=e.oxw();e.xp6(3),e.Q6J("innerHtml",i.event.bibPickup,e.oJD)}}function Cn(n,a){if(1&n&&(e.TgZ(0,"div",67)(1,"h4"),e._uU(2,"Servizos"),e.qZA(),e._UZ(3,"div",68),e.qZA()),2&n){const i=e.oxw();e.xp6(3),e.Q6J("innerHtml",i.event.services,e.oJD)}}function Zn(n,a){if(1&n&&(e.TgZ(0,"div",67)(1,"h4"),e._uU(2,"Premiaci\xf3ns"),e.qZA(),e._UZ(3,"div",68),e.qZA()),2&n){const i=e.oxw();e.xp6(3),e.Q6J("innerHtml",i.event.awards,e.oJD)}}let Tn=(()=>{var n;class a{constructor(t,o){this.eventService=t,this.enrollmentsService=o}ngOnInit(){this.eventService.countEnrollments(this.event.id).subscribe(o=>{this.event.bib0Amount=o[0]?.totalBib0s,this.event.donativeAmount=o[0]?.totalDonations,this.event.races.forEach(r=>{let s=o[0]?.races?.filter(l=>l.id==r.id)[0]?.totalEnrollments;r.count=s||0})},o=>{console.log(o)});let t=this.event.races.reduce((o,r)=>{if(o[r.group]||(o[r.group]={races:[],showEnroll:!1,isCircuit:!1}),o[r.group].showEnroll||(o[r.group].showEnroll=null!=r.rates.find(s=>new Date(s.priceEnd)>new Date)),o[r.group].races.push(r),r.enrollInCircuit){o.Circuit||(o.Circuit={races:[],showEnroll:!1,isCircuit:!0}),console.log("rates",r.rates);let s=r.rates.filter(l=>
1void 0!==l.priceCircuit).map(l=>({...l,price:l.priceCircuit}));if(s.length>0){const l={...r,name:r.name+" CIRCUITO",rates:s};let c={first:0,rows:10};c.filters={raceId:{value:r.id},isCircuit:{value:!0}},this.enrollmentsService.getEnrollments(this.event.id,c).subscribe({next:u=>{console.log("result",u),l.count=u.count,o.Circuit.races.push(l),o.Circuit.showEnroll||(o.Circuit.showEnroll=l.rates.some(v=>new Date(v.priceEnd)>new Date)),o.Circuit.races=o.Circuit.races.sort((v,Z)=>v.order-Z.order)},error:u=>{}})}}return o},{});this.groups=Object.values(t)}isLastRace(t,o){return o.races.indexOf(t)===o.races.length-1}getDistance(t){return t.hideDistance?"":t.roundDistance?t.distance/1e3+" km":t.distance+" m"}getTotalCount(t){return t.reduce((o,r)=>o+r.count,0)}hasLimit(){return this.groups.some(t=>t.races.some(o=>o.participantsLimit))}convertTimeStringToDate(t){return new Date(`1970-01-01T${t}`)}getEventLink(t){return`/events/${t.normalizedName}/${t.id}`}}return(n=a).\u0275fac=function(t){return new(t||n)(e.Y36(q.P),e.Y36(Y))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-event-races"]],inputs:{event:"event"},decls:19,vars:15,consts:[[1,"card-shadow"],[1,"race-name","pb-2","mb-3","text-center","text-lg-start"],[4,"ngIf"],[1,"event-race","fw-bold","mb-3"],["class","nav nav-tabs",4,"ngIf"],["class","race-description",4,"ngIf"],[1,"my-lg-3","text-center"],["src","assets/img/cg-separator.png","alt",""],[1,"row","mb-3","text-center"],[1,"col-md-8"],[1,"d-none","d-lg-inline"],[1,"col-md-4"],[4,"ngFor","ngForOf"],[1,"mb-5"],[1,"row","align-items-center","mb-3"],[1,"col-lg-6"],[1,"row","g-3","align-items-center","mb-3","mb-lg-0","text-center"],[1,"col-6","col-lg-auto"],["class","btn btn-inscripcion me-2",3,"routerLink","queryParams",4,"ngIf"],["class","btn btn-closed me-2",4,"ngIf"],["class","col-6 col-lg-auto",4,"ngIf"],[1,"col-lg-6","fw-normal","f-9","text-center","text-lg-end"],[1,"row","g-3","custom-row"],[1,"col-lg-8"],[1,"bg-grey","event-race","mb-0","mb-lg-3"],[1,"row","align-items-center","p-3"],[1,"col-lg-5"],[1,"text-center","text-lg-start"],[1,"fa-stack"],[1,"fa-solid","fa-circle","fa-stack-2x"],[1,"fa-solid","fa-person-running","fa-stack-1x","primary-color"],[1,"col-lg-3"],["class","text-center",4,"ngIf"],[1,"col-lg-4"],[1,"row","align-items-center","g-1"],["class","col-6",4,"ngIf"],[1,"row","align-items-center","g-3","text-center","mb-3"],["class","text-center f-8 mb-3",4,"ngIf"],[1,"text-center"],[1,"bg-white","px-2","rounded-pill"],[3,"href"],[1,"f-8","fw-semibold","green-text"],[1,"col-6"],[1,"race-icons"],[1,"primary-color"],[1,"fa-regular","fa-clock"],[1,"fa","fa-arrows-h"],[1,"col"],[1,"event-race","py-3",3,"ngClass"],[1,"f-8"],[1,"black-text"],[1,"text-center","f-8","mb-3"],[1,"limit"],[1,"fa-solid","fa-triangle-exclamation"],[1,"btn","btn-inscripcion","me-2",3,"routerLink","queryParams"],[1,"fa-solid","fa-person-running"],[1,"btn","btn-closed","me-2"],[1,"btn","btn-inscripcion","me-2",3,"routerLink"],[1,"fa-solid","fa-people-group"],[1,"btn","btn-inscripcion",3,"routerLink"],[1,"fa-solid","fa-users-rectangle"],["target","_blank","class","btn btn-inscripcion",3,"href",4,"ngIf"],["target","_blank",1,"btn","btn-inscripcion",3,"href"],[1,"fa-solid","fa-users"],[1,"nav","nav-tabs"],[1,"nav-item"],["aria-current","page","href","#",1,"nav-link","active"],[1,"race-description"],[3,"innerHtml"]],template:function(t,o){1&t&&(e.TgZ(0,"div",0)(1,"div",1)(2,"h4"),e._uU(3),e.ALo(4,"date"),e.qZA(),e.TgZ(5,"h2"),e._uU(6),e.qZA(),e.YNc(7,Wt,2,1,"h3",2),e.qZA(),e.TgZ(8,"div",3),e.YNc(9,gn,9,1,"ng-container",2),e.YNc(10,hn,4,2,"ng-container",2),e.qZA(),e.YNc(11,fn,4,0,"ul",4),e.YNc(12,vn,4,1,"div",5),e.YNc(13,xn,4,1,"div",5),e.YNc(14,bn,4,1,"div",5),e.YNc(15,Cn,4,1,"div",5),e.YNc(16,Zn,4,1,"div",5),e.qZA(),e.TgZ(17,"div",6),e._UZ(18,"img",7),e.qZA()),2&t&&(e.xp6(3),e.AsE("",o.event.place," - ",e.xi3(4,12,o.event.date,"fullDate"),""),e.xp6(3),e.Oqu(o.event.name),e.xp6(1),e.Q6J("ngIf",o.event.circuits),e.xp6(2),e.Q6J("ngIf",o.event.races&&o.event.races.length>0),e.xp6(1),e.Q6J("ngIf",!o.event.races||0==o.event.races.length),e.xp6(1),e.Q6J("ngIf",o.event.description||o.event.enrollmentInfo||o.event.bibPickup||o.event.awards),e.xp6(1),e.Q6J("ngIf",o.event.description),e.xp6(1),e.Q6J("ngIf",o.event.enrollmentInfo),e.xp6(1),e.Q6J("ngIf",o.event.bibPickup),e.xp6(1),e.Q6J("ngIf",o.event.services),e.xp6(1),e.Q6J("ngIf",o.event.awards))},dependencies:[m.mk,m.sg,m.O5,T.rH,m.H9,m.uU],styles:['.fa-circle[_ng
1content-%COMP%]{color:#fff}.race-icons[_ngcontent-%COMP%]{font-size:.8rem}.race-icons[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]{line-height:1.5}.green-text[_ngcontent-%COMP%]{color:green}.event-race[_ngcontent-%COMP%]{border-radius:10px}.race-price[_ngcontent-%COMP%]{padding:0 10px;border-radius:5px}.bg-red[_ngcontent-%COMP%]{background-color:#ffeee8;color:#d35932}.bg-blue[_ngcontent-%COMP%]{background-color:#edf2fe}.bg-green[_ngcontent-%COMP%]{background-color:#eaf9f1;color:#47b07c}.limit[_ngcontent-%COMP%]{background-color:#fdf7e5;border-radius:5px;color:#eeb417}.black-text[_ngcontent-%COMP%]{color:#333}.btn-closed[_ngcontent-%COMP%]{cursor:default}@media (max-width: 767.98px){.mb-5[_ngcontent-%COMP%] > .custom-row[_ngcontent-%COMP%]:not(.last-row):after{content:"";display:block;border-bottom:1px solid #F5F5F5;margin-left:10px;margin-right:10px;position:absolute;left:0;right:0;bottom:0}.mb-5[_ngcontent-%COMP%] > .custom-row[_ngcontent-%COMP%]:not(.last-row){position:relative;margin-bottom:20px}}']}),a})();var Ce=g(1621),yn=g(6676),z=g(3822),Ze=g(5919),wn=g(7094),Te=g(3979),X=g(1865),H=g(2105),In=g(3155);function Dn(n,a){1&n&&(e.TgZ(0,"span")(1,"strong"),e._uU(2,"Sesi\xf3n iniciada."),e.qZA(),e._uU(3," Os seus datos carg\xe1ronse da s\xfaa sesi\xf3n de usuario."),e.qZA())}function An(n,a){1&n&&(e.TgZ(0,"span")(1,"strong"),e._uU(2,"Datos recuperados."),e.qZA(),e._uU(3," Os seus datos carg\xe1ronse da s\xfaa sesi\xf3n de navegador."),e.qZA())}function Mn(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"div",28),e.YNc(1,Dn,4,0,"span",10),e.YNc(2,An,4,0,"span",10),e.TgZ(3,"button",29),e.NdJ("click",function(){e.CHM(i);const o=e.oxw();return e.KtG(o.clear())}),e._uU(4,"Limpar datos"),e.qZA()()}if(2&n){const i=e.oxw();e.xp6(1),e.Q6J("ngIf",i.isLogged),e.xp6(1),e.Q6J("ngIf",!i.isLogged&&i.isSession)}}function Nn(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"div",6)(1,"p-radioButton",7),e.NdJ("onClick",function(o){e.CHM(i);const r=e.oxw();return e.KtG(r.selectDocument(o))}),e.qZA(),e.TgZ(2,"label",8),e._uU(3," Menor sin DNI "),e.qZA()()}if(2&n){const i=e.oxw();e.xp6(1),e.Q6J("value",i.documentType.Minor)}}function On(n,a){1&n&&(e.TgZ(0,"div",31),e._uU(1,"* O n\xfamero de documento \xe9 obrigatorio"),e.qZA())}function qn(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,On,2,0,"div",30),e.qZA()),2&n){const i=e.oxw();let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.personalDetails.get("documentType"))?null:t.hasError("required"))}}function Un(n,a){1&n&&(e.TgZ(0,"div",31),e._uU(1,"* O n\xfamero de documento \xe9 obrigatorio"),e.qZA())}function Pn(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Un,2,0,"div",30),e.qZA()),2&n){const i=e.oxw(2);let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.personalDetails.get("documentNumber"))?null:t.hasError("required"))}}function Rn(n,a){1&n&&(e.TgZ(0,"div",31),e._uU(1,"* O n\xfamero de documento non \xe9 v\xe1lido"),e.qZA())}function En(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Rn,2,0,"div",30),e.qZA()),2&n){const i=e.oxw(2);let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.personalDetails.get("documentNumber"))?null:t.hasError("format"))}}function kn(n,a){if(1&n&&(e.TgZ(0,"div")(1,"label",5),e._uU(2,"N\xfamero de Documento"),e.qZA(),e._UZ(3,"input",32),e.YNc(4,Pn,2,1,"div",10),e.YNc(5,En,2,1,"div",10),e.qZA()),2&n){const i=e.oxw();let t,o;e.xp6(4),e.Q6J("ngIf",(null==(t=i.personalDetails.get("documentNumber"))?null:t.errors)&&(null==(t=i.personalDetails.get("documentNumber"))?null:t.dirty)),e.xp6(1),e.Q6J("ngIf",(null==(o=i.personalDetails.get("documentNumber"))?null:o.errors)&&(null==(o=i.personalDetails.get("documentNumber"))?null:o.dirty))}}function Jn(n,a){1&n&&(e.TgZ(0,"div")(1,"label",5),e._uU(2,"C\xf3digo de corredor"),e.qZA(),e._UZ(3,"input",33),e.TgZ(4,"span"),e._uU(5,"Se non tes c\xf3digo crearase un \xf3 final da inscrici\xf3n."),e.qZA()())}function Fn(n,a){1&n&&(e.TgZ(0,"div",31),e._uU(1,"* O nome \xe9 obrigatorio"),e.qZA())}function Sn(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Fn,2,0,"div",30),e.qZA()),2&n){const i=e.oxw();let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.personalDetails.get("name"))?null:t.hasError("required"))}}function Qn(n,a){1&n&&(e.TgZ(0,"div",31),e._uU(1,"* Os apelidos son obrigatorios"),e.qZA())}function Yn(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Qn,2,0,"div",30),e.qZA()),2&n){const i=e.oxw();let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.personalDetails.get("lastName"))?null:t.hasError("required"))}}function Ln(n,a){1&n&&(e.TgZ(0,"div",31),e._uU(1,"* O x\xe9nero \xe9 obrigatorio"),e.qZA())}function zn(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Ln,2,0,"div",30),e.qZA()),2&n){const i=e.oxw();let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.personalDetails.get("gender"))?null:t.hasError("required"))}}function Bn(n,a){1&n&&(e.TgZ(0,"div",31),e._uU(1,"* A data de nacemento \xe9 obrigatoria"),e.qZA())}function Vn(n,a){1&n&&(e.TgZ(0,"div",31),e._uU(1,"* A data non \xe9 v\xe1lida"),e.qZA())}function Gn(n,a){1&n&&(e.TgZ(0,"div",41),e._uU(1," Fecha de nacimiento incorrecta. "),e.qZA())}function Hn(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Bn,2,0,"div",30),e.YNc(2,Vn,2,0,"div",30),e.YNc(3,Gn,2,0,"div",40),e.qZA()),2&n){const i=e.oxw(2);let t,o;e.xp6(1),e.Q6J("ngIf",null==(t=i.personalDetails.get("dateOfBirth"))?null:t.hasError("required")),e.xp6(1),e.Q6J("ngIf",null==(o=i.personalDetails.get("dateOfBirth"))?null:o.hasError("dateNotValid")),e.xp6(1),e.Q6J("ngIf",i.personalDetails.get("dateOfBirth").hasError("customError"))}}function jn(n,a){1&n&&(e.TgZ(0,"div",41),e._uU(1," Fecha de nacimiento incorrecta. "),e.qZA())}function $n(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"div",3)(1,"div",34)(2,"div",35)(3,"label",36),e._uU(4,"Data de nacemento"),e.qZA(),e.TgZ(5,"app-full-date",37),e.NdJ("onChange",function(){e.CHM(i);const o=e.oxw();return e.KtG(o.getCategory())}),e.qZA(),e.YNc(6,Hn,4,3,"div",10),e.qZA(),e.TgZ(7,"div",38)(8,"label",36),e._uU(9,"Categor\xeda"),e.qZA(),e._UZ(10,"input",39),e.YNc(11,jn,2,0,"div",40),e.qZA()()()}if(2&n){const i=e.oxw();let t;e.xp6(6),e.Q6J("ngIf",(null==(t=i.personalDetails.get("dateOfBirth"))?null:t.errors)&&(null==(t=i.personalDetails.get("dateOfBirth"))?null:t.dirty)),e.xp6(
15),e.Q6J("ngIf",i.personalDetails.get("dateOfBirth").hasError("customError"))}}function Kn(n,a){1&n&&(e.TgZ(0,"div",31),e._uU(1,"* O pais \xe9 obrigatorio"),e.qZA())}function Wn(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Kn,2,0,"div",30),e.qZA()),2&n){const i=e.oxw();let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.personalDetails.get("countryObject"))?null:t.hasError("required"))}}function Xn(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"div",4)(1,"label",42),e._uU(2,"Provincia"),e.qZA(),e.TgZ(3,"p-dropdown",43),e.NdJ("onChange",function(o){e.CHM(i);const r=e.oxw();return e.KtG(r.selectState(o))}),e.qZA()()}if(2&n){const i=e.oxw();e.xp6(3),e.Q6J("options",i.states)("showClear",!0)("autoDisplayFirst",!1)}}function ei(n,a){if(1&n&&e._UZ(0,"p-dropdown",47),2&n){const i=e.oxw(2);e.Q6J("options",i.localities)("showClear",!0)("autoDisplayFirst",!1)}}function ti(n,a){1&n&&e._UZ(0,"input",48)}function ni(n,a){if(1&n&&(e.TgZ(0,"div",4)(1,"label",44),e._uU(2,"Localidade"),e.qZA(),e.YNc(3,ei,1,3,"p-dropdown",45),e.YNc(4,ti,1,0,"input",46),e.qZA()),2&n){const i=e.oxw();e.xp6(3),e.Q6J("ngIf",i.localities.length>0),e.xp6(1),e.Q6J("ngIf",0==i.localities.length)}}function ii(n,a){1&n&&(e.TgZ(0,"div",31),e._uU(1,"O tel\xe9fono \xe9 obrigatorio"),e.qZA())}function oi(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,ii,2,0,"div",30),e.qZA()),2&n){const i=e.oxw();let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.personalDetails.get("phone"))?null:t.hasError("required"))}}function ai(n,a){1&n&&(e.TgZ(0,"div",31),e._uU(1,"* O teu email \xe9 obrigatorio"),e.qZA())}function ri(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,ai,2,0,"div",30),e.qZA()),2&n){const i=e.oxw();let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.personalDetails.get("email"))?null:t.hasError("required"))}}function si(n,a){1&n&&(e.TgZ(0,"div",31),e._uU(1,"* O teu email \xe9 obrigatorio"),e.qZA())}function li(n,a){1&n&&(e.TgZ(0,"div",31),e._uU(1,"* O teu email ten que coincidir"),e.qZA())}function ci(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,si,2,0,"div",30),e.YNc(2,li,2,0,"div",30),e.qZA()),2&n){const i=e.oxw();let t,o;e.xp6(1),e.Q6J("ngIf",null==(t=i.personalDetails.get("repeatEmail"))?null:t.hasError("required")),e.xp6(1),e.Q6J("ngIf",null==(o=i.personalDetails.get("repeatEmail"))?null:o.hasError("matching"))}}let j=(()=>{var n;class a{constructor(t,o,r){this.formBuilder=t,this.locationsService=o,this.eventService=r,this.documentType=z.F,this.countries=[],this.states=[],this.localities=[],this.isLogged=!1,this.isSession=!1,this.isComplete=!1,this.onSelectRace=new e.vpe}ngAfterViewInit(){}ngOnInit(){this.getCountries(),this.personalDetails=this.formBuilder.group({documentType:["",p.kI.required],documentNumber:[""],code:[""],name:["",p.kI.required],lastName:["",p.kI.required],dateOfBirth:["",p.kI.required],gender:["",p.kI.required],countryObject:["",p.kI.required],stateObject:["",p.kI.required],localityObject:["",p.kI.required],phone:["",p.kI.required],email:["",p.kI.required],repeatEmail:["",p.kI.required],category:["",p.kI.required]},{validators:[Ce.Z.match("email","repeatEmail"),Ce.Z.identityDocumentFormat("documentNumber","documentType")]}),this.personalDetails.get("documentNumber").valueChanges.subscribe(t=>{let o=this.personalDetails.get("documentType").value;if(t&&o!=z.F.Other&&o!=z.F.Minor){let r=wn.X.normalize(t);r!=t&&this.personalDetails.controls.documentNumber.setValue(r)}}),this.eventService.countEnrollments(this.event.id).subscribe(t=>{this.event.bib0Amount=t[0]?.totalBib0s,this.event.donativeAmount=t[0]?.totalDonations,this.event.races.forEach(o=>{let r=t[0]?.races.filter(s=>s.id==o.id)[0]?.totalEnrollments;o.count=r||0,console.log("count",o.count)})},t=>{console.log(t)})}get personal(){return this.personalDetails.controls}getCountries(){this.locationsService.getAllCountries().subscribe({next:t=>{var o=t.filter(s=>"Espa\xf1a"==s.name),r=t.findIndex(s=>"Espa\xf1a"==s.name);t.splice(r,1),t.unshift(o[0]),this.countries=t,this.loadFormValues()},error:t=>{console.log(t)}})}selectCountry(t,o){t.value?this.locationsService.getAllStates(t.value.code).subscribe({next:r=>{this.states=r,this.personalDetails.get("stateObject")?.setValue(""),o&&(this.getSelectedItem(o,this.states,"stateObject"),this.selectState({value:o.stateObject},o))},error:r=>{console.log(r)}}):(this.localities=[],this.states=[],this.personalDetails.controls.countryObject.reset(),this.personalDetails.controls.stateObject.reset(),this.personalDetails.controls.localityObject.reset())}selectState(t,o){t.value?this.locationsService.getAllLocalities(t.value.code).subscribe({next:r=>{this.localities=r,this.personalDetails.get("localityObject")?.setValue(""),o&&this.get
1SelectedItem(o,this.localities,"localityObject")},error:r=>{console.log(r)}}):(this.localities=[],this.states=[],this.personalDetails.controls.stateObject.reset(),this.personalDetails.controls.localityObject.reset())}getCategory(){if(this.personalDetails.get("gender").valid)if(this.personalDetails.get("dateOfBirth").valid){let t=this.personalDetails.get("dateOfBirth").value,o=yn([t.year,t.month-1,t.day]).toDate(),r=this.event.races.filter(l=>l.group==this.group);const s=this.findRaceAndCategoryByBirthdate(r,o,this.personalDetails.get("gender").value);this.personalDetails.get("category").setValue(null),s?(this.categoryError=!1,this.category=s.category,this.race=s.race,console.log("this.race",this.race),!this.race.participantsLimit||this.race.participantsLimit>this.race.count?(this.categoryText=this.race.name+" - Categor\xeda: "+this.category.name,this.isComplete=!1,localStorage.removeItem("isComplete")):(this.categoryText=this.race.name+" - Completo",this.isComplete=!0,localStorage.setItem("isComplete","true")),this.personalDetails.get("category").setValue(this.categoryText)):(this.categoryError=!0,this.categoryText="")}else this.categoryText="";else this.categoryText=""}findRaceAndCategoryByBirthdate(t,o,r){const s=new Date(o);console.log("birthDate",o);for(const l of t)for(const c of l.categories){const u=this.getDateWithoutOffset(c.fromDate);console.log("fromDate",u);const v=this.getDateWithoutOffset(c.toDate);if(console.log("toDate",v),s>=u&&s<=v&&(c.gender===r||"mixed"===c.gender))return this.onSelectRace.emit(l),this.race=l,{category:c,race:l}}return null}getDateWithoutOffset(t){const o=new Date(t);return new Date(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate())}storeFormValues(){const t=this.personalDetails.value,o={...t,state:t.stateObject.name,locality:t.localityObject.name?t.localityObject.name:t.localityObject,country:t.countryObject.name,category:this.category,id:this.runnerId};let r=JSON.parse(sessionStorage.getItem("enrollments"))||[];r.length>this.index?(r[this.index].personalDetails=o,r[this.index].race=this.race,r[this.index].competition=this.event.id,r[this.index].group=this.group):r.push({personalDetails:o,race:this.race,competition:this.event.id,group:this.group}),sessionStorage.setItem("enrollments",JSON.stringify(r))}loadFormValues(){this.setEnrollmentValues(),this.storedValues&&(this.storedValues.localityObject=this.convertToObj(this.storedValues.localityObject),this.personalDetails.patchValue(this.storedValues),this.getSelectedItem(this.storedValues,this.countries,"countryObject"),this.selectCountry({value:this.storedValues.countryObject},this.storedValues),this.getCategory(),this.configDocumentForm(this.storedValues.documentType),this.isSession=!0)}setEnrollmentValues(){let t=JSON.parse(sessionStorage.getItem("enrollments"));if(t)this.storedValues=t[this.index]?.personalDetails,this.runnerId=t[this.index]?.personalDetails.id;else if(0==this.index){let o=(0,Ze.px)(this.index);o&&(this.storedValues=o.personalDetails,this.runnerId=o.personalDetails.id)}}getSelectedItem(t,o,r){let s;if(t[r].code)s=t[r];else{let l=t[r].name?t[r].name.toLocaleLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,""):null;s=l&&o&&o.length>0?o.find(c=>c.name.toLocaleLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")==l||c.alternatives&&c.alternatives.findIndex(u=>u.toLocaleLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")==l)>=0):t[r].name,t[r]=s}this.personalDetails.controls[r].setValue(s)}selectDocument(t){this.configDocumentForm(t.value)}configDocumentForm(t){t!=z.F.Minor?this.personalDetails.get("documentNumber").setValidators([p.kI.required]):(this.personalDetails.get("documentNumber").setValue(""),this.personalDetails.get("documentNumber").clearValidators()),this.personalDetails.get("documentNumber").updateValueAndValidity()}clear(){sessionStorage.removeItem("enrollments"),this.personalDetails.reset(),this.isSession=!1}hasMinorRaces(){return(0,I.Cl)(this.event)}convertToObj(t){return"string"==typeof t?{name:t}:t}}return(n=a).\u0275fac=function(t){return new(t||n)(e.Y36(p.QS),e.Y36(Te._),e.Y36(q.P))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-registration-general-data"]],inputs:{event:"event",group:"group",index:"index"},outputs:{onSelectRace:"onSelectRace"},decls:72,vars:22,consts:[[1,"race-registration",3,"formGroup"],["class","logged-in",4,"ngIf"],[1,"mb-3"],[1,"mb-3","p-3","bg-grey"],[1,"mb-2"],["for","name",1,"form-label"],[1,"form-check"],["name","documentType","formControlName","documentType",3,"value","onClick"],["for","documentType",1,"form-check-label"],["class","form-check",4,"ngIf"],[4,"ngIf"],["type","text","formControlName","name","pInputText","","placeholder","Introduce o teu nome"],["for","lastName",1,"form-label"],["type","text","formControlName","lastName","pInputText","","placeholder","Introduce os teus apelidos"],["for","genre",1,"form-label"],["name","gender","value","male","formControlName","gender",3,"click"],["for","gender",1,"form-check-label"],["name","gender","value","female","formControlName","gender",3,"click"],["class","mb-3 p-3 bg-grey",4,"ngIf"],["for","country",1,"form-label"],["formControlName","countryObject","optionLabel","name","placeholder","Selecciona un pais","aria-placeholder","Selecciona un pais",3,"options","showClear","autoDisplayFirst","onChange"],["class","mb-2",4,"ngIf"],["for","phone",1,"form-label"],["type","text","formControlName","phone","name","phone","placeholder","Introduce o teu n\xfamero de tel\xe9fono","pInputText",""],["for","email",1,"form-label"],["type","text","formControlName","email","name","email","placeholder","Introduce o teu email","pInputText",""],["for","repeatEmail",1,"form-label"],["type","text","formControlName","repeatEmail","name","repeatEmail","placeholder","Repite o teu email","pInputText",""],[1,"logged-in"],[1,"btn","align-right",3,"click"],["class","text-danger",4,"ngIf"],[1,"text-danger"],["type","text","formControlName","documentNumber","name","documentNumber","pInputText","","placeholder","Introduce o teu NIF / NIE / Outro Documento"],["type","text","formControlName","code","name","code","pInputText","","placeholder","Introduce o teu c\xf3digo de corredor"],[1,"row"],[1,"col-xl-7"],["for","date",1,"form-label"],["formControlName","dateOfBirth","type","inputs",3,"onChange"],[1,"col-xl-5"],["type","text","formControlName","category","name","category","placeholder","Selecciona una fecha v\xe1lida","pInputText","","readonly",""],["class","error-message",4,"ngIf"],[1,"error-message"],["for","stateObject",1,"form-label"],["formControlName","stateObject","optionLabel","name","placeholder","Selecciona unha provincia","aria-placeholder","Selecciona unha provincia",3,"options","showClear","autoDisplayFirst","onChange"],["for","localityObject",1,"form-label"],["formControlName","localityObject","optionLabel","name","placeholder","Selecciona unha localidade","aria-placeholder","Selecciona unha localidade",3,"options","showClear","autoDisplayFirst",4,"ngIf"],["type","text","formControlName","localityObject","name","localityObject","placeholder","Introduce a t\xfaa localidade","pInputText","",4,"ngIf"],["formControlName","localityObject","optionLabel","name","placeholder","Selecciona unha localidade","aria-placeholder","Selecciona unha localidade",3,"options","showClear","autoDisplayFirst"],["type","text","formControlName","localityObject","name","localityObject","placeholder","Introduce a t\xfaa localidade","pInputText",""]],template:function(t,o){if(1&t&&(e.TgZ(0,"form",0),e.YNc(1,Mn,5,2,"div",1),e.TgZ(2,"h4",2),e._uU(3,"Datos xerais do corredor"),e.qZA(),e.TgZ(4,"div",3)(5,"div",4)(6,"label",5),e._uU(7,"Tipo de documento"),e.qZA(),e.TgZ(8,"div",6)(9,"p-radioButton",7),e.NdJ("onClick",function(s){return o.selectDocument(s)}),e.qZA(),e.TgZ(10,"label",8),e._uU(11," DNI "),e.qZA()(),e.TgZ(12,"div",6)(13,"p-radioButton",7),e.NdJ("onClick",function(s){return o.selectDocument(s)}),e.qZA(),e.TgZ(14,"label",8),e._uU(15," NIE "),e.qZA()(),e.YNc(16,Nn,4,1,"div",9),e.TgZ(17,"div",6)(18,"p-radioButton",7),e.NdJ("onClick",function(s){return o.selectDocument(s)}),e.qZA(),e.TgZ(19,"label",8),e._uU(20," Outro documento "),e.qZA()(),e.YNc(21,qn,2,1,"div",10),e.qZA(),e.YNc(22,kn,6,2,"div",10),e.YNc(23,Jn,6,0,"div",10),e.qZA(),e.TgZ(24,"div",3)(25,"div",4)(26,"label",5),e._uU(27,"Nome"),e.qZA(),e._UZ(28,"input",11),e.YNc(29,Sn,2,1,"div",10),e.qZA(),e.TgZ(30,"div",4)(31,"label",12),e._uU(32,"Apelidos"),e.qZA(),e._UZ(33,"input",13),e.YNc(34,Yn,2,1,"div",10),e.qZA()(),e.TgZ(35,"div",3)(36,"label",14),e._uU(37,"X\xe9nero"),e.qZA(),e.TgZ(38,"div",6)(39,"p-radioButton",15),e.NdJ("click",function(){return o.getCategory()}),e.qZA(),e.TgZ(40,"label",16),e._uU(41," Home "),e.qZA()(),e.TgZ(42,"div",6)(43,"p-radioButton",17),e.NdJ("click",function(){return o.getCategory()}),e.qZA(),e.TgZ(44,"label",16),e._uU(45," Muller "),e.qZA()(),e.YNc(46,zn,2,1,"div",10),e.qZA(),e.YNc(47,$n,12,2,"div",18),e.TgZ(48,"div",3)(49,"div",4)(50,"label",19),e._uU(51,"Pa\xeds de nacionalidade"),e.qZA(),e.TgZ(52,"p-dropdown",20),e.NdJ("onChange",function(s){return o.selectCountry(s)}),e.qZA(),e.YNc(53,Wn,2,1,"div",10),e.qZA(),e.YNc(54,Xn,4,3,"div",21),e.YNc(55,ni,5,2,"div",21),e.qZA(),e.TgZ(56,"div",3)(57,"div",4)(58,"label",22),e._uU(59,"Tel\xe9fono"),e.qZA(),e._UZ(60,"input",23),e.YNc(61,oi,2,1,"div",10),e.qZA(),e.TgZ(62,"div",4)(63,"label",24),e._uU(64,"Email"),e.qZA(),e._UZ(65,"input",25),e.YNc(66,ri,2,1,"div",10),e.qZA(),e.TgZ(67,"div")(68,"label",26),e._uU(69,"Repetir email"),e.qZA(),e._UZ(70,"input",27),e.YNc(71,ci,3,2,"div",10),e.qZA()()()),2&t){let r,s,l,c,u,v,Z,y,D,w,h;e.Q6J("formGroup",o.personalDetails),e.xp6(1),e.Q6J("ngIf",o.isLogged||o.isSession),e.xp6(8),e.Q6J("value",o.documentType.Dni),e.xp6(4),e.Q6J("value",o.documentType.Nie),e.xp6(3),e.Q6J("ngIf",o.hasMinorRaces()),e.xp6(2),e.Q6J("value",o.documentType.Other),e.xp6(3),e.Q6J("ngIf",(null==(r=o.personalDetails.get("documentType"))?null:r.errors)&&(null==(r=o.personalDetails.get("documentType"))?null:r.dirty)),e.xp6(1),e.Q6J("ngIf",o.personalDetails.get("documentType").value&&o.personalDetails.get("documentType").value!=o.documentType.Minor),e.xp6(1),e.Q6J("ngIf",o.personalDetails.get("documentType").value&&o.personalDetails.get("documentType").value==o.documentType.Minor),e.xp6(6),e.Q6J("ngIf",(null==(s=o.personalDetails.get("name"))?null:s.errors)&&(null==(s=o.personalDetails.get("name"))?null:s.dirty)),e.xp6(
15),e.Q6J("ngIf",(null==(l=o.personalDetails.get("lastName"))?null:l.errors)&&(null==(l=o.personalDetails.get("lastName"))?null:l.dirty)),e.xp6(12),e.Q6J("ngIf",(null==(c=o.personalDetails.get("gender"))?null:c.errors)&&(null==(c=o.personalDetails.get("gender"))?null:c.dirty)),e.xp6(1),e.Q6J("ngIf",null==(u=o.personalDetails.get("gender"))?null:u.value),e.xp6(5),e.Q6J("options",o.countries)("showClear",!0)("autoDisplayFirst",!1),e.xp6(1),e.Q6J("ngIf",(null==(v=o.personalDetails.get("countryObject"))?null:v.errors)&&(null==(v=o.personalDetails.get("countryObject"))?null:v.dirty)),e.xp6(1),e.Q6J("ngIf",null==(Z=o.personalDetails.get("countryObject"))?null:Z.value),e.xp6(1),e.Q6J("ngIf",null==(y=o.personalDetails.get("stateObject"))?null:y.value),e.xp6(6),e.Q6J("ngIf",(null==(D=o.personalDetails.get("phone"))?null:D.errors)&&(null==(D=o.personalDetails.get("phone"))?null:D.dirty)),e.xp6(5),e.Q6J("ngIf",(null==(w=o.personalDetails.get("email"))?null:w.errors)&&(null==(w=o.personalDetails.get("email"))?null:w.dirty)),e.xp6(5),e.Q6J("ngIf",(null==(h=o.personalDetails.get("repeatEmail"))?null:h.errors)&&(null==(h=o.personalDetails.get("repeatEmail"))?null:h.dirty))}},dependencies:[m.O5,p._Y,p.Fj,p.JJ,p.JL,p.sg,p.u,X.EU,R.o,H.Lt,In.Z],styles:["p-dropdown[_ngcontent-%COMP%]{width:100%;display:inline-block}  .p-dropdown{width:100%}  .p-component[type=text]{width:100%}.category[_ngcontent-%COMP%]{display:block;margin-top:40px}.logged-in[_ngcontent-%COMP%]{background-color:#dff0d8;padding:20px;margin-bottom:10px;border-radius:5px}.align-right[_ngcontent-%COMP%]{float:right}"]}),a})();var di=g(7394),pi=g(111),ye=g(5422),we=g(3304),ee=g(1088),Ie=g(8057),De=g(7327);function ui(n,a){1&n&&(e.TgZ(0,"div",26),e._uU(1,"* O n\xfamero de documento \xe9 obrigatorio"),e.qZA())}function gi(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,ui,2,0,"div",25),e.qZA()),2&n){const i=e.oxw(2);let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.raceDetails.get("legalDocumentType"))?null:t.hasError("required"))}}function mi(n,a){1&n&&(e.TgZ(0,"div",26),e._uU(1,"* O n\xfamero de documento \xe9 obrigatorio"),e.qZA())}function _i(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,mi,2,0,"div",25),e.qZA()),2&n){const i=e.oxw(3);let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.raceDetails.get("legalDocumentNumber"))?null:t.hasError("required"))}}function hi(n,a){if(1&n&&(e.TgZ(0,"div",4)(1,"label",10),e._uU(2,"N\xfamero de Documento do autorizante"),e.qZA(),e._UZ(3,"input",27),e.YNc(4,_i,2,1,"div",2),e.qZA()),2&n){const i=e.oxw(2);let t;e.xp6(4),e.Q6J("ngIf",(null==(t=i.raceDetails.get("legalDocumentNumber"))?null:t.errors)&&(null==(t=i.raceDetails.get("legalDocumentNumber"))?null:t.dirty))}}function fi(n,a){1&n&&(e.TgZ(0,"div",26),e._uU(1,"* O nome \xe9 obrigatorio"),e.qZA())}function vi(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,fi,2,0,"div",25),e.qZA()),2&n){const i=e.oxw(2);let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.raceDetails.get("legalName"))?null:t.hasError("required"))}}function xi(n,a){1&n&&(e.TgZ(0,"div",26),e._uU(1,"* Os apelidos son obrigatorios"),e.qZA())}function bi(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,xi,2,0,"div",25),e.qZA()),2&n){const i=e.oxw(2);let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.raceDetails.get("legalLastName"))?null:t.hasError("required"))}}function Ci(n,a){if(1&n&&(e.TgZ(0,"div")(1,"div",17)(2,"div",4)(3,"strong",18),e._uU(4,"O corredor \xe9 un menor, polo que son obrigatorios os datos do autorizante para participar na carreira."),e.qZA(),e._UZ(5,"br"),e.TgZ(6,"label",10),e._uU(7,"Tipo de documento do autorizante"),e.qZA(),e.TgZ(8,"div",11),e._UZ(9,"p-radioButton",19),e.TgZ(10,"label",20),e._uU(11," DNI "),e.qZA()(),e.TgZ(12,"div",11),e._UZ(13,"p-radioButton",19),e.TgZ(14,"label",20),e._uU(15," NIE "),e.qZA()(),e.TgZ(16,"div",11),e._UZ(17,"p-radioButton",19),e.TgZ(18,"label",20),e._uU(19," Outro documento "),e.qZA()(),e.YNc(20,gi,2,1,"div",2),e.qZA(),e.YNc(21,hi,5,1,"div",7),e.TgZ(22,"div",4)(23,"label",21),e._uU(24,"Nome do autorizante"),e.qZA(),e._UZ(25,"input",22),e.YNc(26,vi,2,1,"div",2),e.qZA(),e.TgZ(27,"div",4)(28,"label",23),e._uU(29,"Apelidos do autorizante"),e.qZA(),e._UZ(30,"input",24),e.YNc(31,bi,2,1,"div",2),e.qZA()()()),2&n){const i=e.oxw();let t,o,r;e.xp6(9),e.Q6J("value",i.documentType.Dni),e.xp6(4),e.Q6J("value",i.documentType.Nie),e.xp6(4),e.Q6J("value",i.documentType.Other),e.xp6(3),e.Q6J("ngIf",(null==(t=i.raceDetails.get("legalDocumentType"))?null:t.errors)&&(null==(t=i.raceDetails.get("legalDocumentType"))?null:t.dirty)),e.xp6(1),e.Q6J("ngIf",i.raceDetails.get("legalDocumentType").value),e.xp6(5),e.Q6J("ngIf",(null==(o=i.raceDetails.get("legalName"))?null:o.errors)&&(null==(o=i.raceDetails.get("legalName"))?null:o.dirty)),e.xp6(
15),e.Q6J("ngIf",(null==(r=i.raceDetails.get("legalLastName"))?null:r.errors)&&(null==(r=i.raceDetails.get("legalLastName"))?null:r.dirty))}}function Zi(n,a){1&n&&(e.TgZ(0,"div",4)(1,"label",5),e._uU(2,"Outro Club"),e.qZA(),e._UZ(3,"input",28),e.qZA())}function Ti(n,a){1&n&&(e.TgZ(0,"div",26),e._uU(1,"* \xc9 obrigatorio marcar unha opci\xf3n"),e.qZA())}function yi(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Ti,2,0,"div",25),e.qZA()),2&n){const i=e.oxw(2);let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.raceDetails.get("localityOfRegistration"))?null:t.hasError("required"))}}function wi(n,a){if(1&n&&(e.TgZ(0,"div",3)(1,"label",10),e._uU(2,"Onde est\xe1s empadroado?"),e.qZA(),e.TgZ(3,"div",4)(4,"div",11),e._UZ(5,"p-radioButton",29),e.TgZ(6,"label",30),e._uU(7),e.qZA()(),e.TgZ(8,"div",11),e._UZ(9,"p-radioButton",31),e.TgZ(10,"label",30),e._uU(11," Nun concello de Galicia "),e.qZA()(),e.TgZ(12,"div",11),e._UZ(13,"p-radioButton",32),e.TgZ(14,"label",30),e._uU(15," Nun concello de fora de Galicia "),e.qZA()(),e.YNc(16,yi,2,1,"div",2),e.qZA()()),2&n){const i=e.oxw();let t;e.xp6(5),e.Q6J("value",i.event.place),e.xp6(2),e.hij(" No concello de ",i.event.place," "),e.xp6(9),e.Q6J("ngIf",(null==(t=i.raceDetails.get("localityOfRegistration"))?null:t.errors)&&(null==(t=i.raceDetails.get("localityOfRegistration"))?null:t.dirty))}}function Ii(n,a){1&n&&(e.TgZ(0,"div",26),e._uU(1,"* \xc9 obrigatorio marcar unha opci\xf3n"),e.qZA())}function Di(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Ii,2,0,"div",25),e.qZA()),2&n){const i=e.oxw(2);let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.raceDetails.get("donation"))?null:t.hasError("required"))}}function Ai(n,a){if(1&n&&(e.TgZ(0,"div",3)(1,"label",10),e._uU(2,"Desexas facer un donativo?"),e.qZA(),e._UZ(3,"br")(4,"p-dropdown",33),e.YNc(5,Di,2,1,"div",2),e.qZA()),2&n){const i=e.oxw();let t;e.xp6(4),e.Q6J("options",i.donatives),e.xp6(1),e.Q6J("ngIf",(null==(t=i.raceDetails.get("donation"))?null:t.errors)&&(null==(t=i.raceDetails.get("donation"))?null:t.dirty))}}function Mi(n,a){1&n&&(e.TgZ(0,"div",26),e._uU(1,"* \xc9 obrigatorio marcar unha opci\xf3n"),e.qZA())}function Ni(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Mi,2,0,"div",25),e.qZA()),2&n){const i=e.oxw();let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.raceDetails.get("acceptancePersonalData"))?null:t.hasError("required"))}}function Oi(n,a){1&n&&(e.TgZ(0,"div",26),e._uU(1,"* \xc9 obrigatorio aceptar as condici\xf3ns"),e.qZA())}function qi(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Oi,2,0,"div",25),e.qZA()),2&n){const i=e.oxw();let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.raceDetails.get("acceptanceConditions"))?null:t.hasError("required"))}}let $=(()=>{var n;class a{constructor(t,o,r){this.formBuilder=t,this.clubsService=o,this.enrollmentFilesService=r,this.documentType=z.F,this.model={},this.clubs=[],this.donatives=[{name:"0 \u20ac",value:0},{name:"1 \u20ac",value:1},{name:"3 \u20ac",value:3},{name:"5 \u20ac",value:5},{name:"10 \u20ac",value:10},{name:"15 \u20ac",value:15},{name:"20 \u20ac",value:20},{name:"25 \u20ac",value:25},{name:"30 \u20ac",value:30},{name:"35 \u20ac",value:35},{name:"40 \u20ac",value:40},{name:"45 \u20ac",value:45},{name:"50 \u20ac",value:50}],this.isMinor=!1,this.enrollFromCircuit=!1,this.configurationsAmountChange=new e.vpe}ngOnInit(){this.raceDetails=this.formBuilder.group({acceptancePersonalData:[null,p.kI.required],acceptanceRegulation:[null,p.kI.required],acceptanceConditions:[null,p.kI.required],club:[null],clubName:[null],legalDocumentType:["",p.kI.required],legalDocumentNumber:["",p.kI.required],legalName:["",p.kI.required],legalLastName:["",p.kI.required]}),this.race.hasDonative&&this.raceDetails.addControl("donation",new p.NI(0,p.kI.required)),this.race.hasLocalityOfRegistration&&this.raceDetails.addControl("localityOfRegistration",new p.NI(null,p.kI.required)),this.race.configurations?.forEach(r=>{r.enabled&&(this.model[r.id]=r,r.mandatory&&(this.model[r.id].rules={required:!0}))});const t=sessionStorage.getItem("enrollments")?JSON.parse(sessionStorage.getItem("enrollments"))[this.index].personalDetails:null,o=t?new Date(t.dateOfBirth.year,t.dateOfBirth.month-1,t.dateOfBirth.day):null;this.isMinor=(0,I.su)(o,this.event.date),this.isMinor?(this.raceDetails.get("legalDocumentType").setValidators(p.kI.required),this.raceDetails.get("legalDocumentNumber").setValidators(p.kI.required),this.raceDetails.get("legalName").setValidators(p.kI.required),this.raceDetails.get("legalLastName").setValidators(p.kI.required)):(this.raceDetails.get("legalDocumentType").clearValidators(),this.raceDetails.get("legalDocumentNumber").clearValidators(),this.raceDetails.get("legalName").clearValidators(),this.raceDetails.get("legalLastName").clearValidators()),this.raceDetails.get("legalDocumentType").updateV
1alueAndValidity(),this.raceDetails.get("legalDocumentNumber").updateValueAndValidity(),this.raceDetails.get("legalName").updateValueAndValidity(),this.raceDetails.get("legalLastName").updateValueAndValidity()}ngAfterViewInit(){setTimeout(()=>{this.subscribeToFormChanges(),this.loadFormValues()},0)}ngOnDestroy(){this.formChangeSub?.unsubscribe()}subscribeToFormChanges(){if(!this.race?.configurations?.some(o=>o.price||o.discount))return;const t=()=>{const o=this.dynamicData?.dynamicFormGroup?.value??{},s={...this.raceDetails?.value??{},...o};let l=0;for(const c of this.race.configurations)c.price&&te(c,s[c.id])&&(l+=c.price);this.configurationsAmountChange.emit(l)};this.formChangeSub=new di.w0,this.dynamicData?.dynamicFormGroup&&this.formChangeSub.add(this.dynamicData.dynamicFormGroup.valueChanges.subscribe(()=>t())),this.formChangeSub.add(this.raceDetails.valueChanges.subscribe(()=>t()))}getDynamicFormValues(){return this.dynamicData.dynamicFormGroup.value}storeFormValues(){const t=this.raceDetails.value,o=this.getDynamicFormValues(),r={...t,...o};let s=JSON.parse(sessionStorage.getItem("enrollments"))||[];if(this.race.configurations){r.configurationsAmount=0;for(const l of this.race.configurations)l.price&&te(l,r[l.id])&&(r.configurationsAmount+=l.price),l.discount&&te(l,r[l.id])&&(r.discountPercentage=l.discount)}this.dynamicData&&this.dynamicData.dynamicFormGroup&&Object.keys(this.dynamicData.dynamicFormGroup.controls).forEach(l=>{const c=this.dynamicData.dynamicFormGroup.get(l);if(c&&c.__files){const u=c.__files;u&&u.length>0&&this.enrollmentFilesService.setFiles(this.index,l,u)}}),s[this.index].raceDetails=r,s[this.index].raceDetails.club=this.getClub(t),sessionStorage.setItem("enrollments",JSON.stringify(s))}loadFormValues(){let t=JSON.parse(sessionStorage.getItem("enrollments"));if(this.setStoredValues(t),this.race=t[this.index].race,this.storedValues){const o=Object.fromEntries(Object.entries(this.storedValues).filter(([s])=>this.raceDetails.contains(s))),r=Object.fromEntries(Object.entries(this.storedValues).filter(([s])=>!this.raceDetails.contains(s)));this.raceDetails.patchValue(o),this.dynamicData.dynamicFormGroup.patchValue(r),this.dynamicData&&this.dynamicData.dynamicFormGroup&&Object.keys(this.dynamicData.dynamicFormGroup.controls).forEach(s=>{const l=this.enrollmentFilesService.getFiles(this.index,s);if(l&&l.length>0){const c=this.dynamicData.dynamicFormGroup.get(s);c&&(c.__files=l)}})}}setStoredValues(t){t&&t[this.index]&&(t[this.index].raceDetails?this.storedValues=t[this.index].raceDetails:0==this.index&&(this.storedValues=(0,Ze.T3)(this.index)))}searchClub(t){this.clubsService.getAll({globalFilter:t.query,sortField:"name",sortOrder:1,first:0,rows:1e4}).subscribe({next:r=>{this.clubs=[pi.z],r.items&&(this.clubs=this.clubs.concat(r.items))},error:r=>{}})}onBlurClub(t){(!this.raceDetails.controls.club.value||this.raceDetails.controls.club.value&&this.raceDetails.controls.club.value.id)&&this.raceDetails.controls.clubName.setValue("")}getClub(t){let o=t.club;return o&&o.id?o:o&&!o.id&&t.clubName?{name:t.clubName}:null}}return(n=a).\u0275fac=function(t){return new(t||n)(e.Y36(p.QS),e.Y36(we.H),e.Y36(ee.$))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-registration-race-data"]],viewQuery:function(t,o){if(1&t&&e.Gf(ye.r,5),2&t){let r;e.iGM(r=e.CRH())&&(o.dynamicData=r.first)}},inputs:{race:"race",event:"event",index:"index",enrollFromCircuit:"enrollFromCircuit"},outputs:{configurationsAmountChange:"configurationsAmountChange"},decls:38,vars:15,consts:[[1,"race-registration",3,"formGroup"],[1,"mb-3"],[4,"ngIf"],[1,"mb-3","p-3","bg-grey"],[1,"mb-2"],["for","club",1,"form-label"],["formControlName","club","minLength","3","field","name","placeholder","Selecciona un teu club","aria-placeholder","Selecciona un teu club",3,"suggestions","dropdown","forceSelection","completeMethod","onBlur"],["class","mb-2",4,"ngIf"],[3,"model","race","enrollFromCircuit"],["class","mb-3 p-3 bg-grey",4,"ngIf"],["for","name",1,"form-label"],[1,"form-check"],["name","acceptancePersonalData","formControlName","acceptancePersonalData","value","true"],["for","acceptancePersonalData",1,"form-check-label"],["name","acceptancePersonalData","formControlName","acceptancePersonalData","value","false"],["name","acceptanceRegulation","label","Lin e acepto o regulamento da carreira","value","true",3,"formControl"],["name","acceptanceConditions","label","Lin e acepto as condici\xf3ns de inscrici\xf3n","value","true",3,"formControl"],[1,"mb-3","p-3","minor"],[1,"minor-title"],["name","legalDocumentType","formControlName","legalDocumentType",3,"value"],["for","legalDocumentType",1,"form-check-label"],["for","legalName",1,"form-label"],["type","text","formControlName","legalName","pInputText","","placeholder","Introduce o nome do autorizante"],["for","lastName",1,"form-label"],["type","text","formControlName","legalLastName","pInputText","","placeholder","Introduce os apelidos do autorizante"],["class","text-danger",4,"ngIf"],[1,"text-danger"],["type","text","formControlName","legalDocumentNumber","name","legalDocumentNumber","pInputText","","placeholder","Introduce o teu NIF / NIE / Outro Documento"],["type","text","formControlName","clubName","name","clubName","placeholder","Introduce a teu club","pInputText",""],["name","localityOfRegistration","formControlName","localityOfRegistration",3,"value"],["for","localityOfRegistration",1,"form-check-label"],["name","localityOfRegistration","formControlName","localityOfRegistration","value","Galicia"],["name","localityOfRegistration","formControlName","localityOfRegistration","value","Espa\xf1a"],["formControlName","donation","optionLabel","name",3,"options"]],template:function(t,o){if(1&t&&(e.TgZ(0,"form",0)(1,"h4",1),e._uU(2,"Datos da Carreira"),e.qZA(),e.YNc(3,Ci,32,7,"div",2),e.TgZ(4,"div",3)(5,"div",4)(6,"label",5),e._uU(7,"Club co que participas"),e.qZA(),e.TgZ(8,"p-autoComplete",6),e.NdJ("completeMethod",function(s){return o.searchClub(s)})("onBlur",function(s){return o.onBlurClub(s)}),e.qZA()(),e.YNc(9,Zi,4,0,"div",7),e.TgZ(10,"span"),e._uU(11," (se non tes club, deixa a casa en branco)"),e.qZA()(),e._UZ(12,"app-dynamic-form",8),e.YNc(13,wi,17,3,"div",9),e.YNc(14,Ai,6,2,"div",9),e.TgZ(15,"div",3)(16,"label",10),e._uU(17,"Tratamento automatizado de datos persoais"),e.qZA(),e.TgZ(18,"div",4)(19,"div",11),e._UZ(20,"p-radioButton",12),e.TgZ(21,"label",13),e._uU(22," S\xed, "),e.qZA(),e.TgZ(23,"span"),e._uU(24," desexo recibir informaci\xf3n relacionada co atletismo"),e.qZA()(),e.TgZ(25,"div",11),e._UZ(26,"p-radioButton",14),e.TgZ(27,"label",13),e._uU(28," Non "),e.qZA(),e.TgZ(29,"span"),e._uU(30," desexo recibir informaci\xf3n relacionada co atletismo"),e.qZA()(),e.YNc(31,Ni,2,1,"div",2),e.qZA(),e.TgZ(32,"div")(33,"div",11),e._UZ(34,"p-checkbox",15),e.qZA(),e.TgZ(35,"div",11),e._UZ(36,"p-checkbox",16),e.qZA(),e.YNc(37,qi,2,1,"div",2),e.qZA()()()),2&t){let r,s,l;e.Q6J("formGroup",o.raceDetails),e.xp6(3),e.Q6J("ngIf",o.isMinor),e.xp6(5),e.Q6J("suggestions",o.clubs)("dropdown",!0)("forceSelection",!0),e.xp6(1),e.Q6J("ngIf",(null==(r=o.raceDetails.get("club"))?null:r.value)&&!(null!=(r=o.raceDetails.get("club"))&&r.value.id)),e.xp6(3),e.Q6J("model",o.model)("race",o.race)("enrollFromCircuit",o.enrollFromCircuit),e.xp6(1),e.Q6J("ngIf",o.race.hasLocalityOfRegistration),e.xp6(1),e.Q6J("ngIf",o.race.hasDonative),e.xp6(17),e.Q6J("ngIf",(null==(s=o.raceDetails.get("acceptancePersonalData"))?null:s.errors)&&(null==(s=o.raceDetails.get("acceptancePersonalData"))?null:s.dirty)),e.xp6(3),e.Q6J("formControl",o.raceDetails.controls.acceptanceRegulation),e.xp6(2),e.Q6J("formControl",o.raceDetails.controls.acceptanceConditions),e.xp6(1),e.Q6J("ngIf",(null==(l=o.raceDetails.get("acceptanceConditions"))?null:l.errors)&&(null==(l=o.raceDetails.get("acceptanceConditions"))?null:l.dirty))}},dependencies:[ye.r,m.O5,p._Y,p.Fj,p.JJ,p.JL,p.oH,p.sg,p.u,X.EU,R.o,H.Lt,Ie.XZ,De.Qc],styles:["p-autocomplete[_ngcontent-%COMP%]{width:100%;display:inline-block}  .p-autocomplete{width:100%}  .p-autocomplete .p-autocomplete-input{height:55px}.minor-title[_ngcontent-%COMP%]{color:red}.minor[_ngcontent-%COMP%]{background-color:#dff0d8}"]}),a})();function te(n,a){if(!a&&!1!==a)return!1;const i=String(a);return null!=n.priceAnswerValue&&""!==n.priceAnswerValue?i===String(n.priceAnswerValue):(null==n.priceAppliesToAllAnswers||!0===n.priceAppliesToAllAnswers)&&""!==i&&"false"!==i&&"null"!==i&&"undefined"!==i}var Q=g(13),ne=g(9509);function B(n,a){let i,t,o;const r=JSON.parse(sessionStorage.getItem("enrollments"))||[];let s=[];const l=new Set;return r.forEach(c=>{if(i=c.personalDetails,t=c.raceDetails,o=c.race,a=c.group,(n.id!=c.competition||a!=c.group)&&(c.verified=!1,sessionStorage.setItem("enrollments",JSON.stringify(r))),o){const v={id:n.id,name:n.name,place:n.place,date:n.date,race:{id:o.id,name:o.name,distance:o.distance,time:o.time,group:o.group},cantEnrollDifferentGroups:n.cantEnrollDifferentGroups};let Z={id:i.id,code:i.code,birthdate:i.dateOfBirth.year+"-"+i.dateOfBirth.month+"-"+i.dateOfBirth.day,category:i.category,document:{type:i.documentType,number:i.documentNumber},email:i.email,gender:i.gender,lastName:i.lastName,name:i.name,phone:i.phone,nationality:i.nationality,locality:i.locality,country:i.country,province:i.state,localityOfRegistration:t?.localityOfRegistration,club:t?.club?t.club:{code:"",name:t?.clubName}};const y=i?new Date(i.dateOfBirth.year,i.dateOfBirth.month-1,i.dateOfBirth.day):null;(0,I.su)(y,n.date)&&(Z={...Z,parent:{name:t?.legalName,lastName:t?.legalLastName,document:{number:t?.legalDocumentNumber,type:t?.legalDocumentType}}});const w={accepted:!0,date:new Date,info:"true"===t?.acceptancePersonalData,ip:""},h=[];let C=!1;o.configurations?.forEach(f=>{const N={id:f.id,name:f.name,type:f.type,mandatory:f.mandatory,enrollInCircuit:f.enrollInCircuit};if(f.enrollInCircuit){const Ee=t?.[f.id];(!0===Ee||"true"===Ee)&&(C=!0)}if(t?.[f.id])switch(f.type){case Q.c.Multitext:t[f.id].length>0&&t[f.id][0]&&(N.values=t[f.id],h.push(N));break;case Q.c.Multiple:N.values=t[f.id],h.push(N);break;case Q.c.Time:t[f.id].hours||(t[f.id].hours="00"),t[f.id].minutes||(t[f.id].minutes="00"),t[f.id].seconds||(t[f.id].seconds="00"),N.value=`${t[f.id].hours}:${t[f.id].minutes}:${t[f.id].seconds}`,h.push(N);break;case Q.c.Document:h.push(N);break;default:N.value=t[f.id],h.push(N)}else f.type===Q.c.Document&&h.push(N)});let A=function Ui(n){const a=new Date;for(const i of n.rates)if(new Date(i.priceEnd)>=a)return i}(o)?.price||0;if(C){const f=`${n.id}::${Z.document?.type}-${Z.document?.number}`;l.has(f)?A=0:l.add(f)}const M={bib:"",amount:A,isCircuit:C,circuitId:n.circuits?n.circuits[0].id:null,donation:t?.donation?.value??0,configurationsAmount:t?.configurationsAmount??0,discountPercentage:t?.discountPercentage,status:ne.O.Started,competition:v,runner:Z,configurations:h,dpp:w,verified:c.verified};(0===_.N.freeRegistrationCompetitions.length||_.N.freeRegistrationCompetitions.includes(n.id
1))&&(0,I.DF)(i.documentNumber,_.N.freeRegistrationNifs)&&(M.amount=0),s.push(M)}}),s}function x(n,a){const i=document.createElement("input");return i.setAttribute("type","hidden"),i.setAttribute("name",n),i.setAttribute("value",a),i}function ie(n,a,i){let t=n.successfulEnrollments.reduce((c,u)=>c+u.donation,0),o=n.successfulEnrollments.reduce((c,u)=>c+u.amount,0);n.discountPercentage&&(o-=o*n.discountPercentage/100);let s=function Ri(n,a,i,t,o){return{amount:100*(i+t+o),currency:_.N.payment.currency,merchantCode:_.N.payment.merchantCode,merchantName:_.N.payment.merchantName,merchantParameters:"",merchantUrl:_.N.payment.merchantUrl,order:"",productDescription:n.name+" - "+(a?a.name:"M\xfaltiple"),signature:"",signatureVersion:_.N.payment.signatureVersion,terminal:_.N.payment.terminal,transactionType:_.N.payment.transactionType,url:_.N.payment.url,urlOk:_.N.payment.urlOk,urlKo:_.N.payment.urlKo,raceId:a?a.id:"M\xfaltiple"}}(a,i,o,t,n.successfulEnrollments.reduce((c,u)=>c+u.configurationsAmount,0));const l=document.createElement("form");l.setAttribute("method","POST"),l.setAttribute("action",s.url),l.appendChild(x("Ds_Merchant_Amount",s.amount)),l.appendChild(x("Ds_Merchant_Currency",s.currency)),l.appendChild(x("Ds_Merchant_Order",n.payment.merchantOrder)),l.appendChild(x("Ds_Merchant_MerchantCode",s.merchantCode)),l.appendChild(x("Ds_Merchant_Terminal",s.terminal)),l.appendChild(x("Ds_Merchant_TransactionType",s.transactionType)),l.appendChild(x("Ds_Merchant_MerchantURL",s.merchantUrl)),l.appendChild(x("Ds_Merchant_MerchantName",s.merchantName)),l.appendChild(x("Ds_Merchant_ProductDescription",s.productDescription)),l.appendChild(x("Ds_Merchant_UrlOK",s.urlOk)),l.appendChild(x("Ds_Merchant_UrlKO",s.urlKo)),l.appendChild(x("Ds_SignatureVersion",s.signatureVersion)),l.appendChild(x("Ds_MerchantParameters",n.payment.merchantParameters)),l.appendChild(x("Ds_Signature",n.payment.signature)),document.body.appendChild(l),l.submit(),document.body.removeChild(l)}function ki(n,a){if(1&n&&(e.TgZ(0,"li")(1,"strong"),e._uU(2,"DNI: "),e.qZA(),e._uU(3),e.qZA()),2&n){const i=e.oxw();e.xp6(3),e.Oqu(i.data.documentNumber)}}function Ji(n,a){if(1&n&&(e.TgZ(0,"li")(1,"strong"),e._uU(2,"C\xf3digo corredor: "),e.qZA(),e._uU(3),e.qZA()),2&n){const i=e.oxw();e.xp6(3),e.Oqu(i.data.code)}}function Fi(n,a){if(1&n&&(e.TgZ(0,"li")(1,"strong"),e._uU(2,"DNI do autorizante: "),e.qZA(),e._uU(3),e.qZA()),2&n){const i=e.oxw();e.xp6(3),e.Oqu(i.data.legalDocumentNumber)}}function Si(n,a){if(1&n&&(e.TgZ(0,"li")(1,"strong"),e._uU(2,"Nome do autorizante: "),e.qZA(),e._uU(3),e.qZA()),2&n){const i=e.oxw();e.xp6(3),e.Oqu(i.data.legalName)}}function Qi(n,a){if(1&n&&(e.TgZ(0,"li")(1,"strong"),e._uU(2,"Apelidos do autorizante "),e.qZA(),e._uU(3),e.qZA()),2&n){const i=e.oxw();e.xp6(3),e.Oqu(i.data.legalLastName)}}function Yi(n,a){if(1&n&&(e.TgZ(0,"li")(1,"strong"),e._uU(2,"Club: "),e.qZA(),e._uU(3),e.qZA()),2&n){const i=e.oxw();e.xp6(3),e.Oqu(i.data.club.name)}}function Li(n,a){if(1&n&&(e.ynx(0),e._uU(1),e.BQk()),2&n){const i=e.oxw(2).$implicit,t=e.oxw();e.xp6(1),e.lnq(" ",null!=t.data[i.id]&&t.data[i.id].hours?t.data[i.id].hours:"00",":",null!=t.data[i.id]&&t.data[i.id].minutes?t.data[i.id].minutes:"00",":",null!=t.data[i.id]&&t.data[i.id].seconds?t.data[i.id].seconds:"00"," ")}}function zi(n,a){if(1&n&&(e.ynx(0),e._uU(1),e.BQk()),2&n){const i=e.oxw(2).$implicit,t=e.oxw();e.xp6(1),e.hij(" ","true"==t.data[i.id]?"S\xed":"Non"," ")}}function Bi(n,a){if(1&n&&(e.ynx(0),e._uU(1),e.BQk()),2&n){const i=e.oxw(2).$implicit,t=e.oxw();e.xp6(1),e.hij(" ",t.data[i.id]?t.data[i.id]:"-"," ")}}function Vi(n,a){if(1&n&&(e.ynx(0),e._uU(1),e.BQk()),2&n){const i=e.oxw(2).$implicit,t=e.oxw();e.xp6(1),e.hij(" ",t.data[i.id]?t.data[i.id]:"-"," ")}}function Gi(n,a){if(1&n&&(e.ynx(0),e.TgZ(1,"strong"),e._uU(2),e.qZA(),e.YNc(3,Li,2,3,"ng-container",2),e.YNc(4,zi,2,1,"ng-container",2),e.YNc(5,Bi,2,1,"ng-container",2),e.YNc(6,Vi,2,1,"ng-container",2),e.BQk()),2&n){const i=e.oxw().$implicit,t=e.oxw();e.xp6(2),e.hij("",i.name,": "),e.xp6(1),e.Q6J("ngIf",i.type===t.type.Time),e.xp6(1),e.Q6J("ngIf",i.type===t.type.Boolean),e.xp6(1),e.Q6J("ngIf",i.type===t.type.Text),e.xp6(1),e.Q6J("ngIf",i.type===t.type.Select)}}function Hi(n,a){if(1&n&&(e.ynx(0),e.TgZ(1,"strong"),e._uU(2),e.qZA(),e.ynx(3),e._uU(4),e.BQk()()),2&n){const i=e.oxw().$implicit,t=e.oxw();e.xp6(2),e.hij("",i.name,": "),e.xp6(2),e.hij(" ",t.data[i.id]?t.data[i.id]:"-"," ")}}function ji(n,a){if(1&n&&(e.ynx(0),e.TgZ(1,"strong"),e._uU(2),e.qZA(),e.ynx(3),e._uU(4),e.BQk()()),2&n){const i=e.oxw().$implicit,t=e.oxw();e.xp6(2),e.hij("",i.name,": "),e.xp6(2),e.hij(" ",t.data[i.id]," ")}}function $i(n,a){if(1&n&&(e.TgZ(0,"li"),e.YNc(1,Gi,7,5,"ng-container",2),e.YNc(2,Hi,5,2,"ng-container",2),e.YNc(3,ji,5,2,"ng-container",2),e.qZA()),2&n){const i=a.$implicit,t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.data[i.id]&&i.type!=t.type.Multitext&&i.type!=t.type.Document),e.xp6(1),e.Q6J("ngIf",t.data[i.id]&&t.data[i.id][0]&&i.type==t.type.Multitext),e.xp6(1),e.Q6J("ngIf",t.data[i.id]&&i.type===t.type.Document)}}function Ki(n,a){if(1&n&&(e.TgZ(0,"li")(1,"strong"),e._uU(2,"Empadroado:"),e.qZA(),e._uU(3),e.qZA()),2&n){const i=e.oxw();e.xp6(3),e.hij(" ",i.data.localityOfRegistration,"")}}function Wi(n,a){if(1&n&&(e.TgZ(0,"li")(1,"strong"),e._uU(2,"Donativo:"),e.qZA(),e._uU(3),e.ALo(4,"currency"),e.qZA()),2&n){const i=e.oxw();e.xp6(3),e.hij(" ",e.gM2(4,1,i.data.donation.value,"EUR",!0,"1.2-2")," ")}}function Xi(n,a){if(1&n&&(e.TgZ(0,"div",5)(1,"strong"),e._uU(2,"Importe a pagar: "),e.qZA(),e.TgZ(3,"span"),e._uU(4),e.qZA()()),2&n){const i=e.oxw();e.xp6(4),e.hij("",i.validRate.price," \u20ac")}}let Ae=(()=>{var n;class a{constructor(){this.type=Q.c}ngOnInit(){this.loadDataFromSessionStorage()}loadDataFromSessionStorage(){const t=JSON.parse(sessionStorage.getItem("enrollments"));if(t.length>0){const o=t[this.index].personalDetails,r=t[this.index].raceDetails,s=t[this.index].race;this.competitionId=t[this.index].competition,this.data={...o,...r,race:s},this.configurations=s.configurations,this.rates=s.rates,this.getValidRate()}else console.log("No data found in sessionStorage")}getValidRate(){const t=new Date;for(const r of this.rates)if(new Date(r.priceEnd)>=t){this.validRate=r;break}if(0!==_.N.freeRegistrationCompetitions.length&&!_.N.freeRegistrationCompetitions.includes(this.competitionId)||!(0,I.DF)(this.data.documentNumber,_.N.freeRegistrationNifs)){if(this.data.donation&&(this.validRate.price+=this.data.donation.value),this.data.race.configurations)for(const r of this.data.race.configurations)r.price&&Me(r,this.data[r.id])&&(this.validRate.price+=r.price),r.discount&&Me(r,this.data[r.id])&&(this.validRate.price=this.validRate.price-this.validRate.price*r.discount/100)}else this.validRate.price=0}}return(n=a).\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-summary-data"]],inputs:{index:"index"},decls:68,vars:25,consts:[[1,"mb-3"],[1,"mb-4","p-3","bg-grey"],[4,"ngIf"],[4,"ngFor","ngForOf"],["class","price bg-green",4,"ngIf"],[1,"price","bg-green"]],template:function(t,o){1&t&&(e.TgZ(0,"h4",0),e._uU(1,"Resume da Inscripci\xf3n e Pago"),e.qZA(),e.TgZ(2,"div",0),e._uU(3,"Estos son os datos da t\xfaa inscripci\xf3n, rev\xedsaos antes de finalizar a inscrici\xf3n:\n"),e.qZA(),e.TgZ(4,"div",1)(5,"ul"),e.YNc(6,ki,4,1,"li",2),e.YNc(7,Ji,4,1,"li",2),e.TgZ(8,"li")(9,"strong"),e._uU(10,"Nome: "),e.qZA(),e._uU(11),e.qZA(),e.TgZ(12,"li")(13,"strong"),e._uU(14,"Apelidos: "),e.qZA(),e._uU(15),e.qZA(),e.TgZ(16,"li")(17,"strong"),e._uU(18,"Data de nacemento: "),e.qZA(),e._uU(19),e.qZA(),e.YNc(20,Fi,4,1,"li",2),e.YNc(21,Si,4,1,"li",2),e.YNc(22,Qi,4,1,"li",2),e.TgZ(23,"li")(24,"strong"),e._uU(25,"Carreira: "),e.qZA(),e._uU(26),e.qZA(),e.YNc(27,Yi,4,1,"li",2),e.TgZ(28,"li")(29,"strong"),e._uU(30,"Categor\xeda: "),e.qZA(),e._uU(31),e.qZA(),e.TgZ(32,"li")(33,"strong"),e._uU(34,"Pa\xeds de nacionalidade: "),e.qZA(),e._uU(35),e.qZA(),e.TgZ(36,"li")(37,"strong"),e._uU(38,"Provincia: "),e.qZA(),e._uU(39),e.qZA(),e.TgZ(40,"li")(41,"strong"),e._uU(42,"Localidade: "),e.qZA(),e._uU(43),e.qZA(),e.TgZ(44,"li")(45,"strong"),e._uU(46,"Tel\xe9fono: "),e.qZA(),e._uU(47),e.qZA(),e.TgZ(48,"li")(49,"strong"),e._uU(50,"Correo electr\xf3nico: "),e.qZA(),e._uU(51),e.qZA(),e.YNc(52,$i,4,3,"li",3),e.YNc(53,Ki,4,1,"li",2),e.YNc(54,Wi,5,6,"li",2),e.TgZ(55,"li")(56,"strong"),e._uU(57,"Recibir informaci\xf3n relacionada co atletismo: "),e.qZA(),e._uU(58),e.qZA(),e.TgZ(59,"li")(60,"strong"),e._uU(61,"Regulamento da carreira: "),e.qZA(),e._uU(62),e.qZA(),e.TgZ(63,"li")(64,"strong"),e._uU(65,"Condici\xf3ns de inscrici\xf3n: "),e.qZA(),e._uU(66),e.qZA()()(),e.YNc(67,Xi,5,1,"div",4)),2&t&&(e.xp6(6),e.Q6J("ngIf",o.data.documentNumber),e.xp6(1),e.Q6J("ngIf",o.data.code),e.xp6(4),e.Oqu(o.data.name),e.xp6(4),e.Oqu(o.data.lastName),e.xp6(4),e.lnq("",o.data.dateOfBirth.day,"/",o.data.dateOfBirth.month,"/",o.data.dateOfBirth.year,""),e.xp6(1),e.Q6J("ngIf",o.data.legalDocumentNumber),e.xp6(1),e.Q6J("ngIf",o.data.legalName),e.xp6(1),e.Q6J("ngIf",o.data.legalLastName),e.xp6(4),e.Oqu(o.data.race.name),e.xp6(1),e.Q6J("ngIf",o.data.club&&o.data.club.name),e.xp6(4),e.Oqu(o.data.category.name),e.xp6(4),e.Oqu(o.data.country),e.xp6(4),e.Oqu(o.data.state),e.xp6(4),e.Oqu(o.data.locality),e.xp6(4),e.Oqu(o.data.phone),e.xp6(4),e.Oqu(o.data.email),e.xp6(1),e.Q6J("ngForOf",o.configurations),e.xp6(1),e.Q6J("ngIf",o.data.localityOfRegistration),e.xp6(1),e.Q6J("ngIf",o.data.donation),e.xp6(4),e.Oqu("True"==o.data.acceptancePersonalData?"Acepto":"Non acepto"),e.xp6(4),e.Oqu(o.data.acceptanceRegulation[0]?"Acepto":"Non acepto"),e.xp6(4),e.Oqu(o.data.acceptanceConditions[0]?"Acepto":"Non acepto"),e.xp6(1),e.Q6J("ngIf",o.validRate))},dependencies:[m.sg,m.O5,m.H9],styles:[".price[_ngcontent-%COMP%]{font-weight:700;padding:10px;border-radius:10px;margin-bottom:30px;
1width:200px}"]}),a})();function Me(n,a){if(!a&&!1!==a)return!1;const i=String(a);return null!=n.priceAnswerValue&&""!==n.priceAnswerValue?i===String(n.priceAnswerValue):(null==n.priceAppliesToAllAnswers||!0===n.priceAppliesToAllAnswers)&&""!==i&&"false"!==i&&"null"!==i&&"undefined"!==i}function eo(n,a){if(1&n&&(e.TgZ(0,"h3"),e._uU(1),e.qZA()),2&n){const i=e.oxw();e.xp6(1),e.Oqu(null==i.event.circuits[0]?null:i.event.circuits[0].name)}}function to(n,a){if(1&n&&(e.TgZ(0,"a",12),e._uU(1,"Datos Xerais"),e.qZA()),2&n){const i=e.oxw();e.Q6J("routerLink","/events/"+i.event.id+"/race/"+i.group+"/race-registration/step-1")("queryParamsHandling","preserve")}}function no(n,a){1&n&&(e.TgZ(0,"span"),e._uU(1,"Datos Xerais"),e.qZA())}function io(n,a){if(1&n&&(e.TgZ(0,"a",12),e._uU(1,"Datos da Carreira"),e.qZA()),2&n){const i=e.oxw();e.Q6J("routerLink","/events/"+i.event.id+"/race/"+i.group+"/race-registration/step-2")("queryParamsHandling","preserve")}}function oo(n,a){1&n&&(e.TgZ(0,"span"),e._uU(1,"Datos da Carreira"),e.qZA())}function ao(n,a){if(1&n&&(e.TgZ(0,"a",12),e._uU(1,"Resumo e Pago"),e.qZA()),2&n){const i=e.oxw();e.Q6J("routerLink","/events/"+i.event.id+"/race/"+i.group+"/race-registration/step-3")("queryParamsHandling","preserve")}}function ro(n,a){1&n&&(e.TgZ(0,"span"),e._uU(1,"Resumo e Pago"),e.qZA())}function so(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"div")(1,"app-registration-general-data",13),e.NdJ("onSelectRace",function(o){e.CHM(i);const r=e.oxw();return e.KtG(r.onSelectRace(o))}),e.qZA()()}if(2&n){const i=e.oxw();e.xp6(1),e.Q6J("event",i.event)("group",i.group)("index",i.index)}}function lo(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"app-registration-race-data",15),e.NdJ("configurationsAmountChange",function(o){e.CHM(i);const r=e.oxw(2);return e.KtG(r.onConfigurationsAmountChange(o))}),e.qZA()}if(2&n){const i=e.oxw(2);e.Q6J("race",i.race)("event",i.event)("index",i.index)("enrollFromCircuit",i.enrollFromCircuit)}}function co(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,lo,1,4,"app-registration-race-data",14),e.qZA()),2&n){const i=e.oxw();e.xp6(1),e.Q6J("ngIf",i.race)}}function po(n,a){if(1&n&&(e.TgZ(0,"div"),e._UZ(1,"app-summary-data",16),e.qZA()),2&n){const i=e.oxw();e.xp6(1),e.Q6J("index",i.index)}}function uo(n,a){1&n&&(e.TgZ(0,"div"),e._uU(1," A inscrici\xf3n foi realizada correctamente. "),e.qZA())}function go(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"button",17),e.NdJ("click",function(){e.CHM(i);const o=e.oxw();return e.KtG(o.previous())}),e._uU(1,"Anterior"),e.qZA()}}function mo(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"button",18),e.NdJ("click",function(){e.CHM(i);const o=e.oxw();return e.KtG(o.next())}),e._uU(1,"Seguinte"),e.qZA()}}function _o(n,a){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",20),e._uU(2," Confirmar e pagar"),e.qZA())}function ho(n,a){1&n&&(e.TgZ(0,"span"),e._uU(1," Confirmar"),e.qZA())}function fo(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"button",19),e.NdJ("click",function(){e.CHM(i);const o=e.oxw();return e.KtG(o.submit())}),e.YNc(1,_o,3,0,"span",3),e.YNc(2,ho,2,0,"span",3),e.qZA()}if(2&n){const i=e.oxw();e.Q6J("disabled",i.paying),e.xp6(1),e.Q6J("ngIf",i.amount>0||i.configurationsAmount>0||i.donation>0),e.xp6(1),e.Q6J("ngIf",0==i.amount&&0==i.configurationsAmount&&0==i.donation)}}const vo=function(n,a,i,t){return{active:n,inactive:a,previous:i,"current-step":t}},Ne=function(n,a,i,t,o){return{active:n,inactive:a,previous:i,next:t,current:o}},xo=function(n,a,i,t){return{active:n,inactive:a,next:i,current:t}};let bo=(()=>{var n;class a{constructor(t,o,r,s,l){this.toastNotifier=t,this.route=o,this.router=r,this.eventService=s,this.enrollmentFilesService=l,this.race_step=!1,this.max_step=0,this.paying=!1,this.amount=0,this.configurationsAmount=0,this.donation=0,this.enrollments=[],this.index=0,this.isComplete=!1,this.enrollFromCircuit=!1,this.route.queryParams.subscribe(c=>{this.enrollFromCircuit="true"===c.circuit}),this.route.params.subscribe(c=>{switch(this.step_name=c.step,this.step_name){case"step-1":default:this.step=1;break;case"step-2":this.step=2;break;case"step-3":this.step=3;break;case"step-4":this.step=4}})}ngOnInit(){let t=this.event.races.reduce((s,l)=>(s[l.group]||(s[l.group]={races:[],showEnroll:!1,name:l.group}),s[l.group].showEnroll||(s[l.group].showEnroll=null!=l.rates.find(c=>new Date(c.priceEnd)>new Date)),s[l.group].races.push(l),s),{});this.groups=Object.values(t),this.groups.find(s=>s.name==this.group).showEnroll||this.router.navigate(["/events/",this.event.normalizedName,this.event.id]);let r=JSON.parse(sessionStorage.getItem("enrollments"))||[];r.length>0&&(this.race=r[0].race),this.enrollments=B(this.event,this.group),this.amount=this.enrollments.reduce((s,l)=>s+l.amount,0),this.configurationsAmount=this.enrollments.reduce((s,l)=>s+l.configurationsAmount,0),this.donation=this.enrollments.reduce((s,l)=>s+l.donation,0),this.max_step=1,this.eventService.countEnrollments(this.event.id).subscribe(s=>{this.event.bib0Amount=s[0]?.totalBib0s,this.event.donativeAmount=s[0]?.totalDonations,this.event.races.forEac
1h(l=>{let c=s[0]?.races?.filter(u=>u.id==l.id)[0]?.totalEnrollments;l.count=c||0})},s=>{console.log(s)})}next(){if(window.scrollTo(0,0),"true"!=localStorage.getItem("isComplete"))if(1==this.step)if(this.registrationGeneralDataComponent.personalDetails.valid){if(this.race.participantsLimit&&this.race.participantsLimit<=this.race.count)return void this.toastNotifier.fail("O l\xedmite de participantes para esta carreira xa foi alcanzado.");this.step++,this.max_step=Math.max(this.max_step,2),this.registrationGeneralDataComponent.storeFormValues(),this.router.navigate(["/events",this.event.normalizedName,this.event.id,"race",this.group,"race-registration","step-2"],{queryParamsHandling:"preserve"})}else(0,I._5)(this.registrationGeneralDataComponent.personalDetails),this.toastNotifier.fail("Revisa los campos");else 2==this.step&&(this.registrationRaceDataComponent.dynamicData.dynamicFormGroup.valid&&this.registrationRaceDataComponent.raceDetails.valid?(this.race_step=!0,this.step++,this.max_step=Math.max(this.max_step,3),this.registrationRaceDataComponent.storeFormValues(),this.enrollments=B(this.event,this.group),this.amount=this.enrollments.reduce((t,o)=>t+o.amount,0),this.configurationsAmount=this.enrollments.reduce((t,o)=>t+o.configurationsAmount,0),this.donation=this.enrollments.reduce((t,o)=>t+o.donation,0),this.router.navigate(["/events",this.event.normalizedName,this.event.id,"race",this.group,"race-registration","step-3"],{queryParamsHandling:"preserve"})):((0,I._5)(this.registrationRaceDataComponent.dynamicData.dynamicFormGroup),(0,I._5)(this.registrationRaceDataComponent.raceDetails),this.toastNotifier.fail("Revisa los campos")));else this.toastNotifier.fail("O l\xedmite de participantes para esta carreira xa foi alcanzado.")}previous(){window.scrollTo(0,0),this.step--,1==this.step&&(this.max_step=Math.max(this.max_step,1),this.race_step=!1,this.router.navigate(["/events",this.event.normalizedName,this.event.id,"race",this.group,"race-registration","step-1"],{queryParamsHandling:"preserve"})),2==this.step&&(this.max_step=Math.max(this.max_step,2),this.router.navigate(["/events",this.event.normalizedName,this.event.id,"race",this.group,"race-registration","step-2"],{queryParamsHandling:"preserve"}))}onSelectRace(t){this.race=t}onConfigurationsAmountChange(t){this.configurationsAmount=t}submit(){this.enrollmentFilesService.getMissingExpected().length>0?this.toastNotifier.fail("Debes volver a adxuntar a documentaci\xf3n requirida antes de continuar."):(this.paying=!0,this.eventService.enroll(this.event.id,this.enrollments).subscribe({next:o=>{this.enrollmentFilesService.clear(),this.amount>0||this.configurationsAmount>0||this.donation>0?(localStorage.setItem("redirect",`/events/${this.event.normalizedName}/${this.event.id}/race/${this.group}/race-registration/step-4`),ie(o,this.event,this.race)):(this.toastNotifier.success("Inscrici\xf3n de "+o.successfulEnrollments.length+" corredor(es) realizada con \xe9xito."),this.router.navigate(["/events",this.event.normalizedName,this.event.id,"race",this.group,"race-registration","step-4"]))},error:o=>{console.log("error",o),this.paying=!1,this.toastNotifier.fail(409==o.status&&o?.error?.alreadyEnrolledEnrollments.length>0?"O(s) corredor(es) que intenta inscribir, xa est\xe1n inscritos nesta carreira, ou noutra carreira da mesma competici\xf3n.":"Ocorreu un erro ao intentar realizar a inscrici\xf3n. Por favor, int\xe9ntao de novo m\xe1is tarde.")}}))}}return(n=a).\u0275fac=function(t){return new(t||n)(e.Y36(F.o),e.Y36(T.gz),e.Y36(T.F0),e.Y36(q.P),e.Y36(ee.$))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-race-registration"]],viewQuery:function(t,o){if(1&t&&(e.Gf(j,5),e.Gf($,5)),2&t){let r;e.iGM(r=e.CRH())&&(o.registrationGeneralDataComponent=r.first),e.iGM(r=e.CRH())&&(o.registrationRaceDataComponent=r.first)}},inputs:{event:"event",group:"group"},decls:30,vars:46,consts:[[1,"card-shadow"],[1,"race-name","pb-2","mb-3","text-center","text-lg-start"],[1,"uppercase"],[4,"ngIf"],["id","progress-bar"],[3,"ngClass"],[3,"routerLink","queryParamsHandling",4,"ngIf"],["type","button","name","previous","class","btn me-3","value","previous",3,"click",4,"ngIf"],["type","button","name","next","class","btn","value","next",3,"click",4,"ngIf"],["type","submit","name","submit","class","btn","value","submit",3,"disabled","click",4,"ngIf"],[1,"my-lg-3","text-center"],["src","assets/img/cg-separator.png","alt",""],[3,"routerLink","queryParamsHandling"],[3,"event","group","index","onSelectRace"],[3,"race","event","index","enrollFromCircuit","configurationsAmountChange",4,"ngIf"],[3,"race","event","index","enrollFromCircuit","configurationsAmountChange"],[3,"index"],["type","button","name","previous","value","previous",1,"btn","me-3",3,"click"],["type","button","name","next","value","next",1,"btn",3,"click"],["type","submit","name","submit","value","submit",1,"btn",3,"disabled","click"],[1,"fa-solid","fa-cart-shopping"]],template:function(t,o){1&t&&(e.TgZ(0,"div",0)(1,"div",1)(2,"h4"),e._uU(3),e.ALo(4,"date"),e.qZA(),e.TgZ(5,"h2",2),e._uU(6),e.qZA(),e.YNc(7,eo,2,1,"h3",3),e.qZA(),e.TgZ(8,"ul",4)(9,"li",5),e.YNc(10,to,2,2,"a",6),e.YNc(11,no,2,0,"span",3),e.qZA(),e.TgZ(12,"li",5),e.YNc(13,io,2,2,"a",6),e.YNc(14,oo,2,0,"span",3),e.qZA(),e.TgZ(15,"li",5),e.YNc(16,ao,2,2,"a",6),e.YNc(17,ro,2,0,"span",3),e.qZA(),e.TgZ(18,"li",5)(19,"span"),e._uU(20,"Confirmaci\xf3n"),e.qZA()()(),e.YNc(21,so,2,3,"div",3),e.YNc(22,co,2,1,"div",3),e.YNc(23,po,2,1,"div",3),e.YNc(24,uo,2,0,"div",3),e.YNc(25,go,2,0,"button",7),e.YNc(26,mo,2,0,"button",8),e.YNc(27,fo,3,3,"button",9),e.qZA(),e.TgZ(28,"div",10),e._UZ(29,"img",11),e.qZA()),2&t&&(e.xp6(3),e.AsE("",o.event.place," - ",e.xi3(4,21,o.event.date,"fullDate"),""),e.xp6(3),e.hij("",o.event.name," "),e.xp6(1),e.Q6J("ngIf",o.event.circuits),e.xp6(2),e.Q6J("ngClass",e.l5B(24,vo,o.step>=1,o.step<1,2===o.step,1===o.step)),e.xp6(1),e.Q6J("ngIf",o.max_step>=1),e.xp6(1),e.Q6J("ngIf",o.max_step<1),e.xp6(1),e.Q6J("ngClass",e.qbA(29,Ne,o.step>=2,o.step<2,3===o.step,1===o.step,2===o.step)),e.xp6(1),e.Q6J("ngIf",o.max_step>=2),e.xp6(1),e.Q6J("ngIf",o.max_step<2),e.xp6(1),e.Q6J("ngClass",e.qbA(35,Ne,o.step>=3,o.step<3,4===o.step,2===o.step,3===o.step)),e.xp6(1),e.Q6J("ngIf",o.max_step>=3),e.xp6(1),e.Q6J("ngIf",o.max_step<3),e.xp6(1),e.Q6J("ngClass",e.l5B(41,xo,o.step>=4,o.step<4,3===o.step,4===o.step)),e.xp6(3),e.Q6J("ngIf",1==o.step),e.xp6(1),e.Q6J("ngIf",2==o.step),e.xp6(1),e.Q6J("ngIf",3==o.step),e.xp6(1),e.Q6J("ngIf",4==o.step),e.xp6(1),e.Q6J("ngIf",1!=o.step&&4!=o.step),e.xp6(1),e.Q6J("ngIf",3!=o.step&&4!=o.step),e.xp6(1),e.Q6J("ngIf",3==o.step))},dependencies:[m.mk,m.O5,T.rH,j,$,Ae,m.uU],styles:['#progress-bar[_ng
1content-%COMP%]{margin-bottom:10px;padding:15px 30px;text-align:center;overflow:hidden;counter-reset:step;border-bottom:1px solid #ebebeb}#progress-bar[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{list-style-type:none;text-transform:uppercase;font-size:12px;font-weight:600;width:25%;float:left;position:relative;letter-spacing:1px}#progress-bar[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]:before{content:counter(step);counter-increment:step;width:24px;height:24px;line-height:26px;display:block;font-size:12px;color:#333;background:white;border-radius:25px;margin:0 auto 10px}#progress-bar[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]:after{content:"";width:100%;height:2px;background:white;position:absolute;left:-50%;top:9px;z-index:-1}#progress-bar[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]:first-child:after{content:none}#progress-bar[_ngcontent-%COMP%]   li.active[_ngcontent-%COMP%]:before, #progress-bar[_ngcontent-%COMP%]   li.active[_ngcontent-%COMP%]:after{background:#0d5aa5;color:#fff}#progress-bar[_ngcontent-%COMP%]   li.inactive[_ngcontent-%COMP%]:before{background:#f5f5f5;color:#000}@media (max-width: 576px){#progress-bar[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]:not(.current-step):not(.next):not(.previous){display:none!important}}']}),a})();var Oe=g(1494);const Co=["dialog"];function Zo(n,a){if(1&n&&(e.TgZ(0,"h3"),e._uU(1),e.qZA()),2&n){const i=e.oxw();e.xp6(1),e.Oqu(null==i.event.circuits[0]?null:i.event.circuits[0].name)}}function To(n,a){1&n&&(e.TgZ(0,"div",25),e._UZ(1,"img",26),e.TgZ(2,"div",27)(3,"div",28),e._uU(4,"Busca aos corredores do teu club que queres inscribir ou engade un novo"),e.qZA()(),e.TgZ(5,"div",29)(6,"div",30),e._UZ(7,"input",31)(8,"i",32),e.qZA()()())}function yo(n,a){1&n&&(e.TgZ(0,"div",33)(1,"div",34),e._uU(2,"A\xednda non hai corredores seleccionados. Engade un novo corredor."),e.qZA()())}function wo(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"a",44),e.NdJ("click",function(){e.CHM(i);const o=e.oxw().index,r=e.oxw(2);return e.KtG(r.edit(o))}),e._uU(1,"Verificar"),e.qZA()}}function Io(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"a",44),e.NdJ("click",function(){e.CHM(i);const o=e.oxw().index,r=e.oxw(2);return e.KtG(r.edit(o))}),e._uU(1,"Editar"),e.qZA()}}function Do(n,a){1&n&&e._UZ(0,"i",45)}function Ao(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"div",35)(1,"div",36),e._uU(2),e.qZA(),e.TgZ(3,"div",37),e._uU(4),e.qZA(),e.TgZ(5,"div",37),e._uU(6),e.qZA(),e.TgZ(7,"div",38),e._uU(8),e.ALo(9,"currency"),e.qZA(),e.TgZ(10,"div",37),e.YNc(11,wo,2,0,"a",39),e.YNc(12,Io,2,0,"a",39),e.qZA(),e.TgZ(13,"div",40),e.YNc(14,Do,1,0,"i",41),e.TgZ(15,"a",42),e.NdJ("click",function(o){const s=e.CHM(i).$implicit,l=e.oxw(2);return e.KtG(l.remove(o,s))}),e._UZ(16,"i",43),e.qZA()()()}if(2&n){const i=a.$implicit;e.xp6(2),e.AsE("",i.personalDetails.name," ",i.personalDetails.lastName," "),e.xp6(2),e.Oqu(i.personalDetails.documentNumber),e.xp6(2),e.Oqu(i.personalDetails.category.name),e.xp6(2),e.Oqu(e.gM2(9,8,i.amount,"EUR",!0,"1.2-2")),e.xp6(3),e.Q6J("ngIf",!i.verified),e.xp6(1),e.Q6J("ngIf",i.verified),e.xp6(2),e.Q6J("ngIf",i.verified)}}function Mo(n,a){1&n&&(e.TgZ(0,"div",46),e._uU(1," Debes verificar los datos de todos los corredores antes de confirmar y pagar "),e.qZA())}function No(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"button",47),e.NdJ("click",function(){e.CHM(i);const o=e.oxw(2);return e.KtG(o.submit())}),e._UZ(1,"i",48),e._uU(2," Confirmar e pagar"),e.qZA()}if(2&n){const i=e.oxw(2);e.Q6J("disabled",i.paying)}}function Oo(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"div"),e.YNc(1,To,9,0,"div",12),e.TgZ(2,"div",13),e._UZ(3,"div",14),e.TgZ(4,"div",15)(5,"a",16),e.NdJ("click",function(){e.CHM(i);const o=e.oxw();return e.KtG(o.new())}),e._UZ(6,"i",17),e._uU(7," Novo Corredor"),e.qZA()()(),e.TgZ(8,"div",18),e.YNc(9,yo,3,0,"div",19),e.YNc(10,Ao,17,13,"div",20),e.qZA(),e.TgZ(11,"div",21)(12,"ul",22)(13,"li"),e._uU(14),e.qZA(),e.TgZ(15,"li"),e._uU(16),e.ALo(17,"currency"),e.qZA()(),e.YNc(18,Mo,2,0,"div",23),e.TgZ(19,"div"),e.YNc(20,No,3,1,"button",24),e.qZA()()()}if(2&n){const i=e.oxw();e.xp6(1),e.Q6J("ngIf",i.club),e.xp6(8),e.Q6J("ngIf",0==i.enrollments.length),e.xp6(1),e.Q6J("ngForOf",i.enrollments),e.xp6(4),e.hij("N\xfamero de inscritos: ",i.enrollments.length,""),e.xp6(2),e.hij("Total: ",e.gM2(17,7,i.total,"EUR",!0,"1.2-2"),""),e.xp6(2),e.Q6J("ngIf",i.enrollments.length>0&&!i.allVerified),e.xp6(2),e.Q6J("ngIf",i.enrollments.length>0&&i.allVerified)}}function qo(n,a){1&n&&(e.TgZ(0,"div"),e._uU(1," A inscrici\xf3n foi realizada correctamente. "),e.qZA())}function Uo(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"div")(1,"app-registration-general-data",49),e.NdJ("onSelectRace",function(o){e.CHM(i);const r=e.oxw();return e.KtG(r.onSelectRace(o))}),e.qZA()()}if(2&n){const i=e.oxw();e.xp6(1),e.Q6J("event",i.event)("group",i.group)("index",i.index)}}function Po(n,a){if(1&n&&e._UZ(0,"app-registration-race-data",51),2&n){const i=e.oxw(2);e.Q6J("race",i.race)("event",i.event)("index",i.index)}}function Ro(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Po,1,3,"app-registration-race-data",50),e.qZA()),2&n){const i=e.oxw();e.xp6(1),e.Q6J("ngIf",i.race)}}function Eo(n,a){if(1&n&&(e.TgZ(0,"div"),e._UZ(1,"app-summary-data",52),e.qZA()),2&n){const i=e.oxw();e.xp6(1),e.Q6J("index",i.index)}}function ko(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"button",53),e.NdJ("click",function(){e.CHM(i);const o=e.oxw();return e.KtG(o.previous())}),e._uU(1,"Anterior"),e.qZA()}}function Jo(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"button",54),e.NdJ("click",function(){e.CHM(i);const o=e.oxw();return e.KtG(o.next())}),e._uU(1,"Seguinte"),e.qZA()}}function Fo(n,a){1&n&&(e.TgZ(0,"span"),e._uU(1,"Engadir"),e.qZA())}function So(n,a){1&n&&(e.TgZ(0,"span"),e._uU(1,"Modificar"),e.qZA())}function Qo(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"button",54),e.NdJ("click",function(){e.CHM(i);const o=e.oxw();return e.KtG(o.add())}),e.YNc(1,Fo,2,0,"span",3),e.YNc(2,So,2,0,"span",3),e.qZA()}if(2&n){const i=e.oxw();e.xp6(1),e.Q6J("ngIf",!i.isEdit),e.xp6(1),e.Q6J("ngIf",i.isEdit)}}const Yo=function(){return{width:"50vw"}};let Lo=(()=>{var n;class a{constructor(t,o,r,s,l){this.toastNotifier=t,this.confirmationService=o,this.eventService=r,this.router=s,this.enrollmentFilesService=l,this.club=!1,this.race_step=!1,this.max_step=0,this.paying=!1,this.enrollments=[],this.preparedEnrollments=[],this.total=0,this.index=0,this.canCancel=!0,this.allVerified=!1,this.isEdit=!1,this.step=1}ngOnInit(){let t=this.event.races.reduce((r,s)=>(r[s.group]||(r[s.group]={races:[],showEnroll:!1,name:s.group}),r[s.group].showEnroll||(r[s.group].showEnroll=null!=s.rates.find(l=>new Date(l.priceEnd)>new Date)),r[s.group].races.push(s),r),{});this.groups=Object.values(t),this.groups.find(r=>r.name==this.group).showEnroll||this.router.navigate(["/events/",this.event.normalizedName,this.event.id]),this.enrollments=JSON.parse(sessionStorage.getItem("enrollments"))||[],this.preparedEnrollments=B(this.event,this.group),this.enrollments=JSON.parse(sessionStorage.getItem("enrollments"))||[],this.recalculateTotal()}ngAfterViewInit(){window.addEventListener("resize",()=>{this.applyModalStyles()})}new(){this.canCancel=!0,this.isEdit=!1,this.index=this.enrollments.length,this.showModalDialog()}showModalDialog(){this.applyModalStyles(),this.displayModal=!0}hideModalDialog(){this.displayModal=!1}onSelectRace(t){this.race=t}next(){1==this.step?this.registrationGeneralDataComponent.personalDetails.valid?(this.step++,this.max_step=Math.max(this.max_step,2),this.registrationGeneralDataComponent.storeFormValues()):((0,I._5)(this.registrationGeneralDataComponent.personalDetails),this.toastNotifier.fail("Revisa los campos")):2==this.step&&(this.registrationRaceDataComponent.dynamicData.dynamicFormGroup.valid&&this.registrationRaceDataComponent.raceDetails.valid?(this.race_step=!0,this.step++,this.max_step=Math.max(this.max_step,3),this.registrationRaceDataComponent.storeFormValues(),this.preparedEnrollments=B(this.event,this.group),this.recalculateTotal(),this.getValidRate()):((0,I._5)(this.registrationRaceDataComponent.dynamicData.dynamicFormGroup),(0,I._5)(this.registrationRaceDataComponent.raceDetails),this.toastNotifier.fail("Revisa los campos")))}previous(){window.scrollTo(0,0),this.step--,1==this.step&&(this.max_step=Math.max(this.max_step,1),this.race_step=!1),2==this.step&&(this.max_step=Math.max(this.max_step,2))}add(){this.enrollments=JSON.parse(sessionStorage.getItem("enrollments"))||[],this.getValidRate(),this.enrollments[this.index].amount=this.validRate.price,this.enrollments[this.index].verified=!0,sessionStorage.setItem("enrollments",JSON.stringify(this.enrollments)),this.preparedEnrollments=B(this.event,this.group),this.recalculateTotal(),this.canCancel=!1,this.hideModalDialog(),this.step=1}recalculateTotal(){this.total=this.preparedEnrollments.reduce((t,o)=>t+o.amount,0),this.total=this.total+this.preparedEnrollments.reduce((t,o)=>t+o.donation,0),this.allVerified=this.preparedEnrollments.every(t=>t.verified)}getValidRate(){const t=new Date;for(const o of this.race.rates)if(new Date(o.priceEnd)>=t)return void(this.validRate=o)}remove(t,o){this.confirmationService.confirm({target:t.target,message:"Estas seguro de que queres eliminar o corredor?",icon:"pi pi-exclamation-triangle",acceptLabel:"Si",rejectLabel:"No",acceptButtonStyleClass:"btn",rejectButtonStyleClass:"btn",accept:()=>{this.enrollments=this.enrollments.filter(r=>r!=o),sessionStorage.setItem("enrollments",JSON.stringify(this.enrollments)),this.recalculateTotal()},reject:()=>{}})}cancel(){this.canCancel&&(this.enrollments.splice(this.index,1),sessionStorage.setItem("enrollments",JSON.stringify(this.enrollments)),this.recalculateTotal(),this.step=1)}edit(t){this.canCancel=!1,this.index=t,this.isEdit=!0,this.showModalDialog()}submit(){this.enrollmentFilesService.getMissingExpected().length>0?this.toastNotifier.fail("Debes volver a adxuntar a documentaci\xf3n requirida antes de continuar."):(this.paying=!0,this.eventService.enroll(this.event.id,this.preparedEnrollments).subscribe({next:o=>{this.enrollmentFilesService.clear(),this.total>0?(localStorage.setItem("redirect",`/events/${this.event.normalizedName}/${this.event.id}/race/${this.group}/race-registration/multiple/confirm`),ie(o,this.event,this.race)):(this.toastNotifier.success("Inscrici\xf3n de "+o.successfulEnrollments.length+" corredor(es) realizada con \xe9xito."),this.step=4)},error:o=>{console.log("error",o),this.paying=!1,this.toastNotifier.fail(409==o.status?o?.error?.alreadyEnrolledEnrollments.length>0?"O(s) corredor(es) que intenta inscribir, xa est\xe1n inscritos nesta carreira, ou noutra carreira da mesma competici\xf3n.":o?.error?.racesFullEnrollments.length>0?"Alg\xfans corredores non se inscribiron correctamente. A competici\xf3n xa est\xe1 completa en non se admiten m\xe1is inscrici\xf3ns.":"Ocorreu un erro ao intentar realizar a inscrici\xf3n. Por favor, int\xe9ntao de novo m\xe1is tarde.":"Ocorreu un erro ao intentar realizar a inscrici\xf3n. Por favor, int\xe9ntao de novo m\xe1is tarde.")}}))}applyModalStyles(){this.dialog.maximized=window.innerWidth<600}}return(n=a).\u0275fac=function(t){return new(t||n)(e.Y36(F.o),e.Y36(E.YP),e.Y36(q.P),e.Y36(T.F0),e.Y36(ee.$))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-race-multiple-registration"]],viewQuery:function(t,o){if(1&t&&(e.Gf(j,5),e.Gf($,5),e.Gf(Co,5)),2&t){let r;e.iGM(r=e.CRH())&&(o.registrationGeneralDataComponent=r.first),e.iGM(r=e.CRH())&&(o.registrationRaceDataComponent=r.first),e.iGM(r=e.CRH())&&(o.dialog=r.first)}},inputs:{event:"event",group:"group"},decls:28,vars:26,consts:[[1,"card-shadow"],[1,"race-name","pb-2","mb-3","text-center","text-lg-start"],[1,"uppercase"],[4,"ngIf"],[1,"my-lg-3","text-center"],["src","assets/img/cg-separator.png","alt",""],["header","Inscribir corredor","appendTo","body",3,"visible","modal","draggable","maximizable","resizable","visibleChange","onHide"],["dialog",""],["id","progress-bar"],[3,"ngClass"],["type","button","name","previous","class","btn me-3","value","previous",3,"click",4,"ngIf"],["type","button","name","next","class","btn","value","next",3,"click",4,"ngIf"],["class","club",4,"ngIf"],[1,"row"],[1,"col-12","col-xl-9"],[1,"col-12","col-xl-3","text-end"],[1,"btn","btn-inscripcion",3,"click"],[1,"fa-solid","fa-user-plus"],[1,"club-members","p-3"],["class","row bg-grey p-3 mb-2",4,"ngIf"],["class","row bg-grey align-items-center p-3 mb-2 text-center",4,"ngFor","ngForOf"],[1,"resume","text-center","text-xl-start"],[1,"mb-3","mb-xl-0"],["class","mb-3",4,"ngIf"],["type","submit","name","submit","class","btn","value","submit",3,"disabled","click",4,"ngIf"],[1,"club"],["src","assets/img/riazor-atletismo.png",1,"img-fluid","mb
1-3"],[1,"row","mb-3"],[1,"col"],[1,"results-search"],[1,"inp-name"],["id","name","type","text","name","your-name","placeholder","Buscar corredor do meu club"],["aria-hidden","true",1,"fa","fa-search"],[1,"row","bg-grey","p-3","mb-2"],[1,"col-12"],[1,"row","bg-grey","align-items-center","p-3","mb-2","text-center"],[1,"col-12","col-xl-4","text-xl-start"],[1,"col-6","col-xl-2"],[1,"col-12","col-xl-1","mb-2","mb-xl-0"],["class","btn btn-sm",3,"click",4,"ngIf"],[1,"col-6","col-xl-1"],["class","fa-solid fa-check",4,"ngIf"],[1,"remove",3,"click"],[1,"fa-solid","fa-trash"],[1,"btn","btn-sm",3,"click"],[1,"fa-solid","fa-check"],[1,"mb-3"],["type","submit","name","submit","value","submit",1,"btn",3,"disabled","click"],[1,"fa-solid","fa-cart-shopping"],[3,"event","group","index","onSelectRace"],[3,"race","event","index",4,"ngIf"],[3,"race","event","index"],[3,"index"],["type","button","name","previous","value","previous",1,"btn","me-3",3,"click"],["type","button","name","next","value","next",1,"btn",3,"click"]],template:function(t,o){1&t&&(e.TgZ(0,"div",0)(1,"div",1)(2,"h4"),e._uU(3),e.ALo(4,"date"),e.qZA(),e.TgZ(5,"h2",2),e._uU(6),e.qZA(),e.YNc(7,Zo,2,1,"h3",3),e.qZA(),e.YNc(8,Oo,21,12,"div",3),e.YNc(9,qo,2,0,"div",3),e.qZA(),e.TgZ(10,"div",4),e._UZ(11,"img",5),e.qZA(),e.TgZ(12,"p-dialog",6,7),e.NdJ("visibleChange",function(s){return o.displayModal=s})("onHide",function(){return o.cancel()}),e.TgZ(14,"ul",8)(15,"li",9),e._uU(16,"Datos Xerais"),e.qZA(),e.TgZ(17,"li",9),e._uU(18,"Datos da Competici\xf3n"),e.qZA(),e.TgZ(19,"li",9),e._uU(20,"Resumo da Inscrici\xf3n "),e.qZA()(),e.YNc(21,Uo,2,3,"div",3),e.YNc(22,Ro,2,1,"div",3),e.YNc(23,Eo,2,1,"div",3),e.YNc(24,ko,2,0,"button",10),e.YNc(25,Jo,2,0,"button",11),e.YNc(26,Qo,3,2,"button",11),e.qZA(),e._UZ(27,"p-confirmPopup")),2&t&&(e.xp6(3),e.AsE("",o.event.place," - ",e.xi3(4,22,o.event.date,"fullDate"),""),e.xp6(3),e.hij("",o.event.name," "),e.xp6(1),e.Q6J("ngIf",o.event.circuits),e.xp6(1),e.Q6J("ngIf",o.step<4),e.xp6(1),e.Q6J("ngIf",4==o.step),e.xp6(3),e.Akn(e.DdM(25,Yo)),e.Q6J("visible",o.displayModal)("modal",!0)("draggable",!1)("maximizable",!0)("resizable",!1),e.xp6(3),e.Q6J("ngClass",o.step>=1?"active ":"inactive"),e.xp6(2),e.Q6J("ngClass",o.step>=2?"active":"inactive"),e.xp6(2),e.Q6J("ngClass",3==o.step?"active":"inactive"),e.xp6(2),e.Q6J("ngIf",o.displayModal&&1==o.step),e.xp6(1),e.Q6J("ngIf",2==o.step),e.xp6(1),e.Q6J("ngIf",3==o.step),e.xp6(1),e.Q6J("ngIf",1!=o.step&&4!=o.step),e.xp6(1),e.Q6J("ngIf",3!=o.step),e.xp6(1),e.Q6J("ngIf",3==o.step))},dependencies:[m.mk,m.sg,m.O5,wt,Oe.P,j,$,Ae,m.H9,m.uU],styles:['.fa-check[_ngcontent-%COMP%]{font-size:20px;color:green}.fa-triangle-exclamation[_ngcontent-%COMP%]{font-size:20px;color:#f90}.s-race-registration[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%]{padding:5px 20px}#progress-bar[_ngcontent-%COMP%]{margin-bottom:10px;padding:15px 30px;text-align:center;overflow:hidden;counter-reset:step;border-bottom:1px solid #ebebeb}#progress-bar[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{list-style-type:none;text-transform:uppercase;font-size:12px;font-weight:600;width:33.33%;float:left;position:relative;letter-spacing:1px}#progress-bar[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]:before{content:counter(step);counter-increment:step;width:24px;height:24px;line-height:26px;display:block;font-size:12px;color:#333;background:white;border-radius:25px;margin:0 auto 10px}#progress-bar[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]:after{content:"";width:100%;height:2px;background:white;position:absolute;left:-50%;top:9px;z-index:-1}#progress-bar[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]:first-child:after{content:none}#progress-bar[_ngcontent-%COMP%]   li.active[_ngcontent-%COMP%]:before, #progress-bar[_ngcontent-%COMP%]   li.active[_ngcontent-%COMP%]:after{background:#0d5aa5;color:#fff}#progress-bar[_ngcontent-%COMP%]   li.inactive[_ngcontent-%COMP%]:before{background:#f5f5f5;color:#000}.text-right[_ngcontent-%COMP%]{text-align:right}.remove[_ngcontent-%COMP%]{cursor:pointer;padding-left:5px}']}),a})(),zo=(()=>{var n;class a{constructor(){this.finishDateString=""}ngAfterViewInit(){let t=new Date(this.finishDateString);new FlipDown(t.getTime()/1e3,{headings:["d\xedas","horas","minutos","segundos"]}).start()}}return(n=a).\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["flipdown-timer"]],inputs:{finishDateString:"finishDateString"},decls:1,vars:0,consts:[["id","flipdown",1,"flipdown"]],template:function(t,o){1&t&&e._UZ(0,"div",0)},styles:['[_nghost-%COMP%]     .flipdown.flipdown__theme-dark{font-family:sans-serif;font-weight:700}[_nghost-%COMP%]     .flipdown.flipdown__theme-dark .rotor-group-heading:before{color:#000}[_nghost-%COMP%]     .flipdown.flipdown__theme-dark .rotor-group:nth-child(n+2):nth-child(-n+3):before, [_nghost-%COMP%]     .flipdown.flipdown__theme-dark .rotor-group:nth-child(n+2):nth-child(-n+3):after{background-color:#151515}[_nghost-%COMP%]     .flipdown.flipdown__theme-dark .rotor, [_nghost-%COMP%]     .flipdown.flipdown__theme-dark .rotor-top, [_nghost-%COMP%]     .flipdown.flipdown__theme-dark .rotor-leaf-front{color:#fff;background-color:#151515}[_nghost-%COMP%]     .flipdown.flipdown__theme-dark .rotor-bottom, [_nghost-%COMP%]     .flipdown.flipdown__theme-dark .rotor-leaf-rear{color:#efefef;background-color:#202020}[_nghost-%COMP%]     .flipdown.flipdown__theme-dark .rotor:after{border-top:solid 1px #151515}[_nghost-%COMP%]     .flipdown.flipdown__theme-light{font-family:sans-serif;font-weight:700}[_nghost-%COMP%]     .flipdown.flipdown__theme-light .rotor-group-heading:before{color:#eee}[_nghost-%COMP%]     .flipdown.flipdown__theme-light .rotor-group:nth-child(n+2):nth-child(-n+3):before, [_nghost-%COMP%]     .flipdown.flipdown__theme-light .rotor-group:nth-child(n+2):nth-child(-n+3):after{background-color:#ddd}[_nghost-%COMP%]     .flipdown.flipdown__theme-light .rotor, [_nghost-%COMP%]     .flipdown.flipdown__theme-light .rotor-top, [_nghost-%COMP%]     .flipdown.flipdown__theme-light .rotor-leaf-front{color:#222;background-color:#ddd}[_nghost-%COMP%]     .flipdown.flipdown__theme-light .rotor-bottom, [_nghost-%COMP%]     .flipdown.flipdown__theme-light .rotor-leaf-rear{color:#333;background-color:#eee}[_nghost-%COMP%]     .flipdown.flipdown__theme-light .rotor:after{border-top:solid 1px #222222}[_nghost-%COMP%]     .flipdown{overflow:visible;width:510px;height:110px}[_nghost-%COMP%]     .flipdown .rotor-group{position:relative;float:left;padding-right:30px}[_nghost-%COMP%]     .flipdown .rotor-group-heading:before{display:block;height:30px;line-height:30px;text-align:center}[_nghost-%COMP%]     .flipdown .rotor-group:nth-child(1) .rotor-group-heading:before{content:attr(data-before)}[_nghost-%COMP%]     .flipdown .rotor-group:nth-child(2) .rotor-group-heading:before{content:attr(data-before)}[_nghost-%COMP%]     .flipdown .rotor-group:nth-child(3) .rotor-group-heading:before{content:attr(data-before)}[_nghost-%COMP%]     .flipdown .rotor-group:nth-child(4) .rotor-group-heading:before{content:attr(data-before)}[_nghost-%COMP%]     .flipdown .rotor-group:nth-child(n+2):nth-child(-n+3):before{content:"";position:absolute;bottom:20px;left:115px;width:10px;height:10px;border-radius:50%}[_nghost-%COMP%]     .flipdown .rotor-group:nth-child(n+2):nth-child(-n+3):after{content:"";position:absolute;bottom:50px;left:115px;width:10px;height:10px;border-radius:50%}[_nghost-%COMP%]     .flipdown .rotor{position:relative;float:left;width:50px;height:80px;margin:0 5px 0 0;border-radius:4px;font-size:4rem;text-align:center;perspective:200px}[_nghost-%COMP%]     .flipdown .rotor:last-child{margin-right:0}[_nghost-%COMP%]     .flipdown .rotor-top, [_nghost-%COMP%]     .flipdown .rotor-bottom{overflow:hidden;position:absolute;width:50px;height:40px}[_nghost-%COMP%]     .flipdown .rotor-leaf{z-index:1;position:absolute;width:50px;height:80px;transform-style:preserve-3d;transition:transform 0s}[_nghost-%COMP%]     .flipdown .rotor-leaf.flipped{transform:rotateX(-180deg);transition:all .5s ease-in-out}[_nghost-%COMP%]     .flipdown .rotor-leaf-front, [_nghost-%COMP%]     .flipdown .rotor-leaf-rear{overflow:hidden;position:absolute;width:50px;height:40px;margin:0;transform:rotateX(0);backface-visibility:hidden;-webkit-backface-visibility:hidden}[_nghost-%COMP%]     .flipdown .rotor-leaf-front{line-height:80px;border-radius:4px 4px 0 0}[_nghost-%COMP%]     .flipdown .rotor-leaf-rear{line-height:0px;border-radius:0 0 4px 4px;transform:rotateX(-180deg)}[_nghost-%COMP%]     .flipdown .rotor-top{line-height:80px;border-radius:4px 4px 0 0}[_nghost-%COMP%]     .flipdown .rotor-bottom{bottom:0;line-height:0px;border-radius:0 0 4px 4px}[_nghost-%COMP%]     .flipdown .rotor:after{content:"";z-index:2;position:absolute;bottom:0;left:0;width:50px;height:40px;border-radius:0 0 4px 4px}[_nghost-%COMP%]     .flipdown{margin:0 auto;width:230px;height:50px;display:flex;justify-content:center;align-items:center}[_nghost-%COMP%]     .flipdown .rotor{font-size:1.2rem;margin-right:3px}[_nghost-%COMP%]     .flipdown .rotor, [_nghost-%COMP%]     .flipdown .rotor-leaf, [_nghost-%COMP%]     .flipdown .rotor-leaf-front, [_nghost-%COMP%]     .flipdown .rotor-leaf-rear, [_nghost-%COMP%]     .flipdown .rotor-top, [_nghost-%COMP%]     .flipdown .rotor-bottom, [_nghost-%COMP%]     .flipdown .rotor:after{width:20px}[_nghost-%COMP%]     .flipdown .rotor-group{padding-right:10px}[_nghost-%COMP%]     .flipdown .rotor-group:last-child{padding-right:0}[_nghost-%COMP%]     .flipdown .rotor-group-heading:before{font-size:.6rem;height:20px;line-height:20px}[_nghost-%COMP%]     .flipdown .rotor-group:nth-child(n+2):nth-child(-n+3):before, [_nghost-%COMP%]     .flipdown .rotor-group:nth-child(n+2):nth-child(-n+3):after{left:46px}[_nghost-%COMP%]     .flipdown .rotor-group:nth-child(n+2):nth-child(-n+3):before{bottom:8px;height:4px;width:4px}[_nghost-%COMP%]     .flipdown .rotor-group:nth-child(n+2):nth-child(-n+3):after{bottom:15px;height:4px;width:4px}[_nghost-%COMP%]     .flipdown .rotor-leaf-front, [_nghost-%COMP%]     .flipdown .rotor-top{line-height:30px}[_nghost-%COMP%]     .flipdown .rotor-leaf, [_nghost-%COMP%]     .flipdown .rotor{height:30px}[_nghost-%COMP%]     .flipdown .rotor-leaf-front, [_nghost-%COMP%]     .flipdown .rotor-leaf-rear, [_nghost-%COMP%]     .flipdown .rotor-top, [_nghost-%COMP%]     .flipdown .rotor-bottom, [_nghost-%COMP%]     .flipdown .rotor:after{height:15px}']}),a})();function Bo(n,a){1&n&&(e.TgZ(0,"div",20),e._uU(1,"* O nome \xe9 obrigatorio"),e.qZA())}function Vo(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Bo,2,0,"div",19),e.qZA()),2&n){const i=e.oxw();let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.bib0Form.get("name"))?null:t.hasError("required"))}}function Go(n,a){1&n&&(e.TgZ(0,"div",20),e._uU(1,"* Os apelidos son obrigatorios"),e.qZA())}function Ho(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Go,2,0,"div",19),e.qZA()),2&n){const i=e.oxw();let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.bib0Form.get("lastName"))?null:t.hasError("required"))}}function jo(n,a){1&n&&(e.TgZ(0,"div",20),e._uU(1,"* O teu email \xe9 obrigatorio"),e.qZA())}function $o(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,jo,2,0,"div",19),e.qZA()),2&n){const i=e.oxw();let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.bib0Form.get("email"))?null:t.hasError("required"))}}function Ko(n,a){1&n&&(e.TgZ(0,"div",20),e._uU(1,"* O teu n\xfamero de documento \xe9 obrigatorio"),e.qZA())}function Wo(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Ko,2,0,"div",19),e.qZA()),2&n){const i=e.oxw();let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.bib0Form.get("documentNumber"))?null:t.hasError("required"))}}function Xo(n,a){1&n&&(e.TgZ(0,"div",20),e._uU(1,"* \xc9 obrigatorio marcar unha opci\xf3n"),e.qZA())}function ea(n,a){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Xo,2,0,"div",19),e.qZA()),2&n){const i=e.oxw();let t;e.xp6(1),e.Q6J("ngIf",null==(t=i.bib0Form.get("amount"))?null:t.hasError("required"))}}let ta=(()=>{var n;class a{constructor(t,o,r){this.formBuilder=t,this.toastNotifier=o,this.eventService=r,this.disabled=!1,this.donatives=[{name:"1 \u20ac",value:1},{name:"3 \u20ac",value:3},{name:"5 \u20ac",value:5},{name:"10 \u20ac",value:10},{name:"15 \u20ac",value:15},{name:"20 \u20ac",value:20},{name:"25 \u20ac",value:25},{name:"30 \u20ac",value:30},{name:"35 \u20ac",value:35},{name:"40 \u20ac",value:40},{name:"45 \u20ac",value:45},{name:"50 \u20ac",value:50},{name:"100 \u20ac",value:100}]}ngOnInit(){this.bib0Form=this.formBuilder.group({documentNumber:["",p.kI.required],name:["",p.kI.required],lastName:["",p.kI.required],email:["",p.kI.required],amount:[5,p.kI.required]})}submit(){let t={...this.bib0Form.value};this.disabled=!0,this.bib0Form.valid?(t.competitionId=this.event.id,this.eventService.createBib0(this.event.id,t).subscribe({next:o=>{localStorage.setItem("redirect",`/events/${this.event.normalizedName}/${this.event.id}`),function Pi(n,a){let i=function Ei(n,a){return{amount:100*a.amount,currency:_.N.payment.currency,merchantCode:_.N.payment.merchantCode,merchantName:_.N.payment.merchantName,merchantParameters:"",merchantUrl:_.N.payment.merchantUrlBib0,order:"",productDescription:n.name+" - "+a.name+" "+a.lastName,signature:"",signatureVersion:_.N.payment.signatureVersion,terminal:_.N.payment.terminal,transactionType:_.N.payment.transactionType,url:_.N.payment.url,urlOk:_.N.payment.urlOk,urlKo:_.N.payment.urlKo}}(a,n);const t=document.createElement("form");t.setAttribute("method","POST"),t.setAttribute("action",i.url),t.appendChild(x("Ds_Merchant_Amou
1nt",n.bib0.amount)),t.appendChild(x("Ds_Merchant_Currency",i.currency)),t.appendChild(x("Ds_Merchant_Order",n.payment.merchantOrder)),t.appendChild(x("Ds_Merchant_MerchantCode",i.merchantCode)),t.appendChild(x("Ds_Merchant_Terminal",i.terminal)),t.appendChild(x("Ds_Merchant_TransactionType",i.transactionType)),t.appendChild(x("Ds_Merchant_MerchantURL",i.merchantUrl+"-bib0")),t.appendChild(x("Ds_Merchant_MerchantName",i.merchantName)),t.appendChild(x("Ds_Merchant_ProductDescription",i.productDescription)),t.appendChild(x("Ds_Merchant_UrlOK",i.urlOk)),t.appendChild(x("Ds_Merchant_UrlKO",i.urlKo)),t.appendChild(x("Ds_SignatureVersion",i.signatureVersion)),t.appendChild(x("Ds_MerchantParameters",n.payment.merchantParameters)),t.appendChild(x("Ds_Signature",n.payment.signature)),document.body.appendChild(t),t.submit(),document.body.removeChild(t)}(o,this.event),this.disabled=!1},error:o=>{this.disabled=!1}})):((0,I._5)(this.bib0Form),this.toastNotifier.fail("Revisa los campos"),this.disabled=!1)}}return(n=a).\u0275fac=function(t){return new(t||n)(e.Y36(p.QS),e.Y36(F.o),e.Y36(q.P))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-bib0"]],inputs:{event:"event"},decls:35,vars:8,consts:[[1,"race-registration",3,"formGroup"],[1,"container"],[1,"row"],[1,"card-shadow"],[1,"mb-3","p-3","bg-grey"],[1,"mb-2"],["for","name",1,"form-label"],["type","text","formControlName","name","pInputText","","placeholder","Introduce o teu nome"],[4,"ngIf"],["for","lastName",1,"form-label"],["type","text","formControlName","lastName","pInputText","","placeholder","Introduce os teus apelidos"],["for","email",1,"form-label"],["type","text","formControlName","email","name","email","placeholder","Introduce o teu email","pInputText",""],["type","text","formControlName","documentNumber","name","documentNumber","placeholder","Introduce o teu NIF / NIE","pInputText",""],["for","amount",1,"form-label"],["formControlName","amount","optionLabel","name","optionValue","value",3,"options"],["type","submit","name","submit","value","submit",1,"btn",3,"disabled","click"],[1,"my-lg-3","text-center"],["src","assets/img/cg-separator.png","alt",""],["class","text-danger",4,"ngIf"],[1,"text-danger"]],template:function(t,o){if(1&t&&(e.TgZ(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"label",6),e._uU(7,"Nome"),e.qZA(),e._UZ(8,"input",7),e.YNc(9,Vo,2,1,"div",8),e.qZA(),e.TgZ(10,"div",5)(11,"label",9),e._uU(12,"Apelidos"),e.qZA(),e._UZ(13,"input",10),e.YNc(14,Ho,2,1,"div",8),e.qZA(),e.TgZ(15,"div",5)(16,"label",11),e._uU(17,"Email"),e.qZA(),e._UZ(18,"input",12),e.YNc(19,$o,2,1,"div",8),e.qZA(),e.TgZ(20,"div",5)(21,"label",11),e._uU(22,"NIF / NIE"),e.qZA(),e._UZ(23,"input",13),e.YNc(24,Wo,2,1,"div",8),e.qZA()(),e.TgZ(25,"div",4)(26,"label",14),e._uU(27,"Importe a donar"),e.qZA(),e._UZ(28,"br")(29,"p-dropdown",15),e.YNc(30,ea,2,1,"div",8),e.qZA(),e.TgZ(31,"button",16),e.NdJ("click",function(){return o.submit()}),e._uU(32," Doar"),e.qZA()()()()(),e.TgZ(33,"div",17),e._UZ(34,"img",18),e.qZA()),2&t){let r,s,l,c,u;e.Q6J("formGroup",o.bib0Form),e.xp6(9),e.Q6J("ngIf",(null==(r=o.bib0Form.get("name"))?null:r.errors)&&(null==(r=o.bib0Form.get("name"))?null:r.dirty)),e.xp6(5),e.Q6J("ngIf",(null==(s=o.bib0Form.get("lastName"))?null:s.errors)&&(null==(s=o.bib0Form.get("lastName"))?null:s.dirty)),e.xp6(5),e.Q6J("ngIf",(null==(l=o.bib0Form.get("email"))?null:l.errors)&&(null==(l=o.bib0Form.get("email"))?null:l.dirty)),e.xp6(5),e.Q6J("ngIf",(null==(c=o.bib0Form.get("documentNumber"))?null:c.errors)&&(null==(c=o.bib0Form.get("documentNumber"))?null:c.dirty)),e.xp6(5),e.Q6J("options",o.donatives),e.xp6(1),e.Q6J("ngIf",(null==(u=o.bib0Form.get("amount"))?null:u.errors)&&(null==(u=o.bib0Form.get("amount"))?null:u.dirty)),e.xp6(1),e.Q6J("disabled",o.disabled)}},dependencies:[m.O5,p._Y,p.Fj,p.JJ,p.JL,p.sg,p.u,R.o,H.Lt],styles:["p-dropdown[_ngcontent-%COMP%]{width:100%;display:inline-block}  .p-dropdown{width:100%}  .p-component[type=text]{width:100%}.category[_ngcontent-%COMP%]{display:block;margin-top:40px}"]}),a})();function na(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"div",4)(1,"div",5)(2,"div",6)(3,"h3",7),e._UZ(4,"i",8),e._uU(5," Conversi\xf3n cerrada "),e.qZA()(),e.TgZ(6,"div",9)(7,"div",10),e._UZ(8,"i",11),e.TgZ(9,"h4"),e._uU(10,"Lo sentimos"),e.qZA(),e.TgZ(11,"p",7),e._uU(12),e.qZA()(),e.TgZ(13,"div",12),e._UZ(14,"i",13),e._uU(15," Si tienes alguna duda, contacta con la organizaci\xf3n del evento. "),e.qZA(),e.TgZ(16,"div",14)(17,"button",15),e.NdJ("click",function(){e.CHM(i);const o=e.oxw();return e.KtG(o.cancel())}),e._UZ(18,"i",16),e._uU(19," Volver al evento "),e.qZA()()()()()}if(2&n){const i=e.oxw();e.xp6(12),e.Oqu(i.blockedMessage)}}function ia(n,a){if(1&n&&(e.TgZ(0,"option",34),e._uU(1),e.qZA()),2&n){const i=a.$implicit;e.Q6J("value",i.value),e.xp6(1),e.hij(" ",i.label," ")}}function oa(n,a){1&n&&(e.TgZ(0,"div",35),e._uU(1," Por favor, introduce un n\xfamero de documento v\xe1lido (m\xednimo 8 caracteres) "),e.qZA())}function aa(n,a){if(1&n&&(e.TgZ(0,"div",10),e._UZ(1,"i",36),e._uU(2),e.qZA()),2&n){const i=e.oxw(2);e.xp6(2),e.hij(" ",i.verificationError," ")}}function ra(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"div",17)(1,"div",5)(2,"div",18)(3,"h3",7),e._UZ(4,"i",19),e._uU(5," Confirmaci\xf3n de plaza (Lista de espera) "),e.qZA()(),e.TgZ(6,"div",9)(7,"div",12),e._UZ(8,"i",13),e._uU(9," Introduce tu DNI/NIE para verificar tu inscripci\xf3n en la lista de espera y convert
1irla a inscripci\xf3n confirmada. "),e.qZA(),e.TgZ(10,"form",20),e.NdJ("ngSubmit",function(){e.CHM(i);const o=e.oxw();return e.KtG(o.onVerify())}),e.TgZ(11,"div",21)(12,"label",22),e._uU(13,"Tipo de documento"),e.qZA(),e.TgZ(14,"select",23),e.YNc(15,ia,2,2,"option",24),e.qZA()(),e.TgZ(16,"div",21)(17,"label",25),e._uU(18,"N\xfamero de documento *"),e.qZA(),e._UZ(19,"input",26),e.YNc(20,oa,2,0,"div",27),e.qZA(),e.YNc(21,aa,3,1,"div",28),e.TgZ(22,"div",29)(23,"button",30),e.NdJ("click",function(){e.CHM(i);const o=e.oxw();return e.KtG(o.cancel())}),e._UZ(24,"i",31),e._uU(25," Cancelar "),e.qZA(),e.TgZ(26,"button",32),e._UZ(27,"i",33),e._uU(28),e.qZA()()()()()()}if(2&n){const i=e.oxw();e.xp6(10),e.Q6J("formGroup",i.verificationForm),e.xp6(5),e.Q6J("ngForOf",i.documentTypes),e.xp6(4),e.ekj("is-invalid",i.verificationForm.get("documentNumber").touched&&i.verificationForm.get("documentNumber").invalid),e.xp6(1),e.Q6J("ngIf",i.verificationForm.get("documentNumber").touched&&i.verificationForm.get("documentNumber").invalid),e.xp6(1),e.Q6J("ngIf",i.verificationError),e.xp6(5),e.Q6J("disabled",!i.verificationForm.valid||i.isVerifying),e.xp6(2),e.hij(" ",i.isVerifying?"Verificando...":"Verificar"," ")}}function sa(n,a){if(1&n&&(e.TgZ(0,"div",44)(1,"h5",45),e._UZ(2,"i",33),e._uU(3," DNI Verificado Correctamente"),e.qZA(),e.TgZ(4,"div",46)(5,"div",47)(6,"strong"),e._UZ(7,"i",48),e._uU(8," Corredor:"),e.qZA(),e.TgZ(9,"span"),e._uU(10),e.qZA()(),e.TgZ(11,"div",47)(12,"strong"),e._UZ(13,"i",49),e._uU(14," DNI:"),e.qZA(),e.TgZ(15,"span"),e._uU(16),e.qZA()(),e.TgZ(17,"div",47)(18,"strong"),e._UZ(19,"i",19),e._uU(20," Lista de Espera:"),e.qZA(),e.TgZ(21,"span"),e._uU(22),e.qZA()(),e.TgZ(23,"div",47)(24,"strong"),e._UZ(25,"i",50),e._uU(26," Carrera Destino:"),e.qZA(),e.TgZ(27,"span"),e._uU(28),e.qZA()(),e.TgZ(29,"div",47)(30,"strong"),e._UZ(31,"i",51),e._uU(32," Precio:"),e.qZA(),e.TgZ(33,"span"),e._uU(34),e.ALo(35,"number"),e.qZA()()()()),2&n){const i=e.oxw(2);e.xp6(10),e.Oqu(i.enrollmentInfo.runnerName),e.xp6(6),e.Oqu(i.enrollmentInfo.documentNumber),e.xp6(6),e.Oqu(i.enrollmentInfo.waitingListRaceName),e.xp6(6),e.Oqu(i.enrollmentInfo.targetRaceName),e.xp6(6),e.hij("",e.xi3(35,5,i.enrollmentInfo.targetRacePrice,"1.2-2")," \u20ac")}}function la(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"div",37)(1,"div",5)(2,"div",18)(3,"h3",7),e._UZ(4,"i",33),e._uU(5," Confirmaci\xf3n de plaza (Lista de espera) "),e.qZA()(),e.TgZ(6,"div",9),e.YNc(7,sa,36,8,"div",38),e.TgZ(8,"div",12)(9,"p",39),e._UZ(10,"i",13),e._uU(11," Al confirmar, tu inscripci\xf3n en lista de espera ser\xe1 convertida a inscripci\xf3n confirmada en la carrera principal. "),e.qZA(),e.TgZ(12,"p",7),e._uU(13," Se te redirigir\xe1 al pago para completar la inscripci\xf3n. "),e.qZA()(),e.TgZ(14,"div",40),e._UZ(15,"i",36),e.TgZ(16,"strong"),e._uU(17,"Importante:"),e.qZA(),e._uU(18," Despu\xe9s del pago exitoso, tu inscripci\xf3n en la lista de espera ser\xe1 eliminada autom\xe1ticamente. "),e.qZA(),e.TgZ(19,"div",29)(20,"button",41),e.NdJ("click",function(){e.CHM(i);const o=e.oxw();return e.KtG(o.goBack())}),e._UZ(21,"i",16),e._uU(22," Volver "),e.qZA(),e.TgZ(23,"button",42),e.NdJ("click",function(){e.CHM(i);const o=e.oxw();return e.KtG(o.onConfirmAndPay())}),e._UZ(24,"i",43),e._uU(25),e.qZA()()()()()}if(2&n){const i=e.oxw();e.xp6(7),e.Q6J("ngIf",i.enrollmentInfo),e.xp6(13),e.Q6J("disabled",i.isVerifying),e.xp6(3),e.Q6J("disabled",i.isVerifying),e.xp6(2),e.hij(" ",i.isVerifying?"Procesando...":"Confirmar e proceder al pago"," ")}}let ca=(()=>{var n;class a{constructor(t,o,r,s,l){this.fb=t,this.route=o,this.router=r,this.eventService=s,this.toastNotifier=l,this.currentStep="verify",this.documentTypes=[{value:"DNI",label:"DNI"},{value:"NIE",label:"NIE"},{value:"Pasaporte",label:"Pasaporte"}],this.verificationError=null,this.isVerifying=!1,this.documentNumber=null,this.enrollmentInfo=null,this.blockedMessage="La conversi\xf3n desde lista de espera est\xe1 temporalmente cerrada.",this.verificationForm=this.fb.group({documentType:["DNI",p.kI.required],documentNumber:["",[p.kI.required,p.kI.minLength(8)]]})}ngOnInit(){if(console.log("====== COMPONENT INITIALIZATION ======"),console.log("Input - event:",this.event),console.log("Input - group:",this.group),this.competitionId=this.route.
1snapshot.paramMap.get("eventId"),this.eventName=this.route.snapshot.paramMap.get("eventName"),this.targetGroup=this.route.snapshot.paramMap.get("group"),this.waitingListGroup=this.route.snapshot.queryParamMap.get("waitingListGroup"),console.log("Params - competitionId:",this.competitionId),console.log("Params - eventName:",this.eventName),console.log("Params - targetGroup:",this.targetGroup),console.log("Params - waitingListGroup:",this.waitingListGroup),!this.waitingListGroup)return this.toastNotifier.fail("Par\xe1metro waitingListGroup no encontrado en la URL"),void this.router.navigate(["/events",this.eventName,this.competitionId]);const t=this.event?.races?.find(o=>o.group===this.targetGroup);if(!t||t.blockWaitingListConversion)return this.currentStep="blocked",void(this.blockedMessage="La conversi\xf3n desde lista de espera est\xe1 temporalmente cerrada.");this.currentStep="verify"}onVerify(){this.verificationForm.valid?(this.isVerifying=!0,this.verificationError=null,this.documentNumber=this.verificationForm.value.documentNumber.toUpperCase(),console.log("Starting verification for DNI:",this.documentNumber),console.log("Competition ID:",this.competitionId),console.log("Waiting List Group:",this.waitingListGroup),console.log("Target Group:",this.targetGroup),this.eventService.verifyWaitingListEnrollment(this.competitionId,this.documentNumber,this.waitingListGroup,this.targetGroup).subscribe({next:t=>{console.log("====== VERIFICATION RESPONSE START ======"),console.log("Full response:",JSON.stringify(t,null,2)),console.log("Response type:",typeof t),console.log("Response.isValid:",t?.isValid),console.log("Response.enrollmentInfo:",t?.enrollmentInfo),console.log("====== VERIFICATION RESPONSE END ======"),this.isVerifying=!1,t&&!0===t.isValid?(console.log("\u2713 Verification successful, switching to summary step"),this.enrollmentInfo=t.enrollmentInfo,console.log("Enrollment info stored:",this.enrollmentInfo),console.log("Before: currentStep =",this.currentStep),this.currentStep="summary",console.log("After: currentStep =",this.currentStep),this.toastNotifier.success("DNI verificado correctamente"),console.log("\u2713 All done - should be on summary screen now")):(console.log("\u2717 Verification failed"),console.log("Response.isValid was:",t?.isValid),console.log("Response.message:",t?.message),t?.message?.includes("bloqueada")||t?.message?.includes("cerrada")?(this.currentStep="blocked",this.blockedMessage=t.message):this.verificationError=t?.message||"DNI no encontrado en la lista de espera o inscripci\xf3n no pagada")},error:t=>{console.log("====== VERIFICATION ERROR ======"),console.error("Caught error:",t),console.error("Error status:",t?.status),console.error("Error message:",t?.message),console.error("Error body:",t?.error),console.log("====== ERROR END ======"),this.isVerifying=!1,this.verificationError="Error al verificar el DNI. Por favor, int\xe9ntelo de nuevo."}})):this.toastNotifier.fail("Por favor, introduce un DNI/NIE v\xe1lido")}onConfirmAndPay(){this.documentNumber?(console.log("Starting conversion for DNI:",this.documentNumber),this.isVerifying=!0,this.eventService.convertWaitingListEnrollment(this.competitionId,this.documentNumber,this.waitingListGroup,this.targetGroup).subscribe({next:t=>{if(console.log("Conversion response:",t),this.isVerifying=!1,t&&t.successfulEnrollments&&t.successfulEnrollments.length>0){const o=t.successfulEnrollments[0];if(console.log("Enrollment:",o),console.log("Enrollment amount:",o.amount),console.log("Enrollment isFree:",o.isFree),console.log("Payment object:",t.payment),o.amount>0&&t.payment){const r=this.event.races.find(s=>s.group===this.targetGroup);if(console.log("Target race:",r),console.log("Event:",this.event),!r)return console.error("Target race not found in event races"),this.verificationError="Error: carrera destino no encontrada",void(this.currentStep="verify");console.log("Calling createAndPostForm with:",{response:t,event:this.event,race:r}),ie(t,this.event,r)}else 0===o.amount||o.isFree?(console.log("Free registration detected, navigating to event page"),this.toastNotifier.success("Inscripci\xf3n completada correctamente (gratuita)"),this.router.navigate(["/events",this.eventName,this.competitionId])):(console.error("No payment information in response but amount > 0"),this.verificationError="Error al generar informaci\xf3n de pago",this.currentStep="verify")}else console.error("No successful enrollments in response"),this.verificationError="Error al crear la inscripci\xf3n",this.currentStep="verify"},error:t=>{if(this.isVerifying=!1,console.error("Conversion error:",t),console.error("Error status:",t.status),console.error("Error message:",t.error),400===t.status){const o=t.error||"";o.includes("bloqueada")||o.includes("cerrada")?(this.currentStep="blocked",this.blockedMessage=o):this.verificationError=o||"DNI no encontrado en la lista de espera o inscripci\xf3n no pagada"}
1else this.verificationError=404===t.status?t.error||"Carrera no encontrada":"Error al procesar la conversi\xf3n. Por favor, int\xe9ntelo de nuevo.";"blocked"!==this.currentStep&&(this.currentStep="verify")}})):console.error("No document number available")}goBack(){this.currentStep="verify",this.verificationError=null,this.enrollmentInfo=null,this.documentNumber=null}cancel(){this.router.navigate(["/events",this.eventName,this.competitionId])}}return(n=a).\u0275fac=function(t){return new(t||n)(e.Y36(p.qu),e.Y36(T.gz),e.Y36(T.F0),e.Y36(q.P),e.Y36(F.o))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-waiting-list-conversion"]],inputs:{event:"event",group:"group"},decls:4,vars:3,consts:[[1,"waiting-list-conversion-container"],["class","blocked-step",4,"ngIf"],["class","verification-step",4,"ngIf"],["class","summary-step",4,"ngIf"],[1,"blocked-step"],[1,"card"],[1,"card-header","bg-danger","text-white"],[1,"mb-0"],[1,"fas","fa-ban"],[1,"card-body"],[1,"alert","alert-danger"],[1,"fas","fa-exclamation-triangle","fa-2x","mb-3"],[1,"alert","alert-info"],[1,"fas","fa-info-circle"],[1,"d-flex","justify-content-center","mt-4"],["type","button",1,"btn","btn-secondary","btn-lg",3,"click"],[1,"fas","fa-arrow-left"],[1,"verification-step"],[1,"card-header","custom-header","text-white"],[1,"fas","fa-list-ul"],[3,"formGroup","ngSubmit"],[1,"form-group"],["for","documentType"],["id","documentType","formControlName","documentType",1,"form-control"],[3,"value",4,"ngFor","ngForOf"],["for","documentNumber"],["id","documentNumber","type","text","formControlName","documentNumber","placeholder","12345678X",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["class","alert alert-danger",4,"ngIf"],[1,"d-flex","justify-content-between","mt-4"],["type","button",1,"btn","btn-secondary",3,"click"],[1,"fas","fa-times"],["type","submit",1,"btn","btn-primary","btn-lg",3,"disabled"],[1,"fas","fa-check-circle"],[3,"value"],[1,"invalid-feedback"],[1,"fas","fa-exclamation-triangle"],[1,"summary-step"],["class","alert alert-success",4,"ngIf"],[1,"mb-2"],[1,"alert","alert-warning"],["type","button",1,"btn","btn-secondary",3,"disabled","click"],["type","button",1,"btn","btn-primary","btn-lg",3,"disabled","click"],[1,"fas","fa-shopping-cart"],[1,"alert","alert-success"],[1,"mb-3"],[1,"enrollment-details"],[1,"detail-row"],[1,"fas","fa-user"],[1,"fas","fa-id-card"],[1,"fas","fa-arrow-right"],[1,"fas","fa-euro-sign"]],template:function(t,o){1&t&&(e.TgZ(0,"div",0),e.YNc(1,na,20,1,"div",1),e.YNc(2,ra,29,8,"div",2),e.YNc(3,la,26,4,"div",3),e.qZA()),2&t&&(e.xp6(1),e.Q6J("ngIf","blocked"===o.currentStep),e.xp6(1),e.Q6J("ngIf","verify"===o.currentStep),e.xp6(1),e.Q6J("ngIf","summary"===o.currentStep))},dependencies:[m.sg,m.O5,p._Y,p.YN,p.Kr,p.Fj,p.EJ,p.JJ,p.JL,p.sg,p.u,m.JJ],styles:[".waiting-list-conversion-container[_ngcontent-%COMP%]{max-width:800px;margin:2rem auto;padding:0 1rem}.waiting-list-conversion-container[_ngcontent-%COMP%]   .card[_ngcontent-%COMP%]{box-shadow:0 2px 8px #0000001a;border-radius:8px;border:none}.waiting-list-conversion-container[_ngcontent-%COMP%]   .card[_ngcontent-%COMP%]   .card-header.custom-header[_ngcontent-%COMP%]{background-color:#0d5aa5}.waiting-list-conversion-container[_ngcontent-%COMP%]   .card[_ngcontent-%COMP%]   .card-header[_ngcontent-%COMP%]{border-radius:8px 8px 0 0;padding:1.5rem}.waiting-list-conversion-container[_ngcontent-%COMP%]   .card[_ngcontent-%COMP%]   .card-header[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{font-size:1.5rem;font-weight:600;color:#fff}.waiting-list-conversion-container[_ngcontent-%COMP%]   .card[_ngcontent-%COMP%]   .card-header[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{margin-right:.5rem}.waiting-list-conversion-container[_ngcontent-%COMP%]   .card[_ngcontent-%COMP%]   .card-body[_ngcontent-%COMP%]{padding:2rem}.waiting-list-conversion-container[_ngcontent-%COMP%]   .alert[_ngcontent-%COMP%]{border-radius:6px}.waiting-list-conversion-container[_ngcontent-%COMP%]   .alert[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{margin-right:.5rem}.waiting-list-conversion-container[_ngcontent-%COMP%]   .alert[_ngcontent-%COMP%]   h5[_ngcontent-%COMP%]{font-weight:600;border-bottom:1px solid rgba(0,0,0,.1);padding-bottom:.75rem}.waiting-list-conversion-container[_ngcontent-%COMP%]   .alert[_ngcontent-%COMP%]   .enrollment-details[_ngcontent-%COMP%]{margin-top:1rem}.waiting-list-conversion-container[_ngcontent-%COMP%]   .alert[_ngcontent-%COMP%]   .enrollment-details[_ngcontent-%COMP%]   .detail-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding:.75rem 0;border-bottom:1px solid rgba(0,0,0,.05)}.waiting-list-conversion-container[_ngcontent-%COMP%]   .alert[_ngcontent-%COMP%]   .enrollment-details[_ngcontent-%COMP%]   .detail-row[_ngcontent-%COMP%]:last-child{border-bottom:none;font-size:1.125rem;font-weight:600}.waiting-list-conversion-container[_ngcontent-%COMP%]   .alert[_ngcontent-%COMP%]   .enrollment-details[_ngcontent-%COMP%]   .detail-row[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]{color:#333}.waiting-list-conversion-container[_ngcontent-%COMP%]   .alert[_ngcontent-%COMP%]   .enrollment-details[_ngcontent-%COMP%]   .detail-row[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{margin-right:.5rem;width:20px;
1display:inline-block}.waiting-list-conversion-container[_ngcontent-%COMP%]   .alert[_ngcontent-%COMP%]   .enrollment-details[_ngcontent-%COMP%]   .detail-row[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{text-align:right;color:#555}.waiting-list-conversion-container[_ngcontent-%COMP%]   .form-group[_ngcontent-%COMP%]{margin-bottom:1.5rem}.waiting-list-conversion-container[_ngcontent-%COMP%]   .form-group[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{font-weight:600;margin-bottom:.5rem;display:block}.waiting-list-conversion-container[_ngcontent-%COMP%]   .form-group[_ngcontent-%COMP%]   .form-control[_ngcontent-%COMP%]{border-radius:4px;padding:.75rem}.waiting-list-conversion-container[_ngcontent-%COMP%]   .form-group[_ngcontent-%COMP%]   .form-control[_ngcontent-%COMP%]:focus{border-color:#007bff;box-shadow:0 0 0 .2rem #007bff40}.waiting-list-conversion-container[_ngcontent-%COMP%]   .form-group[_ngcontent-%COMP%]   .form-control.is-invalid[_ngcontent-%COMP%]{border-color:#dc3545}.waiting-list-conversion-container[_ngcontent-%COMP%]   .form-group[_ngcontent-%COMP%]   .form-control.is-invalid[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.waiting-list-conversion-container[_ngcontent-%COMP%]   .form-group[_ngcontent-%COMP%]   .invali
1d-feedback[_ngcontent-%COMP%]{display:block;margin-top:.25rem;font-size:.875rem;color:#dc3545}.waiting-list-conversion-container[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%]{padding:.75rem 1.5rem;border-radius:4px;font-weight:600;transition:all .3s ease}.waiting-list-conversion-container[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{margin-right:.5rem}.waiting-list-conversion-container[_ngcontent-%COMP%]   .btn.btn-lg[_ngcontent-%COMP%]{padding:1rem 2rem;font-size:1.125rem}.waiting-list-conversion-container[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%]:disabled{cursor:not-allowed;opacity:.6}.waiting-list-conversion-container[_ngcontent-%COMP%]   .d-flex.justify-content-between[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}@media (max-width: 768px){.waiting-list-conversion-container[_ngcontent-%COMP%]{margin:1rem auto}.waiting-list-conversion-container[_ngcontent-%COMP%]   .card[_ngcontent-%COMP%]   .card-header[_ngcontent-%COMP%]{padding:1rem}.waiting-list-conversion-container[_ngcontent-%COMP%]   .card[_ngcontent-%COMP%]   .card-header[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{font-size:1.25rem}.waiting-list-conversion-container[_ngcontent-%COMP%]   .card[_ngcontent-%COMP%]   .card-body[_ngcontent-%COMP%]{padding:1rem}.waiting-list-conversion-container[_ngcontent-%COMP%]   .d-flex.justify-content-between[_ngcontent-%COMP%]{flex-direction:column;gap:1rem}.waiting-list-conversion-container[_ngcontent-%COMP%]   .d-flex.justify-content-between[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%]{width:100%}}"]}),a})();function da(n,a){if(1&n&&(e.TgZ(0,"div",19)(1,"a",20),e._UZ(2,"i",21),e._uU(3),e.qZA()()),2&n){const i=a.$implicit,t=e.oxw(3);e.xp6(1),e.Q6J("href",t.getEventRegulation(t.event,i),e.LSH),e.xp6(2),e.hij(" ",1==t.event.regulations.length?"Regulamento":i.name," ")}}function pa(n,a){if(1&n&&(e.ynx(0),e.YNc(1,da,4,2,"div",18),e.BQk()),2&n){const i=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",i.event.regulations)}}function ua(n,a){if(1&n&&(e.TgZ(0,"div")(1,"div",19)(2,"a",22),e._uU(3," Percorrido "),e.qZA()()()),2&n){const i=e.oxw(2);e.xp6(2),e.Q6J("routerLink",i.getRouteLink(i.event))}}function ga(n,a){if(1&n&&(e.ynx(0),e.TgZ(1,"div",19)(2,"a",23),e._UZ(3,"i",24),e._uU(4," Dorsais "),e.qZA()(),e.BQk()),2&n){const i=e.oxw(2);e.xp6(2),e.Q6J("href",i.getBibsLink(i.event),e.LSH)}}function ma(n,a){if(1&n&&(e.TgZ(0,"li",25)(1,"a",10),e._UZ(2,"i",26),e.qZA()()),2&n){const i=e.oxw(2);e.xp6(1),e.Q6J("href",i.addHttps(i.event.twitterUrl),e.LSH)}}function _a(n,a){if(1&n&&(e.TgZ(0,"li",25)(1,"a",10),e._UZ(2,"i",27),e.qZA()()),2&n){const i=e.oxw(2);e.xp6(1),e.Q6J("href",i.addHttps(i.event.instagramUrl),e.LSH)}}function ha(n,a){if(1&n&&(e.TgZ(0,"li",25)(1,"a",10),e._UZ(2,"i",28),e.qZA()()),2&n){const i=e.oxw(2);e.xp6(1),e.Q6J("href",i.addHttps(i.event.facebookUrl),e.LSH)}}function fa(n,a){if(1&n&&(e.TgZ(0,"li",25)(1,"a",10),e._UZ(2,"i",29),e.qZA()()),2&n){const i=e.oxw(2);e.xp6(1),e.Q6J("href",i.addHttps(i.event.youtubeUrl),e.LSH)}}function va(n,a){if(1&n&&(e.TgZ(0,"li",25)(1,"a",10),e._UZ(2,"i",30),e.qZA()()),2&n){const i=e.oxw(2);e.xp6(1),e.Q6J("href",i.addHttps(i.event.tikTokUrl),e.LSH)}}function xa(n,a){if(1&n&&(e.TgZ(0,"div",31),e._UZ(1,"i",32),e._uU(2),e.qZA()),2&n){const i=e.oxw(2);e.xp6(2),e.hij(" ",i.event.organizerMail," ")}}function ba(n,a){if(1&n&&(e.TgZ(0,"div",33)(1,"div",34)(2,"h6",35),e._uU(3,"Tempo para o inicio da carreira"),e.qZA(),e.TgZ(4,"div"),e._UZ(5,"flipdown-timer",36),e.qZA()()()),2&n){const i=e.oxw(2);e.xp6(5),e.Q6J("finishDateString",i.getRaceDateTime(i.event))}}function Ca(n,a){if(1&n&&e._UZ(0,"div",41),2&n){const i=e.oxw(3);e.Q6J("innerHtml",i.event.donativeDescription,e.oJD)}}function Za(n,a){if(1&n&&(e.TgZ(0,"a",42),e._UZ(1,"i",43),e._uU(2," Dorsal 0 "),e.qZA()),2&n){const i=e.oxw(3);e.Q6J("href",i.getBib0Link(i.event),e.LSH)}}function Ta(n,a){if(1&n&&(e.ynx(0),e.TgZ(1,"strong"),e._uU(2),e.qZA(),e._uU(3," a trav\xe9s do Dorsal 0"),e._UZ(4,"br"),e.BQk()),2&n){const i=e.oxw(4);e.xp6(2),e.hij("",i.event.bib0Amount," \u20ac")}}function ya(n,a){if(1&n&&(e.ynx(0),e.TgZ(1,"strong"),e._uU(2),e.qZA(),e._uU(3," a trav\xe9s de doaz\xf3ns dos participantes "),e.BQk()),2&n){const i=e.oxw(4);e.xp6(2),e.hij("",i.event.donativeAmount," \u20ac")}}function wa(n,a){if(1&n&&(e.TgZ(0,"div",44),e._uU(1," Grazas \xe1 t\xfaa axuda levamos recadados"),e._UZ(2,"br"),e.YNc(3,Ta,5,1,"ng-container",4),e.YNc(4,ya,4,1,"ng-container",4),e.qZA()),2&n){const i=e.oxw(3);e.xp6(3),e.Q6J("ngIf",i.event.bib0Amount>0),e.xp6(1),e.Q6J("ngIf",i.event.donativeAmount>0)}}function Ia(n,a){if(1&n&&(e.TgZ(0,"div",33)(1,"div",37),e.YNc(2,Ca,1,1,"div",38),e.YNc(3,Za,3,1,"a",39),e.YNc(4,wa,5,2,"div",40),e.qZA()()),2&n){const i=e.oxw(2);e.xp6(2),e.Q6J("ngIf",i.event.hasDonative),e.xp6(1),e.Q6J("ngIf",i.event.hasDonative),e.xp6(1),e.Q6J("ngIf",i.event.showDonative)}}function Da(n,a){if(1&n&&(e.ynx(0),e._UZ(1,"p-image",47),e.BQk()),2&n){const i=e.oxw().$implicit,t=e.oxw(3);e.xp6(1),e.Q6J("src",t.getRaceRoute(i))("preview",!0)("alt",t.event.name)}}function Aa(n,a){if(1&n&&(e.TgZ(0,"div",46),e.YNc(1,Da,2,3,"ng-container",4),e.qZA()),2&n){const i=a.$implicit;e.xp6(1),e.Q6J("ngIf",i.routeUrl)}}function Ma(n,a){if(1&n&&(e.TgZ(0,"div",33)(1,"h6",35),e._uU(2,"Percorrido"),e.qZA(),e.YNc(3,Aa,2,1,"div",45),e.qZA()),2&n){const i=e.oxw(2);e.xp6(3),e.Q6J("ngForOf",i.event.races)}}function Na(n,a){if(1&n&&(e.TgZ(0,"div",33),e._UZ(1,"iframe",48),e.qZA()),2&n){const i=e.oxw(2);e.xp6(1),e.Q6J("src",i.mainVideoUrl,e.uOi)}}function Oa(n,a){if(1&n&&(e.TgZ(0,"div")(1,"div",6),e._UZ(2,"p-image",7),e.qZA(),e.YNc(3,pa,2,1,"ng-container",4),e.ynx(4),e.YNc(5,ua,4,1,"div",4),e.BQk(),e.YNc(6,ga,5,1,"ng-container",4),e.TgZ(7,"div",8)(8,"a",9)(9,"strong")(10,"a",10),e._uU(11),e.qZA()()()(),e.TgZ(12,"div",11)(13,"ul",12),e.YNc(14,ma,3,1,"li",13),e.YNc(15,_a,3,1,"li",13),e.YNc(16,ha,3,1,"li",13),e.YNc(17,fa,3,1,"li",13),e.YNc(18,va,3,1,"li",13),e.qZA()(),e.YNc(19,xa,3,1,"div",14),e.YNc(20,ba,6,1,"div",15),e.TgZ(21,"div",16),e._UZ(22,"img",17),e.qZA(),e.YNc(23,Ia,5,3,"div",15),e.YNc(24,Ma,4,1,"div",15),e.YNc(25,Na,2,1,"div",15),e.qZA()),2&n){const i=e.oxw();e.xp6(2),e.Q6J("src",i.getEventPoster(i.event,"medium"))("preview",!0)("previewImageSrc",i.getEventPoster(i.event,"extra"))("alt",i.event.name),e.xp6(1),e.Q6J("ngIf",i.event.regulations&&i.event.regulations.length>0),e.xp6(2),e.Q6J("ngIf",(null==i.event||null==i.event.races?null:i.event.races.length)>0&&(null==i.event?null:i.event.races[0].routeGpxUrl)),e.xp6(1),e.Q6J("ngIf",i.event.showBibs),e.xp6(4),e.Q6J("href",i.addHttps(i.event.organizerWeb),e.LSH),e.xp6(1),e.Oqu(i.event.organizerWeb),e.xp6(3),e.Q6J("ngIf",i.event.twitterUrl),e.xp6(1),e.Q6J("ngIf",i.event.instagramUrl),e.xp6(1),e.Q6J("ngIf",i.event.facebookUrl),e.xp6(1),e.Q6J("ngIf",i.event.youtubeUrl),e.xp6(1),e.Q6J("ngIf",i.event.tikTokUrl),e.xp6(1),e.Q6J("ngIf",i.event.organizerMail),e.xp6(1),e.Q6J("ngIf",i.event.races&&i.event.races.length>0),e.xp6(3),e.Q6J("ngIf",i.event.hasDonative||i.event.donativeAmount>0),e.xp6(1),e.Q6J("ngIf",i.event.hasRoutes),e.xp6(1),e.Q6J("ngIf",null!=i.event.mainVideoYoutubeId&&null!=i.event.mainVideoYoutubeId)}}function qa(n,a){if(1&n&&e._UZ(0,"app-event-races",52),2&n){const i=e.oxw(2);e.Q6J("event",i.event)}}
1function Ua(n,a){if(1&n&&e._UZ(0,"app-bib0",52),2&n){const i=e.oxw(2);e.Q6J("event",i.event)}}function Pa(n,a){if(1&n&&e._UZ(0,"app-race-registration",53),2&n){const i=e.oxw(2);e.Q6J("event",i.event)("group",i.group)}}function Ra(n,a){if(1&n&&e._UZ(0,"app-race-multiple-registration",53),2&n){const i=e.oxw(2);e.Q6J("event",i.event)("group",i.group)}}function Ea(n,a){if(1&n&&e._UZ(0,"app-waiting-list-conversion",53),2&n){const i=e.oxw(2);e.Q6J("event",i.event)("group",i.group)}}function ka(n,a){if(1&n&&(e.TgZ(0,"div",49),e.YNc(1,qa,1,1,"app-event-races",50),e.YNc(2,Ua,1,1,"app-bib0",50),e.YNc(3,Pa,1,2,"app-race-registration",51),e.YNc(4,Ra,1,2,"app-race-multiple-registration",51),e.YNc(5,Ea,1,2,"app-waiting-list-conversion",51),e.qZA()),2&n){const i=e.oxw();e.xp6(1),e.Q6J("ngIf",!i.group&&!i.bib0),e.xp6(1),e.Q6J("ngIf",i.bib0),e.xp6(1),e.Q6J("ngIf",i.group&&!i.multiple&&!i.waitingListConversion),e.xp6(1),e.Q6J("ngIf",i.group&&i.multiple),e.xp6(1),e.Q6J("ngIf",i.group&&i.waitingListConversion)}}let K=(()=>{var n;class a{constructor(t,o,r,s,l,c){this.eventService=t,this.route=o,this.router=r,this.authService=s,this.sanitizer=l,this.titleService=c,this.group=null,this.multiple=!1,this.waitingListConversion=!1,this.bibsUrl="",this.storageEventsUrl="",this.storageRacesUrl="",this.storageRegulationsUrl="",this.isClub=!1,this.bib0=!1,this.route.params.subscribe(u=>{this.eventId=u.eventId,this.group=u.group,this.multiple="multiple"===u.step}),this.router.url.indexOf("/bib0")>-1&&(this.bib0=!0),this.router.url.indexOf("/waiting-list-conversion")>-1&&(this.waitingListConversion=!0),this.storageEventsUrl=`${_.N.storage.basicUrl}/${_.N.storage.competitions}/`,this.storageRacesUrl=`${_.N.storage.basicUrl}/${_.N.storage.races}/`}ngOnInit(){var t=this;return(0,me.Z)(function*(){yield t.authService.checkAuth(),t.eventService.getEvent(t.eventId).subscribe({next:o=>{t.event=o[0],!t.event||t.isDraft(t.event)&&!t.isPreviewUnlocked(t.eventId)?t.router.navigate(["/"]):(t.event.hasRoutes=t.event.races.some(r=>!!r.routeUrl),t.setTitle(t.event.name+" - "+_.N.title),t.initializeClock(new Date(t.event.enrollmentEnd)),t.mainVideoUrl=t.sanitizer.bypassSecurityTrustResourceUrl("https://www.youtube.com/embed/"+t.event.mainVideoYoutubeId))},error:o=>{console.log(o)}})})()}isDraft(t){return null!=t?.status&&String(t.status).toLowerCase()===L.Draft}isPreviewUnlocked(t){const o=`preview_${t}`,r=this.route.snapshot.queryParamMap.get("preview");if(r&&r===t){try{sessionStorage.setItem(o,"1")}catch{}return!0}try{return"1"===sessionStorage.getItem(o)}catch{return!1}}setTitle(t){this.titleService.setTitle((0,I.Qs)(t))}initializeClock(t){let o=setInterval(()=>{const r=new Date,s=t.getTime()-r.getTime();this.days=Math.floor(s/864e5),this.hours=Math.floor(s/36e5%24),this.minutes=Math.floor(s/1e3/60%60),this.seconds=Math.floor(s/1e3%60),s<0&&(clearInterval(o),this.days=0,this.hours=0,this.minutes=0,this.seconds=0)},1e3)}addHttps(t){return/^https?:\/\//i.test(t)?t:`https://${t}`}getFirstRace(t){return t.races&&t.races.length>0?t.races.reduce((o,r)=>{const s=new Date(o.time);return new Date(r.time)<s?r:o}):null}getRaceDateTime(t){const o=this.getFirstRace(t);if(o){const r=this.convertTimeToDate(new Date(t.date),o.time);return this.formatDateToCustomString(r)}return null}getEventPoster(t,o){return t.posterUrl?this.storageEventsUrl+t.id+"/poster/"+this.generateWebpName(t.posterUrl,o):"assets/img/carreiras-galegas-poster.png"}generateWebpName(t,o){return`${t.replace(/\.[^/.]+$/,"")}_${o}.webp`}getEventRegulation(t,o){return this.storageEventsUrl+t.id+"/regulations/"+o.url}getRaceRoute(t){return t.routeUrl?this.storageRacesUrl+t.id+"/route/"+t.routeUrl:"assets/img/carreiras-galegas-poster.png"}convertTimeToDate(t,o){const[r,s,l]=o.split(":").map(Number);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),r,s,l)}formatDateToCustomString(t){const o=t.getFullYear(),r=t.getMonth()+1,s=t.getDate(),l=t.getHours(),c=t.getMinutes(),u=t.getSeconds();return`${o}-${String(r).padStart(2,"0")}-${String(s).padStart(2,"0")} ${String(l).padStart(2,"0")}:${String(c).padStart(2,"0")}
1:${String(u).padStart(2,"0")}`}getBibsLink(t){return`/events/${t.normalizedName}/${t.id}/bibs`}getBib0Link(t){return`/events/${t.normalizedName}/${t.id}/bib0`}getRouteLink(t){return`/events/${t.normalizedName}/${t.id}/maps`}}return(n=a).\u0275fac=function(t){return new(t||n)(e.Y36(q.P),e.Y36(T.gz),e.Y36(T.F0),e.Y36(Kt.e),e.Y36(xe.H7),e.Y36(xe.Dx))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-event"]],decls:6,vars:2,consts:[[1,"s-race"],[1,"container"],[1,"row"],[1,"d-lg-block","col-xl-3","text-center"],[4,"ngIf"],["class","col-xl-9",4,"ngIf"],[1,"race-thumbnail","mb-4"],["appendTo","body","width","100%",1,"img-fluid",3,"src","preview","previewImageSrc","alt"],[1,"race-email","mb-2"],[1,"primary-color"],["target","_blank",3,"href"],[1,"race-social","mb-2"],[1,"list-inline"],["class","list-inline-item fs-1",4,"ngIf"],["class","race-email mb-3",4,"ngIf"],["class","card-shadow",4,"ngIf"],[1,"my-lg-3","text-center"],["src","assets/img/cg-separator.png","alt",""],["class","race-regulation mb-2",4,"ngFor","ngForOf"],[1,"race-regulation","mb-2"],["target","_blank",1,"btn-outline",3,"href"],[1,"fa","fa-download"],[1,"btn-outline",3,"routerLink"],[1,"btn-outline",3,"href"],[1,"fa","fa-person-running"],[1,"list-inline-item","fs-1"],[1,"fa-brands","fa-square-twitter"],[1,"fa-brands","fa-square-instagram"],[1,"fa-brands","fa-square-facebook"],[1,"fa-brands","fa-square-youtube"],[1,"fa-brands","fa-square-tiktok"],[1,"race-email","mb-3"],[1,"fa-regular","fa-envelope"],[1,"card-shadow"],[1,"race-countdown","p-3","bg-grey"],[1,"mb-1"],[3,"finishDateString"],[1,"dorsal-0","p-3","bg-grey"],["class","f-14 mb-2",3,"innerHtml",4,"ngIf"],["class","btn mb-2",3,"href",4,"ngIf"],["class","f-14 thank-you",4,"ngIf"],[1,"f-14","mb-2",3,"innerHtml"],[1,"btn","mb-2",3,"href"],[1,"fa-solid","fa-shirt"],[1,"f-14","thank-you"],["class","race-thumbnail mb-2",4,"ngFor","ngForOf"],[1,"race-thumbnail","mb-2"],["appendTo","body","width","100%",1,"img-fluid",3,"src","preview","alt"],["width","100%","title","YouTube video player","frameborder","0","allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share","allowfullscreen","",3,"src"],[1,"col-xl-9"],[3,"event",4,"ngIf"],[3,"event","group",4,"ngIf"],[3,"event"],[3,"event","group"]],template:function(t,o){1&t&&(e.TgZ(0,"section",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,Oa,26,19,"div",4),e.qZA(),e.YNc(5,ka,6,5,"div",5),e.qZA()()()),2&t&&(e.xp6(4),e.Q6J("ngIf",o.event),e.xp6(1),e.Q6J("ngIf",o.event))},dependencies:[m.sg,m.O5,be.E,T.rH,Tn,bo,Lo,zo,ta,ca]}),a})();var Ja=g(665),qe=g(2289),oe=g(4844),Ue=g(3259);function Fa(n,a){if(1&n&&(e.TgZ(0,"div",8)(1,"h4"),e._uU(2),e.ALo(3,"date"),e.qZA(),e.TgZ(4,"h4"),e._uU(5),e.qZA()()),2&n){const i=e.oxw();e.xp6(2),e.AsE("",i.competition.place,", ",e.xi3(3,3,i.competition.date,"longDate"),""),e.xp6(3),e.Oqu(i.competition.name)}}function Sa(n,a){1&n&&(e.TgZ(0,"div"),e._uU(1,"Error no hay carreras"),e.qZA())}function Qa(n,a){1&n&&(e.TgZ(0,"div",12),e._uU(1," Non hai inscritos "),e.qZA())}function Ya(n,a){1&n&&(e.TgZ(0,"th",27),e._UZ(1,"i",37),e._uU(2," Dorsal "),e.qZA())}function La(n,a){1&n&&(e.TgZ(0,"th",27),e._UZ(1,"i",38),e._uU(2," Circuito "),e.qZA())}function za(n,a){if(1&n&&(e.TgZ(0,"td",45),e._uU(1),e.qZA()),2&n){const i=e.oxw().$implicit;e.xp6(1),e.hij(" ",i.bib,"")}}function Ba(n,a){if(1&n&&(e.TgZ(0,"td",42),e._uU(1),e.qZA()),2&n){const i=e.oxw().$implicit;e.xp6(1),e.hij(" ",i.isCircuit?"Circuito":""," ")}}function Va(n,a){if(1&n&&(e.ynx(0),e.TgZ(1,"tr",39),e.YNc(2,za,2,1,"td",40),e.TgZ(3,"td",41),e._uU(4),e.ALo(5,"titlecase"),e.qZA(),e.TgZ(6,"td",42),e._uU(7),e.ALo(8,"titlecase"),e.qZA(),e.TgZ(9,"td",42),e._uU(10),e.qZA(),e.TgZ(11,"td",42),e._uU(12),e.qZA(),e.TgZ(13,"td",42),e._uU(14),e.qZA(),e.TgZ(15,"td",42),e._uU(16),e.ALo(17,"titlecase"),e.qZA(),e.YNc(18,Ba,2,1,"td",43),e.TgZ(19,"td",44),e._uU(20),e.qZA()(),e.BQk()),2&n){const i=a.$implicit,t=e.oxw(4);e.xp6(2),e.Q6J("ngIf",t.competition.showBibs),e.xp6(2),e.hij("",e.lcZ(5,10,i.name)," "),e.xp6(3),e.Oqu(e.lcZ(8,12,i.lastName)),e.xp6(3),e.Oqu(i.locality),e.xp6(2),e.hij(" ",t.getGender(i.gender),""),e.xp6(2),e.Oqu(i.category),e.xp6(2),e.hij(" ",e.lcZ(17,14,i.club)," "),e.xp6(2),e.Q6J("ngIf",t.hasCircuit),e.xp6(1),e.Q6J("pTooltip",t.getTooltipText(i.status)),e.xp6(1),e.hij(" ",t.getStatus(i.status)," ")}}function Ga(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"div",23)(1,"div",24)(2,"table",25)(3,"thead")(4,"tr"),e.YNc(5,Ya,3,0,"th",26),e.TgZ(6,"th",27),e._UZ(7,"i",28),e._uU(8," Nome "),e.qZA(),e.TgZ(9,"th",27),e._uU(10," Apelidos "),e.qZA(),e.TgZ(11,"th",27),e._UZ(12,"i",29),e._uU(13," Localidade "),e.qZA(),e.TgZ(14,"th",27),e._UZ(15,"i",30),e._uU(16," X\xe9nero "),e.qZA(),e.TgZ(17,"th",27),e._UZ(18,"i",31),e._uU(19," Categor\xeda "),e.qZA(),e.TgZ(20,"th",27),e._UZ(21,"i",32),e._uU(22," Club "),e.qZA(),e.YNc(23,La,3,0,"th",26),e.TgZ(24,"th",27),e._UZ(25,"i",33),e._uU(26," Estado "),e.qZA()()(),e.TgZ(27,"tbody"),e.YNc(28,Va,21,16,"ng-container",34),e.qZA()()(),e.TgZ(29,"div",35)(30,"p-paginator",36),e.NdJ("onPageChange",function(o){e.CHM(i);const r=e.oxw(3);return e.KtG(r.paginate(o))}),e.qZA(),e.TgZ(31,"span"),e._uU(32),e.qZA()()()}if(2&n){const i=e.oxw(3);e.xp6(5),e.Q6J("ngIf",i.competition.showBibs),e.xp6(18),e.Q6J("ngIf",i.hasCircuit),e.xp6(5),e.Q6J("ngForOf",i.enrollments),e.xp6(2),e.Q6J("rows",i.size)("totalRecords",i.totalRecords),e.xp6(2),e.Oqu(i.infoRecords)}}const Ha=function(){return{standalone:!0}};function ja(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"p-tabPanel",11)(1,"div",12)(2,"div",13)(3,"div",14)(4,"div",15)(5,"div",16)(6,"div",17),e._UZ(7,"i",18),e.TgZ(8,"input",19),e.NdJ("ngModelChange",function(o){e.CHM(i);const r=e.oxw(2);return e.KtG(r.searchTerm=o)})("ngModelChange",function(){e.CHM(i);const o=e.oxw(2);return e.KtG(o.search())}),e.qZA()()(),e._UZ(9,"div",20),e.qZA()(),e.YNc(10,Qa,2,0,"div",21),e.YNc(11,Ga,33,6,"div",22),e.qZA()()()}if(2&n){const i=a.$implicit,t=e.oxw(2);e.Q6J("header",i.name),e.xp6(8),e.Q6J("ngModel",t.searchTerm)("ngModelOptions",e.DdM(5,Ha)),e.xp6(2),e.Q6J("ngIf",0==t.totalRecords),e.xp6(1),e.Q6J("ngIf",t.totalRecords>0)}}function $a(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"p-tabView",9),e.NdJ("onChange",function(o){e.CHM(i);const r=e.oxw();return e.KtG(r.selectTab(o))})("activeIndexChange",function(o){e.CHM(i);const r=e.oxw();return e.KtG(r.raceIndex=o)}),e.YNc(1,ja,12,6,"p-tabPanel",10),e.qZA()}if(2&n){const i=e.oxw();e.Q6J("activeIndex",i.raceIndex),e.xp6(1),e.Q6J("ngForOf",i.competition.races)}}let Ka=(()=>{var n;class a{constructor(t,o,r,s){this.eventResultsService=t,this.enrollemntsService=o,this.router=r,this.route=s,this.totalRecords=0,this.infoRecords="",this.actualIndex=0,this.size=50,this.races=[],this.enrollments=[],this.categories=[],this.raceIndex=0,this.genderType=J.Y,this.hasCircuit=!1,this.route.params.subscribe(l=>{this.eventId=l.eventId,this.raceId=l.raceId})}ngOnInit(){this.eventResultsService.get(this.eventId).subscribe({next:t=>{this.competition=t[0],this.competition.races=this.competition.races?this.competition.races.filter(o=>o.status==Ja.H.Published&&!o.hideEnrollments):[],this.competition.races.length>0?(this.raceIndex=this.raceId&&this.competition.races.findIndex(o=>o.id==this.raceId)>=0?this.competition.races.findIndex(o=>o.id==this.raceId):0,this.selectedRace=this.competition.races[this.raceIndex],this.paginate({first:this.actualIndex,rows:this.size})):this.error=!0}})}paginate(t){this.actualIndex=t.first,this.loading=!0,this.setFilter(t),this.enrollemntsService.getEnrollments(this.eventId,t).subscribe({next:o=>{this.enrollments=o.items,console.log("enrollments",this.enrollments),this.totalRecords=o.count,this.infoRecords=(0,I.f8)(this.actualIndex,this.size,this.totalRecords,"inscritos"),this.loading=!1,this.hasCircuit=this.enrollments.some(r=>r.isCircuit)},error:o=>{this.loading=!1}})}selectTab(t){this.selectedRace=this.competition.races[t.index],this.router.navigate([`${this.getEventLink(this.competition)}/races/${this.selectedRace.id}/enrollments`]),this.paginate({first:0,rows:this.size})}search(){this.paginate({first:0,rows:this.size})}setFilter(t){t.globalFilter=this.searchTerm,t.sortField="name",t.sortOrder=1,t.filters={raceId:{value:this.selectedRace.id}}}getGender(t){return J.d.mapGender(t)}getStatus(t){return ne.B.mapStatus(t)}getTooltipText(t){let o="";return t==ne.O.Pending&&(o="Pendente de recibir ou validar a documentaci\xf3n da bonificaci\xf3n"),o}getEventLink(t){return`/events/${t.normalizedName}/${t.id}`}}return(n=a).\u0275fac=function(t){return new(t||n)(e.Y36(qe.L),e.Y36(Y),e.Y36(T.F0),e.Y36(T.gz))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-enrollments"]],decls:10,vars:3,consts:[[1,"mb-3","mb-xl-5","s-enrollments"],[1,"container"],[1,"title","mt-4","mt-lg-0"],[1,"mb-4","text-center"],["src","assets/img/cg-separator.png","alt",""],["class","pb-2 mb-3",4,"ngIf"],[4,"ngIf"],[3,"activeIndex","onChange","activeIndexChange",4,"ngIf"],[1,"pb-2","mb-3"],[3,"activeIndex","onChange","activeIndexChange"],[3,"header",4,"ngFor","ngForOf"],[3,"header"],[1,"event-enrollments","mb-2"],[1,"section-title-wrap"],[1,"records-table-filter"],[1,"row","align-items-end","justify-content-end"],[1,"col-md-6","col-xl-auto","mb-3","mb-xl-0"],[1,"search"],[1,"fa","fa-search"],["title","search","type","text","pInputText","","placeholder","Buscar",1,"form-control",3,"ngModel","ngModelOptions","ngModelChange"],[1,"d-none","d-xl-block","section-title-separator"],["class","event-enrollments  mb-2",4,"ngIf"],["class","mb-2 mt-2",4,"ngIf"],[1,"mb-2","mt-2"],[1,"table-responsive"],[1,"table","table-striped","table-condensed"],["class","text-xl-start",4,"ngIf"],[1,"text-xl-start"],[1,"fa-solid","fa-person-running"],[1,"fa-solid","fa-location-dot"],[1,"fa-solid","fa-person-half-dress"],[1,"fa","fa-list"],[1,"fa","fa-people-group"],[1,"fa","fa-circle-check"],[4,"ngFor","ngForOf"],[1,"pagination","mb-5"],[3,"rows","totalRecords","onPageChange"],[1,"fa","fa-id-card"],[1,"fa","fa-person-walking-arrow-loop-left"],[1,"main-tr"],["class","col-md-2 text-center text-xl-start",4,"ngIf"],[1,"text-center","text-xl-start"],[1,"d-xl-table-cell"],["class","d-xl-table-cell",4,"ngIf"],[1,"d-xl-table-cell",3,"pTooltip"],[1,"col-md-2","text-center","text-xl-start"]],template:function(t,o){1&t&&(e.TgZ(0,"section",0)(1,"div",1)(2,"h2",2)(3,"span"),e._uU(4,"Inscritos"),e.qZA()(),e.TgZ(5,"div",3),e._UZ(6,"img",4),e.qZA(),e.YNc(7,Fa,6,6,"div",5),e.YNc(8,Sa,2,0,"div",6),e.YNc(9,$a,2,2,"p-tabView",7),e.qZA()()),2&t&&(e.xp6(7),e.Q6J("ngIf",o.competition),e.xp6(1),e.Q6J("ngIf",o.error),e.xp6(1),e.Q6J("ngIf",o.competition&&!o.error))},dependencies:[m.sg,m.O5,p.Fj,p.JJ,p.On,R.o,oe.xf,oe.x4,G.D,Ue.u,m.rS,m.uU],styles:[".s-enrollments[_ngcontent-%COMP%]{padding-top:150px;font-size:16px;color:#333}input[type=text][_ngcontent-%COMP%], input[type=search][_ngcontent-%COMP%]{height:41px}.search[_ngcontent-%COMP%]{position:relative}.search[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{text-indent:25px}.search[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus{box-shadow:none}.search[_ngcontent-%COMP%]   .fa-search[_ngcontent-%COMP%]{position:absolute;top:11px;left:12px}.search[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{position:absolute;top:0;right:0}"]}),a})();var Pe=g(2812),Wa=g(7787);function Xa(n,a){if(1&n&&(e.ynx(0),e.TgZ(1,"a",33),e._UZ(2,"i",34),e.qZA(),e.BQk()),2&n){const i=a.$implicit,t=e.oxw(2).$implicit,o=e.oxw(3);e.xp6(1),e.s9C("href",o.storageUrl+t.id+o.folderRegulations+i.url,e.
1LSH),e.s9C("title",i.name)}}function er(n,a){if(1&n&&(e.ynx(0),e.YNc(1,Xa,3,2,"ng-container",15),e.BQk()),2&n){const i=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",i.regulations)}}function tr(n,a){if(1&n&&(e.ynx(0),e.TgZ(1,"tr")(2,"td",27),e._uU(3),e.ALo(4,"date"),e.qZA(),e.TgZ(5,"td",28)(6,"a",29),e._uU(7),e.qZA()(),e.TgZ(8,"td",30),e._uU(9),e.qZA(),e.TgZ(10,"td",31),e.YNc(11,er,2,1,"ng-container",32),e.qZA()(),e.BQk()),2&n){const i=a.$implicit,t=e.oxw(3);e.xp6(3),e.Oqu(e.lcZ(4,5,i.date)),e.xp6(3),e.Q6J("routerLink",t.getEventLink(i)),e.xp6(1),e.Oqu(i.name),e.xp6(2),e.Oqu(i.place),e.xp6(2),e.Q6J("ngIf",i.regulations&&i.regulations.length>0)}}function nr(n,a){if(1&n&&(e.TgZ(0,"div",17)(1,"h6",18),e._uU(2),e.ALo(3,"date"),e.qZA(),e.TgZ(4,"div",19)(5,"table",20)(6,"thead")(7,"tr")(8,"th"),e._UZ(9,"i",21),e._uU(10," Data"),e.qZA(),e.TgZ(11,"th",18),e._UZ(12,"i",22),e._uU(13," Nome "),e.qZA(),e.TgZ(14,"th",23),e._UZ(15,"i",24),e._uU(16," Lugar "),e.qZA(),e.TgZ(17,"th",25),e._UZ(18,"i",26),e._uU(19," Regulamento"),e.qZA()()(),e.TgZ(20,"tbody"),e.YNc(21,tr,12,7,"ng-container",15),e.qZA()()()()),2&n){const i=e.oxw().$implicit;e.xp6(2),e.Oqu(e.xi3(3,2,i.date,"MMMM")),e.xp6(19),e.Q6J("ngForOf",i.competitions)}}function ir(n,a){if(1&n&&(e.ynx(0),e.YNc(1,nr,22,5,"div",16),e.BQk()),2&n){const i=a.$implicit;e.xp6(1),e.Q6J("ngIf",i.competitions.length>0)}}let or=(()=>{var n;class a{constructor(t){this.eventsService=t,this.storageUrl="",this.searchQuery="",this.folderRegulations=`/${_.N.storage.regulations}/`}ngOnInit(){this.storageUrl=`${_.N.storage.basicUrl}/${_.N.storage.competitions}/`,this.eventsService.getFeaturedEvents().subscribe({next:t=>{this.featuredEvents=t,console.log("featuredEvents",this.featuredEvents)},error:t=>{console.log(t)}}),this.eventsService.getNextEvents().subscribe({next:t=>{this.nextEvents=t,this.nextEvents&&(this.filteredNextEvents=JSON.parse(JSON.stringify(this.nextEvents)))}})}search(){this.nextEvents&&(this.filteredNextEvents=JSON.parse(JSON.stringify(this.nextEvents))),this.filteredNextEvents?.forEach(t=>{t.competitions=t.competitions.filter(o=>o.name.toLowerCase().includes(this.searchQuery.toLowerCase())||o.place.toLowerCase().includes(this.searchQuery.toLowerCase()))})}getEventLink(t){return`/events/${t.normalizedName}/${t.id}`}}return(n=a).\u0275fac=function(t){return new(t||n)(e.Y36(Pe.n))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-events"]],decls:18,vars:3,consts:[[3,"events"],[1,"mb-3","mb-xl-5"],[1,"container"],[1,"title"],[1,"mb-4","mb-lg-5","text-center"],["src","assets/img/cg-separator.png","alt",""],[1,"results-filter"],[1,"row","mb-4"],[1,"d-none","d-xl-block","col"],[1,"col"],[1,"results-search"],[1,"inp-name"],["id","name","type","text","name","your-name","placeholder","Buscar carreira ou competici\xf3n",3,"ngModel","ngModelChange","input"],["aria-hidden","true",1,"fa","fa-search"],[1,"results-months"],[4,"ngFor","ngForOf"],["class","results-month",4,"ngIf"],[1,"results-month"],[1,"text-xl-start"],[1,"table-responsive"],[1,"table","table-striped","table-condensed"],[1,"fa-solid","fa-calendar-days"],[1,"fa-solid","fa-person-running"],[1,"d-none","d-xl-table-cell"],[1,"fa-solid","fa-location-dot"],[1,"d-none","d-xl-table-cell","text-center"],[1,"fa-solid","fa-file-invoice"],[1,"col-md-2"],[1,"col-md-6","text-center","text-xl-start"],[3,"routerLink"],[1,"d-none","d-xl-table-cell","col-md-2"],[1,"d-none","d-xl-table-cell","col-md-2","text-center"],[4,"ngIf"],["target","_blank",1,"regulation",3,"href","title"],[1,"fa-solid","fa-file-arrow-down"]],template:function(t,o){1&t&&(e._UZ(0,"app-events-slider",0),e.TgZ(1,"section",1)(2,"div",2)(3,"h2",3)(4,"span"),e._uU(5,"Calendario"),e.qZA()(),e.TgZ(6,"div",4),e._UZ(7,"img",5),e.qZA(),e.TgZ(8,"div",6)(9,"div",7),e._UZ(10,"div",8),e.TgZ(11,"div",9)(12,"div",10)(13,"div",11)(14,"input",12),e.NdJ("ngModelChange",function(s){return o.searchQuery=s})("input",function(){return o.search()}),e.qZA(),e._UZ(15,"i",13),e.qZA()()()()(),e.TgZ(16,"div",14),e.YNc(17,ir,2,1,"ng-container",15),e.qZA()()()),2&t&&(e.Q6J("events",o.featuredEvents),e.xp6(14),e.Q6J("ngModel",o.searchQuery),e.xp6(3),e.Q6J("ngForOf",o.filteredNextEvents))},dependencies:[m.sg,m.O5,p.Fj,p.JJ,p.On,Wa.z,T.rH,m.uU],styles:["[_nghost-%COMP%]     #events{padding-top:150px}.regulation[_ngcontent-%COMP%]{padding-right:5px}"]}),a})();var P=g(8433),ar=(g(9143),g(190)),rr=g(5741),sr=g.n(rr),lr=g(7816),ae=g(7246),Re=g(2150);function cr(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"a",14),e.NdJ("click",function(){e.CHM(i);const o=e.oxw().$implicit,r=e.oxw(3);return e.KtG(r.selectRace(o))}),e._uU(1),e.qZA()}if(2&n){const i=e.oxw().$implicit,t=e.oxw(3);e.Q6J("ngClass",i.id==(null==t.selectedRace?null:t.selectedRace.id)?"active":""),e.xp6(1),e.Oqu(i.name)}}function dr(n,a){if(1&n&&(e.TgZ(0,"div",12),e.YNc(1,cr,2,2,"a",13),e.qZA()),2&n){const i=a.$implicit;e.xp6(1),e.Q6J("ngIf",i.routeGpxUrl)}}function pr(n,a){if(1&n&&(e.TgZ(0,"div",10),e.YNc(1,dr,2,1,"div",11),e.qZA()),2&n){const i=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",null==i.event?null:i.event.races)}}function ur(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"a",19),e.NdJ("click",function(){e.CHM(i);const o=e.oxw(3);return e.KtG(o.startPlayback())}),e._uU(1,"Play"),e.qZA()}}function gr(n,a){if(1&n){const i=e.EpF();e.TgZ(0,"a",19),e.NdJ("click",function(){e.CHM(i);const o=e.oxw(3);return e.KtG(o.pausePlayback())}),e._uU(1,"Pause"),e.qZA()}}function mr(n,a){if(1&n&&e._UZ(0,"canvas",23,24),2&n){const i=e.oxw(3);e.Q6J("options",i.chartOptions)("data",i.lineChartData)("type","line")}}function _r(n,a){if(1&n&&e._UZ(0,"canvas",25,24),2&n){const i=e.oxw(3);e.Q6J("options",i.chartOptions)("data",i.lineChartData)("type","line")}}function hr(n,a){if(1&n){const i=e.EpF();e.ynx(0),e.TgZ(1,"h3",15),e._uU(2),e.qZA(),e.TgZ(3,"div",16),e.NdJ("leafletMapReady",function(o){e.CHM(i);const r=e.oxw(2);return e.KtG(r.onMapReady(o))}),e.qZA(),e.TgZ(4,"div",17),e.YNc(5,ur,2,0,"a",18),e.YNc(6,gr,2,0,"a",18),e.TgZ(7,"a",19),e.NdJ("click",function(){e.CHM(i);const o=e.oxw(2);return e.KtG(o.resetPlayback())}),e._uU(8,"Reset"),e.qZA(),e._UZ(9,"progress",20),e.qZA(),e.YNc(10,mr,2,3,"canvas",21),e.YNc(11,_r,2,3,"canvas",22),e.BQk()}if(2&n){const i=e.oxw(2);e.xp6(2),e.Oqu(i.selectedRace.name),e.xp6(1),e.Q6J("leafletOptions",i.options),e.xp6(2),e.Q6J("ngIf",!i.isPlaying),e.xp6(1),e.Q6J("ngIf",i.isPlaying),e.xp6(3),e.Q6J("value",i.progressValue)("max",i.maxProgressValue),e.xp6(1),e.Q6J("ngIf",i.chartLoaded),e.xp6(1),e.Q6J("ngIf",i.chartLoaded)}}function fr(n,a){if(1&n&&(e.TgZ(0,"div",7),e.YNc(1,pr,2,1,"div",8),e.YNc(2,hr,12,8,"ng-container",9),e.qZA()),2&n){const i=e.oxw();e.xp6(1),e.Q6J("ngIf",(null==i.event||null==i.event.races?null:i.event.races.length)>0),e.xp6(1),e.Q6J("ngIf",i.selectedRace&&i.selectedRace.routeGpxUrl&&!i.loadingMap)}}const vr=[{path:"",children:[{path:"",component:or},{path:":eventName/:eventId",component:K},{path:":eventName/:eventId/maps",component:(()=>{var n;class a{constructor(t,o,r){this.http=t,this.eventService=o,this.route=r,this.options={layers:[P.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:18,attribution:"..."})],zoom:8,center:[46.879966,-121.726909]},this.gpxUrl="",this.elevations=[],this.coordinatesArray=[],this.distances=[],this.chartLoaded=!1,this.currentIndex=0,this.progressValue=0,this.maxProgressValue=0,this.isPlaying=!1,this.xLabels=[],this.yValues=[],this.lineChartData={datasets:[{data:[],label:"Elevaci\xf3n",fill:!0,borderColor:"black",backgroundColor:"rgba(255,0,0,0.3)",pointRadius:0}]},this.chartOptions={},this.loadingMap=!0,this.route.params.subscribe(s=>{this.eventId=s.eventId}),this.storageUrl=`${_.N.storage.basicUrl}/${_.N.storage.races}/`}ngOnInit(){this.eventService.getEvent(this.eventId).subscribe({next:t=>{this.event=t[0],this.selectRace(this.event.races[0]),lr.kL.register({id:"verticalLinePlugin",afterDraw:function(r){const s=r.getActiveElements();if(s?.length){const c=r.ctx,u=s[0].element.x,v=r.scales.y.top,Z=r.scales.y.bottom;c.save(),c.beginPath(),c.moveTo(u,v),c.lineTo(u,Z),c.lineWidth=2,c.strokeStyle="#ff0000",c.stroke(),c.restore(
1)}}})},error:t=>{console.log(t)}})}ngAfterViewInit(){const t=setInterval(()=>{if(this.chart){const o=this.chart?.chart?.ctx;if(o){const r=this.createGradient(o);this.lineChartData.datasets[0].backgroundColor=r,this.chart?.chart?.update()}clearInterval(t)}},50)}onMapReady(t){console.log("onMapReady"),this.map=t,new P.GPX(this.gpxUrl,{async:!0,marker_options:{startIcon:new P.Icon({iconUrl:"assets/img/map/start.webp",iconSize:[52,52],iconAnchor:[26,52]}),endIcon:new P.Icon({iconUrl:"assets/img/map/finish.webp",iconSize:[52,52],iconAnchor:[26,52]}),shadowUrl:"assets/img/map/pin-shadow.png",wptIcons:{"":new P.Icon({iconUrl:"assets/img/map/checkpoint.webp",iconSize:[23,41],iconAnchor:[5,41]})}}}).on("loaded",function(r){t.fitBounds(r.target.getBounds())}).addTo(t)}loadGPX(){this.http.get(this.gpxUrl,{responseType:"text"}).subscribe({next:t=>{this.gpxContent=t,this.elevations=[],this.distances=[],this.coordinatesArray=[];const r=(new ar.a).parseFromString(this.gpxContent,"text/xml"),s=sr().gpx(r),l=s?.features?.[0]?.geometry?.coordinates??[];for(const h of l){const C=h?.[2],A=h?.[0],M=h?.[1];this.elevations.push(C),this.coordinatesArray.push([M,A])}let c=0;this.distances.push(0);for(let h=0;h<l.length-1;h++){const[C,A]=l[h],[M,U]=l[h+1];c+=this.haversineDistance(A,C,U,M),this.distances.push(c)}let u=s.features.filter(h=>"Point"===h.geometry.type).map(h=>({lat:h.geometry.coordinates[1],lon:h.geometry.coordinates[0],name:h.properties.name})),v=this,y=u.map(h=>{const C=function Z(h,C,A){let M=1/0,U=null;for(const f of A){const N=v.haversineDistance(h,C,f[1],f[0]);N<M&&(M=N,U=f)}return U}(h.lat,h.lon,l);if(C){const A=l.findIndex(f=>f[0]===C[0]&&f[1]===C[1]);let M=0;if(A>0){const f=l[A-1];M=this.haversineDistance(f[1],f[0],h.lat,h.lon)}return this.distances[A]+M}return 0}),D=Math.floor(c/1e3),w=[];for(let h=0;h<=D;h++)w.push(1e3*h);w[w.length-1]!==c&&w.push(c),this.lineChartData.datasets[0].data=this.elevations,this.lineChartData.labels=this.distances,this.maxProgressValue=this.coordinatesArray.length,this.chartOptions={responsive:!0,hover:{mode:"index",intersect:!1},plugins:{tooltip:{enabled:!0,mode:"index",intersect:!1,position:"nearest",callbacks:{label:h=>{const C=this.getExactKilometer(h.dataIndex);return`Elevaci\xf3n: ${h.parsed.y.toFixed(2)} m (Km ${C.toFixed(2)})`},title:()=>""}},verticalLinePlugin:{},annotation:{annotations:u.map((h,C)=>({type:"line",mode:"vertical",scaleID:"x",value:y[C],borderColor:"rgba(255, 0, 0, 0.5)",borderWidth:2,label:{content:h.name,enabled:!0,position:"top"}}))}},onHover:(h,C)=>{!this.isPlaying&&C.length>0&&this.moveMarker(C[0].index)},scales:{x:{type:"linear",position:"bottom",min:0,max:c,ticks:{autoSkip:!1,source:"data",callback:function(h,C){return(M=>{let U=M/1e3;return Number.isInteger(U)?`${U}km`:`${U.toFixed(1)}km`})(h)},maxRotation:90,minRotation:90},afterBuildTicks:function(h){h.ticks=w.map(C=>({value:C}))},scaleLabel:{display:!0,labelString:"Distancia (km)"}},y:{beginAtZero:!1,title:{display:!0,text:"Elevaci\xf3n (m)"}}}},this.chartLoaded=!0,this.loadingMap=!1},error:t=>{console.error("Error al obtener el archivo GPX:",t)}})}moveMarker(t){const[o,r]=this.coordinatesArray[t],s=P.icon({iconUrl:"assets/img/map/runner.webp",iconSize:[35,52],iconAnchor:[17,52],popupAnchor:[0,-52]});console.log("this.mapMarker",this.mapMarker),this.mapMarker?this.mapMarker.setLatLng([o,r]):(this.mapMarker=P.marker([o,r],{icon:s}),this.mapMarker.addTo(this.map)),this.map.panTo([o,r],{animate:!0})}startPlayback(){this.isPlaying=!0,this.originalZoom=this.map.getZoom(),this.map.setZoom(15),this.playbackInterval&&clearInterval(this.playbackInterval);const t=P.icon({iconUrl:"assets/img/map/runner.webp",iconSize:[35,52],iconAnchor:[17,52],popupAnchor:[0,-52]});this.playbackInterval=setInterval(()=>{if(this.currentIndex++,this.progressValue=this.currentIndex,this.currentIndex<this.coordinatesArray.length){const[o,r]=this.coordinatesArray[this.currentIndex];this.mapMarker?this.mapMarker.setLatLng([o,r]):this.mapMarker=P.marker([o,r],{icon:t}).addTo(this.map),this.map.panTo([o,r],{animate:!0}),this.currentIndex++}else clearInterval(this.playbackInterval)},200)}pausePlayback(){this.playbackInterval&&clearInterval(this.playbackInterval),this.map.setZoom(this.originalZoom),this.isPlaying=!1}resetPlayback(){if(this.currentIndex=0,this.progressValue=this.currentIndex,this.mapMarker){const[t,o
1]=this.coordinatesArray[this.currentIndex];this.mapMarker.setLatLng([t,o])}this.playbackInterval&&clearInterval(this.playbackInterval),this.map.setZoom(this.originalZoom),this.isPlaying=!1}haversineDistance(t,o,r,s){const c=t*Math.PI/180,u=r*Math.PI/180,v=(r-t)*Math.PI/180,Z=(s-o)*Math.PI/180,y=Math.sin(v/2)*Math.sin(v/2)+Math.cos(c)*Math.cos(u)*Math.sin(Z/2)*Math.sin(Z/2);return 2*Math.atan2(Math.sqrt(y),Math.sqrt(1-y))*6371e3}getExactKilometer(t){return this.distances[t]/1e3}createGradient(t){const o=t.createLinearGradient(0,0,0,200);return o.addColorStop(0,"rgba(13, 90, 165, 1)"),o.addColorStop(1,"rgba(255, 255, 255, 1)"),o}selectRace(t){this.isPlaying&&this.resetPlayback(),this.mapMarker=null,this.selectedRace=t,this.loadingMap=!0,this.chartLoaded=!1,t.routeGpxUrl&&(this.gpxUrl=this.storageUrl+this.selectedRace.id+"/route-gpx/"+t.routeGpxUrl),this.gpxUrl&&this.loadGPX()}}return(n=a).\u0275fac=function(t){return new(t||n)(e.Y36(W.eN),e.Y36(q.P),e.Y36(T.gz))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-maps"]],viewQuery:function(t,o){if(1&t&&e.Gf(ae.jh,5),2&t){let r;e.iGM(r=e.CRH())&&(o.chart=r.first)}},decls:9,vars:1,consts:[[1,"s-race"],[1,"container"],[1,"title"],[1,"mb-4","mb-lg-5","text-center"],["src","assets/img/cg-separator.png","alt",""],[1,"row"],["class","map",4,"ngIf"],[1,"map"],["class","row align-items-center justify-content-center mb-5",4,"ngIf"],[4,"ngIf"],[1,"row","align-items-center","justify-content-center","mb-5"],["class","col-md-3 col-xl-auto mb-3 mb-xl-0",4,"ngFor","ngForOf"],[1,"col-md-3","col-xl-auto","mb-3","mb-xl-0"],["class","default-btn out default-btn-sm",3,"ngClass","click",4,"ngIf"],[1,"default-btn","out","default-btn-sm",3,"ngClass","click"],[1,"text-center"],["leaflet","",3,"leafletOptions","leafletMapReady"],[1,"buttons"],["class","default-btn out default-btn-sm",3,"click",4,"ngIf"],[1,"default-btn","out","default-btn-sm",3,"click"],[3,"value","max"],["class","d-none d-lg-block","height","45","baseChart","",3,"options","data","type",4,"ngIf"],["class","d-block d-lg-none","height","100","baseChart","",3,"options","data","type",4,"ngIf"],["height","45","baseChart","",1,"d-none","d-lg-block",3,"options","data","type"],["chartRef",""],["height","100","baseChart","",1,"d-block","d-lg-none",3,"options","data","type"]],template:function(t,o){1&t&&(e.TgZ(0,"section",0)(1,"div",1)(2,"h2",2)(3,"span"),e._uU(4,"Mapas"),e.qZA()(),e.TgZ(5,"div",3),e._UZ(6,"img",4),e.qZA(),e.TgZ(7,"div",5),e.YNc(8,fr,3,2,"div",6),e.qZA()()()),2&t&&(e.xp6(8),e.Q6J("ngIf",o.event))},dependencies:[m.mk,m.sg,m.O5,Re.je,ae.jh],styles:[".map[_ngcontent-%COMP%]{padding-top:20px;padding-bottom:20px}div[leaflet][_ngcontent-%COMP%]{width:100%;height:500px}.buttons[_ngcontent-%COMP%]{text-align:center;margin-top:20px}.buttons[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{margin:0 5px}progress[_ngcontent-%COMP%]{width:100%;height:20px}progress[_ngcontent-%COMP%]::-webkit-progress-bar{background-color:#eee;border-radius:10px;box-shadow:0 2px 5px #00000040 inset}progress[_ngcontent-%COMP%]::-webkit-progress-value{background-color:#3498db;border-radius:10px}progress[_ngcontent-%COMP%]::-moz-progress-bar{background-color:#3498db;border-radius:10px}.default-btn[_ngcontent-%COMP%]{padding:10px;border:solid 1px #3498db;border-radius:5px;cursor:pointer}.default-btn.active[_ngcontent-%COMP%]{padding:10px;border:solid 2px #0d5aa5;border-radius:5px;cursor:pointer;background-color:#0d5aa5;color:#fff}"]}),a})()},{path:":eventName/:eventId/bibs",component:Pt},{path:":eventName/:eventId/collect-bibs",component:jt},{path:":eventName/:eventId/bib0",component:K},{path:":eventName/:eventId/race/:group/race-registration/:step",component:K},{path:":eventName/:eventId/race/:group/waiting-list-conversion",component:K},{path:":eventName/:eventId/races/:raceId/enrollments",component:Ka}]}];var xr=g(4430);let br=(()=>{var n;class a{}return n=a,(0,d.Z)(a,"\u0275fac",function(t){return new(t||n)}),(0,d.Z)(a,"\u0275mod",e.oAB({type:n})),(0,d.Z)(a,"\u0275inj",e.cJS({imports:[m.ez]})),a})();
1var Cr=g(4443),Zr=g(9081);let Tr=(()=>{var n;class a{}return(n=a).\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[m.ez,p.u5]}),a})();var yr=g(1499),wr=g(5354);let Ir=(()=>{var n;class a{}return(n=a).\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({providers:[Te._,q.P,Pe.n,Zr.j,Y,qe.L,we.H],imports:[yr.N,m.ez,p.u5,p.UX,It,ke.hJ,X.cc,R.j,H.kW,Ie.nD,xr.B,br,Cr.R,Tr,oe.LU,G.U,Oe.n,De.WN,be.$,wr.A,Re.UO,W.JF,ae.vQ,Ue.z,Jt,T.Bz.forChild(vr)]}),a})()}}]);

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.