APP = 'FRONTEND'; IS_NATIVE = typeof(IS_NATIVE) !== 'undefined' ? IS_NATIVE : 0; LAST_CORDOVA_RESTART = false; /* urls & domains */ APP_ENV = 'production'; // SITE_ROOT = window.location.origin.includes('backup') ? window.location.origin+'/' : 'https://www.headfirstbristol.co.uk/'; SITE_ROOT = window.location.origin.includes('backup') ? window.location.origin+'/' : 'https://www.headfirstbristol.co.uk/'; NATIVE_ROOT = 'ionic://app/'; SITE_ROOT_STATIC = 'https://static.headfirstbristol.co.uk/'; IMAGE_ROOT = 'https://www.headfirstbristol.co.uk/images/'; SHORT_URL_ROOT = 'https://hdfst.uk/'; /* api keys */ STRIPE_PUBLISHABLE_KEY = 'pk_live_lPmPdMUX1hytBwmf727PWTvf'; SOUNDCLOUD_CLIENT_ID = 'crVvd4K5dYkclKt4CfVHQ'; GOOGLE_API_KEY_WEBSITE = 'AIzaSyAufS65Ac3d3zhkK1TAZEF7rz2HKYBWRjo'; GOOGLE_ANALYTICS_4 = 'G-PXPY8LMMCK'; /* security */ RECAPTCHA_SITE_KEY = '6LdP9WwaAAAAACLaFAWKtOZF5KVvrxHVRbvzjlPE'; REQUIRE_RECAPTCHA = false; SMS_FEATURES_ENABLED = true; CHECKOUT_ENABLED = 'yes'; PAYOUTS_ENABLED = true; EVENT_MANAGER_ENABLED = 'yes'; FEATURE_RESALE_ENABLED = true; /* helpful */ TODAYS_DATE = '2025-09-26'; TODAYS_DATE_STRTOTIME = 1758841200; TOMORROWS_DATE = '2025-09-27'; EMAIL_MISTYPE_REGEX = new RegExp('/\\.com\\.uk|gogglemail|btitnernet|hotnail|hotmeil|\\.cou\\.k|\\.couk|btinterent|\\.ccom|\\.comm$|btinternnet|btinterrnet.com|btinternet\\.co\\.uk|ntlworld\\.co\\.uk|gmail\\.co\\.uk|\\.co\\.uk[\\w\\.]+$|ntlworrld|\\.co\\.ok$|\\.cpm$|ntllworld|btinterntet|googlmail|maail|googlelmail|gmial|hotmial|hotmailco|yhaoo|\\.dcom|brinternet|\\.con$|\\.couk|ntlword|tiscalli|vigin\\.c|hotail|\\.om$|\\.cm$|\\.co\\.u(m|l|o|p)$|\\.co(n|k|l)$|\\.com[A-Z]+|hotmai\\.|\\.c\\.uk|hotmail\\.co$|htmail|hotmal|gmai\\.|[^a-z0-9-@_\\.]/', 'ig'); ACCEPTABLE_TOKEN_AGE_FOR_CHECKOUT = 119; //minus one so there's a days tolerance to request client side token renewal MAILER_SUBSCRIBERS_TODAY = 15; MAILER_SUBSCRIBERS_THIS_MONTH = 577; MAILER_SUBSCRIBERS_THIS_YEAR = 4067; /* cache versions for query strings */ ASSET_CACHE_VERSION = 2363; /* DONATIONS TO DATE */ TOTAL_DONATIONS_THIS_YEAR = '39,123'; TOTAL_DONATIONS_THIS_MONTH = '3,234'; /* BOOKING FEE DONATIONS */ BOOKING_FEE_CHARITY_NAME = 'Bristol Redistro Community Fund'; BOOKING_FEE_CHARITY_URL = 'https://bristolredistro.net'; /* TICKET DESIGN */ LAST_OLD_TICKET_DESIGN_ID = 101195079; // used to determine whether ticket is using new design for cropping, added in September 2023 - can remove once all old tickets are out of date SELLER = false; /* micro helpers */ has_localstorage = function(){ return typeof localStorage !== 'undefined'; }; rand = function (min, max){ return Math.floor(Math.random() * (max - min + 1)) + min;} /* extra charges venue contributions */ LANES_VENUE_CONTRIBUTION_SELLER_ID = 5884; THEKLA_VENUE_CONTRIBUTION_SELLER_ID = 343; JAMJAR_VENUE_CONTRIBUTION_SELLER_ID = 11; STRANGE_BREW_VENUE_CONTRIBUTION_SELLER_ID = 7107; SWX_VENUE_CONTRIBUTION_SELLER_ID = 9549; LOST_HORIZON_VENUE_CONTRIBUTION_SELLER_ID = 5133; GREEN_WORKS_VENUE_CONTRIBUTION_SELLER_ID = 3992; LOCO_VENUE_CONTRIBUTION_SELLER_ID = 4337; TRINITY_VENUE_CONTRIBUTION_SELLER_ID = 6140; CROFT_VENUE_CONTRIBUTION_SELLER_ID = 9210; /* helpers */ hf_ajax = function(url, callback){ console.log('hf_ajax', url); var xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp.onreadystatechange = function() {if(xmlhttp.readyState == 4 && xmlhttp.status == 200) callback(xmlhttp.responseText);} xmlhttp.open("GET",url,true); xmlhttp.send(); }; hf_append_js_tag = function(params){ if(typeof params.js !== 'string' || !params.js) return console.log('hf_append_js_tag() failed js was not string:', params); //create the elem var s = document.createElement('script'); s.type = 'text/javascript'; if(params.js.match(/^http/)){ s.src = params.js; } else{ s.text = params.js; } if(typeof params.id !== 'undefined') s.id = params.id; if(typeof params.callback != 'undefined') s.onload = params.callback; //ensure there a exists to inject into if(typeof params.head === 'undefined' || !params.head) params.head = document.getElementsByTagName('head')[0]; //inject to dom params.head.appendChild(s); }; get_latest_asset_versions = function(callback){ var anti_cache = rand(1,9999999); hf_ajax(SITE_ROOT+'_asset_cache_version.txt?anti_cache='+anti_cache, function(str){ // updated asset cache version just serves a single version string for all assets rather than tracking separately const version = str.trim(); var rtn = { // in order to gracefully maintain backwards compatibility with the old system (including the native app, which hasn't been updated) we'll maintain the old return type // but modern code should just use rtn.version latest_version_js: version, latest_version_css: version, latest_version_templates: version, version: version }; callback(rtn); }); };