var environmentSettingsConfig = this.environmentSettingsConfig || {}; environmentSettingsConfig.Partner = 'itat'; environmentSettingsConfig.FacebookAppID = '572763470210879'; environmentSettingsConfig.StripeKey = 'pk_live_HEj3q4fAb5oPEElngRD6fzUd00MpNbGLNs'; environmentSettingsConfig.StripeExpressKey = 'pk_live_HEj3q4fAb5oPEElngRD6fzUd00MpNbGLNs'; environmentSettingsConfig.GlobalDomain = 'colleges.wearecollegetennis.com'; environmentSettingsConfig.Genders = [{"Text":"Male","Value":0},{"Text":"Female","Value":1}]; environmentSettingsConfig.SchoolTypes = [{"Text":"School","Value":0}]; environmentSettingsConfig.SubCategorySessions = [{"sessionId":2010,"name":"Adult"},{"sessionId":2040,"name":"Individual"},{"sessionId":2050,"name":"Disability"},{"sessionId":2060,"name":"Camps"},{"sessionId":2990,"name":"Other"},{"sessionId":3010,"name":"Sanctioned Tournament"},{"sessionId":3020,"name":"Event"},{"sessionId":3030,"name":"League Fixture"},{"sessionId":3040,"name":"Fun Tournament"},{"sessionId":3990,"name":"Other"},{"sessionId":4010,"name":"Team Practice"},{"sessionId":4020,"name":"Club Night"},{"sessionId":4990,"name":"Other"},{"sessionId":5030,"name":"Non-venue Event/Tournament"},{"sessionId":5990,"name":"Other"}]; environmentSettingsConfig.VenueMode = window.location.hostname == environmentSettingsConfig.GlobalDomain ? 'brand' : 'domain'; environmentSettingsConfig.GlobalFeatures = { "Version": 638224499357476169, "DefaultModules": { "Venues": true, "CoachingOrganisations": false, "Regions": false, "Authorities": false }, "Account": { "UserPhoneNumberIsRequired": false, "AcceptTermsIsRequired": true, "EnableUserImpersonation": true, "SetPaymentReceiptEmail": false }, "Booking": { "AdminOnlyBookingSheetColours": false, "AppPromo": false, "CheckInContacts": false, "NewDayBookingAvailabilityTime": true, "NoShowCharges": false, "ResourceFormat": false, "ResponsibilityCategory": false, "SessionMaxBookingSlots": false, "CourtProperties": true, "CalendarEntry": false, "MembershipRequired": false, "ResourceCategories": false, "BookingEngineV2": false, "EnableGroupBooking": true }, "Membership": { "DisableInstallments": true, "DirectDebitPayment": false, "CreditCardPayment": true, "DisableGiftAidOption": true, "GuardianMandatory": true, "AutoPaymentDateOfPurchasePackages": false, "AutoPaymentFixedDatePackages": false, "NewMembershipRegistrationProcess": true }, "Coaching": { "OptimisedSearch": false, "RunningFields": false, "CoachingTeam": true, "CoursePaymentRequests": true, "CoachingReports": true, "SessionPaymentRequests": true, "TennisForKidsLive": false, "JuniorLabel": false, "DelayParticipantOrders": false, "DelayCoachOrders": false, "RecurringSessions": true, "MembershipRequired": false, "EnqueueBookings": false, "EnableSchemeSearchFilter": false, "EnableThemeSearchFilter": false, "EnableBookingOpeningTimeRestrictedSchemeFeature": true, "OfflineCoachingPayments": true, "JuniorSafePlay": false, "AdultSafePlay": false, "Lessons": true, "EnableBookingCourtInProgramming": true, "DisableHolidayCamps": false, "DisableAddCategory": false, "EnableResources": false, "OneOffCourseFeatures": { "BulkDiscountsEnabled": false, "MultipleSessionsEnabled": false, "CreateSessionsAutomatically": true }, "SeriesFeatures": { "BulkDiscountsEnabled": true, "MultipleSessionsEnabled": true, "CreateSessionsAutomatically": true }, "EnableThemeForCustomCourses": false, "EnableCancellationWindowForCourses": true, "RoundRobinFormat": false, "EnableThemeConsent": false, "PlayTrackerProgramming": false, "FamilyCategories": true, "ArchiveCategories": true }, "Competition": { "SocialLeagues": false, "UsePersonExternalID": false, "CustomerCareWidget": false, "BulkPaymentRequests": false, "DisableRefereeSearch": true, "DisableTournamentDirectorSearch": true, "HideLevelNames": true, "EnablePlayersAdmin": true }, "Contacts": { "Bios": false, "Photos": false, "Social": false, "Mentors": false, "Delete": true, "Unsubscribe": true, "RestrictUnregistered": false, "EmailAttachments": true, "VenueContactRelationships": true, "BulkDeleteContacts": true, "ContactLookupsV2": true, "ContactForm": false, "LockPersonalDetailsWhenUserConnected": false, "OneSuperAdministratorOnly": true, "IncludeVenueRolesInAdministrators": true, "GrantResponsiblesAdminAccessOnAdd": true }, "Venue": { "DeliveryAddress": false, "PrivacyPolicy": true, "SocialAccountsDisabled": false, "CanEditJuniorAge": true, "SubDomainCreation": false, "Facilities": false, "AddTraditionalLocation": true, "AddNonTraditionalLocation": true, "LinkedLocations": false, "Waiver": false }, "Website": { "Multilingual": false, "NoCoachingCourseSearch": false, "NoSubPages": false, "SectionHeros": true, "ConsentsOptOutByDefault": true, "VenueConsentsOptOutByDefault": true, "GuardianMandatory": true, "Activation": false, "ExternalActivation": false, "NationalCourtBookingLive": false, "EnableClassificationLogoImages": false, "PasswordConfirmation": true, "AcceptPrivacyPolicyOnRegister": false, "NewLocationsLookup": true, "Appcues": false, "FooterNavigation": false, "Affiliations": false, "DisableVenues": false, "MyGameNavigation": false, "ActivityVideosWebpage": false }, "Events": { "GBTWAccess": false, "CustomEventName": false } }; environmentSettingsConfig.CurrentVenueUrlSegment = ''; environmentSettingsConfig.ErrorsVerboseConsole = false; environmentSettingsConfig.ErrorsVerboseHtml = false; environmentSettingsConfig.tournamentMustHavePaymentAccountIdRule = false; environmentSettingsConfig.PortalUrlSegment = "ServeControl"; environmentSettingsConfig.ResourceItems = { Administrators : { AdministratorLower : "staff", AdministratorUpper : "Staff", AdministratorsLower : "staff", AdministratorsUpper : "Staff" }, Booking : { CourtLower : "court", CourtUpper : "Court", CourtsLower : "courts", CourtsUpper : "Courts", BookingLower : "court booking", BookingUpper : "Court booking", BookingsLower : "court bookings", BookingsUpper : "Court bookings", BookedLower : "booked", BookedUpper : "Booked", BookLower : "book", BookUpper : "Book", CourtBookingsLower : "court bookings", CourtBookingsUpper : "Court bookings" }, Classification : { Level1 : "National administrator", Level2 : "Regional", Level3 : "County" }, Coaching : { CategoryName : "", ClassesLower : "sessions", ClassesUpper : "Sessions", ClassLower : "session", ClassUpper : "Session", CoachLower : "coach", CoachUpper : "Coach", CoachesUpper : "Staff", CoachingLower : "programming", CoachingUpper : "Programming", CostUnit : "", CourseCodeShort : "code", CourseCodeLong : "Code", CourseLower : "course", CoursesLower : "courses", CoursesUpper : "Courses", CourseUpper : "Course", HolidayCamp : "Camp", HolidayCamps : "Camps", HolidayCampLower : "", HolidayCampsLower : "", Interval : "Interval", PlayerLower : "player", PlayersLower : "players", PlayersUpper : "Players", PlayerUpper : "Player", SessionsLower : "sessions", ProgrammeLower : "program", ProgrammesLower : "programs", ProgrammesUpper : "Programs", ProgrammeUpper : "Program", ProgrammeNameUpper : "Program Name", ProgrammeTypeUpper : "", SessionName : "session", SessionVenue : "Facility", TeamName : "Staff", TitleRoot : "Programming / Programs / ", PageDefaultView : "List", UtrRatingMin : "1", UtrRatingMax : "16.5", BasketCourseName : "course", BasketSessionName : "session", AddNewBooking : "Add participant", AddNewCampBooking : "Add participant", ThemeUpper : "Color", SchemeContactSourceOrganiser : "Organizer", LeadCoach : "Lead coach", StartDate : "Start date", SessionThemeUpper : "Ball color", SkillLevelUpper : "Level", CapacityUpper : "Capacity", CostUpper : "Cost", NameUpper : "Name", EndDate : "End date", PublicCourseDescriptionHeader : "Notes from the coach", ValidateAgeMinMaxErrorMessage : "[MinimumAge]-[MaximumAge] year olds only", ValidateAgeMinErrorMessage : "[MinimumAge] year olds and over only", ValidateAgeMaxErrorMessage : "[MaximumAge] year olds and under only" }, Common : { ChequeLabel : "Check", ColourLabel : "Color", DocumentRegion : "us", PlatformName : "ITA", PlatformLat : "41.850033", PlatformLng : "-87.6500523", PlatformZoom : "4", PlatformCountryRestriction : "us", StripeCountry : "GB", TownLabel : "Town", PostcodeLabel : "Zip code", DistanceUnit : "miles", CurrencySymbol : "$", CurrencyCode : "USD", TournamentsCurrencySymbol : "$", TournamentsCurrencyCode : "USD", TournamentsStripeCountry : "US", PublicJavaScriptShortDateFormat : "m/d/yy", AdminJavaScriptShortDateFormat : "m/d/yyyy", JavaScriptTimeFormat : "hh:mm:ss", SmsName : "SMS", MembershipName : "Membership", MemberName : "Member", PartnerLocale : "en-GB", CountyLabel : "State", GDPRGuardianConsentLabel : "I confirm I am the Parent or Guardian of this player, or have the permission of the Parent or Guardian to book on behalf of this player.", GDPRGuardianConsentToolTip : "In order to make a booking you must be ?0? years old; be the parent or guardian of the player under ?0? years old, or have permission from the parent or guardian of the player.", GDPRGuardianConsentValidation : "Consent required - edit details", ProgrammeLower : "program", ProgrammeUpper : "Program", ProgrammesLower : "programs", ProgrammesUpper : "Programs", FloodlitLabel : "Lighted", StripeCosts : "Stripe will deduct 2.9% + 30c per transaction. The fees are subject to change and we will notify you in advance of any changes to the fees.", GoCardlessCosts : "We have a special arrangement with GoCardless who will only charge 1.0% and capped to a maximum of £2.00 per transaction (minimum of 20p). In addition Sportlabs charge 0.8% (uncapped) per transaction in order to provide and support this service. A maximum of 1.8% is deducted automatically when a user makes a payment.", GoCardlessIntro : "It only takes a few minutes to complete the form on the GoCardless site. Once registered you'll be asked to connect your account to ClubSpark and as soon as you've done this we'll be able to help you to automatically keep track of payments made via GoCardless (for one-off payments and monthly Direct Debits).", OperatorNameLong : "Intercollegiate Tennis Association", OperatorName : "ITA", OperatorLogoDark : "~/Content/Public/Clubspark/ita/global/img/ita-logo.png", OperatorWebsite : "https://www.wearecollegetennis.com/", OperatorWebsiteText : "wearecollegetennis.com", OperatorPoweredText : " ", RegisterLinkText : "Join us", OptimisationLower : "optimization", AdminDateFormat : "MM/dd/yyyy", CancelledLower : "canceled", CancelledUpper : "Canceled", CancellingLower : "canceling", SchemeCategoryThemeValidation : "Theme preference required", SchemeCategoryProfileThemeValidation : "competition level is required to enter this event.", TermsAndConditionsPrefix : "Please tick this box to confirm you agree to the", DefaultRegisterTitle : "Register to hire a tennis court", TermsAndConditionsOverride : "https://www.wearecollegetennis.com/terms/", PrivacyPolicyOverride : "https://www.wearecollegetennis.com/privacy-policy/" }, Contacts : { CoachingRole : "Programming administrator", GoverningBodyNumber : "", ResponsibleLower : "contact", ResponsibleUpper : "Contact", ResponsiblesLower : "contacts", ResponsiblesUpper : "Contacts", RolesDescription : "Organization", MentalHealthChampionUpper : "" }, Emails : { Salutation : "Dear" }, Home : { Heading : "Where would you like to go?" }, MyGame : { SkillLevelUpper : "" }, RegularExpressions : { PersonName : "^[a-zA-Z\\-\\'\\&\\ \\.]+$", Postcode : "^[A-Z a-z0-9_-]{3,}($)", PhoneNumber : "^(\\+\\d{1,2}\\s)?\\(?\\d{3}\\)?[\\s.-]?\\d{3}[\\s.-]?\\d{4}$" }, Terms : { MinimumUserAge : "13", AssociationScope : "ITA", InvolvementScope : "College tennis", UseOfPersonalInformationScope : "Sportlabs Technology Ltd" }, Venue : { CoachingOrganisationLower : "coaching organisation", CoachingOrganisationUpper : "Coaching organisation", CoachingOrganisationModuleStatusName : "coaching organisation", OrganisationUpper : "Organization", OrganisationLower : "organization", OrganisationsLower : "organizations", OrganisationsUpper : "Organizations", VenueLower : "facility", VenueUpper : "Facility", VenuesLower : "facilities", VenuesUpper : "Facilities", VenueClassification : "Classification", VenueEventDefaltName : "Course details", PartnerIdentifierName : "", VenueProfileName : "School name", AcceptInvitationAgreeTermsAndConditionsPrefix : "Please check this box to confirm you agree to the", PrivacyPolicyConsentPrefix : "Please check this box to confirm you have read and accepted" }, Region : { RegionLower : "region", RegionUpper : "Region", RegionsLower : "regions", RegionsUpper : "Regions" }, Events : { EventLower : "event", EventUpper : "Event", EventsLower : "events", EventsUpper : "Events", ChangeLabel : "Change" }, AccountEmails : { ResetPassword : "ACCOUNT RECOVERY / RESET PASSWORD" }, MembershipEmails : { LoginTextForAccount : "You will need to login with your existing ClubSpark account" }, AdminWebsite : { HeroPhotoGuidance : "For best viewing of this photo we recommend uploading a photo with dimensions of 1600px by 800px", GalleryGuidance : "For best viewing of this photo we recommend uploading a photo with dimensions of 600px by 400px", NewsArticleGuidance : "For best viewing of this photo we recommend uploading a photo with dimensions of 1180px by 600px", SubSectionPhotoGuidance : "For best viewing of this photo we recommend uploading a photo with dimensions of 1400px x 450px", NewsArticleTextGuidance : "For best viewing please upload images that are 1180px wide. Height can be variable" }, SchemesEmails : { SchemeSessionsBookingUserSubject : "[#scheme#] / Booking Confirmation", SchemeSessionsBookingAdminSubject : "[#scheme#] / Booking Confirmation", SchemeSessionFullNotificationSubject : "[#scheme#] / [#course-type#] Full" }, Roster : { RosterUpper : "Roster" } }; var AuthHandler = function(config) { var cache; var redirectUrl = config.zoneRoot + 'oauth2-redirect.html'; var authorizeUrl = config.authRoot + 'issue/oauth2/authorize'; this.withToken = function (args) { args = args || {}; if (typeof args === "function") args = { success: args }; args.success = args.success || function() {}; args.error = args.error || function() {}; args.scope = args.scope || "token"; /* Attempt to load the current oauth token from localStorage */ /* var tokenCache = localStorage.getItem('oauth2.token'); */ var tokenCache = cache; var adminToken = null; if (tokenCache != null) adminToken = JSON.parse(tokenCache); var now = Math.floor(Date.now() / 1000); /* If token expires within next 60 seconds, we'll request a new one anyways */ if (adminToken != null && adminToken.expires_after < now + 60) adminToken = null; if (adminToken == null) { window.addEventListener('message', function (event) { if (event.data.action == 'oauth2.callback') { if (event.data.isValid) { var token = { expires_after: now + event.data.expires_in, access_token: event.data.access_token }; /* Store the token in cache */ /* localStorage.setItem('oauth2.token', JSON.stringify(token)); */ cache = JSON.stringify(token); args.success(token.access_token); } else { args.error(event.data); } } }, { once: true, capture: false }); var nonce = btoa(Date.now()); var authorizePayload = { tokenType: 'csa', response_type: 'token', client_id: 'clubspark-ui', redirect_uri: redirectUrl, scope: config.scopeRoot + args.scope, state: nonce, realm: config.webRoot, }; var implicitUrl = authorizeUrl + '?' + $.param(authorizePayload); /* Get iframe for sso */ var iframe = $('iframe[name="oauth2"]'); if (iframe.length == 0) { iframe = $('