(function(){"use strict";angular.module("anet.directives",[]).directive("blurOnClick",function(){return{restrict:"A",link:function(n,t){t.on("click",function(){t[0].blur()})}}}).directive("stopPropagation",function(){return{restrict:"A",link:function(n,t){t.on("click",function(n){n.stopPropagation()})}}}).directive("convertToNumber",function(){return{require:"ngModel",link:function(n,t,i,r){r.$parsers.push(function(n){return parseInt(n,10)});r.$formatters.push(function(n){return""+n})}}}).directive("convertToBoolean",function(){return{require:"ngModel",link:function(n,t,i,r){r.$parsers.push(function(n){return n=="true"});r.$formatters.push(function(n){return n?"true":"false"})}}}).directive("replaceInvalidNumberWithNull",function(){return{require:"ngModel",link:function(n,t,i,r){r.$viewChangeListeners.push(function(){_.keys(r.$error).length&&(r.$setViewValue(null,event),r.$render())});r.$parsers.push(function(n){return n!==null&&_.keys(r.$error).length?(r.$setViewValue(null,event),r.$render(),null):n})}}}).directive("devOnly",["ngIfDirective","params",function(n,t){var i=n[0];return{transclude:i.transclude,priority:i.priority,terminal:i.terminal,restrict:i.restrict,link:function(n,r,u){t&&_.has(t,"isProduction")||alert("Error!\n\nYou've tried to use the dev-only directive, but params.isProduction does not exist.");var f=function(){return!t.isProduction};u.ngIf=f;i.link.apply(i,arguments)}}}]).directive("anetScrollToFix",function(){var n=$(window),t={sm:576,md:768,lg:992,xl:1200};return{restrict:"A",link:function(i,r,u){var a=parseInt(u.anetScrollToFix,10),f=$(r),s=f.parent(),h="anet-scroll-to-fix",c,e=null,o=null;if(u.anetScrollRange){var l=u.anetScrollRange.split("-"),e=t[l[0]],o=l[1];e&&o&&(o=="up"||o=="dn")||(e=null,alert("anet-scroll-range must be in the format: '{size}-{direction} (e.g. 'md-up')"))}n.on("scroll",function(){f.is(":visible")&&(c=s.offset().top-a,n.scrollTop()>=c&&(!e||(o=="up"?n.width()>=e:n.width()<e))?(f.addClass(h),f.attr("id",h),s.height(f.outerHeight())):(f.removeClass(h),s.css("height",null)))})}}})})(),function(){"use strict";angular.module("tfx",["anet.directives"]).constant("appPath","/trackandfield/division/app_top/").controller("AppCtrl",["$window","params","initialData",function(n,t,i){var r=this,u;r.params=t;r.data=i;r.gender=t.gender;r.compare=!1;r.compareIds={};r.compareIdArr=[];r.compareEventId;t.listId&&(r.custom=!0,u=t.season,u||(u=(new Date).getFullYear()-2),r.seasonList2=[u+2,u+1,u,u-1,u-2]);i.locations&&i.locations.length&&(r.locationDivId=t.divId,i.locations[0].name="--- ALL ---");i.tree&&i.tree.length&&(r.locationDivId=i.tree[0].id,i.tree[0].name="--- ALL ---");i.levels&&(i.levels[0].level=4,i.levels[1].level=2,i.levels[2].level=16,i.levels[3].level=8,r.currentLevel=_.find(i.levels,{level:r.params.level}));r.seasonList=[];r.grades={};r.ages={};t.filter&&_.forEach(t.filter.split(","),function(n){r.grades[n]=!0});t.age&&_.forEach(t.age.split(","),function(n){r.ages[n]=!0});console.log(r.params.agesGrades);r.params.agesGrades||(r.params.agesGrades={},r.params.agesGrades.grades=[{ID:1,Grade:"1"},{ID:2,Grade:"2"},{ID:3,Grade:"3"},{ID:4,Grade:"4"},{ID:5,Grade:"5"},{ID:6,Grade:"6"},{ID:7,Grade:"7"},{ID:8,Grade:"8"},{ID:0,Grade:"0"},{ID:9,Grade:"9"},{ID:10,Grade:"10"},{ID:11,Grade:"11"},{ID:12,Grade:"12"},{ID:0,Grade:"0"},{ID:21,Grade:"Fr"},{ID:22,Grade:"So"},{ID:23,Grade:"Jr"},{ID:24,Grade:"Sr"},],r.params.agesGrades.ages=[{Age:5},{Age:6},{Age:7},{Age:8},{Age:9},{Age:10},{Age:11},{Age:12},{Age:13},{Age:14},{Age:15},{Age:16},{Age:17},{Age:18},{Age:19},{Age:20},]);_.forEach(i.seasons,function(n,i){i=parseInt(i);(i>1e4&&t.season>1e4||i<1e4&&t.season<1e4)&&r.seasonList.push({div:n,season:i})});r.MainEvents=[];i.events_main&&_.forEach(i.events_main,function(n){var t=_.find(i.events,{id:n});t&&r.MainEvents.push(t)});r.ToggleGrade=function(n){r.grades[n]?delete r.grades[n]:r.grades[n]=!0};r.ToggleAge=function(n){r.ages[n]?delete r.ages[n]:r.ages[n]=!0};r.ApplyGradeAgeFilter=function(){var i="",n;_.forEach(r.grades,function(n,t){n&&(i+=t+",")});i.length>1&&(i=i.slice(0,-1));t.filter=i;n="";_.forEach(r.ages,function(t,i){t&&(n+=i+",")});n.length>1&&(n=n.slice(0,-1));t.age=n;r.navigate()};r.setPage=function(n){t.page=n;r.navigate()};r.navigateBySeason2=function(){r.navigate()};r.switchSports=function(){t.season=-1;r.navigateBySeason()};r.navigateBySeason=function(){if(t.season==-1)n.location.href="/api/v1/TFX/go?action=tftoxc&id="+t.divId;else if(t.location)r.navigate();else{var u=i.seasons[t.season];u&&(t.divId=u);r.navigate()}};r.LevelChanged=function(){t.divId=_.find(i.levels,{level:r.params.level}).id;t.divId==0&&(t.location="usa");r.navigate()};r.GenderClick=function(n){t.gender!=n&&(t.gender=n,t.eventId&&(t.eventId=t.otherGender),r.navigate())};r.navigate=function(){var i="/TrackAndField/Division/";t.divId&&t.eventId>0?i+="Event.aspx?DivID="+t.divId+"&Event="+t.eventId:t.divId?i+="Top.aspx?DivID="+t.divId:t.listId&&(t.listId>0?(i+="Top.aspx?List="+t.listId,t.teamId&&(i+="&SchoolID="+t.teamId),(t.season||t.season==0)&&(i+="&S="+t.season)):i+="Top.aspx?Meet="+-t.listId);t.type!=t.defaults.type&&(i+="&type="+t.type);t.subType!=t.defaults.subType&&t.eventId==t.defaults.eventId&&(i+="&subtype="+t.subType);t.depth!=t.defaults.depth&&(i+="&depth="+t.depth);t.measure!=t.defaults.measure&&(i+="&m="+t.measure);t.filter&&t.filter.length&&(i+="&filter="+t.filter);t.age&&t.age.length&&(i+="&age="+t.age);t.page!=t.defaults.page&&(i+="&page="+t.page);t.restrict!=t.defaults.restrict&&(i+="&restrict="+(t.restrict?"1":"0"));t.gender!="f"||t.eventId||(i+="&gender=f");n.location.href=i};r.compareNow=function(){t.userId?window.open("/profile/athleteId/log/"+t.season%1e4+"-01-01/stats/activity?type=101&athletes="+r.compareIdArr.join(",")+"&event="+r.compareEventId,"_blank"):window.AnetOpenModal("authenticate",{state:"signup"})};r.updateCompareIds=function(n){r.compareEventId=n;r.compareIdArr=[];_.forOwn(r.compareIds,function(n,t){n&&r.compareIdArr.push(t)})};r.compareEvent=function(n,t){r.compareIdArr&&r.compareIdArr.length<10&&(r.compare=!0,r.compareEventId=n,_.forEach(t.slice(0,10-r.compareIdArr.length),function(n){r.compareIds[n]=!0}),r.updateCompareIds(n))}}])}(),function(){"use strict";$(function(){$("#HL_click").one("click",function(){var n=$("table.HLData"),i=[3,4,5,6,7,8,9,10],t="../../";$.ajax({dataType:"script",cache:!0,url:t+"Shared/scripts/AnetOriginals/jquery.A.hoverlight.4.1.160119.min.js",success:function(){n.hoverLight({HL_homePath:t,HL_cells:i});$("#HL_click").on("click",function(){$(this).hasClass("on")?($(this).find("span").text("Highlighter"),n.hoverLight("off")):($(this).find("span").text("Turn Off"),n.hoverLight("on"));$(this).toggleClass("btn-info on").toggleClass("btn-default");$("#HL_active").toggle()});$("#HL_click").click()}})});$("#hasPrevSeason").length>0&&$("#h_AllSeasons").find(".b").parent().next().find("a").length>0&&($("#hasPrevSeason").show(),$("#noPrevSeason").hide(),$("#clk_prevSeason").attr("href",$("#h_AllSeasons").find(".b").parent().next().find("a").attr("href")))})}()