} slots An array of ad slot objects to be registered\r\n */\r\n var registerSlots = function (slots) {\r\n for (var i = 0; i < slots.length; i++) {\r\n registerSlot(slots[i]);\r\n }\r\n }\r\n\r\n var _adSlotCleanup = function () {\r\n for (var i = 0; i < _data.slots.length; i++) {\r\n var slot = _data.slots[i];\r\n\r\n // Disable auto refresh on road block\r\n if (slot.isRoadBlock) {\r\n ;\r\n _data.slots.splice(i, 1); // remove element from the array\r\n i--; // reduce indexer since we've removed an element from the array\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Handle the refresh of a given slot when timer is up\r\n * @param {AdSlot} slot Ad slot object\r\n */\r\n var _handleAutoRefresh = function (slot) {\r\n slot.autorefreshstate = _config.state.READY;\r\n\r\n if (slot.loaded && utilities.elementIsInView(slot.dom) && document.hasFocus()) {\r\n _refreshAd(slot);\r\n } else {\r\n ;\r\n }\r\n }\r\n\r\n /*\r\n * Handle view detection on scroll so slots are only refreshed if they are in view\r\n */\r\n var scrolllock = false;\r\n var _handleAutoRefreshScroll = function () {\r\n if (scrolllock) return;\r\n\r\n scrolllock = true;\r\n for (var i = 0; i < _data.slots.length; i++) {\r\n var slot = _data.slots[i];\r\n\r\n // Changes only occur when an ad slot is in view and loaded\r\n if (!slot.loaded || !utilities.elementIsInView(slot.dom)) continue;\r\n\r\n switch (slot.autorefreshstate) {\r\n case _config.state.IDLE:\r\n // Set timeout for refresh\r\n setTimeout(_handleAutoRefresh, _config.timeout * 1000, slot);\r\n\r\n // Timeout is set, set state to WAIT\r\n slot.autorefreshstate = _config.state.WAIT;\r\n\r\n ;\r\n break;\r\n\r\n case _config.state.READY:\r\n // Slot is ready for a refresh now\r\n _refreshAd(slot);\r\n break;\r\n }\r\n }\r\n scrolllock = false;\r\n }\r\n\r\n /**\r\n * Handle the actual refresh of a slot \r\n * @param {AdSlot} slot Ad slot object\r\n */\r\n var _refreshautocount = 0;\r\n var _refreshAd = function (slot) {\r\n // only refresh an ad in the READY state\r\n if (slot.autorefreshstate != _config.state.READY) {\r\n logging.warn(\"A call was made to refresh an ad that was no in a READY state\", _ModuleName);\r\n return;\r\n };\r\n\r\n ;\r\n\r\n // Mark slot as refreshing\r\n slot.autorefreshstate = _config.state.REFRESHING;\r\n\r\n // Create Ready Monitor for DFP Refresh\r\n var readyMonitorName = 'dfpautorefresh' + (++_refreshautocount);\r\n utilities.registerReadyMonitor(readyMonitorName, function () {\r\n ;\r\n\r\n // Call Refresh\r\n dfp.refreshSlot(slot);\r\n\r\n ;\r\n\r\n // Set timeout for another refresh\r\n setTimeout(_handleAutoRefresh, _config.timeout * 1000, slot);\r\n\r\n // Timeout is set, set state to WAIT\r\n slot.autorefreshstate = _config.state.WAIT;\r\n });\r\n\r\n headerbidding.refresh(slot, readyMonitorName);\r\n }\r\n\r\n return {\r\n init: init,\r\n start: start,\r\n registerSlot: registerSlot,\r\n registerSlots: registerSlots,\r\n enabled: (function () { return _config.enabled; })\r\n }\r\n});\n","/**\r\n * Buckets Module\r\n * Handles Bucket Targeting for DFP\r\n * version 2.0.1\r\n * \r\n * Using Semantic Versioning, please update accordingly to keep files in sync across code bases\r\n * \r\n * Given a version number MAJOR.MINOR.PATCH, increment the:\r\n * 1. MAJOR version when you implement a full re-build of the architecture,\r\n * 2. MINOR version when you add functionality, and\r\n * 3. PATCH version when you implement bug fixes or make small tweaks to current functionality.\r\n */\r\ndefine('AdModules/buckets',[\r\n \"jquery\",\r\n \"storage\",\r\n \"logging\"\r\n], function($, storage, logging) {\r\n \"use strict\";\r\n\r\n var _ModuleName = \"DFP Buckets Module\";\r\n\r\n var _config = {\r\n storage: { }\r\n }\r\n\r\n var init = function( config ) {\r\n // Get Bucket Configuration Data\r\n $.extend(_config, config.buckets);\r\n // Get Storage Configuration Data\r\n $.extend(_config.storage, config.storage);\r\n\r\n // If buckets are enabled, divide traffic\r\n if(_config.enabled) {\r\n ;\r\n\r\n // Try and get target from session storage\r\n _config.target = storage.getSessionStorage(_config.storage.bucketTarget) || 0;\r\n // If unable to get from storage, calculate new value and store in session storage\r\n if(_config.target == 0) {\r\n ;\r\n\r\n _config.target = Math.floor(Math.random() * _config.max) + 1;\r\n storage.setSessionStorage(_config.storage.bucketTarget, _config.target);\r\n } \r\n\r\n ;\r\n ;\r\n }\r\n }\r\n\r\n return {\r\n init: init,\r\n isEnabled: (function() { return _config.enabled; }),\r\n getTarget: (function() { return _config.target; })\r\n }\r\n});\n","/**\r\n * Lazy Loading Module\r\n * Implements lazy loading functionality for DFP Ads\r\n * version 2.0.1\r\n * \r\n * Using Semantic Versioning, please update accordingly to keep files in sync across code bases\r\n * \r\n * Given a version number MAJOR.MINOR.PATCH, increment the:\r\n * 1. MAJOR version when you implement a full re-build of the architecture,\r\n * 2. MINOR version when you add functionality, and\r\n * 3. PATCH version when you implement bug fixes or make small tweaks to current functionality.\r\n */\r\ndefine('AdModules/targeting',[\r\n \"jquery\",\r\n \"logging\",\r\n \"utilities\"\r\n], function( $, logging, utilities ) {\r\n \"use strict\";\r\n\r\n var _ModuleName = \"Targeting Module\";\r\n\r\n var _config = { \r\n targetmapping: { }\r\n };\r\n var _data = {\r\n pageconfig: { },\r\n targets: { }\r\n }\r\n\r\n var init = function(config) {\r\n $.extend(_config, config.targeting);\r\n $.extend(_config.targetmapping, config.targetmapping);\r\n }\r\n\r\n var start = function(pageconfig) {\r\n _data.pageconfig = pageconfig;\r\n }\r\n\r\n var loadTargeting = function( monitor ) {\r\n ;\r\n\r\n utilities.subscribeToReadyMonitor(monitor, \"targeting\");\r\n\r\n for(var mapkey in _config.targetmapping) {\r\n ;\r\n\r\n var map = _config.targetmapping[mapkey];\r\n\r\n // Key: Value, assumes same key is used on pageconfig where data is to be pulled, and DFP\r\n if(typeof map == 'string') {\r\n var value = _data.pageconfig[mapkey];\r\n ;\r\n _setTarget(mapkey, value);\r\n }\r\n\r\n // Key: Function, runs function to calculate value and assumes same key is used on DFP\r\n else if(typeof map == 'function') {\r\n var value = map[mapkey](_data.pageconfig);\r\n ;\r\n _setTarget(mapkey, key);\r\n }\r\n\r\n // Key: Object\r\n else if(typeof map == 'object') {\r\n ;\r\n // Calculate Key to use\r\n var key = (map.key && typeof map.key == 'string') ? map.key : mapkey;\r\n\r\n \r\n if(typeof map.conditional == \"object\") {\r\n // Process Conditional\r\n _processConditional(map, key, monitor);\r\n } else {\r\n _getValueAndSetTarget(map, key, monitor);\r\n }\r\n } else {\r\n logging.warn(\"Something went wrong trying to process target \" + mapkey, _ModuleName);\r\n }\r\n }\r\n\r\n utilities.confirmReady(monitor, 'targeting');\r\n }\r\n\r\n /**\r\n * Gets the value and sets the target\r\n * @param {Object} map target mapping we're working with\r\n * @param {String} key target key used in key:value pair\r\n * @param {String} monitor Name of ready monitor we'll be subscribing to if we have to do things async\r\n */\r\n var _getValueAndSetTarget = function(map, key, monitor) {\r\n // Value is of type String\r\n if(typeof map.value == 'string') {\r\n ;\r\n _setTarget(key, map.value);\r\n }\r\n\r\n // Value is of type Function\r\n else if(typeof map.value == 'function') {\r\n var value = map.value(_data.pageconfig);\r\n ;\r\n _setTarget(key, value)\r\n }\r\n\r\n // Value is of type Object\r\n else if(typeof map.value == 'object') {\r\n ;\r\n if(Array.isArray(map.value.requirements) && map.value.requirements.length) {\r\n ;\r\n _calculateResponseAsync(map.value, \"targeting-value-\" + key, monitor, function( response ) {\r\n ;\r\n _setTarget(key, response);\r\n });\r\n } else {\r\n ;\r\n _calculateResponse(map.value, function( response ) {\r\n ;\r\n _setTarget(key, response);\r\n });\r\n }\r\n }\r\n\r\n else {\r\n logging.warn(\"Something went wrong calculateing the value for \" + key, _ModuleName);\r\n }\r\n }\r\n\r\n /**\r\n * Handles the object configuration for calculating some value, but does so async as it needs to load some require modules\r\n * @param {Object} config configuration for response to calculate\r\n * @param {String} name Ready monitor process name to use, must be unique\r\n * @param {String} monitor name of ready monitor to subscribe to\r\n * @param {Function} callback Function to call once response is calculated\r\n */\r\n var _calculateResponseAsync = function( config, name, monitor, callback ) {\r\n if(Array.isArray(config.requirements) && config.requirements.length) {\r\n\r\n utilities.subscribeToReadyMonitor(monitor, name);\r\n\r\n require(config.requirements, function() {\r\n var modules = $.makeArray(arguments); // Get List of Modules Loaded\r\n // If page config should be included, add it\r\n if(config.pageconfig) {\r\n modules.push(_data.pageconfig);\r\n }\r\n if(typeof config.calculate == 'boolean' || typeof config.calculate == 'string') {\r\n if(typeof callback == 'function') {\r\n callback(config.calculate);\r\n }\r\n }\r\n // Run calculation function\r\n if(typeof config.calculate == 'function') {\r\n var response = config.calculate.apply(this, modules);\r\n // Call the callback function if provided\r\n if(typeof callback == 'function') {\r\n callback(response);\r\n }\r\n }\r\n utilities.confirmReady(monitor, name);\r\n })\r\n }\r\n }\r\n\r\n /**\r\n * Handles the object configuration for calculating some value\r\n * @param {Object} config configuration for response to calculate\r\n * @param {Function} callback Function to call once response is calculated\r\n */\r\n var _calculateResponse = function( config, callback ) {\r\n if(!Array.isArray(config.requirements) || config.requirements.length == 0) {\r\n var modules = [];\r\n // If page config should be included, add it\r\n if(config.pageconfig) {\r\n modules.push(_data.pageconfig);\r\n }\r\n\r\n if(typeof config.calculate == 'boolean' || typeof config.calculate == 'string') {\r\n if(typeof callback == 'function') {\r\n callback(config.calculate);\r\n }\r\n }\r\n // Run calculation function\r\n if(typeof config.calculate == 'function') {\r\n var response = config.calculate.apply(this, modules);\r\n // Call the callback function if provided\r\n if(typeof callback == 'function') {\r\n callback(response);\r\n }\r\n }\r\n } else {\r\n logging.error(\"Requirements are defined. Response should be calculated async\", _ModuleName);\r\n }\r\n }\r\n\r\n /**\r\n * Set the DFP Target\r\n * @param {String} key Targeting Key\r\n * @param {String} value Targeting Value\r\n */\r\n var _setTarget = function(key, value) {\r\n window.googletag.pubads().setTargeting(key, (value || \"\"));\r\n _data.targets[key] = (value || \"\");\r\n }\r\n\r\n /**\r\n * Handles the conditional to decide whether or not to calculate the value\r\n * @param {Object} map target mapping we're working with\r\n * @param {String} key target key used in key:value pair\r\n * @param {String} monitor Name of ready monitor we'll be subscribing to if we have to do things async\r\n */\r\n var _processConditional = function(map, key, monitor) {\r\n // Check and Handle Conditional\r\n if(Array.isArray(map.conditional.requirements) && map.conditional.requirements.length) {\r\n ;\r\n _calculateResponseAsync(map.conditional, \"targeting-conditional-\" + key, monitor, function( response ) {\r\n if(typeof response == 'boolean' && response) {\r\n ;\r\n _getValueAndSetTarget(map, key, monitor);\r\n } else {\r\n ;\r\n }\r\n });\r\n } else {\r\n ;\r\n _calculateResponse(map.conditional, function( response ) {\r\n if(typeof response == 'boolean' && response) {\r\n ;\r\n _getValueAndSetTarget(map, key, monitor);\r\n } else {\r\n ;\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Prints targeting data to the console for debugging purposes\r\n */\r\n var printTargetDataToConsole = function() {\r\n console.log(\"DFP Targeting: %o\", _data.targets);\r\n }\r\n\r\n return {\r\n init: init,\r\n start: start,\r\n loadTargeting: loadTargeting,\r\n printTargetDataToConsole: printTargetDataToConsole\r\n }\r\n});\n","/**\r\n * Manual Loading Module\r\n * Handles loading ad slots manually\r\n * version 2.1.0\r\n * \r\n * Using Semantic Versioning, please update accordingly to keep files in sync across code bases\r\n * \r\n * Given a version number MAJOR.MINOR.PATCH, increment the:\r\n * 1. MAJOR version when you implement a full re-build of the architecture,\r\n * 2. MINOR version when you add functionality, and\r\n * 3. PATCH version when you implement bug fixes or make small tweaks to current functionality.\r\n */\r\ndefine('AdModules/manualloading',[\r\n \"jquery\",\r\n \"logging\",\r\n \"utilities\",\r\n \"AdPlatforms/dfp\",\r\n \"AdModules/headerbidding\"\r\n], function ($, logging, utilities, dfp, headerbidding) {\r\n \"use strict\";\r\n\r\n var _ModuleName = \"Manual Ad Slot Loader\";\r\n\r\n var _config = {};\r\n var _data = {\r\n slots: [],\r\n pageconfig: {}\r\n };\r\n\r\n /**\r\n * Get configuration data off config object\r\n * @param {Config} config Configuration object\r\n */\r\n var init = function (config) {\r\n $.extend(_config, config.manualloading);\r\n }\r\n\r\n /**\r\n * Starts off manual load capabilities by storing the page config\r\n * @param {pageconfig} pageconfig page configuration object\r\n */\r\n var start = function (pageconfig) {\r\n // Store page config\r\n _data.pageconfig = pageconfig;\r\n }\r\n\r\n /**\r\n * Register an ad slot for lazy loading\r\n * @param {AdSlot} slot Ad slot object\r\n */\r\n var registerSlot = function (slot) {\r\n _data.slots.push(slot);\r\n ;\r\n }\r\n\r\n var registerSlots = function (slots) {\r\n for (var i = 0; i < slots.length; i++) {\r\n _data.slots.push(slots[i]);\r\n ;\r\n }\r\n }\r\n\r\n var _manualcount = 0;\r\n\r\n var loadAdManually = function (requestId) {\r\n loadAdsManually([requestId]);\r\n }\r\n\r\n var loadAdsManually = function (requestIds) {\r\n // Find slots with request Ids requested, and not already loaded\r\n var slots = _data.slots.filter(function (s) { return requestIds.indexOf(s.id) > -1 && !s.loaded; });\r\n\r\n // If we don't have any slots to load, we're done here\r\n if (slots.length === 0) return;\r\n\r\n if (dfp.loadSlots(slots, _data.pageconfig)) {\r\n // Create Ready Monitor for DFP Refresh\r\n var readyMonitorName = 'dfpmanual' + (++_manualcount);\r\n utilities.registerReadyMonitor(readyMonitorName, function () {\r\n ;\r\n // Call Refresh\r\n dfp.refreshSlots(slots);\r\n });\r\n\r\n headerbidding.refresh(slots, readyMonitorName);\r\n }\r\n }\r\n\r\n /**\r\n * Removes slot from being tracked\r\n */\r\n var removeSlot = function (slot) {\r\n try {\r\n var index = _data.slots.findIndex(function (s) { return s.id == slot.id; });\r\n if (index >= 0) {\r\n ;\r\n _data.slots.splice(index, 1);\r\n ;\r\n }\r\n } catch (error) {\r\n logging.error(\"Failed to remove slot\", _ModuleName);\r\n logging.error(error, _ModuleName);\r\n }\r\n }\r\n\r\n return {\r\n init: init,\r\n start: start,\r\n registerSlot: registerSlot,\r\n registerSlots: registerSlots,\r\n loadAdManually: loadAdManually,\r\n loadAdsManually: loadAdsManually,\r\n enabled: (function () { return _config.enabled; }),\r\n removeSlot: removeSlot\r\n }\r\n});\n","/**\r\n * Rate Limit Module\r\n * Handles limiting the amount of traffic that an ad position is served to\r\n * version 2.0.4\r\n * \r\n * Using Semantic Versioning, please update accordingly to keep files in sync across code bases\r\n * \r\n * Given a version number MAJOR.MINOR.PATCH, increment the:\r\n * 1. MAJOR version when you implement a full re-build of the architecture,\r\n * 2. MINOR version when you add functionality, and\r\n * 3. PATCH version when you implement bug fixes or make small tweaks to current functionality.\r\n */\r\ndefine('AdModules/ratelimit',[\r\n \"jquery\",\r\n \"logging\",\r\n \"storage\"\r\n], function ($, logging, storage) {\r\n \"use strict\";\r\n\r\n var _ModuleName = \"DFP Rate Limit Module\";\r\n var _config = {}\r\n var _data = {\r\n records: []\r\n }\r\n\r\n /**\r\n * Get configuration data off config object\r\n * @param {Config} config Configuration object\r\n */\r\n var init = function (config) {\r\n $.extend(_config, config.ratelimit);\r\n }\r\n\r\n /**\r\n * Start rate limit module\r\n */\r\n var start = function () {\r\n _printRateLimitResults();\r\n }\r\n\r\n\r\n /**\r\n * Checks if a given ad slot can serve to the current user. \r\n * @param {AdSlot} slot Ad slot object\r\n */\r\n var canServe = function (slot) {\r\n // If limits are disabled, return true\r\n if (typeof _config.enabled == 'undefined' || _config.enabled === false) return true;\r\n\r\n // If limit not set, or set to 100%, return true \r\n if (typeof slot.limit == 'undefined' || (slot.limit && slot.limit == 1.0)) return true;\r\n\r\n // If limit is set to 0, it was simply not set so return true\r\n if (slot.limit == 0.0) return true;\r\n\r\n ;\r\n\r\n // If invalid value for limit setting is passed, don't display slot at all\r\n if (slot.limit < 0 || slot.limit > 1.0) {\r\n logging.error(\"Invalid Slot Display Limit \" + slot.limit + \". Should be a value between 0.0 and 1.0, inclusive.\", _ModuleName);\r\n return false;\r\n }\r\n\r\n // Otherwise, calculate whether to display\r\n var sname = _getUniqueName(slot);\r\n\r\n // First check storage to see if it was previously calculated\r\n var result;\r\n if (_config.storage.enabled) {\r\n result = storage.getSessionStorage(sname);\r\n if (typeof result == 'boolean') {\r\n // Record the Rate Limited Slot Result\r\n _recordRateLimitedSlot(slot, result);\r\n\r\n ;\r\n return result;\r\n }\r\n }\r\n\r\n // If not, calculate\r\n result = Math.random() < slot.limit;\r\n\r\n // Store result\r\n if (_config.storage.enabled) {\r\n storage.setSessionStorage(sname, result);\r\n }\r\n\r\n if (_config.storage.enabled) {\r\n ;\r\n } else {\r\n ;\r\n }\r\n\r\n // Record the Rate Limited Slot Result\r\n _recordRateLimitedSlot(slot, result);\r\n\r\n // return result;\r\n return result;\r\n }\r\n\r\n /**\r\n * Disables this module\r\n */\r\n var disableStorage = function () {\r\n _config.storage.enabled = false;\r\n }\r\n\r\n /**\r\n * Checks if a slot was served\r\n * @param {String} position position value of the slot you're checking on\r\n */\r\n var wasServed = function (position) {\r\n // Check if the position has a rate limit record\r\n var record = _data.records.find(function (r) { return r.position = position; });\r\n // If nothing was recorded, then we don't know if it was served so return false\r\n if (typeof record == 'undefined') return false;\r\n // Return the display record for the position\r\n return record.display;\r\n }\r\n\r\n /**\r\n * Gets a unique storage name specific to this ad slot\r\n * @param {AdSlot} slot Ad slot object\r\n */\r\n var _getUniqueName = function (slot) {\r\n return _config.storage.limit + slot.position.toLowerCase().replace(\"_\", \"-\");\r\n }\r\n\r\n var _recordRateLimitedSlot = function (slot, result) {\r\n var record = _data.records.find(function (r) { return r.position = slot.position; });\r\n if (typeof record == 'undefined') {\r\n _data.records.push({\r\n position: slot.position,\r\n display: result\r\n });\r\n } else {\r\n record.display = result;\r\n }\r\n }\r\n\r\n var _printRateLimitResults = function() {\r\n console.log(\"Rate Limit Results: %o\", _data.records);\r\n }\r\n\r\n return {\r\n init: init,\r\n start: start,\r\n canServe: canServe,\r\n wasServed: wasServed,\r\n disableStorage: disableStorage,\r\n enabled: (function () { return _config.enabled; })\r\n }\r\n});\n","/**\r\n * Disable Flags Module\r\n * Allows flags to be used in the URL to indicate disabling certain position\r\n * version 2.0.0\r\n *\r\n * Using Semantic Versioning, please update accordingly to keep files in sync across code bases\r\n *\r\n * Given a version number MAJOR.MINOR.PATCH, increment the:\r\n * 1. MAJOR version when you implement a full re-build of the architecture,\r\n * 2. MINOR version when you add functionality, and\r\n * 3. PATCH version when you implement bug fixes or make small tweaks to current functionality.\r\n */\r\ndefine('AdModules/disableflags',['jquery', 'logging', 'storage', 'utilities'], function ($, logging, storage, utilities) {\r\n 'use strict';\r\n\r\n var _ModuleName = 'DFP Disable Flag Module';\r\n var _config = {};\r\n var _data = {\r\n records: [],\r\n disabledPositions: []\r\n };\r\n\r\n /**\r\n * Get configuration data off config object\r\n * @param {Config} config Configuration object\r\n */\r\n var init = function (config) {\r\n $.extend(_config, config.disableflags);\r\n\r\n // build list of disabled positions\r\n for (var i = 0; i < _config.flags.length; i++) {\r\n var flag = _config.flags[i];\r\n var result = utilities.getParameter(document.URL, flag.key);\r\n if (result) {\r\n _data.disabledPositions.push(flag.position);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Start rate limit module\r\n */\r\n var start = function () {\r\n _printFlagDisabledResults();\r\n };\r\n\r\n /**\r\n * Checks if a given ad slot can serve to the current user.\r\n * @param {AdSlot} slot Ad slot object\r\n */\r\n var canServe = function (slot) {\r\n // If limits are disabled, return true\r\n if (typeof _config.enabled == 'undefined' || _config.enabled === false) return true;\r\n\r\n // Otherwise, calculate whether to display\r\n var sname = _getUniqueName(slot);\r\n\r\n // First check storage to see if it was previously calculated\r\n if (_config.storage.enabled) {\r\n var storedDisabled = storage.getSessionStorage(sname);\r\n if (typeof storedDisabled == 'boolean' && storedDisabled) {\r\n ;\r\n\r\n // Record the Flag Disabled Slot Result\r\n _recordFlagDisabledSlot(slot);\r\n\r\n // Since disabled, we can not serve the slot\r\n return false;\r\n }\r\n }\r\n\r\n // If not, calculate\r\n var disabled = _data.disabledPositions.includes(slot.position);\r\n\r\n // Store result\r\n if (disabled && _config.storage.enabled) {\r\n storage.setSessionStorage(sname, true);\r\n }\r\n\r\n // Record the Flag Disabled Slot Result\r\n if (disabled) {\r\n _recordFlagDisabledSlot(slot);\r\n }\r\n\r\n // return whether we can display the slot\r\n return !disabled;\r\n };\r\n\r\n /**\r\n * Disables this module\r\n */\r\n var disableStorage = function () {\r\n _config.storage.enabled = false;\r\n };\r\n\r\n /**\r\n * Checks if a slot was served\r\n * @param {String} position position value of the slot you're checking on\r\n */\r\n var wasServed = function (position) {\r\n // Check if the position has a rate limit record\r\n var record = _data.records.find(function (r) {\r\n return (r.position = position);\r\n });\r\n // If nothing was recorded, then we don't know if it was served so return true\r\n if (typeof record == 'undefined') return true;\r\n // Return the display record for the position\r\n return record.display;\r\n };\r\n\r\n /**\r\n * Gets a unique storage name specific to this ad slot\r\n * @param {AdSlot} slot Ad slot object\r\n */\r\n var _getUniqueName = function (slot) {\r\n return _config.storage.flags + slot.position.toLowerCase().replace('_', '-');\r\n };\r\n\r\n var _recordFlagDisabledSlot = function (slot) {\r\n var record = _data.records.find(function (r) {\r\n return (r.position = slot.position);\r\n });\r\n if (typeof record == 'undefined') {\r\n _data.records.push({\r\n position: slot.position,\r\n disabled: true\r\n });\r\n } else {\r\n record.disabled = true;\r\n }\r\n };\r\n\r\n var _printFlagDisabledResults = function () {\r\n console.log('Flag Disabled Results: %o', _data.records);\r\n };\r\n\r\n return {\r\n init: init,\r\n start: start,\r\n canServe: canServe,\r\n wasServed: wasServed,\r\n disableStorage: disableStorage,\r\n enabled: function () {\r\n return _config.enabled;\r\n }\r\n };\r\n});\r\n\n","/**\r\n * Page Config Model\r\n * Defines page level configuration data for DFP\r\n */\r\ndefine('AdModels/PageConfig',[],function() {\r\n \"use strict\";\r\n\r\n function PageConfig() {\r\n this.hierarchy = \"\"; // string : DFP Hierarchy String\r\n this.tags = []; // array : array of keywords\r\n this.secure = (\"https:\" == document.location.protocol ? \"True\" : \"False\"); // bool : True if HTTPS, False otherwise\r\n this.source = \"\"; // string : Analytics Source\r\n this.medium = \"\"; // string : Analytics Medium\r\n this.campaign = \"\"; // string : Analytics Campaign\r\n this.contentid = \"\"; // string : Unique ID for Targeting\r\n this.title = \"\"; // string : Title of Page\r\n this.pagenum = 0; // int : Current Page Number\r\n this.pagecount = \"\"; // int : Total Number of Pages\r\n this.channel = []; // array : array of channels\r\n this.audience = []; // array : array of audiences\r\n this.ministry = \"\"; // string : Ministry\r\n this.political = \"\"; // string : Political\r\n this.category = \"\"; // string : Category\r\n this.pageurl = location.protocol + '//' + location.host + location.pathname; // string : Current Page URL\r\n this.type = \"\"; // string : Content Type\r\n this.disabled = false; // bool : True if ads are disabled on the page, False otherwise\r\n this.enableCookies = 0; // int : True if ads should be personalized with cookies, False otherwise\r\n this.fluid = {}; // object : Config data for fluid ad sizes\r\n }\r\n\r\n return PageConfig;\r\n});\n","/**\r\n * Config Model\r\n * Contains all DFP Configuration Data that is passed to other modules and such\r\n */\r\ndefine('AdModels/Config',[],function () {\r\n \"use strict\";\r\n\r\n function Config() {\r\n this.cleanup = false; // Remove references to slots when loading is complete (and no configured refresh)\r\n this.customAdSlotClass = \"\",\r\n this.ratelimit = {\r\n enabled: false,\r\n storage: {\r\n enabled: false,\r\n limit: \"slot-limit-\"\r\n }\r\n };\r\n this.disableflags = {\r\n enabled: false,\r\n storage: {\r\n enabled: true,\r\n flags: \"disable-flag-\"\r\n },\r\n flags: [\r\n { key: \"nonstick\", position: \"Mob_Adhesion\" },\r\n { key: \"nonstick\", position: \"DT_Adhesion\" }\r\n ]\r\n };\r\n this.fluid = {\r\n enabled: true,\r\n size: \"fluid\"\r\n };\r\n this.lazyload = {\r\n enabled: true,\r\n offset: 250, // Scroll offset when loading should start in px\r\n throttle: 500, // Throttle Time in ms\r\n eligible: [\r\n \"DT_MidList_3\",\r\n \"DT_MidList_4\",\r\n \"DT_MidList_5\",\r\n \"DT_MidList_6\",\r\n \"DT_MidList_7\",\r\n \"DT_MidList_8\",\r\n \"DT_MidList_9\",\r\n \"DT_MidList_10\",\r\n \"Mob_MidList_3\",\r\n \"Mob_MidList_4\",\r\n \"Mob_MidList_5\",\r\n \"Mob_MidList_6\",\r\n \"Mob_MidList_7\",\r\n \"Mob_MidList_8\",\r\n \"Mob_MidList_9\",\r\n \"Mob_MidList_10\"\r\n ],\r\n // Global Lazy Loading\r\n // Apply lazy loading to all slots on the site except those above the fold\r\n global: {\r\n enabled: true, // whether to enable global lazy loading\r\n rate: 1.0 // percentage of traffic that will use global lazy loading\r\n },\r\n // On Page Load\r\n // When page has fully loaded (onLoad event), go ahead and load any remaining lazy loaded slots\r\n onPageLoad: {\r\n enabled: true, // whether to enable on page load loading of remaining slots\r\n requireGlobal: true, // Only enable page load when using global lazy loading\r\n delay: 5e3 // number of miliseconds to delay the load after the onLoad event\r\n }\r\n };\r\n this.delayedload = {\r\n enabled: false,\r\n offset: 750, // Scroll offset when loading should start in px\r\n throttle: 100, // Throttle Time in ms\r\n eligible: [\r\n \"Mob_Adhesion\",\r\n \"DT_Adhesion\"\r\n ]\r\n };\r\n this.storage = {\r\n pageViewCount: \"dfp-page-view-count\",\r\n bucketTarget: \"dfp-bucket-target\",\r\n dfpSource: \"dfp-source\",\r\n dfpMedium: \"dfp-medium\",\r\n dfpCampaign: \"dfp-campaign\",\r\n useCookies: \"dfp-cookies\"\r\n };\r\n this.buckets = {\r\n enabled: true,\r\n max: 10, // Max number of buckets to divide traffic into\r\n target: 0 // Bucket number for this user\r\n };\r\n this.cookies = {\r\n enabled: 0,\r\n disabled: 1\r\n };\r\n this.autorefresh = {\r\n enabled: false,\r\n throttle: 1e3,\r\n timeout: 60, // Amount of time between refresh, in seconds\r\n state: {\r\n IDLE: 0, // auto refresh process not started\r\n WAIT: 1, // timeout is set, waiting configured time\r\n READY: 2, // timeout is complete, ready for a refresh\r\n REFRESHING: 3, // refreshing in progress\r\n FAILED: 4 // Something went wrong. refresh disabled for slot\r\n }\r\n };\r\n this.creatives = {\r\n scrollThrottle: 100,\r\n frameBusting: {\r\n type: {\r\n overlay: \"overlay\",\r\n skin: \"skin\",\r\n adhesion: \"adhesion\"\r\n },\r\n containers: {\r\n pixels: \".overlay-pixels\"\r\n },\r\n data: {\r\n src: \"bnm-src\"\r\n }\r\n },\r\n insertLocationIds: [\r\n \"overlay-inject-location\"\r\n ],\r\n navId: \"beliefnet-header-bar\",\r\n enableScrollingNav: false,\r\n creativeConfig: {\r\n wrapperId: 'interstitial-gray-background',\r\n closeBtnId: 'show_hide',\r\n timerClass: 'timer-span',\r\n autoCloseInterval: 10,\r\n blurPage: false,\r\n timerPreText: '',\r\n timerPostText: ' seconds',\r\n disableAutoClose: false\r\n }\r\n };\r\n this.manualloading = {\r\n enabled: true\r\n };\r\n this.headerbidding = {\r\n enabled: true, // Global header bidding enable/disable flag\r\n bidders: {\r\n amazon: {\r\n enabled: true,\r\n pubId: '3300',\r\n timeout: 500,\r\n scriptUrl: \"https://c.amazon-adsystem.com/aax2/apstag.js\",\r\n networkId: \"\",\r\n exclusions: [\r\n \"DT_BTF_Bottom\",\r\n \"Mob_NonPrem_Bottom\"\r\n ]\r\n },\r\n prebid: {\r\n enabled: true,\r\n scriptUrl: window.location.origin + \"/areas/beliefnet/js/vendor/prebid4.8.0pre.js\",\r\n timeouts: {\r\n bidding: 500,\r\n failsafe: 1e3\r\n },\r\n pbjsConfig: {\r\n userSync: {\r\n filterSettings: {\r\n iframe: {\r\n bidders: '*',\r\n filter: 'include'\r\n },\r\n image: {\r\n bidders: '*',\r\n filter: 'include'\r\n }\r\n },\r\n syncEnabled: true,\r\n iframeEnabled: true,\r\n syncsPerBidder: 8,\r\n syncDelay: 3000\r\n },\r\n consentManagement: {\r\n gdpr: {\r\n cmpApi: 'iab',\r\n allowAuctionWithoutConsent: false, // suppress auctions if there's no GDPR consent string\r\n timeout: 10e3 // GDPR timeout 3000ms\r\n },\r\n usp: {\r\n cmpApi: 'iab',\r\n timeout: 10e3 // US Privacy timeout 100ms\r\n }\r\n }\r\n },\r\n adapters: [\r\n {\r\n name: \"nobid\",\r\n enabled: true,\r\n siteId: \"22042552136\",\r\n moduleName: \"nobid\"\r\n },\r\n {\r\n name: \"pubmatic\",\r\n enabled: true,\r\n moduleName: \"pubmatic\",\r\n publisherId: \"159758\",\r\n pubmaticAdSlots: [\r\n {\r\n id: \"3099861\",\r\n size: [300, 100],\r\n mobile: true\r\n },\r\n {\r\n id: \"3099857\",\r\n size: [300, 250],\r\n mobile: false\r\n },\r\n {\r\n id: \"3099863\",\r\n size: [300, 250],\r\n mobile: true\r\n },\r\n {\r\n id: \"3099859\",\r\n size: [300, 600],\r\n mobile: false\r\n },\r\n {\r\n id: \"3099862\",\r\n size: [350, 50],\r\n mobile: true\r\n },\r\n {\r\n id: \"3099858\",\r\n size: [728, 90],\r\n mobile: false\r\n },\r\n {\r\n id: \"3099860\",\r\n size: [970, 250],\r\n mobile: false\r\n }\r\n ]\r\n },\r\n {\r\n name: \"criteo\",\r\n enabled: true,\r\n networkId: \"4428\",\r\n moduleName: \"criteo\"\r\n },\r\n {\r\n name: \"consumable\",\r\n enabled: true,\r\n siteId: \"2000921\",\r\n networkId: \"9969\",\r\n moduleName: \"consumable\",\r\n zones: [\r\n {\r\n unitId: \"9492\",\r\n unitName: \"cnsmbl-video-970x250\",\r\n zoneIds: [\r\n 2004532\r\n ],\r\n mobile: false,\r\n size: [970, 250]\r\n },\r\n {\r\n unitId: \"9490\",\r\n unitName: \"cnsmbl-audio-300x250-slider\",\r\n zoneIds: [\r\n 2004526\r\n ],\r\n mobile: true,\r\n size: [300, 250]\r\n },\r\n {\r\n unitId: \"9488\",\r\n unitName: \"cnsmbl-audio-300x600\",\r\n zoneIds: [\r\n 2004523\r\n ],\r\n mobile: false,\r\n size: [300, 600]\r\n },\r\n {\r\n unitId: \"9487\",\r\n unitName: \"cnsmbl-audio-728x90-slider\",\r\n zoneIds: [\r\n 2004524\r\n ],\r\n mobile: false,\r\n size: [728, 90]\r\n },\r\n {\r\n unitId: \"9489\",\r\n unitName: \"cnsmbl-audio-728x90-slider\",\r\n zoneIds: [\r\n 2004522\r\n ],\r\n mobile: false,\r\n size: [728, 90]\r\n },\r\n {\r\n unitId: \"9486\",\r\n unitName: \"cnsmbl-audio-300x600\",\r\n zoneIds: [\r\n 2004525\r\n ],\r\n mobile: false,\r\n size: [300, 600]\r\n },\r\n {\r\n unitId: \"9493\",\r\n unitName: \"cnsmbl-video-300x250-videoonly\",\r\n zoneIds: [\r\n 2004531\r\n ],\r\n mobile: false,\r\n size: [300, 250]\r\n }\r\n ]\r\n },\r\n {\r\n name: \"undertone\",\r\n enabled: false,\r\n publisherId: \"219\",\r\n moduleName: \"undertone\",\r\n placements: [\r\n {\r\n placementId: 219003,\r\n desktop: false,\r\n mobile: true,\r\n size: [300, 250]\r\n },\r\n {\r\n placementId: 219004,\r\n desktop: true,\r\n mobile: false,\r\n size: [300, 250]\r\n },\r\n {\r\n placementId: 219005,\r\n desktop: true,\r\n mobile: false,\r\n size: [728, 90]\r\n },\r\n {\r\n placementId: 219006,\r\n desktop: true,\r\n mobile: true,\r\n size: [300, 250]\r\n }\r\n ]\r\n },\r\n {\r\n name: 'colossusssp',\r\n enabled: true,\r\n moduleName: \"colossus\",\r\n placements: [\r\n {\r\n placementId: 46423,\r\n desktop: true,\r\n mobile: false,\r\n size: [300, 250]\r\n },\r\n {\r\n placementId: 46435,\r\n desktop: true,\r\n mobile: false,\r\n size: [728, 90]\r\n },\r\n {\r\n placementId: 46436,\r\n desktop: true,\r\n mobile: false,\r\n size: [300, 600]\r\n },\r\n {\r\n placementId: 46437,\r\n desktop: true,\r\n mobile: false,\r\n size: [970, 250]\r\n },\r\n {\r\n placementId: 46438,\r\n desktop: false,\r\n mobile: true,\r\n size: [300, 100]\r\n },\r\n {\r\n placementId: 46439,\r\n desktop: false,\r\n mobile: true,\r\n size: [320, 50]\r\n },\r\n {\r\n placementId: 46440,\r\n desktop: false,\r\n mobile: true,\r\n size: [300, 250]\r\n }\r\n ]\r\n },\r\n {\r\n name: 'adprime',\r\n enabled: true,\r\n moduleName: \"adprime\",\r\n adprimePlacements: [\r\n {\r\n id: \"36\",\r\n vtier: \"B_T1\"\r\n },\r\n {\r\n id: \"45\",\r\n vtier: \"B_T2\"\r\n },\r\n {\r\n id: \"54\",\r\n vtier: \"B_T3\"\r\n },\r\n {\r\n id: \"63\",\r\n vtier: \"B_T4\"\r\n }\r\n ]\r\n },\r\n {\r\n name: \"deepintent\",\r\n enabled: true,\r\n moduleName: \"deepintent\",\r\n deepintentAdSlots: [\r\n {\r\n id: \"354\",\r\n size: [300, 100],\r\n mobile: true\r\n },\r\n {\r\n id: \"353\",\r\n size: [320, 50],\r\n mobile: true\r\n },\r\n {\r\n id: \"352\",\r\n size: [300, 250],\r\n mobile: true\r\n },\r\n {\r\n id: \"351\",\r\n size: [300, 600],\r\n mobile: false\r\n },\r\n {\r\n id: \"350\",\r\n size: [970, 250],\r\n mobile: false\r\n },\r\n {\r\n id: \"349\",\r\n size: [728, 90],\r\n mobile: false\r\n },\r\n {\r\n id: \"348\",\r\n size: [300, 250],\r\n mobile: false\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n }\r\n };\r\n /*\r\n SASS Defined Size Mappings\r\n XS: 0 -> 767 // Phone\r\n SM: 768 -> 999 // Tablet/Small Screen Desktop\r\n MD: 1000 -> 1299 // Desktop\r\n LG: 1300 -> inf // Desktop\r\n */\r\n this.adslots = {\r\n displaymaps: {\r\n XTRASMALL: [0, 0], // Phone\r\n SMALL: [768, 576], // Tablet/Desktop\r\n //MEDIUM: [1000, 750], // Desktop\r\n //LARGE: [1300, 975] // Desktop\r\n }\r\n };\r\n\r\n /**\r\n * Custom Targeting\r\n * \r\n * This section allows you to pass in custom targeting details into DFP using a few different methods\r\n * \r\n * 1. Basic Page Config Value\r\n * mykey: \"value\"\r\n * \r\n * Using this method, the key is matched up to a key on the DFP Page Config, \r\n * and the value from there is passed into the targeting. \"value\" defined here \r\n * is used to define the DFP Targeting Key. Thus google's targeting gets this:\r\n * googletag.pubads().setTarget(\"value\", PageConfig.mykey);\r\n * \r\n * 2. Basic Function Calculation\r\n * mykey: (function( pageconfig ) { return pageconfig.channel.join(); })\r\n * \r\n * Using this method, the key used here will be the same key that is passed to DFP's targeting\r\n * and the function is called to get the value. The page config object is passed into the function\r\n * so if you need to access it, be sure it's set as an argument. Thus google's targeting gets this:\r\n * googletag.pubads().setTarget(\"mykey\", \"result of function\");\r\n * \r\n * 3. Advanced Object Definition for Calculation\r\n * mykey: {\r\n * key: \"dfp targeting key\",\r\n * value: {\r\n * requirements: [ \"req1\", \"req2\" ],\r\n * pageconfig: true,\r\n * calculate: (function(req1, req2, pageconfig) { return if(req1.isEnabled() && req2.hasSomeValue()) { return pageconfig.something; }})\r\n * },\r\n * conditional: {\r\n * requirements: [ \"mod1\", \"mod2\" ],\r\n * pageconfig: false,\r\n * calculate: (function(mod1, mod2) { return mod1.foo() && mod2.bar(); }})\r\n * }\r\n * }\r\n * \r\n * Using this setup, you have 3 values you can define.\r\n * 1. key : This is optional and would define the key used for the targeting. If not set, \"mykey\" is used (or whatever you have set).\r\n * 2. value : This is basically required. It can be a basic string value, a function that returns a value, or a calculation object described below\r\n * 3. conditional : This is optional, but if defined it allows you to only include the targeting value if this returns true. It can be a function, \r\n * or a calculation object described below. It must return a boolean.\r\n * \r\n * Calculation Object: This object has 3 values to define\r\n * 1. requirements : This is optional but allows you to define an array of require.js modules to load\r\n * 2. pageconfig : this is optional but allows you to define if the pageconfig needs to be passed into the calculate function. If set to true, pageconfig\r\n * will be passed in as the last argument.\r\n * 3. calculate : This is required and should be a function with a parameter for each requirement (just like when defining an RJS Module),\r\n * and possibly pageconfig as the last argument. This function will return it's expected value; either a conditional boolean, or a targeting value.\r\n */\r\n this.targetmapping = {\r\n tags: \"tags\",\r\n source: \"source\",\r\n medium: \"medium\",\r\n campaign: \"campaign\",\r\n contentid: \"contentID\",\r\n title: \"title\",\r\n pagecount: \"PageCount\",\r\n type: \"type\",\r\n pageurl: \"page_url\",\r\n audience: {\r\n key: \"likely_audience\",\r\n value: {\r\n pageconfig: true,\r\n calculate: (function (config) { return config.audience || []; })\r\n }\r\n },\r\n lazyloading: {\r\n key: \"adconfig\",\r\n value: {\r\n requirements: [\"AdModules/lazyloading\"],\r\n pageconfig: false,\r\n calculate: (function (lazyloading) { return lazyloading.isGlobal() ? \"test\" : \"control\"; })\r\n }\r\n },\r\n buckets: {\r\n key: \"bucket\",\r\n value: {\r\n requirements: [\"AdModules/buckets\"],\r\n pageconfig: false,\r\n calculate: (function (buckets) { return String(buckets.getTarget()); })\r\n },\r\n conditional: {\r\n requirements: [\"AdModules/buckets\"],\r\n pageconfig: false,\r\n calculate: (function (buckets) { return (buckets.isEnabled() && buckets.getTarget() > 0); })\r\n }\r\n }\r\n };\r\n }\r\n\r\n return Config;\r\n});\r\n\n","/**\r\n * Ads\r\n * Contains the logic necessary for initiating and displaying DFP Ads on the site\r\n * version 2.6.0\r\n * \r\n * Using Semantic Versioning, please update accordingly to keep files in sync across code bases\r\n * \r\n * Given a version number MAJOR.MINOR.PATCH, increment the:\r\n * 1. MAJOR version when you implement a full re-build of the architecture,\r\n * 2. MINOR version when you add functionality, and\r\n * 3. PATCH version when you implement bug fixes or make small tweaks to current functionality.\r\n */\r\ndefine('ads',[\r\n /* 3rd Party Libs */\r\n \"jquery\",\r\n\r\n /* General Libs */\r\n \"logging\",\r\n \"utilities\",\r\n \"storage\",\r\n \"ModuleLoader\",\r\n \"performance\",\r\n\r\n /* GDPR Stuff */\r\n \"location\",\r\n \"onetrust\",\r\n\r\n /* Ad Creative Libs */\r\n \"creatives\",\r\n\r\n /* Admiral Ad-Free */\r\n \"admiral\",\r\n\r\n /* DFP Libs */\r\n \"AdPlatforms/dfp\",\r\n \"AdModules/lazyloading\",\r\n \"AdModules/delayedloading\",\r\n \"AdModules/autorefresh\",\r\n \"AdModules/buckets\",\r\n \"AdModules/headerbidding\",\r\n \"AdModules/adslots\",\r\n \"AdModules/targeting\",\r\n \"AdModules/manualloading\",\r\n \"AdModules/ratelimit\",\r\n \"AdModules/disableflags\",\r\n\r\n /* DFP Models */\r\n \"AdModels/PageConfig\",\r\n \"AdModels/Config\"\r\n], function (\r\n /* 3rd Party Libs */\r\n $,\r\n /* General Libs */\r\n logging, utilities, storage, moduleloader, performance,\r\n /* GDPR Stuff */\r\n location, onetrust,\r\n /* Ad Creative Libs */\r\n creatives,\r\n /* Admiral Ad-Free */\r\n admiral,\r\n /* DFP Libs */\r\n dfp, lazyloading, delayedloading, autorefresh, buckets, headerbidding, adslots, targeting, manualloading, limit, disableflags,\r\n /* DFP Models */\r\n PageConfig, Config\r\n) {\r\n \"use strict\";\r\n\r\n var _ModuleName = \"Ads\";\r\n\r\n var _config = {};\r\n var _data = {\r\n slots: [],\r\n pageconfig: {},\r\n initialized: false,\r\n monitorName: 'dfp',\r\n monitorSubscriptionName: 'dfpjs'\r\n }\r\n var _perfMonitor = 'DFP';\r\n\r\n /*\r\n * Initialize global dfp object, used for ads on the pages to register themselves\r\n */\r\n var init = function () {\r\n performance.registerMonitor(_perfMonitor);\r\n\r\n // create a deferred response\r\n var dfd = $.Deferred();\r\n\r\n // Check if ads have been disabled\r\n if (_adsAreDisabled()) {\r\n ;\r\n return dfd.resolve();\r\n }\r\n\r\n // Initialize configuration object\r\n $.extend(_config, new Config());\r\n\r\n console.log(\"Ad Config Loaded: %o\", _config);\r\n\r\n if (Object.keys(_config).length === 0) {\r\n logging.error(\"Failed to load Ad Configuration\", _ModuleName);\r\n return dfd.resolve();\r\n }\r\n\r\n // Initialize Admiral Ad-Free\r\n admiral.init();\r\n\r\n performance.tick(_perfMonitor, 'Admiral Ad-Free Subscription Check Started');\r\n admiral.checkUserSubscribed(function () {\r\n // USER IS SUBSCRIBED, NO ADS WILL LOAD\r\n ;\r\n\r\n // mark ads as disabled\r\n _config.enabled = false;\r\n\r\n }, function () {\r\n // USER IS NOT SUBSCRIBED, LOAD THE ADS\r\n ;\r\n\r\n // mark whether ads are enabled or not\r\n _config.enabled = !dfp.adsAreDisabled() && !_data.pageconfig.disabled;\r\n\r\n // run initializations\r\n initWork();\r\n\r\n }, function () {\r\n // DO THIS WHETHER SUBSCRIBED OR NOT\r\n\r\n // update performance monitor\r\n performance.tick(_perfMonitor, 'Finished Admiral Ad-Free Subscription Check');\r\n\r\n // resolve promise\r\n dfd.resolve();\r\n }, true)\r\n\r\n // return promise\r\n return dfd.promise();\r\n }\r\n\r\n var _adLoadStart;\r\n var _adLoadEnd;\r\n var initWork = function () {\r\n // if already initiallized, we don't need to do it again\r\n if (_data.initialized) { return; }\r\n\r\n // Initialize Creative JavaScript Functions\r\n creatives.init(_config);\r\n\r\n // Initialize Ad Slot Module\r\n adslots.init(_config);\r\n\r\n // Initialize Manual Ad Loading\r\n manualloading.init(_config);\r\n\r\n // Initialize Lazy Loading\r\n lazyloading.init(_config);\r\n\r\n // Initialize Delayed Loading\r\n delayedloading.init(_config);\r\n\r\n // Initialize Auto Refresh\r\n autorefresh.init(_config);\r\n\r\n // Initialize DFP Targeting\r\n targeting.init(_config);\r\n\r\n // Initialize Disable Flag Support\r\n disableflags.init(_config);\r\n\r\n // Initialize Rate Limiting Library\r\n limit.init(_config);\r\n\r\n // Create Ready Monitor for DFP Refresh\r\n utilities.registerReadyMonitor(_data.monitorName, function () {\r\n ;\r\n _adLoadStart = new Date();\r\n dfp.refreshAllSlots();\r\n\r\n performance.tick(_perfMonitor, 'Request Refresh from DFP');\r\n\r\n ;\r\n targeting.printTargetDataToConsole();\r\n\r\n // Starting Lazy Loading\r\n ;\r\n lazyloading.start(_data.pageconfig);\r\n\r\n // Starting Delayed Loading\r\n ;\r\n delayedloading.start(_data.pageconfig);\r\n\r\n // handle any after ad request callbacks\r\n _handleAdsRequestedCallbacks();\r\n });\r\n\r\n // Subscribe to Ready Monitor\r\n utilities.subscribeToReadyMonitor(_data.monitorName, _data.monitorSubscriptionName);\r\n\r\n window.googletag = window.googletag || {};\r\n window.googletag.cmd = window.googletag.cmd || [];\r\n\r\n // Set up default page config\r\n _data.pageconfig = new PageConfig();\r\n _data.pageconfig.source = utilities.getParameter(document.URL, \"utm_source\");\r\n _data.pageconfig.medium = utilities.getParameter(document.URL, \"utm_medium\");\r\n _data.pageconfig.campaign = utilities.getParameter(document.URL, \"utm_campaign\");\r\n _data.pageconfig.pagenum = utilities.getParameter(document.URL, 'p');\r\n _data.pageconfig.enableCookies = _config.cookies.enabled;\r\n _data.pageconfig.fluid = _config.fluid; // Pass through entire fluid configuration\r\n\r\n // In the EU, disable cookies unless explicitly allowed \r\n var useCookies = storage.getSessionStorage(_config.storage.useCookies);\r\n if (typeof (useCookies) === 'boolean') {\r\n // enable or disable cookies based on what was stored\r\n _data.pageconfig.enableCookies = useCookies ? _config.cookies.enabled : _config.cookies.disabled;\r\n } else {\r\n location.isCookieLawZone(function () {\r\n // Disable Cookies until authorized\r\n _data.pageconfig.enableCookies = _config.cookies.disabled;\r\n storage.setSessionStorage(_config.storage.useCookies, false);\r\n\r\n ;\r\n ;\r\n onetrust.registerScript(onetrust.categories.Targeting, function () {\r\n // Authorization received, enable cookies\r\n ;\r\n storage.setSessionStorage(_config.storage.useCookies, true);\r\n _data.pageconfig.enableCookies = _config.cookies.enabled;\r\n });\r\n\r\n // If OneTrust fails to initialize, enable cookies\r\n setTimeout(function () {\r\n if (!onetrust.isInitialized()) {\r\n // OneTrust isn't working fast enough. enabling cookies\r\n ;\r\n storage.setSessionStorage(_config.storage.useCookies, true);\r\n _data.pageconfig.enableCookies = _config.cookies.enabled;\r\n }\r\n }, 1e3);\r\n\r\n }, function () { storage.setSessionStorage(_config.storage.useCookies, true); });\r\n\r\n // default cookies to enabled while we decide if they should be enabled/disabled\r\n useCookies = true;\r\n _data.pageconfig.enableCookies = _config.cookies.enabled;\r\n }\r\n\r\n // Only do this stuff if cookies are allowed\r\n if (useCookies) {\r\n ;\r\n // Initialize Header Bidding\r\n _initializeHeaderBidding();\r\n\r\n // Initialize buckets\r\n buckets.init(_config);\r\n\r\n // Get current page veiw count, default to 0\r\n var pageCount = storage.getSessionStorage(_config.storage.pageViewCount) || 0;\r\n // Increment and store page view count\r\n storage.setSessionStorage(_config.storage.pageViewCount, ++pageCount);\r\n _data.pageconfig.pagecount = ((typeof pageCount === 'undefined') ? \"\" : String(pageCount));\r\n ;\r\n\r\n //Grab source from query parameter or from session\r\n var source = _data.pageconfig.source || storage.getSessionStorage(_config.storage.dfpSource);\r\n storage.setSessionStorage(_config.storage.dfpSource, source);\r\n _data.pageconfig.source = source;\r\n\r\n //Grab medium from query parameter or from session\r\n var medium = _data.pageconfig.medium || storage.getSessionStorage(_config.storage.dfpMedium);\r\n storage.setSessionStorage(_config.storage.dfpMedium, medium);\r\n _data.pageconfig.medium = medium;\r\n\r\n //Grab campaign from query parameter or from session\r\n var campaign = _data.pageconfig.campaign || storage.getSessionStorage(_config.storage.dfpCampaign);\r\n storage.setSessionStorage(_config.storage.dfpCampaign, campaign);\r\n _data.pageconfig.campaign = campaign;\r\n } else {\r\n // Disable Storage for Rate Limit Lib\r\n limit.disableStorage();\r\n\r\n // Disable personalized ads if in cookie law zone.\r\n location.isCookieLawZone(function () {\r\n _disablePersonalizedAds(true);\r\n }, function () { });\r\n }\r\n\r\n performance.tick(_perfMonitor, 'Requesting DFP Load Scripts');\r\n\r\n // Load DFP Scripts\r\n dfp.loadScripts();\r\n\r\n ;\r\n\r\n ;\r\n window.bnm = window.bnm || {};\r\n window.bnm.ads = window.bnm.ads || {};\r\n window.bnm.ads.loadNewAds = _loadNewAds;\r\n\r\n _data.initialized = true;\r\n ;\r\n\r\n performance.tick(_perfMonitor, 'Finished Initialization');\r\n }\r\n\r\n var _preloaded = false;\r\n var preload = function () {\r\n ;\r\n // if preload data was found, run through the process\r\n if (window.bnm && window.bnm.ads && window.bnm.ads.preload) {\r\n var config = JSON.parse(window.bnm.ads.preload);\r\n if (config) {\r\n this.registerPageConfig(config.pageConfig);\r\n for (var i = 0; i < config.adSlots.length; i++) {\r\n var slot = config.adSlots[i];\r\n this.registerAdSlot(slot);\r\n }\r\n\r\n _preloaded = true;\r\n\r\n logging.log(\"Finished preloading ad configuration.\", _ModuleName);\r\n return true;\r\n } else {\r\n logging.error(\"Failed to parse Ad Config Preload Data. Will fall back to standard loading with a performance impact.\", _ModuleName);\r\n }\r\n } else {\r\n logging.warn(\"Ad Config Preload Data Not Found. Will fall back to standard loading with a performance impact.\", _ModuleName);\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Enable/Disable personalized ads\r\n * @param {boolean} restrict whether or not to restrict ad personalization\r\n */\r\n var _disablePersonalizedAds = function (restrict) {\r\n if (typeof restrict === undefined) {\r\n restrict = false;\r\n }\r\n\r\n ;\r\n window.googletag.pubads().setPrivacySettings({\r\n 'restrictDataProcessing': restrict\r\n });\r\n }\r\n\r\n /**\r\n * Register ad slot configuration with global dfp object\r\n * @param {any} config ad slot configuration object\r\n * @returns {boolean} true if slot registered successfully, false otherwise\r\n */\r\n var registerAdSlot = function (config) {\r\n // if ads are disabled, no need to register\r\n if (!_config.enabled) { return false; }\r\n\r\n // if slots were preloaded, find slot and update as needed\r\n if (_preloaded) {\r\n var preloadedSlot = _data.slots.find(function (slot) { return slot.id === config.id; });\r\n if (preloadedSlot !== undefined) {\r\n preloadedSlot.dom = config.dom;\r\n ;\r\n return true;\r\n }\r\n\r\n logging.warn(\"Ad configurations were preloaded, but this slot was not found. Was it missed during preload?\", _ModuleName);\r\n return false;\r\n }\r\n\r\n // make sure slot matches device type\r\n if (utilities.IsPhone() !== config.mobile) {\r\n ;\r\n return false;\r\n }\r\n\r\n var slot = adslots.initAdSlot(config);\r\n\r\n if (limit.enabled() && !limit.canServe(slot)) {\r\n ;\r\n return false;\r\n }\r\n\r\n if (disableflags.enabled() && !disableflags.canServe(slot)) {\r\n ;\r\n return false;\r\n }\r\n\r\n ;\r\n _data.slots.push(slot);\r\n return true;\r\n }\r\n\r\n /*\r\n * Register page configuration with global dfp object\r\n */\r\n var registerPageConfig = function (config) {\r\n if (_preloaded) {\r\n logging.warn(\"DFP Page Config already exists. Will not register again. It was preloaded.\", _ModuleName);\r\n return;\r\n }\r\n\r\n $.extend(_data.pageconfig, config);\r\n }\r\n\r\n /*\r\n * Start DFP processes (run after ads are all registered)\r\n */\r\n var start = function () {\r\n performance.tick(_perfMonitor, 'Starting Ad Load Process');\r\n\r\n // Ensure ads are enabled before we proceed\r\n if (_adsAreDisabled()) {\r\n ;\r\n _hideAdSlots();\r\n _handleAdsLoadedCallbacks();\r\n _handleAdsRequestedCallbacks();\r\n return;\r\n }\r\n\r\n if (_data.initialized === false) {\r\n logging.error(\"Ads system was not initialized properly and will not be started.\", _ModuleName);\r\n _handleAdsLoadedCallbacks();\r\n _handleAdsRequestedCallbacks();\r\n return;\r\n }\r\n\r\n // Let's drop some DFP config details on the console even in prod for the ad-ops team\r\n console.log(\"DFP Configuration: %o\", _data.pageconfig);\r\n console.log(\"DFP Ad Slots: %o\", _data.slots.map(function (s) { return { id: s.id, position: s.position }; }));\r\n\r\n // If we have no ad slots, no need to continue\r\n if (_data.slots.length === 0) {\r\n logging.log(\"No Ad Slots on the Page\", _ModuleName);\r\n _handleAdsLoadedCallbacks();\r\n _handleAdsRequestedCallbacks();\r\n return;\r\n }\r\n\r\n // Start Ad Slot Module\r\n adslots.start(_data.pageconfig);\r\n\r\n // Start Targeting Module\r\n targeting.start(_data.pageconfig);\r\n\r\n disableflags.start();\r\n\r\n // Start Manual Ad Load Module\r\n manualloading.start(_data.pageconfig);\r\n\r\n // Start Rate Limit Module\r\n limit.start();\r\n\r\n performance.tick(_perfMonitor, 'Queueing Processes with DFP');\r\n\r\n ;\r\n\r\n ;\r\n dfp.enqueue(_loadDFPConfiguration);\r\n\r\n ;\r\n dfp.enqueue(_loadInitialSlots);\r\n\r\n ;\r\n dfp.enqueue(_registerAutoRefreshSlots);\r\n\r\n ;\r\n dfp.enqueue(function () {\r\n performance.tick(_perfMonitor, 'Enabling DFP Services');\r\n dfp.enableServices();\r\n });\r\n\r\n ;\r\n dfp.enqueue(_confirmReady);\r\n }\r\n\r\n var _hideAdSlots = function () {\r\n if (_config.customAdSlotClass) {\r\n $('.' + _config.customAdSlotClass).hide();\r\n }\r\n\r\n $('.DFPAdSlot').hide();\r\n }\r\n\r\n /**\r\n * Initialize header bidding libraries\r\n */\r\n var _initializeHeaderBidding = function () {\r\n performance.tick(_perfMonitor, 'Initialize Header Bidding');\r\n\r\n headerbidding.init(_config, _data.monitorName);\r\n }\r\n\r\n /**\r\n * Instruct header bidding libraries to start the bidding\r\n */\r\n var _startHeaderBidding = function (slots) {\r\n performance.tick(_perfMonitor, 'Starting Header Bidding');\r\n\r\n headerbidding.start(slots, _data.pageconfig);\r\n }\r\n\r\n /**\r\n * Load DFP Configuration, including targeting parameters and slot positions\r\n */\r\n var _loadDFPConfiguration = function () {\r\n ;\r\n\r\n performance.tick(_perfMonitor, 'Loading DFP Configuration');\r\n\r\n // Load DFP Targeting\r\n targeting.loadTargeting(\"dfp\");\r\n\r\n // Load Remaining DFP Configuration\r\n dfp.loadConfiguration(_data.pageconfig, _handleAdLoaded, _config.targetmapping);\r\n }\r\n\r\n var _adsLoadedCount = 0;\r\n var _handleAdLoaded = function (event) {\r\n // log to the console how long it took to load the first ad\r\n if (_adLoadEnd === undefined) {\r\n _adLoadEnd = new Date();\r\n var elapsed = _adLoadEnd.getTime() - _adLoadStart.getTime();\r\n logging.log(\"DFP Response received after \" + elapsed + \"ms\", _ModuleName);\r\n }\r\n\r\n // Grab line item id\r\n _storeLineItemId(event);\r\n\r\n // Run dom updates on load\r\n dfp.adDomUpdatesOnLoad(event);\r\n\r\n if (--_adsLoadedCount === 0) {\r\n _handleAllAdsLoaded();\r\n }\r\n\r\n // Handle Slot Reference Cleanup\r\n var id = event.slot.getSlotElementId();\r\n _handleCleanup(id);\r\n }\r\n\r\n var _storeLineItemId = function (event) {\r\n var slotId = event.slot.getSlotElementId();\r\n var slot = _data.slots.find(function (s) { return s.id === slotId; });\r\n if (slot) {\r\n slot.lineItemId = event.lineItemId;\r\n }\r\n }\r\n\r\n var _handleCleanup = function (requestId) {\r\n if (_config.cleanup) {\r\n ;\r\n var slot = _data.slots.find(function (s) { return s.id === requestId; });\r\n if (slot) {\r\n if (!(autorefresh.enabled() && slot.autorefresh)) {\r\n // remove from own slots\r\n _removeSlot(slot);\r\n\r\n // remove from lazy loading\r\n if (lazyloading && lazyloading.enabled() && slot.lazyloading) {\r\n lazyloading.removeSlot(slot);\r\n }\r\n\r\n // remove from header bidding\r\n if (headerbidding && headerbidding.enabled()) {\r\n headerbidding.removeSlot(slot);\r\n }\r\n\r\n // remove from delayed loading\r\n if (delayedloading && delayedloading.enabled()) {\r\n delayedloading.removeSlot(slot);\r\n }\r\n\r\n // remove from manual loading\r\n if (manualloading && manualloading.enabled() && slot.manual) {\r\n manualloading.removeSlot(slot);\r\n }\r\n } else {\r\n logging.warn(\"Slot \" + slot.id + \" marked for auto refresh and will not be removed\", _ModuleName);\r\n }\r\n } else {\r\n logging.error(\"Unable to find slot by id \" + requestId + \". Cleanup process failed.\", _ModuleName);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Removes slot from being tracked\r\n * @param {any} slot Slot definition\r\n */\r\n var _removeSlot = function (slot) {\r\n try {\r\n var index = _data.slots.findIndex(function (s) { return s.id === slot.id; });\r\n if (index >= 0) {\r\n ;\r\n _data.slots.splice(index, 1);\r\n ;\r\n } else {\r\n logging.error(\"Unable to locate slot with id \" + slot.id + \" so it will not be removed\", _ModuleName);\r\n }\r\n } catch (error) {\r\n logging.error(\"Failed to remove slot from auto refresh\", _ModuleName);\r\n logging.error(error, _ModuleName);\r\n }\r\n }\r\n\r\n /**\r\n * Handles any operations needed once all ads have loaded\r\n */\r\n var _handleAllAdsLoaded = function () {\r\n ;\r\n\r\n performance.complete(_perfMonitor);\r\n\r\n // Check for possible road block ads\r\n _detectRoadBlockAds();\r\n\r\n // Start Auto Refresh\r\n ;\r\n autorefresh.start();\r\n\r\n // handle callbacks that were requested to run after ads are loaded\r\n _handleAdsLoadedCallbacks();\r\n }\r\n\r\n var _detectRoadBlockAds = function () {\r\n ;\r\n for (var i = 0; i < _data.slots.length; i++) {\r\n // if more than one ad slot has the same line item id, it's likely a roadblock ad\r\n if (_data.slots[i].lineItemId && _data.slots.filter(function (s) { return s.lineItemId === _data.slots[i].lineItemId; }).length > 1) {\r\n ;\r\n _data.slots[i].isRoadBlock = true;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Load the initial slots and mark others for lazyloading, delayed loading, or manual if eligible\r\n */\r\n var _loadInitialSlots = function () {\r\n ;\r\n\r\n performance.tick(_perfMonitor, 'Loading Initial Slots');\r\n\r\n var slots = [];\r\n for (var i = 0; i < _data.slots.length; i++) {\r\n var slot = _data.slots[i];\r\n\r\n if (delayedloading.enabled() && delayedloading.isEligibleForDelayedLoad(slot)) {\r\n // if delayed loading is enabled and slot is eligible\r\n delayedloading.registerSlot(slot);\r\n } else if (lazyloading.enabled() && lazyloading.isEligibleForLazyLoad(slot) && !lazyloading.isInView(slot)) {\r\n // if lazy loading is enabled, slot is eligible and slot is not in view\r\n lazyloading.registerSlot(slot);\r\n } else if (manualloading.enabled() && slot.manual) {\r\n // if marked for manual loading, register with module instead of loading\r\n manualloading.registerSlot(slot);\r\n } else {\r\n // if no special cases, just load it normally\r\n slots.push(slot);\r\n }\r\n }\r\n\r\n if (slots) {\r\n // start the header bidding on the slots\r\n _startHeaderBidding(slots);\r\n\r\n _adsLoadedCount = slots.length;\r\n ;\r\n if (!dfp.loadSlots(slots, _data.pageconfig)) {\r\n logging.warn(\"Not all slots were loaded successfully\", _ModuleName);\r\n } else {\r\n ;\r\n }\r\n } else {\r\n logging.warn(\"No slots eligible for initial load\", _ModuleName);\r\n }\r\n }\r\n\r\n /**\r\n * Register ad slots for auto refresh if eligible\r\n */\r\n var _registerAutoRefreshSlots = function () {\r\n ;\r\n autorefresh.registerSlots(_data.slots);\r\n }\r\n\r\n var _confirmReady = function () {\r\n performance.tick(_perfMonitor, 'Confirm Main ads Ready');\r\n\r\n // Confirm Ready with Ready Monitor\r\n ;\r\n utilities.confirmReady(_data.monitorName, _data.monitorSubscriptionName);\r\n }\r\n\r\n // attach function to window that we can use to load new ads\r\n var _loadNewAds = function () {\r\n ;\r\n moduleloader.loadPendingModules($('.DFPAdSlot')).done(function (modules) {\r\n if (modules) {\r\n // get slot ids from modules\r\n var slotIds = modules.filter(function (m) { return m !== null; }).map(function (m) { return m.slotId; });\r\n\r\n // pull slot data based on ids\r\n var slots = _data.slots.filter(function (s) { return slotIds.includes(s.id) && s.loaded === false; });\r\n\r\n if (slots.length > 0) {\r\n ;\r\n console.log(\"New Ad Slots\", slots);\r\n\r\n ;\r\n // register slots as manually loaded\r\n manualloading.registerSlots(slots);\r\n\r\n ;\r\n // register slots with header bidding\r\n headerbidding.registerSlots(slots);\r\n\r\n ;\r\n // load manually\r\n manualloading.loadAdsManually(slots.map(function (s) { return s.id; }));\r\n\r\n ;\r\n } else {\r\n ;\r\n }\r\n } else {\r\n ;\r\n }\r\n });\r\n }\r\n\r\n // Handle running some callbacks after ads have loaded\r\n var _adsLoaded = false;\r\n var _afterAdLoadCallbacks = [];\r\n var runAfterAdsLoaded = function (callback) {\r\n ;\r\n if (_adsLoaded) {\r\n if (typeof callback === 'function') {\r\n ;\r\n callback();\r\n }\r\n } else {\r\n ;\r\n _afterAdLoadCallbacks.push(callback);\r\n }\r\n }\r\n\r\n var _handleAdsLoadedCallbacks = function () {\r\n ;\r\n _adsLoaded = true;\r\n for (var i = 0; i < _afterAdLoadCallbacks.length; i++) {\r\n var callback = _afterAdLoadCallbacks[i];\r\n if (typeof callback === 'function') {\r\n callback();\r\n }\r\n }\r\n }\r\n\r\n var _adsRequested = false;\r\n var _afterAdRequestCallbacks = [];\r\n var runAfterAdsRequested = function (callback) {\r\n ;\r\n if (_adsRequested) {\r\n if (typeof callback === 'function') {\r\n ;\r\n callback();\r\n }\r\n } else {\r\n ;\r\n _afterAdRequestCallbacks.push(callback);\r\n }\r\n }\r\n\r\n var _handleAdsRequestedCallbacks = function () {\r\n ;\r\n _adsRequested = true;\r\n for (var i = 0; i < _afterAdRequestCallbacks.length; i++) {\r\n var callback = _afterAdRequestCallbacks[i];\r\n if (typeof callback === 'function') {\r\n callback();\r\n }\r\n }\r\n };\r\n\r\n var _adsAreDisabled = function () {\r\n // config has an enabled property set to false\r\n return (_config && typeof _config.enabled === 'boolean' && !_config.enabled)\r\n // dfp specifically says ads are disabled\r\n || dfp.adsAreDisabled()\r\n // dfp page configuration is loaded and marked as disabled\r\n || (_data && _data.pageconfig && typeof _data.pageconfig.disabled === 'boolean' && _data.pageconfig.disabled);\r\n };\r\n\r\n return {\r\n init: init,\r\n preload: preload,\r\n start: start,\r\n registerAdSlot: registerAdSlot,\r\n registerPageConfig: registerPageConfig,\r\n runAfterAdsLoaded: runAfterAdsLoaded,\r\n runAfterAdsRequested: runAfterAdsRequested,\r\n isPreloaded: (function () { return _preloaded; })\r\n }\r\n});\n","define('pushnami',[\r\n \"jquery\",\r\n \"logging\",\r\n \"gtm\"\r\n], function ($, logging, gtm) {\r\n \"use strict\";\r\n\r\n var _ModuleName = \"Pushnami Integration\";\r\n var _config = {\r\n enabled: true,\r\n apiKey: \"5d408411b0919900128a9aa2\",\r\n category: \"Push Notifications\",\r\n label: \"Pushnami\",\r\n events: [\r\n {\r\n PushnamiEventName: \"permissions-action-subscribed-new\",\r\n GTMEventName: \"pushnamiNewSubscribe\",\r\n AnalyticsAction: \"Accept\"\r\n }\r\n ]\r\n };\r\n\r\n var init = function () {\r\n ;\r\n\r\n var section = $('html').data('content-section');\r\n var options = {};\r\n\r\n // Add section information if not default Beliefnet\r\n if (section !== 'Beliefnet') {\r\n options[\"section\"] = section;\r\n }\r\n\r\n ;\r\n\r\n var script = document.createElement(\"script\");\r\n script.type = \"text/javascript\";\r\n script.src = \"https://api.pushnami.com/scripts/v1/pushnami-adv/\" + _config.apiKey;\r\n script.onload = function () {\r\n Pushnami\r\n .update(options)\r\n .prompt();\r\n\r\n // Hook into the defined events and fire analytics events\r\n for (var i = 0; i < _config.events.length; i++) {\r\n var event = _config.events[i];\r\n Pushnami.on([event.PushnamiEventName], function () {\r\n gtm.fireEvent(event.GTMEventName, _config.category, event.AnalyticsAction, _config.label)\r\n });\r\n }\r\n };\r\n document.getElementsByTagName(\"head\")[0].appendChild(script);\r\n }\r\n\r\n return {\r\n init: init\r\n }\r\n});\n","/**\r\n * Delayed Tasks\r\n * Runs tasks after page and ads have loaded\r\n * version 1.1.0\r\n *\r\n * Using Semantic Versioning, please update accordingly to keep files in sync across code bases\r\n *\r\n * Given a version number MAJOR.MINOR.PATCH, increment the:\r\n * 1. MAJOR version when you implement a full re-build of the architecture,\r\n * 2. MINOR version when you add functionality, and\r\n * 3. PATCH version when you implement bug fixes or make small tweaks to current functionality.\r\n */\r\ndefine('delayedtasks',[\r\n \"jquery\",\r\n \"ads\",\r\n \"logging\"\r\n], function ($, ads, logging) {\r\n \"use strict\";\r\n\r\n var _ModuleName = \"Delayed Tasks\";\r\n var _config = {\r\n enabled: true\r\n };\r\n\r\n var _tasks = [];\r\n var _delayComplete = false;\r\n\r\n var init = function () {\r\n if (_config.enabled) {\r\n // wait for page load\r\n $(function () {\r\n // ensure ads have loaded\r\n ads.runAfterAdsLoaded(function () {\r\n // now we can run our tasks\r\n _handleDelayComplete();\r\n });\r\n });\r\n } else {\r\n _handleDelayComplete();\r\n }\r\n };\r\n\r\n var registerTask = function (task) {\r\n if (typeof task === 'function') {\r\n // if the page load is already complete, and delay no longer needed\r\n // or if this isn't even enabled, then go ahead and run the task\r\n // otherwise, store it in a queue\r\n if (_delayComplete || !_config.enabled) {\r\n task();\r\n } else {\r\n _tasks.push(task);\r\n }\r\n }\r\n };\r\n\r\n var _handleDelayComplete = function () {\r\n ;\r\n\r\n if (_delayComplete) { return; }\r\n _delayComplete = true;\r\n\r\n for (var i = 0; i < _tasks.length; i++) {\r\n var task = _tasks[i];\r\n if (typeof task === 'function') {\r\n task();\r\n }\r\n }\r\n _tasks = [];\r\n };\r\n\r\n return {\r\n init: init,\r\n registerTask: registerTask\r\n };\r\n});\n","define('main',[\r\n \"jquery\",\r\n \"underscore\",\r\n \"score_ccf/ModuleLoader\",\r\n \"scorebootstrap\",\r\n \"utilities\",\r\n \"ads\",\r\n \"storage\",\r\n \"onetrust\",\r\n \"analytics\",\r\n \"gtm\",\r\n \"pushnami\",\r\n \"admiral\",\r\n \"logging\",\r\n \"delayedtasks\",\r\n \"matchHeight\"\r\n],\r\nfunction ($, _, moduleLoader, scorebootstrap, utilities, ads, storage, onetrust, analytics, gtm, pushnami, admiral, logging, delayedtasks) {\r\n \"use strict\";\r\n\r\n //prevents dropdown from closing when clicked inside\r\n $(document).on(\"click\", \".score-megamenu .dropdown-menu\", function (e) {\r\n e.stopPropagation();\r\n });\r\n\r\n // match height style boxes within a container with a special \"signal\" class\r\n $(\".matchheight-stylebox .score-style-box\").matchHeight(true);\r\n\r\n // if you need to monkey patch anything in Score Bootstrap Initialization logic\r\n // here's where you would do it. Before calling to init(). Something like:\r\n // scorebootstrap.Accordion.init = function() { ... }\r\n\r\n // init SCORE Bootstrap components (Tabsets, Accordeons, Carousels, etc.)\r\n scorebootstrap.init();\r\n\r\n // init beliefnet utilities\r\n utilities.init();\r\n\r\n // initialize storage\r\n storage.init();\r\n\r\n // Initialize OneTrust\r\n onetrust.init();\r\n\r\n // initialize analytics\r\n analytics.init();\r\n\r\n // initialize GTM\r\n gtm.init();\r\n\r\n // initialize pushnami\r\n pushnami.init();\r\n\r\n // inititialize DFP\r\n logging.log(\"Starting Ad Init\");\r\n $.when(ads.init()).then(function () {\r\n delayedtasks.init();\r\n\r\n // handle ad config preloading\r\n if (ads.preload()) {\r\n logging.log(\"Starting Ad Run\");\r\n ads.start();\r\n ads.runAfterAdsLoaded(function () {\r\n loadModulesNoAds();\r\n }); \r\n } else {\r\n loadModulesWithAds();\r\n }\r\n\r\n // Load Taboola Later\r\n delayedtasks.registerTask(function () {\r\n console.log('Loading Taboola Header Script');\r\n\r\n window._taboola = window._taboola || [];\r\n _taboola.push({ photo: 'auto' });\r\n !function (e, f, u, i) {\r\n if (!document.getElementById(i)) {\r\n e.async = 1;\r\n e.src = u;\r\n e.id = i;\r\n f.parentNode.insertBefore(e, f);\r\n }\r\n }(document.createElement('script'),\r\n document.getElementsByTagName('script')[0],\r\n document.location.href.indexOf('/espanol/') > -1\r\n ? '//cdn.taboola.com/libtrc/bnmedia-beliefnetes/loader.js' // spanish \r\n : '//cdn.taboola.com/libtrc/bnmedia-beliefnet/loader.js', // english\r\n 'tb_loader_script');\r\n if (window.performance && typeof window.performance.mark == 'function') { window.performance.mark('tbl_ic'); }\r\n });\r\n });\r\n\r\n function loadModulesNoAds() {\r\n $(function () {\r\n logging.log(\"Starting module loading without ads\");\r\n moduleLoader.loadPendingModules($('div[data-ux-module]').not('.DFPAdSlot, .dfp-page-config')).done(function () {\r\n // anything that neeeds to run globally when all modules are loaded goes here \r\n onModuleLoadComplete();\r\n });\r\n });\r\n }\r\n\r\n function loadModulesWithAds() {\r\n $(function () {\r\n logging.log(\"Starting module loading with ads\");\r\n moduleLoader.loadPendingModules($('.DFPAdSlot, .dfp-page-config')).done(function () {\r\n // Start DFP\r\n ads.start();\r\n\r\n // Load rest of the modules\r\n moduleLoader.loadPendingModules().done(function () {\r\n // anything that neeeds to run globally when all modules are loaded goes here \r\n\r\n onModuleLoadComplete();\r\n });\r\n });\r\n })\r\n }\r\n\r\n function onModuleLoadComplete() {\r\n // Load nativo if Ad-Free Subscription not detected or Ad-Free is disabled\r\n if (admiral.isEnabled()) {\r\n admiral.checkUserSubscribed(function () {\r\n ;\r\n }, function () {\r\n // Load Nativo\r\n utilities.load3rdPartyScript(\"//s.ntv.io/serve/load.js\");\r\n });\r\n } else {\r\n // Load Nativo\r\n utilities.load3rdPartyScript(\"//s.ntv.io/serve/load.js\");\r\n }\r\n\r\n // fire pageview event\r\n gtm.fireEvent('pageview');\r\n }\r\n});\r\n\n","/**\r\n * NoBid - PrebidJS Adapter\r\n * Handles header bidding with Amazon\r\n * version 1.0.1\r\n * \r\n * Using Semantic Versioning, please update accordingly to keep files in sync across code bases\r\n * \r\n * Given a version number MAJOR.MINOR.PATCH, increment the:\r\n * 1. MAJOR version when you implement a full re-build of the architecture,\r\n * 2. MINOR version when you add functionality, and\r\n * 3. PATCH version when you implement bug fixes or make small tweaks to current functionality.\r\n */\r\ndefine('nobid',[\r\n \"jquery\",\r\n \"logging\"\r\n], function ($, logging) {\r\n \"use strict\";\r\n var _ModuleName = \"NoBid\";\r\n\r\n var _config = {}\r\n\r\n var _initialized = false;\r\n var init = function (config) {\r\n if (!_initialized) {\r\n $.extend(_config, config);\r\n _initialized = true;\r\n }\r\n }\r\n\r\n var getBidDefinition = function (slot) {\r\n // make sure we're initialized\r\n if (!_initialized) { return; }\r\n\r\n ;\r\n\r\n // build definition\r\n var definition = $.extend({}, {\r\n bidder: _config.name,\r\n params: {\r\n siteId: _config.siteId\r\n }\r\n });\r\n\r\n return definition;\r\n }\r\n\r\n var getBidderSettings = function () {\r\n return {}\r\n }\r\n\r\n return {\r\n name: _ModuleName,\r\n init: init,\r\n getBidDefinition: getBidDefinition,\r\n getBidderSettings: getBidderSettings\r\n }\r\n});\n","/**\r\n * Criteo - PrebidJS Adapter\r\n * Handles header bidding with Criteo\r\n * version 1.1.0\r\n * \r\n * Using Semantic Versioning, please update accordingly to keep files in sync across code bases\r\n * \r\n * Given a version number MAJOR.MINOR.PATCH, increment the:\r\n * 1. MAJOR version when you implement a full re-build of the architecture,\r\n * 2. MINOR version when you add functionality, and\r\n * 3. PATCH version when you implement bug fixes or make small tweaks to current functionality.\r\n */\r\ndefine('criteo',[\r\n \"jquery\",\r\n \"logging\"\r\n], function ($, logging) {\r\n \"use strict\";\r\n var _ModuleName = \"Criteo\";\r\n\r\n var _config = {}\r\n\r\n var _initialized = false;\r\n var init = function (config) {\r\n if (!_initialized) {\r\n $.extend(_config, config);\r\n _initialized = true;\r\n }\r\n }\r\n\r\n var getBidDefinition = function (slot) {\r\n // make sure we're initialized\r\n if (!_initialized) { return; }\r\n\r\n ;\r\n\r\n // build definition\r\n var definition = $.extend({}, {\r\n bidder: _config.name,\r\n params: {\r\n networkId: _config.networkId\r\n }\r\n });\r\n\r\n return definition;\r\n }\r\n\r\n var getBidderSettings = function () {\r\n return {}\r\n }\r\n\r\n return {\r\n name: _ModuleName,\r\n init: init,\r\n getBidDefinition: getBidDefinition,\r\n getBidderSettings: getBidderSettings\r\n }\r\n});\n","/**\r\n * Consumable - PrebidJS Adapter\r\n * Handles header bidding with Consumable\r\n * version 1.1.0\r\n * \r\n * Using Semantic Versioning, please update accordingly to keep files in sync across code bases\r\n * \r\n * Given a version number MAJOR.MINOR.PATCH, increment the:\r\n * 1. MAJOR version when you implement a full re-build of the architecture,\r\n * 2. MINOR version when you add functionality, and\r\n * 3. PATCH version when you implement bug fixes or make small tweaks to current functionality.\r\n */\r\ndefine('consumable',[\r\n \"jquery\",\r\n \"logging\",\r\n \"utilities\"\r\n], function ($, logging, utilities) {\r\n \"use strict\";\r\n var _ModuleName = \"Consumable\";\r\n\r\n var _config = {}\r\n\r\n var _initialized = false;\r\n var init = function (config) {\r\n if (!_initialized) {\r\n $.extend(_config, config);\r\n _initialized = true;\r\n }\r\n }\r\n\r\n var getBidDefinition = function (slot) {\r\n // make sure we're initialized\r\n if (!_initialized) { return; }\r\n\r\n ;\r\n\r\n var bids = [];\r\n if (_config.zones) {\r\n for (var i = 0; i < _config.zones.length; i++) {\r\n var zone = _config.zones[i];\r\n\r\n if (slot.mobile === zone.mobile // slot and zone mobile setting must match\r\n && utilities.isArrayInArray(slot.sizes, zone.size) // slot must contain eligible size for zone\r\n && zone.zoneIds.length > 0) { // zone must have a zone id\r\n\r\n // filter out lower viewability 300x250s\r\n var vtier = slot.vtier.charAt(slot.vtier.length - 1);\r\n if ((vtier === \"3\" || vtier === \"4\")\r\n && utilities.isArrayInArray([[300, 250]], zone.size)) { continue; }\r\n\r\n bids.push(\r\n $.extend({}, {\r\n bidder: _config.name,\r\n params: {\r\n siteId: _config.siteId,\r\n networkId: _config.networkId,\r\n unitId: zone.unitId,\r\n unitName: zone.unitName,\r\n zoneIds: zone.zoneIds\r\n }\r\n })\r\n );\r\n }\r\n }\r\n }\r\n\r\n return bids;\r\n }\r\n\r\n var getBidderSettings = function () {\r\n return {}\r\n }\r\n\r\n return {\r\n name: _ModuleName,\r\n init: init,\r\n getBidDefinition: getBidDefinition,\r\n getBidderSettings: getBidderSettings\r\n }\r\n});\n","/**\r\n * Undertone - PrebidJS Adapter\r\n * Handles header bidding with Undertone\r\n * version 1.0.0\r\n * \r\n * Using Semantic Versioning, please update accordingly to keep files in sync across code bases\r\n * \r\n * Given a version number MAJOR.MINOR.PATCH, increment the:\r\n * 1. MAJOR version when you implement a full re-build of the architecture,\r\n * 2. MINOR version when you add functionality, and\r\n * 3. PATCH version when you implement bug fixes or make small tweaks to current functionality.\r\n */\r\ndefine('undertone',[\r\n \"jquery\",\r\n \"logging\",\r\n \"utilities\"\r\n], function ($, logging, utilities) {\r\n \"use strict\";\r\n var _ModuleName = \"Undertone\";\r\n\r\n var _config = {}\r\n\r\n var _initialized = false;\r\n var init = function (config) {\r\n if (!_initialized) {\r\n $.extend(_config, config);\r\n _initialized = true;\r\n }\r\n }\r\n\r\n var getBidDefinition = function (slot) {\r\n // make sure we're initialized\r\n if (!_initialized) { return; }\r\n\r\n ;\r\n\r\n var bids = [];\r\n if (_config.placements) {\r\n for (var i = 0; i < _config.placements.length; i++) {\r\n var placement = _config.placements[i];\r\n\r\n if (((slot.mobile && placement.mobile) || (!slot.mobile && placement.desktop)) // slot and zone mobile setting must match\r\n && utilities.isArrayInArray(slot.sizes, placement.size) // slot must contain eligible size for zone\r\n ) {\r\n\r\n bids.push(\r\n $.extend({}, {\r\n bidder: _config.name,\r\n params: {\r\n publisherId: _config.publisherId,\r\n placementId: placement.placementId\r\n }\r\n })\r\n );\r\n }\r\n }\r\n }\r\n\r\n return bids;\r\n }\r\n\r\n var getBidderSettings = function () {\r\n return {}\r\n }\r\n\r\n return {\r\n name: _ModuleName,\r\n init: init,\r\n getBidDefinition: getBidDefinition,\r\n getBidderSettings: getBidderSettings\r\n }\r\n});\n","/**\r\n * Colossus - PrebidJS Adapter\r\n * Handles header bidding with Colossus\r\n * version 1.0.0\r\n * \r\n * Using Semantic Versioning, please update accordingly to keep files in sync across code bases\r\n * \r\n * Given a version number MAJOR.MINOR.PATCH, increment the:\r\n * 1. MAJOR version when you implement a full re-build of the architecture,\r\n * 2. MINOR version when you add functionality, and\r\n * 3. PATCH version when you implement bug fixes or make small tweaks to current functionality.\r\n */\r\ndefine('colossus',[\r\n \"jquery\",\r\n \"logging\",\r\n \"utilities\"\r\n], function ($, logging, utilities) {\r\n \"use strict\";\r\n var _ModuleName = \"Colossus\";\r\n\r\n var _config = {}\r\n\r\n var _initialized = false;\r\n var init = function (config) {\r\n if (!_initialized) {\r\n $.extend(_config, config);\r\n _initialized = true;\r\n }\r\n }\r\n\r\n var getBidDefinition = function (slot) {\r\n // make sure we're initialized\r\n if (!_initialized) { return; }\r\n\r\n ;\r\n\r\n var bids = [];\r\n if (_config.placements) {\r\n for (var i = 0; i < _config.placements.length; i++) {\r\n var placement = _config.placements[i];\r\n\r\n if (((slot.mobile && placement.mobile) || (!slot.mobile && placement.desktop)) // slot and zone mobile setting must match\r\n && utilities.isArrayInArray(slot.sizes, placement.size) // slot must contain eligible size for zone\r\n ) {\r\n\r\n bids.push(\r\n $.extend({}, {\r\n bidder: _config.name,\r\n params: {\r\n placement_id: placement.placementId\r\n }\r\n })\r\n );\r\n }\r\n }\r\n }\r\n\r\n return bids;\r\n }\r\n\r\n var getBidderSettings = function () {\r\n return {}\r\n }\r\n\r\n return {\r\n name: _ModuleName,\r\n init: init,\r\n getBidDefinition: getBidDefinition,\r\n getBidderSettings: getBidderSettings\r\n }\r\n});\n","/**\r\n * PubMatic - PrebidJS Adapter\r\n * Handles header bidding with Amazon\r\n * version 1.0.0\r\n * \r\n * Using Semantic Versioning, please update accordingly to keep files in sync across code bases\r\n * \r\n * Given a version number MAJOR.MINOR.PATCH, increment the:\r\n * 1. MAJOR version when you implement a full re-build of the architecture,\r\n * 2. MINOR version when you add functionality, and\r\n * 3. PATCH version when you implement bug fixes or make small tweaks to current functionality.\r\n */\r\ndefine('pubmatic',[\r\n \"jquery\",\r\n \"logging\",\r\n \"utilities\"\r\n], function ($, logging, utilities) {\r\n \"use strict\";\r\n var _ModuleName = \"PubMatic\";\r\n\r\n var _config = {};\r\n\r\n var _initialized = false;\r\n var init = function (config) {\r\n if (!_initialized) {\r\n $.extend(_config, config);\r\n _initialized = true;\r\n }\r\n };\r\n\r\n var getBidDefinition = function (slot) {\r\n // make sure we're initialized\r\n if (!_initialized) { return; }\r\n\r\n ;\r\n\r\n var bids = [];\r\n if (_config.pubmaticAdSlots) {\r\n _config.pubmaticAdSlots.forEach(function (pubmaticAdSlot) {\r\n if ((slot.mobile === pubmaticAdSlot.mobile) // slot and pubmaticAdSlot mobile setting must match\r\n && utilities.isArrayInArray(slot.sizes, pubmaticAdSlot.size)) { // slot must contain eligible size for pubmaticAdSlot\r\n bids.push(\r\n $.extend({}, {\r\n bidder: _config.name,\r\n params: {\r\n publisherId: _config.publisherId,\r\n adSlot: pubmaticAdSlot.id\r\n }\r\n })\r\n );\r\n }\r\n });\r\n }\r\n\r\n return bids;\r\n };\r\n\r\n var getBidderSettings = function () {\r\n return {};\r\n };\r\n\r\n return {\r\n name: _ModuleName,\r\n init: init,\r\n getBidDefinition: getBidDefinition,\r\n getBidderSettings: getBidderSettings\r\n };\r\n});\n","/**\r\n * AdPrime - PrebidJS Adapter\r\n * Handles header bidding with Amazon\r\n * version 1.0.0\r\n * \r\n * Using Semantic Versioning, please update accordingly to keep files in sync across code bases\r\n * \r\n * Given a version number MAJOR.MINOR.PATCH, increment the:\r\n * 1. MAJOR version when you implement a full re-build of the architecture,\r\n * 2. MINOR version when you add functionality, and\r\n * 3. PATCH version when you implement bug fixes or make small tweaks to current functionality.\r\n */\r\ndefine('adprime',[\r\n \"jquery\",\r\n \"logging\",\r\n \"utilities\"\r\n], function ($, logging, utilities) {\r\n \"use strict\";\r\n var _ModuleName = \"AdPrime\";\r\n\r\n var _config = {};\r\n\r\n var _initialized = false;\r\n var init = function (config) {\r\n if (!_initialized) {\r\n $.extend(_config, config);\r\n _initialized = true;\r\n }\r\n };\r\n\r\n var getBidDefinition = function (slot) {\r\n // make sure we're initialized\r\n if (!_initialized) { return; }\r\n\r\n ;\r\n\r\n var bids = [];\r\n if (_config.adprimePlacements) {\r\n _config.adprimePlacements.forEach(function (adprimePlacement) {\r\n if (slot.vtier === adprimePlacement.vtier) { // slot must contain eligible vtier for adprimePlacement\r\n bids.push(\r\n $.extend({}, {\r\n bidder: _config.name,\r\n params: {\r\n placementId: adprimePlacement.id\r\n }\r\n })\r\n );\r\n }\r\n });\r\n }\r\n\r\n return bids;\r\n };\r\n\r\n var getBidderSettings = function () {\r\n return {};\r\n };\r\n\r\n return {\r\n name: _ModuleName,\r\n init: init,\r\n getBidDefinition: getBidDefinition,\r\n getBidderSettings: getBidderSettings\r\n };\r\n});\r\n\n","/**\r\n * DeepIntent - PrebidJS Adapter\r\n * Handles header bidding with Amazon\r\n * version 1.0.0\r\n * \r\n * Using Semantic Versioning, please update accordingly to keep files in sync across code bases\r\n * \r\n * Given a version number MAJOR.MINOR.PATCH, increment the:\r\n * 1. MAJOR version when you implement a full re-build of the architecture,\r\n * 2. MINOR version when you add functionality, and\r\n * 3. PATCH version when you implement bug fixes or make small tweaks to current functionality.\r\n */\r\ndefine('deepintent',[\r\n \"jquery\",\r\n \"logging\",\r\n \"utilities\"\r\n], function ($, logging, utilities) {\r\n \"use strict\";\r\n var _ModuleName = \"DeepIntent\";\r\n\r\n var _config = {};\r\n\r\n var _initialized = false;\r\n var init = function (config) {\r\n if (!_initialized) {\r\n $.extend(_config, config);\r\n _initialized = true;\r\n }\r\n };\r\n\r\n var getBidDefinition = function (slot) {\r\n // make sure we're initialized\r\n if (!_initialized) { return; }\r\n\r\n ;\r\n\r\n var bids = [];\r\n if (_config.deepintentAdSlots) {\r\n _config.deepintentAdSlots.forEach(function (deepintentAdSlot) {\r\n if ((slot.mobile === deepintentAdSlot.mobile) // slot and deepintentAdSlot mobile setting must match\r\n && utilities.isArrayInArray(slot.sizes, deepintentAdSlot.size)) { // slot must contain eligible size for deepintentAdSlot\r\n bids.push(\r\n $.extend({}, {\r\n bidder: _config.name,\r\n params: {\r\n tagId: deepintentAdSlot.id\r\n }\r\n })\r\n );\r\n }\r\n });\r\n }\r\n\r\n return bids;\r\n };\r\n\r\n var getBidderSettings = function () {\r\n return {};\r\n };\r\n\r\n return {\r\n name: _ModuleName,\r\n init: init,\r\n getBidDefinition: getBidDefinition,\r\n getBidderSettings: getBidderSettings\r\n };\r\n});\r\n\n","(function(root) {\ndefine(\"jqueryRadiosToSlider\", [\"jquery\"], function() {\n return (function() {\n(function ($) { var KNOB_WIDTH = 32; var KNOB_MARGIN = 28; var LEVEL_MARGIN = KNOB_MARGIN + 10; var LABEL_WIDTH = 44; var LEVEL_WIDTH = 22; function RadiosToSlider(element, options) { this.bearer = element; this.options = options; this.currentLevel = 0 } RadiosToSlider.prototype = { activate: function () { this.numOptions = this.bearer.find('input[type=radio]').length; this.fitContainer(); this.addBaseStyle(); this.addLevels(); this.addBar(); this.setSlider(); this.addInteraction() }, fitContainer: function () { if (this.options.fitContainer) { KNOB_MARGIN = (this.bearer.width() - KNOB_WIDTH) / (this.numOptions - 1) - KNOB_WIDTH; LEVEL_MARGIN = KNOB_MARGIN + 10 } }, addBaseStyle: function () { this.bearer.find('input[type=radio]').hide(); this.bearer.addClass(\"radios-to-slider\"); this.bearer.addClass(this.options.size); this.bearer.css('width', (this.numOptions * LEVEL_WIDTH) + (this.numOptions - 1) * LEVEL_MARGIN + 'px'); var label = 0; this.bearer.find('label').each(function () { var leftPos = KNOB_WIDTH / 2 - (LABEL_WIDTH / 2) + label * LEVEL_MARGIN + label * LEVEL_WIDTH; $(this).addClass('slider-label'); $(this).css('left', leftPos + 'px'); label++ }) }, addLevels: function () { var b = this.bearer; this.bearer.find('input[type=radio]').each(function () { var radioId = $(this).attr('id'); b.append(\"\") }); var level = 0; this.bearer.find('.slider-level').each(function () { var paddingLeft = parseInt(b.css('padding-left').replace('px', '')); $(this).css('left', paddingLeft + (level * LEVEL_MARGIN) + (level * LEVEL_WIDTH) + 'px'); level++ }) }, addBar: function () { this.bearer.append(\"\") }, setSlider: function () { var radio = 1; var slider = this; this.bearer.find('input[type=radio]').each(function () { var radioId = $(this).attr('id'); if ($(this).prop('checked')) { slider.bearer.find('.slider-bar').css('display', 'block'); slider.bearer.find('.slider-bar').width((radio * KNOB_WIDTH) + (radio - 1) * KNOB_MARGIN + 'px'); slider.currentLevel = radio } if (slider.options.animation) { slider.bearer.find('.slider-bar').addClass('transition-enabled') } radio++ }); var label = 0; this.bearer.find('.slider-level').each(function () { label++; if (label < slider.currentLevel) { $(this).show(); $(this).addClass('slider-lower-level') } else if (label == slider.currentLevel) { $(this).hide() } else { $(this).show(); $(this).removeClass('slider-lower-level') } }); var label = 0; this.bearer.find('.slider-label').each(function () { label++; if (label == slider.currentLevel) { $(this).addClass('slider-label-active') } else { $(this).removeClass('slider-label-active') } }) }, addInteraction: function () { var slider = this; this.bearer.find('.slider-level').click(function () { var radioId = $(this).attr('data-radio'); slider.bearer.find('#' + radioId).prop('checked', true); slider.setSlider() }); this.bearer.find('input[type=radio]').change(function () { slider.setSlider() }) } };$.fn.radiosToSlider=function(options){this.each(function(){options=$.extend({},$.fn.radiosToSlider.defaults,options);var slider=new RadiosToSlider($(this),options);slider.activate()})};$.fn.radiosToSlider.defaults={size:'medium',animation:true,fitContainer:true}})(jQuery);\n\n }).apply(root, arguments);\n});\n}(this));\n\n","/*! skrollr 0.6.30 (2015-08-12) | Alexander Prinzhorn - https://github.com/Prinzhorn/skrollr | Free to use under terms of MIT license */\r\n!function (a, b, c) { \"use strict\"; function d(c) { if (e = b.documentElement, f = b.body, T(), ha = this, c = c || {}, ma = c.constants || {}, c.easing) for (var d in c.easing) W[d] = c.easing[d]; ta = c.edgeStrategy || \"set\", ka = { beforerender: c.beforerender, render: c.render, keyframe: c.keyframe }, la = c.forceHeight !== !1, la && (Ka = c.scale || 1), na = c.mobileDeceleration || y, pa = c.smoothScrolling !== !1, qa = c.smoothScrollingDuration || A, ra = { targetTop: ha.getScrollTop() }, Sa = (c.mobileCheck || function () { return /Android|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent || navigator.vendor || a.opera) })(), Sa ? (ja = b.getElementById(c.skrollrBody || z), ja && ga(), X(), Ea(e, [s, v], [t])) : Ea(e, [s, u], [t]), ha.refresh(), wa(a, \"resize orientationchange\", function () { var a = e.clientWidth, b = e.clientHeight; (b !== Pa || a !== Oa) && (Pa = b, Oa = a, Qa = !0) }); var g = U(); return function h() { $(), va = g(h) }(), ha } var e, f, g = { get: function () { return ha }, init: function (a) { return ha || new d(a) }, VERSION: \"0.6.30\" }, h = Object.prototype.hasOwnProperty, i = a.Math, j = a.getComputedStyle, k = \"touchstart\", l = \"touchmove\", m = \"touchcancel\", n = \"touchend\", o = \"skrollable\", p = o + \"-before\", q = o + \"-between\", r = o + \"-after\", s = \"skrollr\", t = \"no-\" + s, u = s + \"-desktop\", v = s + \"-mobile\", w = \"linear\", x = 1e3, y = .004, z = \"skrollr-body\", A = 200, B = \"start\", C = \"end\", D = \"center\", E = \"bottom\", F = \"___skrollable_id\", G = /^(?:input|textarea|button|select)$/i, H = /^\\s+|\\s+$/g, I = /^data(?:-(_\\w+))?(?:-?(-?\\d*\\.?\\d+p?))?(?:-?(start|end|top|center|bottom))?(?:-?(top|center|bottom))?$/, J = /\\s*(@?[\\w\\-\\[\\]]+)\\s*:\\s*(.+?)\\s*(?:;|$)/gi, K = /^(@?[a-z\\-]+)\\[(\\w+)\\]$/, L = /-([a-z0-9_])/g, M = function (a, b) { return b.toUpperCase() }, N = /[\\-+]?[\\d]*\\.?[\\d]+/g, O = /\\{\\?\\}/g, P = /rgba?\\(\\s*-?\\d+\\s*,\\s*-?\\d+\\s*,\\s*-?\\d+/g, Q = /[a-z\\-]+-gradient/g, R = \"\", S = \"\", T = function () { var a = /^(?:O|Moz|webkit|ms)|(?:-(?:o|moz|webkit|ms)-)/; if (j) { var b = j(f, null); for (var c in b) if (R = c.match(a) || +c == c && b[c].match(a)) break; if (!R) return void (R = S = \"\"); R = R[0], \"-\" === R.slice(0, 1) ? (S = R, R = { \"-webkit-\": \"webkit\", \"-moz-\": \"Moz\", \"-ms-\": \"ms\", \"-o-\": \"O\" }[R]) : S = \"-\" + R.toLowerCase() + \"-\" } }, U = function () { var b = a.requestAnimationFrame || a[R.toLowerCase() + \"RequestAnimationFrame\"], c = Ha(); return (Sa || !b) && (b = function (b) { var d = Ha() - c, e = i.max(0, 1e3 / 60 - d); return a.setTimeout(function () { c = Ha(), b() }, e) }), b }, V = function () { var b = a.cancelAnimationFrame || a[R.toLowerCase() + \"CancelAnimationFrame\"]; return (Sa || !b) && (b = function (b) { return a.clearTimeout(b) }), b }, W = { begin: function () { return 0 }, end: function () { return 1 }, linear: function (a) { return a }, quadratic: function (a) { return a * a }, cubic: function (a) { return a * a * a }, swing: function (a) { return -i.cos(a * i.PI) / 2 + .5 }, sqrt: function (a) { return i.sqrt(a) }, outCubic: function (a) { return i.pow(a - 1, 3) + 1 }, bounce: function (a) { var b; if (.5083 >= a) b = 3; else if (.8489 >= a) b = 9; else if (.96208 >= a) b = 27; else { if (!(.99981 >= a)) return 1; b = 91 } return 1 - i.abs(3 * i.cos(a * b * 1.028) / b) } }; d.prototype.refresh = function (a) { var d, e, f = !1; for (a === c ? (f = !0, ia = [], Ra = 0, a = b.getElementsByTagName(\"*\")) : a.length === c && (a = [a]), d = 0, e = a.length; e > d; d++) { var g = a[d], h = g, i = [], j = pa, k = ta, l = !1; if (f && F in g && delete g[F], g.attributes) { for (var m = 0, n = g.attributes.length; n > m; m++) { var p = g.attributes[m]; if (\"data-anchor-target\" !== p.name) if (\"data-smooth-scrolling\" !== p.name) if (\"data-edge-strategy\" !== p.name) if (\"data-emit-events\" !== p.name) { var q = p.name.match(I); if (null !== q) { var r = { props: p.value, element: g, eventType: p.name.replace(L, M) }; i.push(r); var s = q[1]; s && (r.constant = s.substr(1)); var t = q[2]; /p$/.test(t) ? (r.isPercentage = !0, r.offset = (0 | t.slice(0, -1)) / 100) : r.offset = 0 | t; var u = q[3], v = q[4] || u; u && u !== B && u !== C ? (r.mode = \"relative\", r.anchors = [u, v]) : (r.mode = \"absolute\", u === C ? r.isEnd = !0 : r.isPercentage || (r.offset = r.offset * Ka)) } } else l = !0; else k = p.value; else j = \"off\" !== p.value; else if (h = b.querySelector(p.value), null === h) throw 'Unable to find anchor target \"' + p.value + '\"' } if (i.length) { var w, x, y; !f && F in g ? (y = g[F], w = ia[y].styleAttr, x = ia[y].classAttr) : (y = g[F] = Ra++, w = g.style.cssText, x = Da(g)), ia[y] = { element: g, styleAttr: w, classAttr: x, anchorTarget: h, keyFrames: i, smoothScrolling: j, edgeStrategy: k, emitEvents: l, lastFrameIndex: -1 }, Ea(g, [o], []) } } } for (Aa(), d = 0, e = a.length; e > d; d++) { var z = ia[a[d][F]]; z !== c && (_(z), ba(z)) } return ha }, d.prototype.relativeToAbsolute = function (a, b, c) { var d = e.clientHeight, f = a.getBoundingClientRect(), g = f.top, h = f.bottom - f.top; return b === E ? g -= d : b === D && (g -= d / 2), c === E ? g += h : c === D && (g += h / 2), g += ha.getScrollTop(), g + .5 | 0 }, d.prototype.animateTo = function (a, b) { b = b || {}; var d = Ha(), e = ha.getScrollTop(), f = b.duration === c ? x : b.duration; return oa = { startTop: e, topDiff: a - e, targetTop: a, duration: f, startTime: d, endTime: d + f, easing: W[b.easing || w], done: b.done }, oa.topDiff || (oa.done && oa.done.call(ha, !1), oa = c), ha }, d.prototype.stopAnimateTo = function () { oa && oa.done && oa.done.call(ha, !0), oa = c }, d.prototype.isAnimatingTo = function () { return !!oa }, d.prototype.isMobile = function () { return Sa }, d.prototype.setScrollTop = function (b, c) { return sa = c === !0, Sa ? Ta = i.min(i.max(b, 0), Ja) : a.scrollTo(0, b), ha }, d.prototype.getScrollTop = function () { return Sa ? Ta : a.pageYOffset || e.scrollTop || f.scrollTop || 0 }, d.prototype.getMaxScrollTop = function () { return Ja }, d.prototype.on = function (a, b) { return ka[a] = b, ha }, d.prototype.off = function (a) { return delete ka[a], ha }, d.prototype.destroy = function () { var a = V(); a(va), ya(), Ea(e, [t], [s, u, v]); for (var b = 0, d = ia.length; d > b; b++) fa(ia[b].element); e.style.overflow = f.style.overflow = \"\", e.style.height = f.style.height = \"\", ja && g.setStyle(ja, \"transform\", \"none\"), ha = c, ja = c, ka = c, la = c, Ja = 0, Ka = 1, ma = c, na = c, La = \"down\", Ma = -1, Oa = 0, Pa = 0, Qa = !1, oa = c, pa = c, qa = c, ra = c, sa = c, Ra = 0, ta = c, Sa = !1, Ta = 0, ua = c }; var X = function () { var d, g, h, j, o, p, q, r, s, t, u, v; wa(e, [k, l, m, n].join(\" \"), function (a) { var e = a.changedTouches[0]; for (j = a.target; 3 === j.nodeType;) j = j.parentNode; switch (o = e.clientY, p = e.clientX, t = a.timeStamp, G.test(j.tagName) || a.preventDefault(), a.type) { case k: d && d.blur(), ha.stopAnimateTo(), d = j, g = q = o, h = p, s = t; break; case l: G.test(j.tagName) && b.activeElement !== j && a.preventDefault(), r = o - q, v = t - u, ha.setScrollTop(Ta - r, !0), q = o, u = t; break; default: case m: case n: var f = g - o, w = h - p, x = w * w + f * f; if (49 > x) { if (!G.test(d.tagName)) { d.focus(); var y = b.createEvent(\"MouseEvents\"); y.initMouseEvent(\"click\", !0, !0, a.view, 1, e.screenX, e.screenY, e.clientX, e.clientY, a.ctrlKey, a.altKey, a.shiftKey, a.metaKey, 0, null), d.dispatchEvent(y) } return } d = c; var z = r / v; z = i.max(i.min(z, 3), -3); var A = i.abs(z / na), B = z * A + .5 * na * A * A, C = ha.getScrollTop() - B, D = 0; C > Ja ? (D = (Ja - C) / B, C = Ja) : 0 > C && (D = -C / B, C = 0), A *= 1 - D, ha.animateTo(C + .5 | 0, { easing: \"outCubic\", duration: A }) } }), a.scrollTo(0, 0), e.style.overflow = f.style.overflow = \"hidden\" }, Y = function () { var a, b, c, d, f, g, h, j, k, l, m, n = e.clientHeight, o = Ba(); for (j = 0, k = ia.length; k > j; j++) for (a = ia[j], b = a.element, c = a.anchorTarget, d = a.keyFrames, f = 0, g = d.length; g > f; f++) h = d[f], l = h.offset, m = o[h.constant] || 0, h.frame = l, h.isPercentage && (l *= n, h.frame = l), \"relative\" === h.mode && (fa(b), h.frame = ha.relativeToAbsolute(c, h.anchors[0], h.anchors[1]) - l, fa(b, !0)), h.frame += m, la && !h.isEnd && h.frame > Ja && (Ja = h.frame); for (Ja = i.max(Ja, Ca()), j = 0, k = ia.length; k > j; j++) { for (a = ia[j], d = a.keyFrames, f = 0, g = d.length; g > f; f++) h = d[f], m = o[h.constant] || 0, h.isEnd && (h.frame = Ja - h.offset + m); a.keyFrames.sort(Ia) } }, Z = function (a, b) { for (var c = 0, d = ia.length; d > c; c++) { var e, f, i = ia[c], j = i.element, k = i.smoothScrolling ? a : b, l = i.keyFrames, m = l.length, n = l[0], s = l[l.length - 1], t = k < n.frame, u = k > s.frame, v = t ? n : s, w = i.emitEvents, x = i.lastFrameIndex; if (t || u) { if (t && -1 === i.edge || u && 1 === i.edge) continue; switch (t ? (Ea(j, [p], [r, q]), w && x > -1 && (za(j, n.eventType, La), i.lastFrameIndex = -1)) : (Ea(j, [r], [p, q]), w && m > x && (za(j, s.eventType, La), i.lastFrameIndex = m)), i.edge = t ? -1 : 1, i.edgeStrategy) { case \"reset\": fa(j); continue; case \"ease\": k = v.frame; break; default: case \"set\": var y = v.props; for (e in y) h.call(y, e) && (f = ea(y[e].value), 0 === e.indexOf(\"@\") ? j.setAttribute(e.substr(1), f) : g.setStyle(j, e, f)); continue } } else 0 !== i.edge && (Ea(j, [o, q], [p, r]), i.edge = 0); for (var z = 0; m - 1 > z; z++) if (k >= l[z].frame && k <= l[z + 1].frame) { var A = l[z], B = l[z + 1]; for (e in A.props) if (h.call(A.props, e)) { var C = (k - A.frame) / (B.frame - A.frame); C = A.props[e].easing(C), f = da(A.props[e].value, B.props[e].value, C), f = ea(f), 0 === e.indexOf(\"@\") ? j.setAttribute(e.substr(1), f) : g.setStyle(j, e, f) } w && x !== z && (\"down\" === La ? za(j, A.eventType, La) : za(j, B.eventType, La), i.lastFrameIndex = z); break } } }, $ = function () { Qa && (Qa = !1, Aa()); var a, b, d = ha.getScrollTop(), e = Ha(); if (oa) e >= oa.endTime ? (d = oa.targetTop, a = oa.done, oa = c) : (b = oa.easing((e - oa.startTime) / oa.duration), d = oa.startTop + b * oa.topDiff | 0), ha.setScrollTop(d, !0); else if (!sa) { var f = ra.targetTop - d; f && (ra = { startTop: Ma, topDiff: d - Ma, targetTop: d, startTime: Na, endTime: Na + qa }), e <= ra.endTime && (b = W.sqrt((e - ra.startTime) / qa), d = ra.startTop + b * ra.topDiff | 0) } if (sa || Ma !== d) { La = d > Ma ? \"down\" : Ma > d ? \"up\" : La, sa = !1; var h = { curTop: d, lastTop: Ma, maxTop: Ja, direction: La }, i = ka.beforerender && ka.beforerender.call(ha, h); i !== !1 && (Z(d, ha.getScrollTop()), Sa && ja && g.setStyle(ja, \"transform\", \"translate(0, \" + -Ta + \"px) \" + ua), Ma = d, ka.render && ka.render.call(ha, h)), a && a.call(ha, !1) } Na = e }, _ = function (a) { for (var b = 0, c = a.keyFrames.length; c > b; b++) { for (var d, e, f, g, h = a.keyFrames[b], i = {}; null !== (g = J.exec(h.props)) ;) f = g[1], e = g[2], d = f.match(K), null !== d ? (f = d[1], d = d[2]) : d = w, e = e.indexOf(\"!\") ? aa(e) : [e.slice(1)], i[f] = { value: e, easing: W[d] }; h.props = i } }, aa = function (a) { var b = []; return P.lastIndex = 0, a = a.replace(P, function (a) { return a.replace(N, function (a) { return a / 255 * 100 + \"%\" }) }), S && (Q.lastIndex = 0, a = a.replace(Q, function (a) { return S + a })), a = a.replace(N, function (a) { return b.push(+a), \"{?}\" }), b.unshift(a), b }, ba = function (a) { var b, c, d = {}; for (b = 0, c = a.keyFrames.length; c > b; b++) ca(a.keyFrames[b], d); for (d = {}, b = a.keyFrames.length - 1; b >= 0; b--) ca(a.keyFrames[b], d) }, ca = function (a, b) { var c; for (c in b) h.call(a.props, c) || (a.props[c] = b[c]); for (c in a.props) b[c] = a.props[c] }, da = function (a, b, c) { var d, e = a.length; if (e !== b.length) throw \"Can't interpolate between \\\"\" + a[0] + '\" and \"' + b[0] + '\"'; var f = [a[0]]; for (d = 1; e > d; d++) f[d] = a[d] + (b[d] - a[d]) * c; return f }, ea = function (a) { var b = 1; return O.lastIndex = 0, a[0].replace(O, function () { return a[b++] }) }, fa = function (a, b) { a = [].concat(a); for (var c, d, e = 0, f = a.length; f > e; e++) d = a[e], c = ia[d[F]], c && (b ? (d.style.cssText = c.dirtyStyleAttr, Ea(d, c.dirtyClassAttr)) : (c.dirtyStyleAttr = d.style.cssText, c.dirtyClassAttr = Da(d), d.style.cssText = c.styleAttr, Ea(d, c.classAttr))) }, ga = function () { ua = \"translateZ(0)\", g.setStyle(ja, \"transform\", ua); var a = j(ja), b = a.getPropertyValue(\"transform\"), c = a.getPropertyValue(S + \"transform\"), d = b && \"none\" !== b || c && \"none\" !== c; d || (ua = \"\") }; g.setStyle = function (a, b, c) { var d = a.style; if (b = b.replace(L, M).replace(\"-\", \"\"), \"zIndex\" === b) isNaN(c) ? d[b] = c : d[b] = \"\" + (0 | c); else if (\"float\" === b) d.styleFloat = d.cssFloat = c; else try { R && (d[R + b.slice(0, 1).toUpperCase() + b.slice(1)] = c), d[b] = c } catch (e) { } }; var ha, ia, ja, ka, la, ma, na, oa, pa, qa, ra, sa, ta, ua, va, wa = g.addEvent = function (b, c, d) { var e = function (b) { return b = b || a.event, b.target || (b.target = b.srcElement), b.preventDefault || (b.preventDefault = function () { b.returnValue = !1, b.defaultPrevented = !0 }), d.call(this, b) }; c = c.split(\" \"); for (var f, g = 0, h = c.length; h > g; g++) f = c[g], b.addEventListener ? b.addEventListener(f, d, !1) : b.attachEvent(\"on\" + f, e), Ua.push({ element: b, name: f, listener: d }) }, xa = g.removeEvent = function (a, b, c) { b = b.split(\" \"); for (var d = 0, e = b.length; e > d; d++) a.removeEventListener ? a.removeEventListener(b[d], c, !1) : a.detachEvent(\"on\" + b[d], c) }, ya = function () { for (var a, b = 0, c = Ua.length; c > b; b++) a = Ua[b], xa(a.element, a.name, a.listener); Ua = [] }, za = function (a, b, c) { ka.keyframe && ka.keyframe.call(ha, a, b, c) }, Aa = function () { var a = ha.getScrollTop(); Ja = 0, la && !Sa && (f.style.height = \"\"), Y(), la && !Sa && (f.style.height = Ja + e.clientHeight + \"px\"), Sa ? ha.setScrollTop(i.min(ha.getScrollTop(), Ja)) : ha.setScrollTop(a, !0), sa = !0 }, Ba = function () { var a, b, c = e.clientHeight, d = {}; for (a in ma) b = ma[a], \"function\" == typeof b ? b = b.call(ha) : /p$/.test(b) && (b = b.slice(0, -1) / 100 * c), d[a] = b; return d }, Ca = function () { var a, b = 0; return ja && (b = i.max(ja.offsetHeight, ja.scrollHeight)), a = i.max(b, f.scrollHeight, f.offsetHeight, e.scrollHeight, e.offsetHeight, e.clientHeight), a - e.clientHeight }, Da = function (b) { var c = \"className\"; return a.SVGElement && b instanceof a.SVGElement && (b = b[c], c = \"baseVal\"), b[c] }, Ea = function (b, d, e) { var f = \"className\"; if (a.SVGElement && b instanceof a.SVGElement && (b = b[f], f = \"baseVal\"), e === c) return void (b[f] = d); for (var g = b[f], h = 0, i = e.length; i > h; h++) g = Ga(g).replace(Ga(e[h]), \" \"); g = Fa(g); for (var j = 0, k = d.length; k > j; j++) -1 === Ga(g).indexOf(Ga(d[j])) && (g += \" \" + d[j]); b[f] = Fa(g) }, Fa = function (a) { return a.replace(H, \"\") }, Ga = function (a) { return \" \" + a + \" \" }, Ha = Date.now || function () { return +new Date }, Ia = function (a, b) { return a.frame - b.frame }, Ja = 0, Ka = 1, La = \"down\", Ma = -1, Na = Ha(), Oa = 0, Pa = 0, Qa = !1, Ra = 0, Sa = !1, Ta = 0, Ua = []; \"function\" == typeof define && define.amd ? define('skrollr',[], function () { return g }) : \"undefined\" != typeof module && module.exports ? module.exports = g : a.skrollr = g }(window, document);\n","(function(root) {\ndefine(\"customScrollbar\", [\"jquery\"], function() {\n return (function() {\n/*\r\n Had to change function name 'define' to 'defineCustom'\r\n -Ajo\r\n*/\r\n!function (e) { \"function\" == typeof defineCustom && defineCustom.amd ? defineCustom([\"jquery\"], e) : \"object\" == typeof exports ? module.exports = e : e(jQuery) }(function (e) { var t, i, n = [\"wheel\", \"mousewheel\", \"DOMMouseScroll\", \"MozMousePixelScroll\"], o = \"onwheel\" in document || document.documentMode >= 9 ? [\"wheel\"] : [\"mousewheel\", \"DomMouseScroll\", \"MozMousePixelScroll\"], l = Array.prototype.slice; if (e.event.fixHooks) for (var s = n.length; s;) e.event.fixHooks[n[--s]] = e.event.mouseHooks; var a = e.event.special.mousewheel = { version: \"3.1.12\", setup: function () { if (this.addEventListener) for (var t = o.length; t;) this.addEventListener(o[--t], h, !1); else this.onmousewheel = h; e.data(this, \"mousewheel-line-height\", a.getLineHeight(this)), e.data(this, \"mousewheel-page-height\", a.getPageHeight(this)) }, teardown: function () { if (this.removeEventListener) for (var t = o.length; t;) this.removeEventListener(o[--t], h, !1); else this.onmousewheel = null; e.removeData(this, \"mousewheel-line-height\"), e.removeData(this, \"mousewheel-page-height\") }, getLineHeight: function (t) { var i = e(t), n = i[\"offsetParent\" in e.fn ? \"offsetParent\" : \"parent\"](); return n.length || (n = e(\"body\")), parseInt(n.css(\"fontSize\"), 10) || parseInt(i.css(\"fontSize\"), 10) || 16 }, getPageHeight: function (t) { return e(t).height() }, settings: { adjustOldDeltas: !0, normalizeOffset: !0 } }; function h(n) { var o, s = n || window.event, h = l.call(arguments, 1), f = 0, d = 0, m = 0, c = 0, g = 0; if ((n = e.event.fix(s)).type = \"mousewheel\", \"detail\" in s && (m = -1 * s.detail), \"wheelDelta\" in s && (m = s.wheelDelta), \"wheelDeltaY\" in s && (m = s.wheelDeltaY), \"wheelDeltaX\" in s && (d = -1 * s.wheelDeltaX), \"axis\" in s && s.axis === s.HORIZONTAL_AXIS && (d = -1 * m, m = 0), f = 0 === m ? d : m, \"deltaY\" in s && (f = m = -1 * s.deltaY), \"deltaX\" in s && (d = s.deltaX, 0 === m && (f = -1 * d)), 0 !== m || 0 !== d) { if (1 === s.deltaMode) { var w = e.data(this, \"mousewheel-line-height\"); f *= w, m *= w, d *= w } else if (2 === s.deltaMode) { var v = e.data(this, \"mousewheel-page-height\"); f *= v, m *= v, d *= v } if (o = Math.max(Math.abs(m), Math.abs(d)), (!i || o < i) && (i = o, r(s, o) && (i /= 40)), r(s, o) && (f /= 40, d /= 40, m /= 40), f = Math[f >= 1 ? \"floor\" : \"ceil\"](f / i), d = Math[d >= 1 ? \"floor\" : \"ceil\"](d / i), m = Math[m >= 1 ? \"floor\" : \"ceil\"](m / i), a.settings.normalizeOffset && this.getBoundingClientRect) { var p = this.getBoundingClientRect(); c = n.clientX - p.left, g = n.clientY - p.top } return n.deltaX = d, n.deltaY = m, n.deltaFactor = i, n.offsetX = c, n.offsetY = g, n.deltaMode = 0, h.unshift(n, f, d, m), t && clearTimeout(t), t = setTimeout(u, 200), (e.event.dispatch || e.event.handle).apply(this, h) } } function u() { i = null } function r(e, t) { return a.settings.adjustOldDeltas && \"mousewheel\" === e.type && t % 120 == 0 } e.fn.extend({ mousewheel: function (e) { return e ? this.bind(\"mousewheel\", e) : this.trigger(\"mousewheel\") }, unmousewheel: function (e) { return this.unbind(\"mousewheel\", e) } }) });\r\n/* == malihu jquery custom scrollbar plugin == Version: 3.1.5, License: MIT License (MIT) */\r\n!function (e) { \"function\" == typeof defineCustom && defineCustom.amd ? defineCustom([\"jquery\"], e) : \"undefined\" != typeof module && module.exports ? module.exports = e : e(jQuery, window, document) }(function (e) {\r\n !function (t) { var o = \"function\" == typeof defineCustom && defineCustom.amd, a = \"undefined\" != typeof module && module.exports, n = \"https:\" == document.location.protocol ? \"https:\" : \"http:\", i = \"cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js\"; o || (a ? require(\"jquery-mousewheel\")(e) : e.event.special.mousewheel || e(\"head\").append(decodeURI(\"%3Cscript src=\" + n + \"//\" + i + \"%3E%3C/script%3E\"))), t() }(function () {\r\n var t, o = \"mCustomScrollbar\", a = \"mCS\", n = \".mCustomScrollbar\", i = { setTop: 0, setLeft: 0, axis: \"y\", scrollbarPosition: \"inside\", scrollInertia: 950, autoDraggerLength: !0, alwaysShowScrollbar: 0, snapOffset: 0, mouseWheel: { enable: !0, scrollAmount: \"auto\", axis: \"y\", deltaFactor: \"auto\", disableOver: [\"select\", \"option\", \"keygen\", \"datalist\", \"textarea\"] }, scrollButtons: { scrollType: \"stepless\", scrollAmount: \"auto\" }, keyboard: { enable: !0, scrollType: \"stepless\", scrollAmount: \"auto\" }, contentTouchScroll: 25, documentTouchScroll: !0, advanced: { autoScrollOnFocus: \"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']\", updateOnContentResize: !0, updateOnImageLoad: \"auto\", autoUpdateTimeout: 60 }, theme: \"light\", callbacks: { onTotalScrollOffset: 0, onTotalScrollBackOffset: 0, alwaysTriggerOffsets: !0 } }, r = 0, l = {}, s = window.attachEvent && !window.addEventListener ? 1 : 0, c = !1, d = [\"mCSB_dragger_onDrag\", \"mCSB_scrollTools_onDrag\", \"mCS_img_loaded\", \"mCS_disabled\", \"mCS_destroyed\", \"mCS_no_scrollbar\", \"mCS-autoHide\", \"mCS-dir-rtl\", \"mCS_no_scrollbar_y\", \"mCS_no_scrollbar_x\", \"mCS_y_hidden\", \"mCS_x_hidden\", \"mCSB_draggerContainer\", \"mCSB_buttonUp\", \"mCSB_buttonDown\", \"mCSB_buttonLeft\", \"mCSB_buttonRight\"], u = { init: function (t) { var t = e.extend(!0, {}, i, t), o = f.call(this); if (t.live) { var s = t.liveSelector || this.selector || n, c = e(s); if (\"off\" === t.live) return void m(s); l[s] = setTimeout(function () { c.mCustomScrollbar(t), \"once\" === t.live && c.length && m(s) }, 500) } else m(s); return t.setWidth = t.set_width ? t.set_width : t.setWidth, t.setHeight = t.set_height ? t.set_height : t.setHeight, t.axis = t.horizontalScroll ? \"x\" : p(t.axis), t.scrollInertia = t.scrollInertia > 0 && t.scrollInertia < 17 ? 17 : t.scrollInertia, \"object\" != typeof t.mouseWheel && 1 == t.mouseWheel && (t.mouseWheel = { enable: !0, scrollAmount: \"auto\", axis: \"y\", preventDefault: !1, deltaFactor: \"auto\", normalizeDelta: !1, invert: !1 }), t.mouseWheel.scrollAmount = t.mouseWheelPixels ? t.mouseWheelPixels : t.mouseWheel.scrollAmount, t.mouseWheel.normalizeDelta = t.advanced.normalizeMouseWheelDelta ? t.advanced.normalizeMouseWheelDelta : t.mouseWheel.normalizeDelta, t.scrollButtons.scrollType = g(t.scrollButtons.scrollType), h(t), e(o).each(function () { var o = e(this); if (!o.data(a)) { o.data(a, { idx: ++r, opt: t, scrollRatio: { y: null, x: null }, overflowed: null, contentReset: { y: null, x: null }, bindEvents: !1, tweenRunning: !1, sequential: {}, langDir: o.css(\"direction\"), cbOffsets: null, trigger: null, poll: { size: { o: 0, n: 0 }, img: { o: 0, n: 0 }, change: { o: 0, n: 0 } } }); var n = o.data(a), i = n.opt, l = o.data(\"mcs-axis\"), s = o.data(\"mcs-scrollbar-position\"), c = o.data(\"mcs-theme\"); l && (i.axis = l), s && (i.scrollbarPosition = s), c && (i.theme = c, h(i)), v.call(this), n && i.callbacks.onCreate && \"function\" == typeof i.callbacks.onCreate && i.callbacks.onCreate.call(this), e(\"#mCSB_\" + n.idx + \"_container img:not(.\" + d[2] + \")\").addClass(d[2]), u.update.call(null, o) } }) }, update: function (t, o) { var n = t || f.call(this); return e(n).each(function () { var t = e(this); if (t.data(a)) { var n = t.data(a), i = n.opt, r = e(\"#mCSB_\" + n.idx + \"_container\"), l = e(\"#mCSB_\" + n.idx), s = [e(\"#mCSB_\" + n.idx + \"_dragger_vertical\"), e(\"#mCSB_\" + n.idx + \"_dragger_horizontal\")]; if (!r.length) return; n.tweenRunning && Q(t), o && n && i.callbacks.onBeforeUpdate && \"function\" == typeof i.callbacks.onBeforeUpdate && i.callbacks.onBeforeUpdate.call(this), t.hasClass(d[3]) && t.removeClass(d[3]), t.hasClass(d[4]) && t.removeClass(d[4]), l.css(\"max-height\", \"none\"), l.height() !== t.height() && l.css(\"max-height\", t.height()), _.call(this), \"y\" === i.axis || i.advanced.autoExpandHorizontalScroll || r.css(\"width\", x(r)), n.overflowed = y.call(this), M.call(this), i.autoDraggerLength && S.call(this), b.call(this), T.call(this); var c = [Math.abs(r[0].offsetTop), Math.abs(r[0].offsetLeft)]; \"x\" !== i.axis && (n.overflowed[0] ? s[0].height() > s[0].parent().height() ? B.call(this) : (G(t, c[0].toString(), { dir: \"y\", dur: 0, overwrite: \"none\" }), n.contentReset.y = null) : (B.call(this), \"y\" === i.axis ? k.call(this) : \"yx\" === i.axis && n.overflowed[1] && G(t, c[1].toString(), { dir: \"x\", dur: 0, overwrite: \"none\" }))), \"y\" !== i.axis && (n.overflowed[1] ? s[1].width() > s[1].parent().width() ? B.call(this) : (G(t, c[1].toString(), { dir: \"x\", dur: 0, overwrite: \"none\" }), n.contentReset.x = null) : (B.call(this), \"x\" === i.axis ? k.call(this) : \"yx\" === i.axis && n.overflowed[0] && G(t, c[0].toString(), { dir: \"y\", dur: 0, overwrite: \"none\" }))), o && n && (2 === o && i.callbacks.onImageLoad && \"function\" == typeof i.callbacks.onImageLoad ? i.callbacks.onImageLoad.call(this) : 3 === o && i.callbacks.onSelectorChange && \"function\" == typeof i.callbacks.onSelectorChange ? i.callbacks.onSelectorChange.call(this) : i.callbacks.onUpdate && \"function\" == typeof i.callbacks.onUpdate && i.callbacks.onUpdate.call(this)), N.call(this) } }) }, scrollTo: function (t, o) { if (\"undefined\" != typeof t && null != t) { var n = f.call(this); return e(n).each(function () { var n = e(this); if (n.data(a)) { var i = n.data(a), r = i.opt, l = { trigger: \"external\", scrollInertia: r.scrollInertia, scrollEasing: \"mcsEaseInOut\", moveDragger: !1, timeout: 60, callbacks: !0, onStart: !0, onUpdate: !0, onComplete: !0 }, s = e.extend(!0, {}, l, o), c = Y.call(this, t), d = s.scrollInertia > 0 && s.scrollInertia < 17 ? 17 : s.scrollInertia; c[0] = X.call(this, c[0], \"y\"), c[1] = X.call(this, c[1], \"x\"), s.moveDragger && (c[0] *= i.scrollRatio.y, c[1] *= i.scrollRatio.x), s.dur = ne() ? 0 : d, setTimeout(function () { null !== c[0] && \"undefined\" != typeof c[0] && \"x\" !== r.axis && i.overflowed[0] && (s.dir = \"y\", s.overwrite = \"all\", G(n, c[0].toString(), s)), null !== c[1] && \"undefined\" != typeof c[1] && \"y\" !== r.axis && i.overflowed[1] && (s.dir = \"x\", s.overwrite = \"none\", G(n, c[1].toString(), s)) }, s.timeout) } }) } }, stop: function () { var t = f.call(this); return e(t).each(function () { var t = e(this); t.data(a) && Q(t) }) }, disable: function (t) { var o = f.call(this); return e(o).each(function () { var o = e(this); if (o.data(a)) { o.data(a); N.call(this, \"remove\"), k.call(this), t && B.call(this), M.call(this, !0), o.addClass(d[3]) } }) }, destroy: function () { var t = f.call(this); return e(t).each(function () { var n = e(this); if (n.data(a)) { var i = n.data(a), r = i.opt, l = e(\"#mCSB_\" + i.idx), s = e(\"#mCSB_\" + i.idx + \"_container\"), c = e(\".mCSB_\" + i.idx + \"_scrollbar\"); r.live && m(r.liveSelector || e(t).selector), N.call(this, \"remove\"), k.call(this), B.call(this), n.removeData(a), $(this, \"mcs\"), c.remove(), s.find(\"img.\" + d[2]).removeClass(d[2]), l.replaceWith(s.contents()), n.removeClass(o + \" _\" + a + \"_\" + i.idx + \" \" + d[6] + \" \" + d[7] + \" \" + d[5] + \" \" + d[3]).addClass(d[4]) } }) } }, f = function () { return \"object\" != typeof e(this) || e(this).length < 1 ? n : this }, h = function (t) { var o = [\"rounded\", \"rounded-dark\", \"rounded-dots\", \"rounded-dots-dark\"], a = [\"rounded-dots\", \"rounded-dots-dark\", \"3d\", \"3d-dark\", \"3d-thick\", \"3d-thick-dark\", \"inset\", \"inset-dark\", \"inset-2\", \"inset-2-dark\", \"inset-3\", \"inset-3-dark\"], n = [\"minimal\", \"minimal-dark\"], i = [\"minimal\", \"minimal-dark\"], r = [\"minimal\", \"minimal-dark\"]; t.autoDraggerLength = e.inArray(t.theme, o) > -1 ? !1 : t.autoDraggerLength, t.autoExpandScrollbar = e.inArray(t.theme, a) > -1 ? !1 : t.autoExpandScrollbar, t.scrollButtons.enable = e.inArray(t.theme, n) > -1 ? !1 : t.scrollButtons.enable, t.autoHideScrollbar = e.inArray(t.theme, i) > -1 ? !0 : t.autoHideScrollbar, t.scrollbarPosition = e.inArray(t.theme, r) > -1 ? \"outside\" : t.scrollbarPosition }, m = function (e) { l[e] && (clearTimeout(l[e]), $(l, e)) }, p = function (e) { return \"yx\" === e || \"xy\" === e || \"auto\" === e ? \"yx\" : \"x\" === e || \"horizontal\" === e ? \"x\" : \"y\" }, g = function (e) { return \"stepped\" === e || \"pixels\" === e || \"step\" === e || \"click\" === e ? \"stepped\" : \"stepless\" }, v = function () { var t = e(this), n = t.data(a), i = n.opt, r = i.autoExpandScrollbar ? \" \" + d[1] + \"_expand\" : \"\", l = [\"\", \"\"], s = \"yx\" === i.axis ? \"mCSB_vertical_horizontal\" : \"x\" === i.axis ? \"mCSB_horizontal\" : \"mCSB_vertical\", c = \"yx\" === i.axis ? l[0] + l[1] : \"x\" === i.axis ? l[1] : l[0], u = \"yx\" === i.axis ? \"\" : \"\", f = i.autoHideScrollbar ? \" \" + d[6] : \"\", h = \"x\" !== i.axis && \"rtl\" === n.langDir ? \" \" + d[7] : \"\"; i.setWidth && t.css(\"width\", i.setWidth), i.setHeight && t.css(\"height\", i.setHeight), i.setLeft = \"y\" !== i.axis && \"rtl\" === n.langDir ? \"989999px\" : i.setLeft, t.addClass(o + \" _\" + a + \"_\" + n.idx + f + h).wrapInner(\"\"); var m = e(\"#mCSB_\" + n.idx), p = e(\"#mCSB_\" + n.idx + \"_container\"); \"y\" === i.axis || i.advanced.autoExpandHorizontalScroll || p.css(\"width\", x(p)), \"outside\" === i.scrollbarPosition ? (\"static\" === t.css(\"position\") && t.css(\"position\", \"relative\"), t.css(\"overflow\", \"visible\"), m.addClass(\"mCSB_outside\").after(c)) : (m.addClass(\"mCSB_inside\").append(c), p.wrap(u)), w.call(this); var g = [e(\"#mCSB_\" + n.idx + \"_dragger_vertical\"), e(\"#mCSB_\" + n.idx + \"_dragger_horizontal\")]; g[0].css(\"min-height\", g[0].height()), g[1].css(\"min-width\", g[1].width()) }, x = function (t) { var o = [t[0].scrollWidth, Math.max.apply(Math, t.children().map(function () { return e(this).outerWidth(!0) }).get())], a = t.parent().width(); return o[0] > a ? o[0] : o[1] > a ? o[1] : \"100%\" }, _ = function () { var t = e(this), o = t.data(a), n = o.opt, i = e(\"#mCSB_\" + o.idx + \"_container\"); if (n.advanced.autoExpandHorizontalScroll && \"y\" !== n.axis) { i.css({ width: \"auto\", \"min-width\": 0, \"overflow-x\": \"scroll\" }); var r = Math.ceil(i[0].scrollWidth); 3 === n.advanced.autoExpandHorizontalScroll || 2 !== n.advanced.autoExpandHorizontalScroll && r > i.parent().width() ? i.css({ width: r, \"min-width\": \"100%\", \"overflow-x\": \"inherit\" }) : i.css({ \"overflow-x\": \"inherit\", position: \"absolute\" }).wrap(\"\").css({ width: Math.ceil(i[0].getBoundingClientRect().right + .4) - Math.floor(i[0].getBoundingClientRect().left), \"min-width\": \"100%\", position: \"relative\" }).unwrap() } }, w = function () { var t = e(this), o = t.data(a), n = o.opt, i = e(\".mCSB_\" + o.idx + \"_scrollbar:first\"), r = oe(n.scrollButtons.tabindex) ? \"tabindex='\" + n.scrollButtons.tabindex + \"'\" : \"\", l = [\"\", \"\", \"\", \"\"], s = [\"x\" === n.axis ? l[2] : l[0], \"x\" === n.axis ? l[3] : l[1], l[2], l[3]]; n.scrollButtons.enable && i.prepend(s[0]).append(s[1]).next(\".mCSB_scrollTools\").prepend(s[2]).append(s[3]) }, S = function () { var t = e(this), o = t.data(a), n = e(\"#mCSB_\" + o.idx), i = e(\"#mCSB_\" + o.idx + \"_container\"), r = [e(\"#mCSB_\" + o.idx + \"_dragger_vertical\"), e(\"#mCSB_\" + o.idx + \"_dragger_horizontal\")], l = [n.height() / i.outerHeight(!1), n.width() / i.outerWidth(!1)], c = [parseInt(r[0].css(\"min-height\")), Math.round(l[0] * r[0].parent().height()), parseInt(r[1].css(\"min-width\")), Math.round(l[1] * r[1].parent().width())], d = s && c[1] < c[0] ? c[0] : c[1], u = s && c[3] < c[2] ? c[2] : c[3]; r[0].css({ height: d, \"max-height\": r[0].parent().height() - 10 }).find(\".mCSB_dragger_bar\").css({ \"line-height\": c[0] + \"px\" }), r[1].css({ width: u, \"max-width\": r[1].parent().width() - 10 }) }, b = function () { var t = e(this), o = t.data(a), n = e(\"#mCSB_\" + o.idx), i = e(\"#mCSB_\" + o.idx + \"_container\"), r = [e(\"#mCSB_\" + o.idx + \"_dragger_vertical\"), e(\"#mCSB_\" + o.idx + \"_dragger_horizontal\")], l = [i.outerHeight(!1) - n.height(), i.outerWidth(!1) - n.width()], s = [l[0] / (r[0].parent().height() - r[0].height()), l[1] / (r[1].parent().width() - r[1].width())]; o.scrollRatio = { y: s[0], x: s[1] } }, C = function (e, t, o) { var a = o ? d[0] + \"_expanded\" : \"\", n = e.closest(\".mCSB_scrollTools\"); \"active\" === t ? (e.toggleClass(d[0] + \" \" + a), n.toggleClass(d[1]), e[0]._draggable = e[0]._draggable ? 0 : 1) : e[0]._draggable || (\"hide\" === t ? (e.removeClass(d[0]), n.removeClass(d[1])) : (e.addClass(d[0]), n.addClass(d[1]))) }, y = function () { var t = e(this), o = t.data(a), n = e(\"#mCSB_\" + o.idx), i = e(\"#mCSB_\" + o.idx + \"_container\"), r = null == o.overflowed ? i.height() : i.outerHeight(!1), l = null == o.overflowed ? i.width() : i.outerWidth(!1), s = i[0].scrollHeight, c = i[0].scrollWidth; return s > r && (r = s), c > l && (l = c), [r > n.height(), l > n.width()] }, B = function () { var t = e(this), o = t.data(a), n = o.opt, i = e(\"#mCSB_\" + o.idx), r = e(\"#mCSB_\" + o.idx + \"_container\"), l = [e(\"#mCSB_\" + o.idx + \"_dragger_vertical\"), e(\"#mCSB_\" + o.idx + \"_dragger_horizontal\")]; if (Q(t), (\"x\" !== n.axis && !o.overflowed[0] || \"y\" === n.axis && o.overflowed[0]) && (l[0].add(r).css(\"top\", 0), G(t, \"_resetY\")), \"y\" !== n.axis && !o.overflowed[1] || \"x\" === n.axis && o.overflowed[1]) { var s = dx = 0; \"rtl\" === o.langDir && (s = i.width() - r.outerWidth(!1), dx = Math.abs(s / o.scrollRatio.x)), r.css(\"left\", s), l[1].css(\"left\", dx), G(t, \"_resetX\") } }, T = function () { function t() { r = setTimeout(function () { e.event.special.mousewheel ? (clearTimeout(r), W.call(o[0])) : t() }, 100) } var o = e(this), n = o.data(a), i = n.opt; if (!n.bindEvents) { if (I.call(this), i.contentTouchScroll && D.call(this), E.call(this), i.mouseWheel.enable) { var r; t() } P.call(this), U.call(this), i.advanced.autoScrollOnFocus && H.call(this), i.scrollButtons.enable && F.call(this), i.keyboard.enable && q.call(this), n.bindEvents = !0 } }, k = function () { var t = e(this), o = t.data(a), n = o.opt, i = a + \"_\" + o.idx, r = \".mCSB_\" + o.idx + \"_scrollbar\", l = e(\"#mCSB_\" + o.idx + \",#mCSB_\" + o.idx + \"_container,#mCSB_\" + o.idx + \"_container_wrapper,\" + r + \" .\" + d[12] + \",#mCSB_\" + o.idx + \"_dragger_vertical,#mCSB_\" + o.idx + \"_dragger_horizontal,\" + r + \">a\"), s = e(\"#mCSB_\" + o.idx + \"_container\"); n.advanced.releaseDraggableSelectors && l.add(e(n.advanced.releaseDraggableSelectors)), n.advanced.extraDraggableSelectors && l.add(e(n.advanced.extraDraggableSelectors)), o.bindEvents && (e(document).add(e(!A() || top.document)).unbind(\".\" + i), l.each(function () { e(this).unbind(\".\" + i) }), clearTimeout(t[0]._focusTimeout), $(t[0], \"_focusTimeout\"), clearTimeout(o.sequential.step), $(o.sequential, \"step\"), clearTimeout(s[0].onCompleteTimeout), $(s[0], \"onCompleteTimeout\"), o.bindEvents = !1) }, M = function (t) { var o = e(this), n = o.data(a), i = n.opt, r = e(\"#mCSB_\" + n.idx + \"_container_wrapper\"), l = r.length ? r : e(\"#mCSB_\" + n.idx + \"_container\"), s = [e(\"#mCSB_\" + n.idx + \"_scrollbar_vertical\"), e(\"#mCSB_\" + n.idx + \"_scrollbar_horizontal\")], c = [s[0].find(\".mCSB_dragger\"), s[1].find(\".mCSB_dragger\")]; \"x\" !== i.axis && (n.overflowed[0] && !t ? (s[0].add(c[0]).add(s[0].children(\"a\")).css(\"display\", \"block\"), l.removeClass(d[8] + \" \" + d[10])) : (i.alwaysShowScrollbar ? (2 !== i.alwaysShowScrollbar && c[0].css(\"display\", \"none\"), l.removeClass(d[10])) : (s[0].css(\"display\", \"none\"), l.addClass(d[10])), l.addClass(d[8]))), \"y\" !== i.axis && (n.overflowed[1] && !t ? (s[1].add(c[1]).add(s[1].children(\"a\")).css(\"display\", \"block\"), l.removeClass(d[9] + \" \" + d[11])) : (i.alwaysShowScrollbar ? (2 !== i.alwaysShowScrollbar && c[1].css(\"display\", \"none\"), l.removeClass(d[11])) : (s[1].css(\"display\", \"none\"), l.addClass(d[11])), l.addClass(d[9]))), n.overflowed[0] || n.overflowed[1] ? o.removeClass(d[5]) : o.addClass(d[5]) }, O = function (t) { var o = t.type, a = t.target.ownerDocument !== document && null !== frameElement ? [e(frameElement).offset().top, e(frameElement).offset().left] : null, n = A() && t.target.ownerDocument !== top.document && null !== frameElement ? [e(t.view.frameElement).offset().top, e(t.view.frameElement).offset().left] : [0, 0]; switch (o) { case \"pointerdown\": case \"MSPointerDown\": case \"pointermove\": case \"MSPointerMove\": case \"pointerup\": case \"MSPointerUp\": return a ? [t.originalEvent.pageY - a[0] + n[0], t.originalEvent.pageX - a[1] + n[1], !1] : [t.originalEvent.pageY, t.originalEvent.pageX, !1]; case \"touchstart\": case \"touchmove\": case \"touchend\": var i = t.originalEvent.touches[0] || t.originalEvent.changedTouches[0], r = t.originalEvent.touches.length || t.originalEvent.changedTouches.length; return t.target.ownerDocument !== document ? [i.screenY, i.screenX, r > 1] : [i.pageY, i.pageX, r > 1]; default: return a ? [t.pageY - a[0] + n[0], t.pageX - a[1] + n[1], !1] : [t.pageY, t.pageX, !1] } }, I = function () { function t(e, t, a, n) { if (h[0].idleTimer = d.scrollInertia < 233 ? 250 : 0, o.attr(\"id\") === f[1]) var i = \"x\", s = (o[0].offsetLeft - t + n) * l.scrollRatio.x; else var i = \"y\", s = (o[0].offsetTop - e + a) * l.scrollRatio.y; G(r, s.toString(), { dir: i, drag: !0 }) } var o, n, i, r = e(this), l = r.data(a), d = l.opt, u = a + \"_\" + l.idx, f = [\"mCSB_\" + l.idx + \"_dragger_vertical\", \"mCSB_\" + l.idx + \"_dragger_horizontal\"], h = e(\"#mCSB_\" + l.idx + \"_container\"), m = e(\"#\" + f[0] + \",#\" + f[1]), p = d.advanced.releaseDraggableSelectors ? m.add(e(d.advanced.releaseDraggableSelectors)) : m, g = d.advanced.extraDraggableSelectors ? e(!A() || top.document).add(e(d.advanced.extraDraggableSelectors)) : e(!A() || top.document); m.bind(\"contextmenu.\" + u, function (e) { e.preventDefault() }).bind(\"mousedown.\" + u + \" touchstart.\" + u + \" pointerdown.\" + u + \" MSPointerDown.\" + u, function (t) { if (t.stopImmediatePropagation(), t.preventDefault(), ee(t)) { c = !0, s && (document.onselectstart = function () { return !1 }), L.call(h, !1), Q(r), o = e(this); var a = o.offset(), l = O(t)[0] - a.top, u = O(t)[1] - a.left, f = o.height() + a.top, m = o.width() + a.left; f > l && l > 0 && m > u && u > 0 && (n = l, i = u), C(o, \"active\", d.autoExpandScrollbar) } }).bind(\"touchmove.\" + u, function (e) { e.stopImmediatePropagation(), e.preventDefault(); var a = o.offset(), r = O(e)[0] - a.top, l = O(e)[1] - a.left; t(n, i, r, l) }), e(document).add(g).bind(\"mousemove.\" + u + \" pointermove.\" + u + \" MSPointerMove.\" + u, function (e) { if (o) { var a = o.offset(), r = O(e)[0] - a.top, l = O(e)[1] - a.left; if (n === r && i === l) return; t(n, i, r, l) } }).add(p).bind(\"mouseup.\" + u + \" touchend.\" + u + \" pointerup.\" + u + \" MSPointerUp.\" + u, function () { o && (C(o, \"active\", d.autoExpandScrollbar), o = null), c = !1, s && (document.onselectstart = null), L.call(h, !0) }) }, D = function () { function o(e) { if (!te(e) || c || O(e)[2]) return void (t = 0); t = 1, b = 0, C = 0, d = 1, y.removeClass(\"mCS_touch_action\"); var o = I.offset(); u = O(e)[0] - o.top, f = O(e)[1] - o.left, z = [O(e)[0], O(e)[1]] } function n(e) { if (te(e) && !c && !O(e)[2] && (T.documentTouchScroll || e.preventDefault(), e.stopImmediatePropagation(), (!C || b) && d)) { g = K(); var t = M.offset(), o = O(e)[0] - t.top, a = O(e)[1] - t.left, n = \"mcsLinearOut\"; if (E.push(o), W.push(a), z[2] = Math.abs(O(e)[0] - z[0]), z[3] = Math.abs(O(e)[1] - z[1]), B.overflowed[0]) var i = D[0].parent().height() - D[0].height(), r = u - o > 0 && o - u > -(i * B.scrollRatio.y) && (2 * z[3] < z[2] || \"yx\" === T.axis); if (B.overflowed[1]) var l = D[1].parent().width() - D[1].width(), h = f - a > 0 && a - f > -(l * B.scrollRatio.x) && (2 * z[2] < z[3] || \"yx\" === T.axis); r || h ? (U || e.preventDefault(), b = 1) : (C = 1, y.addClass(\"mCS_touch_action\")), U && e.preventDefault(), w = \"yx\" === T.axis ? [u - o, f - a] : \"x\" === T.axis ? [null, f - a] : [u - o, null], I[0].idleTimer = 250, B.overflowed[0] && s(w[0], R, n, \"y\", \"all\", !0), B.overflowed[1] && s(w[1], R, n, \"x\", L, !0) } } function i(e) { if (!te(e) || c || O(e)[2]) return void (t = 0); t = 1, e.stopImmediatePropagation(), Q(y), p = K(); var o = M.offset(); h = O(e)[0] - o.top, m = O(e)[1] - o.left, E = [], W = [] } function r(e) { if (te(e) && !c && !O(e)[2]) { d = 0, e.stopImmediatePropagation(), b = 0, C = 0, v = K(); var t = M.offset(), o = O(e)[0] - t.top, a = O(e)[1] - t.left; if (!(v - g > 30)) { _ = 1e3 / (v - p); var n = \"mcsEaseOut\", i = 2.5 > _, r = i ? [E[E.length - 2], W[W.length - 2]] : [0, 0]; x = i ? [o - r[0], a - r[1]] : [o - h, a - m]; var u = [Math.abs(x[0]), Math.abs(x[1])]; _ = i ? [Math.abs(x[0] / 4), Math.abs(x[1] / 4)] : [_, _]; var f = [Math.abs(I[0].offsetTop) - x[0] * l(u[0] / _[0], _[0]), Math.abs(I[0].offsetLeft) - x[1] * l(u[1] / _[1], _[1])]; w = \"yx\" === T.axis ? [f[0], f[1]] : \"x\" === T.axis ? [null, f[1]] : [f[0], null], S = [4 * u[0] + T.scrollInertia, 4 * u[1] + T.scrollInertia]; var y = parseInt(T.contentTouchScroll) || 0; w[0] = u[0] > y ? w[0] : 0, w[1] = u[1] > y ? w[1] : 0, B.overflowed[0] && s(w[0], S[0], n, \"y\", L, !1), B.overflowed[1] && s(w[1], S[1], n, \"x\", L, !1) } } } function l(e, t) { var o = [1.5 * t, 2 * t, t / 1.5, t / 2]; return e > 90 ? t > 4 ? o[0] : o[3] : e > 60 ? t > 3 ? o[3] : o[2] : e > 30 ? t > 8 ? o[1] : t > 6 ? o[0] : t > 4 ? t : o[2] : t > 8 ? t : o[3] } function s(e, t, o, a, n, i) { e && G(y, e.toString(), { dur: t, scrollEasing: o, dir: a, overwrite: n, drag: i }) } var d, u, f, h, m, p, g, v, x, _, w, S, b, C, y = e(this), B = y.data(a), T = B.opt, k = a + \"_\" + B.idx, M = e(\"#mCSB_\" + B.idx), I = e(\"#mCSB_\" + B.idx + \"_container\"), D = [e(\"#mCSB_\" + B.idx + \"_dragger_vertical\"), e(\"#mCSB_\" + B.idx + \"_dragger_horizontal\")], E = [], W = [], R = 0, L = \"yx\" === T.axis ? \"none\" : \"all\", z = [], P = I.find(\"iframe\"), H = [\"touchstart.\" + k + \" pointerdown.\" + k + \" MSPointerDown.\" + k, \"touchmove.\" + k + \" pointermove.\" + k + \" MSPointerMove.\" + k, \"touchend.\" + k + \" pointerup.\" + k + \" MSPointerUp.\" + k], U = void 0 !== document.body.style.touchAction && \"\" !== document.body.style.touchAction; I.bind(H[0], function (e) { o(e) }).bind(H[1], function (e) { n(e) }), M.bind(H[0], function (e) { i(e) }).bind(H[2], function (e) { r(e) }), P.length && P.each(function () { e(this).bind(\"load\", function () { A(this) && e(this.contentDocument || this.contentWindow.document).bind(H[0], function (e) { o(e), i(e) }).bind(H[1], function (e) { n(e) }).bind(H[2], function (e) { r(e) }) }) }) }, E = function () { function o() { return window.getSelection ? window.getSelection().toString() : document.selection && \"Control\" != document.selection.type ? document.selection.createRange().text : 0 } function n(e, t, o) { d.type = o && i ? \"stepped\" : \"stepless\", d.scrollAmount = 10, j(r, e, t, \"mcsLinearOut\", o ? 60 : null) } var i, r = e(this), l = r.data(a), s = l.opt, d = l.sequential, u = a + \"_\" + l.idx, f = e(\"#mCSB_\" + l.idx + \"_container\"), h = f.parent(); f.bind(\"mousedown.\" + u, function () { t || i || (i = 1, c = !0) }).add(document).bind(\"mousemove.\" + u, function (e) { if (!t && i && o()) { var a = f.offset(), r = O(e)[0] - a.top + f[0].offsetTop, c = O(e)[1] - a.left + f[0].offsetLeft; r > 0 && r < h.height() && c > 0 && c < h.width() ? d.step && n(\"off\", null, \"stepped\") : (\"x\" !== s.axis && l.overflowed[0] && (0 > r ? n(\"on\", 38) : r > h.height() && n(\"on\", 40)), \"y\" !== s.axis && l.overflowed[1] && (0 > c ? n(\"on\", 37) : c > h.width() && n(\"on\", 39))) } }).bind(\"mouseup.\" + u + \" dragend.\" + u, function () { t || (i && (i = 0, n(\"off\", null)), c = !1) }) }, W = function () { function t(t, a) { if (Q(o), !z(o, t.target)) { var r = \"auto\" !== i.mouseWheel.deltaFactor ? parseInt(i.mouseWheel.deltaFactor) : s && t.deltaFactor < 100 ? 100 : t.deltaFactor || 100, d = i.scrollInertia; if (\"x\" === i.axis || \"x\" === i.mouseWheel.axis) var u = \"x\", f = [Math.round(r * n.scrollRatio.x), parseInt(i.mouseWheel.scrollAmount)], h = \"auto\" !== i.mouseWheel.scrollAmount ? f[1] : f[0] >= l.width() ? .9 * l.width() : f[0], m = Math.abs(e(\"#mCSB_\" + n.idx + \"_container\")[0].offsetLeft), p = c[1][0].offsetLeft, g = c[1].parent().width() - c[1].width(), v = \"y\" === i.mouseWheel.axis ? t.deltaY || a : t.deltaX; else var u = \"y\", f = [Math.round(r * n.scrollRatio.y), parseInt(i.mouseWheel.scrollAmount)], h = \"auto\" !== i.mouseWheel.scrollAmount ? f[1] : f[0] >= l.height() ? .9 * l.height() : f[0], m = Math.abs(e(\"#mCSB_\" + n.idx + \"_container\")[0].offsetTop), p = c[0][0].offsetTop, g = c[0].parent().height() - c[0].height(), v = t.deltaY || a; \"y\" === u && !n.overflowed[0] || \"x\" === u && !n.overflowed[1] || ((i.mouseWheel.invert || t.webkitDirectionInvertedFromDevice) && (v = -v), i.mouseWheel.normalizeDelta && (v = 0 > v ? -1 : 1), (v > 0 && 0 !== p || 0 > v && p !== g || i.mouseWheel.preventDefault) && (t.stopImmediatePropagation(), t.preventDefault()), t.deltaFactor < 5 && !i.mouseWheel.normalizeDelta && (h = t.deltaFactor, d = 17), G(o, (m - v * h).toString(), { dir: u, dur: d })) } } if (e(this).data(a)) { var o = e(this), n = o.data(a), i = n.opt, r = a + \"_\" + n.idx, l = e(\"#mCSB_\" + n.idx), c = [e(\"#mCSB_\" + n.idx + \"_dragger_vertical\"), e(\"#mCSB_\" + n.idx + \"_dragger_horizontal\")], d = e(\"#mCSB_\" + n.idx + \"_container\").find(\"iframe\"); d.length && d.each(function () { e(this).bind(\"load\", function () { A(this) && e(this.contentDocument || this.contentWindow.document).bind(\"mousewheel.\" + r, function (e, o) { t(e, o) }) }) }), l.bind(\"mousewheel.\" + r, function (e, o) { t(e, o) }) } }, R = new Object, A = function (t) { var o = !1, a = !1, n = null; if (void 0 === t ? a = \"#empty\" : void 0 !== e(t).attr(\"id\") && (a = e(t).attr(\"id\")), a !== !1 && void 0 !== R[a]) return R[a]; if (t) { try { var i = t.contentDocument || t.contentWindow.document; n = i.body.innerHTML } catch (r) { } o = null !== n } else { try { var i = top.document; n = i.body.innerHTML } catch (r) { } o = null !== n } return a !== !1 && (R[a] = o), o }, L = function (e) { var t = this.find(\"iframe\"); if (t.length) { var o = e ? \"auto\" : \"none\"; t.css(\"pointer-events\", o) } }, z = function (t, o) { var n = o.nodeName.toLowerCase(), i = t.data(a).opt.mouseWheel.disableOver, r = [\"select\", \"textarea\"]; return e.inArray(n, i) > -1 && !(e.inArray(n, r) > -1 && !e(o).is(\":focus\")) }, P = function () { var t, o = e(this), n = o.data(a), i = a + \"_\" + n.idx, r = e(\"#mCSB_\" + n.idx + \"_container\"), l = r.parent(), s = e(\".mCSB_\" + n.idx + \"_scrollbar .\" + d[12]); s.bind(\"mousedown.\" + i + \" touchstart.\" + i + \" pointerdown.\" + i + \" MSPointerDown.\" + i, function (o) { c = !0, e(o.target).hasClass(\"mCSB_dragger\") || (t = 1) }).bind(\"touchend.\" + i + \" pointerup.\" + i + \" MSPointerUp.\" + i, function () { c = !1 }).bind(\"click.\" + i, function (a) { if (t && (t = 0, e(a.target).hasClass(d[12]) || e(a.target).hasClass(\"mCSB_draggerRail\"))) { Q(o); var i = e(this), s = i.find(\".mCSB_dragger\"); if (i.parent(\".mCSB_scrollTools_horizontal\").length > 0) { if (!n.overflowed[1]) return; var c = \"x\", u = a.pageX > s.offset().left ? -1 : 1, f = Math.abs(r[0].offsetLeft) - u * (.9 * l.width()) } else { if (!n.overflowed[0]) return; var c = \"y\", u = a.pageY > s.offset().top ? -1 : 1, f = Math.abs(r[0].offsetTop) - u * (.9 * l.height()) } G(o, f.toString(), { dir: c, scrollEasing: \"mcsEaseInOut\" }) } }) }, H = function () { var t = e(this), o = t.data(a), n = o.opt, i = a + \"_\" + o.idx, r = e(\"#mCSB_\" + o.idx + \"_container\"), l = r.parent(); r.bind(\"focusin.\" + i, function () { var o = e(document.activeElement), a = r.find(\".mCustomScrollBox\").length, i = 0; o.is(n.advanced.autoScrollOnFocus) && (Q(t), clearTimeout(t[0]._focusTimeout), t[0]._focusTimer = a ? (i + 17) * a : 0, t[0]._focusTimeout = setTimeout(function () { var e = [ae(o)[0], ae(o)[1]], a = [r[0].offsetTop, r[0].offsetLeft], s = [a[0] + e[0] >= 0 && a[0] + e[0] < l.height() - o.outerHeight(!1), a[1] + e[1] >= 0 && a[0] + e[1] < l.width() - o.outerWidth(!1)], c = \"yx\" !== n.axis || s[0] || s[1] ? \"all\" : \"none\"; \"x\" === n.axis || s[0] || G(t, e[0].toString(), { dir: \"y\", scrollEasing: \"mcsEaseInOut\", overwrite: c, dur: i }), \"y\" === n.axis || s[1] || G(t, e[1].toString(), { dir: \"x\", scrollEasing: \"mcsEaseInOut\", overwrite: c, dur: i }) }, t[0]._focusTimer)) }) }, U = function () { var t = e(this), o = t.data(a), n = a + \"_\" + o.idx, i = e(\"#mCSB_\" + o.idx + \"_container\").parent(); i.bind(\"scroll.\" + n, function () { 0 === i.scrollTop() && 0 === i.scrollLeft() || e(\".mCSB_\" + o.idx + \"_scrollbar\").css(\"visibility\", \"hidden\") }) }, F = function () { var t = e(this), o = t.data(a), n = o.opt, i = o.sequential, r = a + \"_\" + o.idx, l = \".mCSB_\" + o.idx + \"_scrollbar\", s = e(l + \">a\"); s.bind(\"contextmenu.\" + r, function (e) { e.preventDefault() }).bind(\"mousedown.\" + r + \" touchstart.\" + r + \" pointerdown.\" + r + \" MSPointerDown.\" + r + \" mouseup.\" + r + \" touchend.\" + r + \" pointerup.\" + r + \" MSPointerUp.\" + r + \" mouseout.\" + r + \" pointerout.\" + r + \" MSPointerOut.\" + r + \" click.\" + r, function (a) { function r(e, o) { i.scrollAmount = n.scrollButtons.scrollAmount, j(t, e, o) } if (a.preventDefault(), ee(a)) { var l = e(this).attr(\"class\"); switch (i.type = n.scrollButtons.scrollType, a.type) { case \"mousedown\": case \"touchstart\": case \"pointerdown\": case \"MSPointerDown\": if (\"stepped\" === i.type) return; c = !0, o.tweenRunning = !1, r(\"on\", l); break; case \"mouseup\": case \"touchend\": case \"pointerup\": case \"MSPointerUp\": case \"mouseout\": case \"pointerout\": case \"MSPointerOut\": if (\"stepped\" === i.type) return; c = !1, i.dir && r(\"off\", l); break; case \"click\": if (\"stepped\" !== i.type || o.tweenRunning) return; r(\"on\", l) } } }) }, q = function () { function t(t) { function a(e, t) { r.type = i.keyboard.scrollType, r.scrollAmount = i.keyboard.scrollAmount, \"stepped\" === r.type && n.tweenRunning || j(o, e, t) } switch (t.type) { case \"blur\": n.tweenRunning && r.dir && a(\"off\", null); break; case \"keydown\": case \"keyup\": var l = t.keyCode ? t.keyCode : t.which, s = \"on\"; if (\"x\" !== i.axis && (38 === l || 40 === l) || \"y\" !== i.axis && (37 === l || 39 === l)) { if ((38 === l || 40 === l) && !n.overflowed[0] || (37 === l || 39 === l) && !n.overflowed[1]) return; \"keyup\" === t.type && (s = \"off\"), e(document.activeElement).is(u) || (t.preventDefault(), t.stopImmediatePropagation(), a(s, l)) } else if (33 === l || 34 === l) { if ((n.overflowed[0] || n.overflowed[1]) && (t.preventDefault(), t.stopImmediatePropagation()), \"keyup\" === t.type) { Q(o); var f = 34 === l ? -1 : 1; if (\"x\" === i.axis || \"yx\" === i.axis && n.overflowed[1] && !n.overflowed[0]) var h = \"x\", m = Math.abs(c[0].offsetLeft) - f * (.9 * d.width()); else var h = \"y\", m = Math.abs(c[0].offsetTop) - f * (.9 * d.height()); G(o, m.toString(), { dir: h, scrollEasing: \"mcsEaseInOut\" }) } } else if ((35 === l || 36 === l) && !e(document.activeElement).is(u) && ((n.overflowed[0] || n.overflowed[1]) && (t.preventDefault(), t.stopImmediatePropagation()), \"keyup\" === t.type)) { if (\"x\" === i.axis || \"yx\" === i.axis && n.overflowed[1] && !n.overflowed[0]) var h = \"x\", m = 35 === l ? Math.abs(d.width() - c.outerWidth(!1)) : 0; else var h = \"y\", m = 35 === l ? Math.abs(d.height() - c.outerHeight(!1)) : 0; G(o, m.toString(), { dir: h, scrollEasing: \"mcsEaseInOut\" }) } } } var o = e(this), n = o.data(a), i = n.opt, r = n.sequential, l = a + \"_\" + n.idx, s = e(\"#mCSB_\" + n.idx), c = e(\"#mCSB_\" + n.idx + \"_container\"), d = c.parent(), u = \"input,textarea,select,datalist,keygen,[contenteditable='true']\", f = c.find(\"iframe\"), h = [\"blur.\" + l + \" keydown.\" + l + \" keyup.\" + l]; f.length && f.each(function () { e(this).bind(\"load\", function () { A(this) && e(this.contentDocument || this.contentWindow.document).bind(h[0], function (e) { t(e) }) }) }), s.attr(\"tabindex\", \"0\").bind(h[0], function (e) { t(e) }) }, j = function (t, o, n, i, r) { function l(e) { u.snapAmount && (f.scrollAmount = u.snapAmount instanceof Array ? \"x\" === f.dir[0] ? u.snapAmount[1] : u.snapAmount[0] : u.snapAmount); var o = \"stepped\" !== f.type, a = r ? r : e ? o ? p / 1.5 : g : 1e3 / 60, n = e ? o ? 7.5 : 40 : 2.5, s = [Math.abs(h[0].offsetTop), Math.abs(h[0].offsetLeft)], d = [c.scrollRatio.y > 10 ? 10 : c.scrollRatio.y, c.scrollRatio.x > 10 ? 10 : c.scrollRatio.x], m = \"x\" === f.dir[0] ? s[1] + f.dir[1] * (d[1] * n) : s[0] + f.dir[1] * (d[0] * n), v = \"x\" === f.dir[0] ? s[1] + f.dir[1] * parseInt(f.scrollAmount) : s[0] + f.dir[1] * parseInt(f.scrollAmount), x = \"auto\" !== f.scrollAmount ? v : m, _ = i ? i : e ? o ? \"mcsLinearOut\" : \"mcsEaseInOut\" : \"mcsLinear\", w = !!e; return e && 17 > a && (x = \"x\" === f.dir[0] ? s[1] : s[0]), G(t, x.toString(), { dir: f.dir[0], scrollEasing: _, dur: a, onComplete: w }), e ? void (f.dir = !1) : (clearTimeout(f.step), void (f.step = setTimeout(function () { l() }, a))) } function s() { clearTimeout(f.step), $(f, \"step\"), Q(t) } var c = t.data(a), u = c.opt, f = c.sequential, h = e(\"#mCSB_\" + c.idx + \"_container\"), m = \"stepped\" === f.type, p = u.scrollInertia < 26 ? 26 : u.scrollInertia, g = u.scrollInertia < 1 ? 17 : u.scrollInertia; switch (o) { case \"on\": if (f.dir = [n === d[16] || n === d[15] || 39 === n || 37 === n ? \"x\" : \"y\", n === d[13] || n === d[15] || 38 === n || 37 === n ? -1 : 1], Q(t), oe(n) && \"stepped\" === f.type) return; l(m); break; case \"off\": s(), (m || c.tweenRunning && f.dir) && l(!0) } }, Y = function (t) { var o = e(this).data(a).opt, n = []; return \"function\" == typeof t && (t = t()), t instanceof Array ? n = t.length > 1 ? [t[0], t[1]] : \"x\" === o.axis ? [null, t[0]] : [t[0], null] : (n[0] = t.y ? t.y : t.x || \"x\" === o.axis ? null : t, n[1] = t.x ? t.x : t.y || \"y\" === o.axis ? null : t), \"function\" == typeof n[0] && (n[0] = n[0]()), \"function\" == typeof n[1] && (n[1] = n[1]()), n }, X = function (t, o) { if (null != t && \"undefined\" != typeof t) { var n = e(this), i = n.data(a), r = i.opt, l = e(\"#mCSB_\" + i.idx + \"_container\"), s = l.parent(), c = typeof t; o || (o = \"x\" === r.axis ? \"x\" : \"y\"); var d = \"x\" === o ? l.outerWidth(!1) - s.width() : l.outerHeight(!1) - s.height(), f = \"x\" === o ? l[0].offsetLeft : l[0].offsetTop, h = \"x\" === o ? \"left\" : \"top\"; switch (c) { case \"function\": return t(); case \"object\": var m = t.jquery ? t : e(t); if (!m.length) return; return \"x\" === o ? ae(m)[1] : ae(m)[0]; case \"string\": case \"number\": if (oe(t)) return Math.abs(t); if (-1 !== t.indexOf(\"%\")) return Math.abs(d * parseInt(t) / 100); if (-1 !== t.indexOf(\"-=\")) return Math.abs(f - parseInt(t.split(\"-=\")[1])); if (-1 !== t.indexOf(\"+=\")) { var p = f + parseInt(t.split(\"+=\")[1]); return p >= 0 ? 0 : Math.abs(p) } if (-1 !== t.indexOf(\"px\") && oe(t.split(\"px\")[0])) return Math.abs(t.split(\"px\")[0]); if (\"top\" === t || \"left\" === t) return 0; if (\"bottom\" === t) return Math.abs(s.height() - l.outerHeight(!1)); if (\"right\" === t) return Math.abs(s.width() - l.outerWidth(!1)); if (\"first\" === t || \"last\" === t) { var m = l.find(\":\" + t); return \"x\" === o ? ae(m)[1] : ae(m)[0] } return e(t).length ? \"x\" === o ? ae(e(t))[1] : ae(e(t))[0] : (l.css(h, t), void u.update.call(null, n[0])) } } }, N = function (t) {\r\n function o() { return clearTimeout(f[0].autoUpdate), 0 === l.parents(\"html\").length ? void (l = null) : void (f[0].autoUpdate = setTimeout(function () { return c.advanced.updateOnSelectorChange && (s.poll.change.n = i(), s.poll.change.n !== s.poll.change.o) ? (s.poll.change.o = s.poll.change.n, void r(3)) : c.advanced.updateOnContentResize && (s.poll.size.n = l[0].scrollHeight + l[0].scrollWidth + f[0].offsetHeight + l[0].offsetHeight + l[0].offsetWidth, s.poll.size.n !== s.poll.size.o) ? (s.poll.size.o = s.poll.size.n, void r(1)) : !c.advanced.updateOnImageLoad || \"auto\" === c.advanced.updateOnImageLoad && \"y\" === c.axis || (s.poll.img.n = f.find(\"img\").length, s.poll.img.n === s.poll.img.o) ? void ((c.advanced.updateOnSelectorChange || c.advanced.updateOnContentResize || c.advanced.updateOnImageLoad) && o()) : (s.poll.img.o = s.poll.img.n, void f.find(\"img\").each(function () { n(this) })) }, c.advanced.autoUpdateTimeout)) } function n(t) {\r\n function o(e, t) {\r\n return function () {\r\n return t.apply(e, arguments)\r\n }\r\n } function a() { this.onload = null, e(t).addClass(d[2]), r(2) } if (e(t).hasClass(d[2])) return void r(); var n = new Image; n.onload = o(n, a), n.src = t.src\r\n } function i() { c.advanced.updateOnSelectorChange === !0 && (c.advanced.updateOnSelectorChange = \"*\"); var e = 0, t = f.find(c.advanced.updateOnSelectorChange); return c.advanced.updateOnSelectorChange && t.length > 0 && t.each(function () { e += this.offsetHeight + this.offsetWidth }), e } function r(e) { clearTimeout(f[0].autoUpdate), u.update.call(null, l[0], e) } var l = e(this), s = l.data(a), c = s.opt, f = e(\"#mCSB_\" + s.idx + \"_container\"); return t ? (clearTimeout(f[0].autoUpdate), void $(f[0], \"autoUpdate\")) : void o()\r\n }, V = function (e, t, o) { return Math.round(e / t) * t - o }, Q = function (t) { var o = t.data(a), n = e(\"#mCSB_\" + o.idx + \"_container,#mCSB_\" + o.idx + \"_container_wrapper,#mCSB_\" + o.idx + \"_dragger_vertical,#mCSB_\" + o.idx + \"_dragger_horizontal\"); n.each(function () { Z.call(this) }) }, G = function (t, o, n) { function i(e) { return s && c.callbacks[e] && \"function\" == typeof c.callbacks[e] } function r() { return [c.callbacks.alwaysTriggerOffsets || w >= S[0] + y, c.callbacks.alwaysTriggerOffsets || -B >= w] } function l() { var e = [h[0].offsetTop, h[0].offsetLeft], o = [x[0].offsetTop, x[0].offsetLeft], a = [h.outerHeight(!1), h.outerWidth(!1)], i = [f.height(), f.width()]; t[0].mcs = { content: h, top: e[0], left: e[1], draggerTop: o[0], draggerLeft: o[1], topPct: Math.round(100 * Math.abs(e[0]) / (Math.abs(a[0]) - i[0])), leftPct: Math.round(100 * Math.abs(e[1]) / (Math.abs(a[1]) - i[1])), direction: n.dir } } var s = t.data(a), c = s.opt, d = { trigger: \"internal\", dir: \"y\", scrollEasing: \"mcsEaseOut\", drag: !1, dur: c.scrollInertia, overwrite: \"all\", callbacks: !0, onStart: !0, onUpdate: !0, onComplete: !0 }, n = e.extend(d, n), u = [n.dur, n.drag ? 0 : n.dur], f = e(\"#mCSB_\" + s.idx), h = e(\"#mCSB_\" + s.idx + \"_container\"), m = h.parent(), p = c.callbacks.onTotalScrollOffset ? Y.call(t, c.callbacks.onTotalScrollOffset) : [0, 0], g = c.callbacks.onTotalScrollBackOffset ? Y.call(t, c.callbacks.onTotalScrollBackOffset) : [0, 0]; if (s.trigger = n.trigger, 0 === m.scrollTop() && 0 === m.scrollLeft() || (e(\".mCSB_\" + s.idx + \"_scrollbar\").css(\"visibility\", \"visible\"), m.scrollTop(0).scrollLeft(0)), \"_resetY\" !== o || s.contentReset.y || (i(\"onOverflowYNone\") && c.callbacks.onOverflowYNone.call(t[0]), s.contentReset.y = 1), \"_resetX\" !== o || s.contentReset.x || (i(\"onOverflowXNone\") && c.callbacks.onOverflowXNone.call(t[0]), s.contentReset.x = 1), \"_resetY\" !== o && \"_resetX\" !== o) { if (!s.contentReset.y && t[0].mcs || !s.overflowed[0] || (i(\"onOverflowY\") && c.callbacks.onOverflowY.call(t[0]), s.contentReset.x = null), !s.contentReset.x && t[0].mcs || !s.overflowed[1] || (i(\"onOverflowX\") && c.callbacks.onOverflowX.call(t[0]), s.contentReset.x = null), c.snapAmount) { var v = c.snapAmount instanceof Array ? \"x\" === n.dir ? c.snapAmount[1] : c.snapAmount[0] : c.snapAmount; o = V(o, v, c.snapOffset) } switch (n.dir) { case \"x\": var x = e(\"#mCSB_\" + s.idx + \"_dragger_horizontal\"), _ = \"left\", w = h[0].offsetLeft, S = [f.width() - h.outerWidth(!1), x.parent().width() - x.width()], b = [o, 0 === o ? 0 : o / s.scrollRatio.x], y = p[1], B = g[1], T = y > 0 ? y / s.scrollRatio.x : 0, k = B > 0 ? B / s.scrollRatio.x : 0; break; case \"y\": var x = e(\"#mCSB_\" + s.idx + \"_dragger_vertical\"), _ = \"top\", w = h[0].offsetTop, S = [f.height() - h.outerHeight(!1), x.parent().height() - x.height()], b = [o, 0 === o ? 0 : o / s.scrollRatio.y], y = p[0], B = g[0], T = y > 0 ? y / s.scrollRatio.y : 0, k = B > 0 ? B / s.scrollRatio.y : 0 } b[1] < 0 || 0 === b[0] && 0 === b[1] ? b = [0, 0] : b[1] >= S[1] ? b = [S[0], S[1]] : b[0] = -b[0], t[0].mcs || (l(), i(\"onInit\") && c.callbacks.onInit.call(t[0])), clearTimeout(h[0].onCompleteTimeout), J(x[0], _, Math.round(b[1]), u[1], n.scrollEasing), !s.tweenRunning && (0 === w && b[0] >= 0 || w === S[0] && b[0] <= S[0]) || J(h[0], _, Math.round(b[0]), u[0], n.scrollEasing, n.overwrite, { onStart: function () { n.callbacks && n.onStart && !s.tweenRunning && (i(\"onScrollStart\") && (l(), c.callbacks.onScrollStart.call(t[0])), s.tweenRunning = !0, C(x), s.cbOffsets = r()) }, onUpdate: function () { n.callbacks && n.onUpdate && i(\"whileScrolling\") && (l(), c.callbacks.whileScrolling.call(t[0])) }, onComplete: function () { if (n.callbacks && n.onComplete) { \"yx\" === c.axis && clearTimeout(h[0].onCompleteTimeout); var e = h[0].idleTimer || 0; h[0].onCompleteTimeout = setTimeout(function () { i(\"onScroll\") && (l(), c.callbacks.onScroll.call(t[0])), i(\"onTotalScroll\") && b[1] >= S[1] - T && s.cbOffsets[0] && (l(), c.callbacks.onTotalScroll.call(t[0])), i(\"onTotalScrollBack\") && b[1] <= k && s.cbOffsets[1] && (l(), c.callbacks.onTotalScrollBack.call(t[0])), s.tweenRunning = !1, h[0].idleTimer = 0, C(x, \"hide\") }, e) } } }) } }, J = function (e, t, o, a, n, i, r) { function l() { S.stop || (x || m.call(), x = K() - v, s(), x >= S.time && (S.time = x > S.time ? x + f - (x - S.time) : x + f - 1, S.time < x + 1 && (S.time = x + 1)), S.time < a ? S.id = h(l) : g.call()) } function s() { a > 0 ? (S.currVal = u(S.time, _, b, a, n), w[t] = Math.round(S.currVal) + \"px\") : w[t] = o + \"px\", p.call() } function c() { f = 1e3 / 60, S.time = x + f, h = window.requestAnimationFrame ? window.requestAnimationFrame : function (e) { return s(), setTimeout(e, .01) }, S.id = h(l) } function d() { null != S.id && (window.requestAnimationFrame ? window.cancelAnimationFrame(S.id) : clearTimeout(S.id), S.id = null) } function u(e, t, o, a, n) { switch (n) { case \"linear\": case \"mcsLinear\": return o * e / a + t; case \"mcsLinearOut\": return e /= a, e--, o * Math.sqrt(1 - e * e) + t; case \"easeInOutSmooth\": return e /= a / 2, 1 > e ? o / 2 * e * e + t : (e--, -o / 2 * (e * (e - 2) - 1) + t); case \"easeInOutStrong\": return e /= a / 2, 1 > e ? o / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--, o / 2 * (-Math.pow(2, -10 * e) + 2) + t); case \"easeInOut\": case \"mcsEaseInOut\": return e /= a / 2, 1 > e ? o / 2 * e * e * e + t : (e -= 2, o / 2 * (e * e * e + 2) + t); case \"easeOutSmooth\": return e /= a, e--, -o * (e * e * e * e - 1) + t; case \"easeOutStrong\": return o * (-Math.pow(2, -10 * e / a) + 1) + t; case \"easeOut\": case \"mcsEaseOut\": default: var i = (e /= a) * e, r = i * e; return t + o * (.499999999999997 * r * i + -2.5 * i * i + 5.5 * r + -6.5 * i + 4 * e) } } e._mTween || (e._mTween = { top: {}, left: {} }); var f, h, r = r || {}, m = r.onStart || function () { }, p = r.onUpdate || function () { }, g = r.onComplete || function () { }, v = K(), x = 0, _ = e.offsetTop, w = e.style, S = e._mTween[t]; \"left\" === t && (_ = e.offsetLeft); var b = o - _; S.stop = 0, \"none\" !== i && d(), c() }, K = function () { return window.performance && window.performance.now ? window.performance.now() : window.performance && window.performance.webkitNow ? window.performance.webkitNow() : Date.now ? Date.now() : (new Date).getTime() }, Z = function () { var e = this; e._mTween || (e._mTween = { top: {}, left: {} }); for (var t = [\"top\", \"left\"], o = 0; o < t.length; o++) { var a = t[o]; e._mTween[a].id && (window.requestAnimationFrame ? window.cancelAnimationFrame(e._mTween[a].id) : clearTimeout(e._mTween[a].id), e._mTween[a].id = null, e._mTween[a].stop = 1) } }, $ = function (e, t) { try { delete e[t] } catch (o) { e[t] = null } }, ee = function (e) { return !(e.which && 1 !== e.which) }, te = function (e) { var t = e.originalEvent.pointerType; return !(t && \"touch\" !== t && 2 !== t) }, oe = function (e) { return !isNaN(parseFloat(e)) && isFinite(e) }, ae = function (e) { var t = e.parents(\".mCSB_container\"); return [e.offset().top - t.offset().top, e.offset().left - t.offset().left] }, ne = function () { function e() { var e = [\"webkit\", \"moz\", \"ms\", \"o\"]; if (\"hidden\" in document) return \"hidden\"; for (var t = 0; t < e.length; t++) if (e[t] + \"Hidden\" in document) return e[t] + \"Hidden\"; return null } var t = e(); return t ? document[t] : !1 }; e.fn[o] = function (t) { return u[t] ? u[t].apply(this, Array.prototype.slice.call(arguments, 1)) : \"object\" != typeof t && t ? void e.error(\"Method \" + t + \" does not exist\") : u.init.apply(this, arguments) }, e[o] = function (t) { return u[t] ? u[t].apply(this, Array.prototype.slice.call(arguments, 1)) : \"object\" != typeof t && t ? void e.error(\"Method \" + t + \" does not exist\") : u.init.apply(this, arguments) }, e[o].defaults = i, window[o] = !0, e(window).bind(\"load\", function () { e(n)[o](), e.extend(e.expr[\":\"], { mcsInView: e.expr[\":\"].mcsInView || function (t) { var o, a, n = e(t), i = n.parents(\".mCSB_container\"); if (i.length) return o = i.parent(), a = [i[0].offsetTop, i[0].offsetLeft], a[0] + ae(n)[0] >= 0 && a[0] + ae(n)[0] < o.height() - n.outerHeight(!1) && a[1] + ae(n)[1] >= 0 && a[1] + ae(n)[1] < o.width() - n.outerWidth(!1) }, mcsInSight: e.expr[\":\"].mcsInSight || function (t, o, a) { var n, i, r, l, s = e(t), c = s.parents(\".mCSB_container\"), d = \"exact\" === a[3] ? [[1, 0], [1, 0]] : [[.9, .1], [.6, .4]]; if (c.length) return n = [s.outerHeight(!1), s.outerWidth(!1)], r = [c[0].offsetTop + ae(s)[0], c[0].offsetLeft + ae(s)[1]], i = [c.parent()[0].offsetHeight, c.parent()[0].offsetWidth], l = [n[0] < i[0] ? d[0] : d[1], n[1] < i[1] ? d[0] : d[1]], r[0] - i[0] * l[0][0] < 0 && r[0] + n[0] - i[0] * l[0][1] >= 0 && r[1] - i[1] * l[1][0] < 0 && r[1] + n[1] - i[1] * l[1][1] >= 0 }, mcsOverflow: e.expr[\":\"].mcsOverflow || function (t) { var o = e(t).data(a); if (o) return o.overflowed[0] || o.overflowed[1] } }) })\r\n })\r\n});\n\n }).apply(root, arguments);\n});\n}(this));\n\n",";(function (global, factory) {\r\n typeof define === 'function' && define.amd ? define('score_bootstrap/Components/Accordion',[\"jquery\", \"eventManager\"], factory) :\r\n typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require(\"jquery\"), require(\"eventManager\")) :\r\n console && console.error('Accordion does not support non-amd script loading.');\r\n}(this/* window */, function ($, eventManager) {\r\n\r\n function Accordion(scope, stateChangeMessages) {\r\n var self = this;\r\n Object.defineProperty(this, \"$scope\", { enumerable: true, value: $(scope) });\r\n\r\n //#region message transmitter registration\r\n if (stateChangeMessages.length) {\r\n this.$scope.on(\"shown.bs.collapse hidden.bs.collapse\", function () {\r\n\r\n stateChangeMessages.forEach(function (eventName) {\r\n window.console && console.info(\"Accordion raises message: \\'%s\\'\", eventName);\r\n\r\n eventManager.trigger(eventName, self);\r\n });\r\n\r\n return false;\r\n });\r\n }\r\n //#endregion\r\n\r\n this._setupDeepLinking();\r\n }\r\n\r\n Accordion.prototype._setupDeepLinking = function () {\r\n var that = this;\r\n // make accordion panel with anchors change the URL to make them sticky\r\n this.$scope.on('shown.bs.collapse',\r\n function (e) {\r\n var anchor = '';\r\n var oldHash = window.location.hash.substring(1);\r\n\r\n var anchorLink = $(e.target).closest('.panel').find('a[data-toggle=\"collapse\"][href*=\"#collapse-\"][data-anchorable=\"True\"]');\r\n if (anchorLink.length) {\r\n anchor = anchorLink.attr(\"href\").replace(\"#collapse-\", \"\");\r\n }\r\n\r\n if (anchor) {\r\n window.history && window.history.pushState && window.history.pushState(null, null, '#' + anchor);\r\n window.location.hash = anchor;\r\n } else {\r\n // if we open a panel without deep linking, we should release previously selected anchorable panel.\r\n if (oldHash && $(e.target).closest('.panel-group').find('a[data-toggle=\"collapse\"][href*=\"#collapse-' + oldHash + '\"][data-anchorable=\"True\"]').length) {\r\n window.location.hash = '';\r\n }\r\n // otherwise we don't care.\r\n }\r\n });\r\n\r\n // make all tabs with anchors to be visible when we walk along the browser history\r\n $(window).on(\"hashchange\", function () {\r\n if (!window.location.hash) return !1;\r\n\r\n // find a tab which should be activated within current tabset. otherwise keep tabset without any changes.\r\n var panel = that.$scope.find('a[href=#collapse-' + window.location.hash.substring(1) + ']');\r\n if (panel.length) {\r\n panel.click();\r\n }\r\n });\r\n }\r\n\r\n\r\n return function initAccordion(args) {\r\n return args.IsPageEditorEditing === true ? null : new Accordion(args.scope, args.StateChangeMessagesTransmitting || []);\r\n };\r\n}));\n",";(function (global, factory) {\r\n typeof define === 'function' && define.amd ? define('score_bootstrap/Components/AccordionPanel',[\"jquery\", \"eventManager\"], factory) :\r\n typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require(\"jquery\"), require(\"eventManager\")) :\r\n console && console.error('AccordionPanel does not support non-amd script loading.');\r\n}(this/* window */, function ($, eventManager) {\r\n function AccordionPanel(scope, stateChangeMessages, onShowMessagesPerformer, onHideMessagePerformer) {\r\n ///Initialize a new instance of AccordionPanel. Subscribe to messages which are passed to current instance.\r\n\r\n var self = this;\r\n Object.defineProperty(this, \"$scope\", { enumerable: true, value: $(scope) });\r\n\r\n //#region state change message transmitter registration\r\n if (stateChangeMessages.length) {\r\n this.$scope.on(\"shown.bs.collapse hidden.bs.collapse\", function () {\r\n stateChangeMessages.forEach(function (eventName) {\r\n window.console && console.info(\"AccordionPanel raises message: \\'%s\\'\", eventName);\r\n\r\n eventManager.trigger(eventName, self);\r\n });\r\n\r\n return !1;\r\n });\r\n }\r\n //#endregion\r\n\r\n //#region show messages performer\r\n if (onShowMessagesPerformer.length) {\r\n onShowMessagesPerformer.forEach(function(messageName) {\r\n eventManager.subscribe(messageName, self.show, self);\r\n });\r\n }\r\n //#endregion\r\n\r\n //#region hide mesage performer\r\n if (onHideMessagePerformer.length) {\r\n onHideMessagePerformer.forEach(function (messageName) {\r\n eventManager.subscribe(messageName, self.hide, self);\r\n });\r\n }\r\n //#endregion\r\n\r\n }\r\n\r\n AccordionPanel.prototype.show = function () {\r\n ///Unfold current accordion panel\r\n\r\n this.$scope.find('.collapse').collapse('show');\r\n }\r\n\r\n AccordionPanel.prototype.hide = function () {\r\n ///Fold current accordion panel.\r\n\r\n this.$scope.find('.collapse').collapse('hide');\r\n }\r\n\r\n return function initAccordionPanel(args) {\r\n return args.IsPageEditorEditing === true\r\n ? null\r\n : new AccordionPanel(args.scope,\r\n args.StateChangeMessagesTransmitting || [],\r\n args.ShowActionMessages || [],\r\n args.HideActionMessages || []);\r\n }\r\n}));\n",";(function (global, factory) {\r\n typeof define === 'function' && define.amd ? define('score_bootstrap/Components/BasicMenuItem',[\"jquery\", \"eventManager\"], factory) :\r\n typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require(\"jquery\"), require(\"eventManager\")) :\r\n console && console.error('BasicMenuItem does not support non-amd script loading.');\r\n}(this/* window */, function ($, eventManager) {\r\n function BasicMenuItem(scope, clickMessagesTransmitting) {\r\n var self = this;\r\n Object.defineProperty(this, \"$scope\", { enumerable: true, value: $(scope) });\r\n\r\n\r\n //#region click messages transmitting registration\r\n if (clickMessagesTransmitting.length) {\r\n this.$scope.on(\"click\", \"a\", function (e) {\r\n e.preventDefault();\r\n\r\n clickMessagesTransmitting.forEach(function (eventName) {\r\n window.console && console.info(\"BasicMenuItem raises message: \\'%s\\'\", eventName);\r\n\r\n eventManager.trigger(eventName, self);\r\n });\r\n\r\n return !1;\r\n });\r\n }\r\n //#endregion\r\n }\r\n\r\n return function initBasicMenuItem(args) {\r\n return args.IsPageEditorEditing === true\r\n ? null\r\n : new BasicMenuItem(args.scope,\r\n args.ClickMessagesTransmitting || []);\r\n }\r\n\r\n}));\n",";(function (global, factory) {\r\n typeof define === 'function' && define.amd ? define('score_bootstrap/Components/Button',[\"jquery\", \"eventManager\"], factory) :\r\n typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require(\"jquery\"), require(\"eventManager\")) :\r\n console && console.error('Button does not support non-amd script loading.');\r\n}(this/* window */, function ($, eventManager) {\r\n function Button(scope, clickMessagesTransmitting, stateChangeMessages, onShowMessagesPerformer, onHideMessagePerformer) {\r\n ///Initialize a new instance of Button. Subscribe to messages which are passed to current instance.\r\n\r\n var self = this;\r\n Object.defineProperty(this, \"$scope\", { enumerable: true, value: $(scope) });\r\n Object.defineProperty(this, \"stateChangeMessages\", { enumerable: true, value: stateChangeMessages.slice() });\r\n\r\n\r\n //#region click messages transmitting registration\r\n if (clickMessagesTransmitting.length) {\r\n this.$scope.on(\"click\", function (e) {\r\n e.preventDefault();\r\n clickMessagesTransmitting.forEach(function (ev) {\r\n eventManager.trigger(ev, self);\r\n });\r\n\r\n return !1;\r\n });\r\n }\r\n //#endregion\r\n\r\n //#region show messages performer\r\n if (onShowMessagesPerformer.length) {\r\n onShowMessagesPerformer.forEach(function (messageName) {\r\n eventManager.subscribe(messageName, self.show, self);\r\n });\r\n\r\n }\r\n //#endregion\r\n\r\n\r\n //#region hide mesage performer\r\n if (onHideMessagePerformer.length) {\r\n onHideMessagePerformer.forEach(function (messageName) {\r\n eventManager.subscribe(messageName, self.hide, self);\r\n });\r\n }\r\n //#endregion\r\n }\r\n\r\n Button.prototype.show = function () {\r\n ///Make panel visible with jQuery.show() method.\r\n this.$scope.show();\r\n\r\n var self = this;\r\n if (this.stateChangeMessages.length) {\r\n this.stateChangeMessages.forEach(function (ev) {\r\n eventManager.trigger(ev, self);\r\n });\r\n }\r\n };\r\n\r\n Button.prototype.hide = function () {\r\n ///Make panel hidden with jQuery.hide() method.\r\n this.$scope.hide();\r\n\r\n var self = this;\r\n if (this.stateChangeMessages.length) {\r\n this.stateChangeMessages.forEach(function (ev) {\r\n eventManager.trigger(ev, self);\r\n });\r\n }\r\n };\r\n\r\n return function initButton(args) {\r\n return args.IsPageEditorEditing === true ? null :\r\n new Button(args.scope,\r\n args.ClickMessagesTransmitting || [],\r\n args.StateChangeMessagesTransmitting || [],\r\n args.ShowActionMessages || [],\r\n args.HideActionMessages || []);\r\n };\r\n}));\n",";(function (global, factory) {\r\n typeof define === 'function' && define.amd ? define('score_bootstrap/Components/ButtonMenuItem',[\"jquery\", \"eventManager\"], factory) :\r\n typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require(\"jquery\"), require(\"eventManager\")) :\r\n console && console.error('ButtonMenuItem does not support non-amd script loading.');\r\n}(this/* window */, function ($, eventManager) {\r\n\r\n function ButtonMenuItem(scope, clickMessagesTransmitting) {\r\n var self = this;\r\n Object.defineProperty(this, \"$scope\", { enumerable: true, value: $(scope) });\r\n\r\n\r\n //#region click messages transmitting registration\r\n if (clickMessagesTransmitting.length) {\r\n this.$scope.on(\"click\", \"a\", function (e) {\r\n e.preventDefault();\r\n\r\n clickMessagesTransmitting.forEach(function (eventName) {\r\n window.console && console.info(\"ButtonMenuItem raises message: \\'%s\\'\", eventName);\r\n\r\n eventManager.trigger(eventName, self);\r\n });\r\n\r\n return !1;\r\n });\r\n }\r\n //#endregion\r\n }\r\n\r\n return function initButtonMenuItem(args) {\r\n return args.IsPageEditorEditing === true\r\n ? null\r\n : new ButtonMenuItem(args.scope,\r\n args.ClickMessagesTransmitting || []);\r\n }\r\n}));\n",";(function (global, factory) {\r\n typeof define === 'function' && define.amd ? define('score_bootstrap/Components/CarouselPane',[\"jquery\", \"eventManager\"], factory) :\r\n typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require(\"jquery\"), require(\"eventManager\")) :\r\n console && console.error('CarouselPane does not support non-amd script loading.');\r\n}(this/* window */, function ($, eventManager) {\r\n\r\n function CarouselPane(scope, selectActionMessages) {\r\n var self = this;\r\n Object.defineProperty(this, \"$scope\", { enumerable: true, value: $(scope) });\r\n\r\n //#region select on mesage performer\r\n if (selectActionMessages.length) {\r\n selectActionMessages.forEach(function (messageName) {\r\n eventManager.subscribe(messageName, self.makeActive, self);\r\n });\r\n }\r\n //#endregion\r\n }\r\n\r\n CarouselPane.prototype.makeActive = function() {\r\n var carousel = this.$scope.closest('.carousel');\r\n\r\n if (!carousel) {\r\n console && console.error(\"Cannot detect carousel element. Carousel panel selection canceled.\");\r\n return!1;\r\n }\r\n\r\n var index = carousel.find('.carousel-inner > .item').index(this.$scope);\r\n carousel.carousel(index);\r\n }\r\n\r\n\r\n return function initCarouselPane(args) {\r\n return args.IsPageEditorEditing === true\r\n ? null\r\n : new CarouselPane(args.scope, args.SelectActionMessages || []);\r\n }\r\n}));\n","\n",";(function (global, factory) {\r\n typeof define === 'function' && define.amd ? define('score_bootstrap/Components/GoogleMap',[\"jquery\", \"async!//maps.google.com/maps/api/js?sensor=false\"], factory) :\r\n typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require(\"jquery\"), require(\"async!//maps.google.com/maps/api/js?sensor=false\")) :\r\n console && console.error('GoogleMap does not support non-amd script loading.');\r\n}(this/* window */, function ($) {\r\n var defaultLat = 0, defaultLng = 0, defaultZoom = 12;\r\n\r\n function GoogleMap(scope, lat, lng, zoom, allowZoom, allowPan) {\r\n var $mapCanvas = $(\".google-map-canvas\", scope), $pinElements, center, map, $panel;\r\n\r\n if (!$mapCanvas.length) {\r\n console.warn(\"Skipping GoogleMap initialization, cannot find .google-map-canvas element\");\r\n return;\r\n }\r\n console.log(allowPan);\r\n $pinElements = $(\".google-map-pin\", $mapCanvas).remove();\r\n center = new google.maps.LatLng(lat, lng);\r\n map = new google.maps.Map($mapCanvas[0], {\r\n center: center,\r\n zoom: zoom,\r\n scrollwheel: false,\r\n zoomControl: allowZoom,\r\n disableDoubleClickZoom: !allowZoom,\r\n draggable: allowPan,\r\n mapTypeId: google.maps.MapTypeId.ROADMAP,\r\n panControl: allowPan\r\n });\r\n\r\n $pinElements.each(function () {\r\n var $pin = $(this), description = $pin.html(), marker = new google.maps.Marker({\r\n position: new google.maps.LatLng(parseFloat($pin.attr(\"data-lat\")), parseFloat($pin.attr(\"data-lng\"))),\r\n map: map,\r\n title: $pin.attr(\"data-title\")\r\n });\r\n\r\n if (description) {\r\n description = new google.maps.InfoWindow({ content: description });\r\n marker.addListener('click', function () {\r\n description.open(map, marker);\r\n });\r\n }\r\n });\r\n\r\n $mapCanvas.show();\r\n\r\n // The map must be visible at the time when it is rendered, otherwise it does not render correctly.\r\n // In some cases, it is not visible on page load and needs to be rerendered manually.\r\n function rerender() {\r\n google.maps.event.trigger(map, 'resize');\r\n map.setCenter(center);\r\n map.setZoom(zoom);\r\n }\r\n\r\n // If the map is inside a variable column then it needs to be rerendered after it has been\r\n // initialized, otherwise it looks weird because its initialized while the width is 0.\r\n if ($mapCanvas.closest(\".score-variable-column\").length) {\r\n rerender();\r\n }\r\n\r\n // If the map is inside a hidden accordion/tab/modal panel, it needs to be rerendered when that panel is made visible.\r\n $panel = $mapCanvas.closest(\".score-accordion-panel\");\r\n if ($panel.length) {\r\n $panel.on(\"shown.bs.collapse\", rerender);\r\n }\r\n\r\n $panel = $mapCanvas.closest(\".score-tab\");\r\n if ($panel.length) {\r\n $panel.on(\"shown.bs.tab\", rerender);\r\n }\r\n\r\n $panel = $mapCanvas.closest(\".score-modal\");\r\n if ($panel.length) {\r\n $panel.on(\"shown.bs.modal\", rerender);\r\n }\r\n\r\n // If the map is inside a hidden carousel pane it needs to be rerendered when that pane is made visible.\r\n $panel = $mapCanvas.closest(\".score-carousel\");\r\n if ($panel.length) {\r\n $panel.on(\"slid.bs.carousel\", rerender);\r\n }\r\n }\r\n\r\n return function initGoogleMap(args) {\r\n return args.IsPageEditorEditing ? null : new GoogleMap(\r\n args.scope,\r\n parseFloat(args.Latitude) || defaultLat,\r\n parseFloat(args.Longitude) || defaultLng,\r\n parseInt(args.ZoomLevel || defaultZoom, 10),\r\n Boolean(args.AllowsZoom),\r\n Boolean(args.AllowsPan)\r\n );\r\n };\r\n\r\n}));\n",";(function (global, factory) {\r\n typeof define === 'function' && define.amd ? define('score_bootstrap/Components/IFrame',[\"jquery\", \"eventManager\"], factory) :\r\n typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require(\"jquery\"), require(\"eventManager\")) :\r\n console && console.error('Iframe does not support non-amd script loading.');\r\n}(this/* window */, function ($, eventManager) {\r\n\r\n function Iframe(scope) {\r\n ///Initialize a new instance of Iframe. Subscribe to messages which are passed to current instance.\r\n\r\n var self = this;\r\n Object.defineProperty(this, '$scope', { enumerable: true, value: $(scope) });\r\n\r\n var iframeComp = $('iframe', this.$scope);\r\n\r\n // #region calculate the size with 4:3 ratio\r\n if (iframeComp.data('autosize') !== 'disabled') {\r\n var iframeHolder = iframeComp.parent();\r\n var width = iframeHolder.width();\r\n\r\n //This calculation will set the size to a 4:3 ratio.\r\n iframeComp.css({\r\n 'height': (width / 1.25 | 0) + 'px', \r\n 'width': width + 'px'\r\n });\r\n }\r\n //#endregion\r\n }\r\n\r\n return function initIframe(args) {\r\n return args.IsPageEditorEditing === true\r\n ? null\r\n : new Iframe(args.scope);\r\n };\r\n}));\n",";(function (global, factory) {\r\n typeof define === 'function' && define.amd ? define('score_bootstrap/Components/MegaMenuButtonMenu',[\"jquery\", \"eventManager\"], factory) :\r\n typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require(\"jquery\"), require(\"eventManager\")) :\r\n console && console.error('MegaMenuButtonMenu does not support non-amd script loading.');\r\n}(this/* window */, function ($, eventManager) {\r\n\r\n function MegaMenuButtonMenu(scope, clickMessagesTransmitting, stateChangeMessages, onShowMessagesTransmitter, onHideMessageTransmitter) {\r\n var self = this;\r\n Object.defineProperty(this, \"$scope\", { enumerable: true, value: $(scope) });\r\n\r\n\r\n //#region click messages transmitting registration\r\n if (clickMessagesTransmitting.length) {\r\n this.$scope.on(\"click\", \"button\", function() {\r\n clickMessagesTransmitting.forEach(function(eventName) {\r\n window.console && console.info(\"MegaMenuButtonMenu raises message: \\'%s\\'\", eventName);\r\n\r\n eventManager.trigger(eventName, self);\r\n });\r\n\r\n // don't hide event, otherwise bootstrap dropdown won't ever open.\r\n return 1;\r\n });\r\n }\r\n //#endregion\r\n\r\n //#region state change message transmitter registration\r\n if (stateChangeMessages.length) {\r\n this.$scope.on(\"shown.bs.dropdown hidden.bs.dropdown\", function () {\r\n stateChangeMessages.forEach(function (eventName) {\r\n window.console && console.info(\"MegaMenuButtonMenu raises message: \\'%s\\'\", eventName);\r\n\r\n eventManager.trigger(eventName, self);\r\n });\r\n\r\n return !1;\r\n });\r\n }\r\n //#endregion\r\n\r\n //#region on show message transmitter registration\r\n if (onShowMessagesTransmitter.length) {\r\n this.$scope.on(\"shown.bs.dropdown\", function() {\r\n onShowMessagesTransmitter.forEach(function(eventName) {\r\n window.console && console.info(\"MegaMenuButtonMenu raises message: '%s'\", eventName);\r\n\r\n eventManager.trigger(eventName, self);\r\n });\r\n\r\n return !1;\r\n });\r\n }\r\n //#endregion\r\n\r\n //#region on hide message transmitter registration\r\n if (onHideMessageTransmitter.length) {\r\n this.$scope.on(\"hidden.bs.dropdown\", function() {\r\n onHideMessageTransmitter.forEach(function(eventName) {\r\n window.console && console.info(\"MegaMenuButtonMenu raises message: '%s'\", eventName);\r\n\r\n eventManager.trigger(eventName, self);\r\n });\r\n\r\n return !1;\r\n });\r\n }\r\n //#endregion\r\n\r\n }\r\n\r\n return function initMegaMenuButtonMenu(args) {\r\n return args.IsPageEditorEditing === true\r\n ? null\r\n : new MegaMenuButtonMenu(args.scope,\r\n args.ClickMessagesTransmitting || [],\r\n args.StateChangeMessagesTransmitting || [],\r\n args.ShowMessagesTransmitting || [],\r\n args.HideMessagesTransmitting || []);\r\n }\r\n}));\n",";(function (global, factory) {\r\n typeof define === 'function' && define.amd ? define('score_bootstrap/Components/MegaMenuItem',[\"jquery\", \"eventManager\"], factory) :\r\n typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require(\"jquery\"), require(\"eventManager\")) :\r\n console && console.error('MegaMenuItem does not support non-amd script loading.');\r\n}(this/* window */, function ($, eventManager) {\r\n\r\n function MegaMenuItem(scope, clickMessagesTransmitting) {\r\n var self = this;\r\n Object.defineProperty(this, \"$scope\", { enumerable: true, value: $(scope) });\r\n\r\n //#region click messages transmitting registration\r\n if (clickMessagesTransmitting.length) {\r\n this.$scope.on(\"click\", \"a.dropdown-toggle.toggle-caret\", function (e) {\r\n e.preventDefault();\r\n\r\n clickMessagesTransmitting.forEach(function (eventName) {\r\n window.console && console.info(\"MegaMenuItem raises message: \\'%s\\'\", eventName);\r\n\r\n eventManager.trigger(eventName, self);\r\n });\r\n\r\n return 1;\r\n });\r\n }\r\n //#endregion\r\n }\r\n\r\n return function initMegaMenuItem(args) {\r\n return args.IsPageEditorEditing === true\r\n ? null\r\n : new MegaMenuItem(args.scope,\r\n args.ClickMessagesTransmitting || []);\r\n }\r\n}));\n",";(function (global, factory) {\r\n typeof define === 'function' && define.amd ? define('score_bootstrap/Components/MenuListImageLink',[\"jquery\", \"eventManager\"], factory) :\r\n typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require(\"jquery\"), require(\"eventManager\")) :\r\n console && console.error('MenuListImageLink does not support non-amd script loading.');\r\n}(this/* window */, function ($, eventManager) {\r\n function MenuListImageLink(scope, clickMessagesTransmitting) {\r\n var self = this;\r\n Object.defineProperty(this, \"$scope\", { enumerable: true, value: $(scope) });\r\n\r\n\r\n //#region click messages transmitting registration\r\n if (clickMessagesTransmitting.length) {\r\n this.$scope.on(\"click\", \"a\", function (e) {\r\n e.preventDefault();\r\n\r\n clickMessagesTransmitting.forEach(function (eventName) {\r\n window.console && console.info(\"MenuListImageLink raises message: \\'%s\\'\", eventName);\r\n\r\n eventManager.trigger(eventName, self);\r\n });\r\n\r\n return !1;\r\n });\r\n }\r\n //#endregion\r\n }\r\n\r\n return function initMenuListImageLink(args) {\r\n return args.IsPageEditorEditing === true\r\n ? null\r\n : new MenuListImageLink(args.scope,\r\n args.ClickMessagesTransmitting || []);\r\n }\r\n}));\n",";(function (global, factory) {\r\n typeof define === 'function' && define.amd ? define('score_bootstrap/Components/MenuListItem',[\"jquery\", \"eventManager\"], factory) :\r\n typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require(\"jquery\"), require(\"eventManager\")) :\r\n console && console.error('MenuListItem does not support non-amd script loading.');\r\n}(this/* window */, function ($, eventManager) {\r\n\r\n function MenuListItem(scope, clickMessagesTransmitting) {\r\n var self = this;\r\n Object.defineProperty(this, \"$scope\", { enumerable: true, value: $(scope) });\r\n\r\n\r\n //#region click messages transmitting registration\r\n if (clickMessagesTransmitting.length) {\r\n this.$scope.on(\"click\", \"a\", function (e) {\r\n e.preventDefault();\r\n\r\n clickMessagesTransmitting.forEach(function (eventName) {\r\n window.console && console.info(\"MenuListItem raises message: \\'%s\\'\", eventName);\r\n\r\n eventManager.trigger(eventName, self);\r\n });\r\n\r\n return !1;\r\n });\r\n }\r\n //#endregion\r\n }\r\n\r\n return function initMenuListItem(args) {\r\n return args.IsPageEditorEditing === true\r\n ? null\r\n : new MenuListItem(args.scope,\r\n args.ClickMessagesTransmitting || []);\r\n }\r\n}));\n",";(function (global, factory) {\r\n typeof define === 'function' && define.amd ? define('score_bootstrap/Components/Modal',[\"jquery\", \"eventManager\"], factory) :\r\n typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require(\"jquery\"), require(\"eventManager\")) :\r\n console && console.error('Modal does not support non-amd script loading.');\r\n}(this/* window */, function ($, eventManager) {\r\n function Modal(scope, stateChangeMessages, onShowMessagePerformer, onHideMessagePerformer, onShowMessagesTransmitter, onHideMessageTransmitter) {\r\n ///Initialize a new instance of Panel. Subscribe to messages which are passed to current instance.\r\n\r\n var self = this;\r\n //Object.defineProperty(this, \"$scope\", { enumerable: true, value: $(scope) });\r\n Object.defineProperties(this,\r\n {\r\n $scope: { enumerable: true, value: $(scope) },\r\n onShowMessagesTransmitter: {\r\n enumerable: true,\r\n value: onShowMessagesTransmitter.slice()\r\n },\r\n onHideMessageTransmitter: {\r\n enumerable: true,\r\n value: onHideMessageTransmitter.slice()\r\n }\r\n });\r\n\r\n\r\n function doShow() {\r\n self.show();\r\n if (stateChangeMessages.length) {\r\n stateChangeMessages.forEach(function (ev) {\r\n eventManager.trigger(ev, \"shown\");\r\n });\r\n }\r\n }\r\n\r\n function doHide() {\r\n self.hide();\r\n if (stateChangeMessages.length) {\r\n stateChangeMessages.forEach(function (ev) {\r\n eventManager.trigger(ev, \"hidden\");\r\n });\r\n }\r\n }\r\n\r\n if (onShowMessagePerformer.length) {\r\n onShowMessagePerformer.forEach(function (ev) {\r\n eventManager.subscribe(ev, doShow);\r\n });\r\n }\r\n\r\n if (onHideMessagePerformer.length) {\r\n onHideMessagePerformer.forEach(function (ev) {\r\n eventManager.subscribe(ev, doHide);\r\n });\r\n }\r\n\r\n //this.$scope.find(\".modal-header button.close\").on(\"click\", doHide);\r\n this.$scope.on('hidden.bs.modal', doHide);\r\n this.$scope.on('shown.bs.modal', doShow);\r\n }\r\n\r\n Modal.prototype.show = function show() {\r\n this.$scope.modal(\"show\");\r\n this.notifyOnShow();\r\n };\r\n\r\n Modal.prototype.notifyOnShow = function () {\r\n var self = this;\r\n if (this.onShowMessagesTransmitter.length) {\r\n this.onShowMessagesTransmitter.forEach(function (ev) {\r\n eventManager.trigger(ev, self);\r\n });\r\n }\r\n }\r\n\r\n Modal.prototype.hide = function hide() {\r\n this.$scope.modal(\"hide\");\r\n this.notifyOnHide();\r\n };\r\n\r\n Modal.prototype.notifyOnHide = function() {\r\n var self = this;\r\n if (this.onHideMessageTransmitter.length) {\r\n this.onHideMessageTransmitter.forEach(function (ev) {\r\n eventManager.trigger(ev, self);\r\n });\r\n }\r\n }\r\n\r\n return function initModal(args) {\r\n return args.IsPageEditorEditing === true ? null : new Modal(\r\n args.scope,\r\n args.StateChangeMessagesTransmitting || [],\r\n args.ShowActionMessages || [],\r\n args.HideActionMessages || [],\r\n args.ShowMessagesTransmitting || [],\r\n args.HideMessagesTransmitting || []\r\n );\r\n };\r\n}));\n",";(function (global, factory) {\r\n typeof define === 'function' && define.amd ? define('score_bootstrap/Components/Panel',[\"jquery\", \"eventManager\"], factory) :\r\n typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require(\"jquery\"), require(\"eventManager\")) :\r\n console && console.error('Panel does not support non-amd script loading.');\r\n}(this/* window */, function ($, eventManager) {\r\n\r\n function Panel(scope, stateChangeMessages, onShowMessagesPerformer, onHideMessagePerformer) {\r\n ///Initialize a new instance of Panel. Subscribe to messages which are passed to current instance.\r\n\r\n var self = this;\r\n Object.defineProperty(this, \"$scope\", { enumerable: true, value: $(scope) });\r\n Object.defineProperty(this, \"stateChangeMessages\", { enumerable: true, value: stateChangeMessages.slice() });\r\n\r\n //#region show messages performer\r\n if (onShowMessagesPerformer.length) {\r\n onShowMessagesPerformer.forEach(function (messageName) {\r\n eventManager.subscribe(messageName, self.show, self);\r\n });\r\n\r\n }\r\n //#endregion\r\n\r\n\r\n //#region hide mesage performer\r\n if (onHideMessagePerformer.length) {\r\n onHideMessagePerformer.forEach(function (messageName) {\r\n eventManager.subscribe(messageName, self.hide, self);\r\n });\r\n }\r\n //#endregion\r\n }\r\n\r\n Panel.prototype.show = function () {\r\n ///Make panel visible with jQuery.show() method.\r\n this.$scope.show();\r\n\r\n var self = this;\r\n if (this.stateChangeMessages.length) {\r\n this.stateChangeMessages.forEach(function (ev) {\r\n eventManager.trigger(ev, self);\r\n });\r\n }\r\n };\r\n\r\n Panel.prototype.hide = function () {\r\n ///Make panel hidden with jQuery.hide() method.\r\n this.$scope.hide();\r\n\r\n var self = this;\r\n if (this.stateChangeMessages.length) {\r\n this.stateChangeMessages.forEach(function (ev) {\r\n eventManager.trigger(ev, self);\r\n });\r\n }\r\n };\r\n\r\n return function initPanel(args) {\r\n return args.IsPageEditorEditing === true\r\n ? null\r\n : new Panel(args.scope,\r\n args.StateChangeMessagesTransmitting || [],\r\n args.ShowActionMessages || [],\r\n args.HideActionMessages || []);\r\n };\r\n}));\n",";(function (global, factory) {\r\n typeof define === 'function' && define.amd ? define('score_bootstrap/Components/SplitButtnMenu',[\"jquery\", \"eventManager\"], factory) :\r\n typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require(\"jquery\"), require(\"eventManager\")) :\r\n console && console.error('SplitButtonMenu does not support non-amd script loading.');\r\n}(this/* window */, function ($, eventManager) {\r\n\r\n function SplitButtonMenu(scope, clickMessagesTransmitting, stateChangeMessages, onShowMessagesTransmitter, onHideMessageTransmitter) {\r\n var self = this;\r\n Object.defineProperty(this, \"$scope\", { enumerable: true, value: $(scope) });\r\n\r\n\r\n //#region click messages transmitting registration\r\n if (clickMessagesTransmitting.length) {\r\n this.$scope.on(\"click\", \"button\", function() {\r\n clickMessagesTransmitting.forEach(function(eventName) {\r\n window.console && console.info(\"SplitButtonMenu raises message: \\'%s\\'\", eventName);\r\n\r\n eventManager.trigger(eventName, self);\r\n });\r\n\r\n return 1;\r\n });\r\n }\r\n //#endregion\r\n\r\n //#region state change message transmitter registration\r\n if (stateChangeMessages.length) {\r\n this.$scope.on(\"shown.bs.dropdown hidden.bs.dropdown\", function () {\r\n stateChangeMessages.forEach(function (eventName) {\r\n window.console && console.info(\"SplitButtonMenu raises message: \\'%s\\'\", eventName);\r\n\r\n eventManager.trigger(eventName, self);\r\n });\r\n\r\n return !1;\r\n });\r\n }\r\n //#endregion\r\n\r\n //#region on show message transmitter registration\r\n if (onShowMessagesTransmitter.length) {\r\n this.$scope.on(\"shown.bs.dropdown\", function() {\r\n onShowMessagesTransmitter.forEach(function(eventName) {\r\n window.console && console.info(\"SplitButtonMenu raises message: '%s'\", eventName);\r\n\r\n eventManager.trigger(eventName, self);\r\n });\r\n\r\n return !1;\r\n });\r\n }\r\n //#endregion\r\n\r\n //#region on hide message transmitter registration\r\n if (onHideMessageTransmitter.length) {\r\n this.$scope.on(\"hidden.bs.dropdown\", function() {\r\n onHideMessageTransmitter.forEach(function(eventName) {\r\n window.console && console.info(\"SplitButtonMenu rauses message: '%s'\", eventName);\r\n\r\n eventManager.trigger(eventName, self);\r\n });\r\n\r\n return !1;\r\n });\r\n }\r\n //#endregion\r\n\r\n }\r\n\r\n return function initSplitButtonMenu(args) {\r\n return args.IsPageEditorEditing === true\r\n ? null\r\n : new SplitButtonMenu(args.scope,\r\n args.ClickMessagesTransmitting || [],\r\n args.StateChangeMessagesTransmitting || [],\r\n args.ShowMessagesTransmitting || [],\r\n args.HideMessagesTransmitting || []);\r\n }\r\n}));\n",";(function (global, factory) {\r\n typeof define === 'function' && define.amd ? define('score_bootstrap/Components/StyleBox',[\"jquery\", \"eventManager\"], factory) :\r\n typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require(\"jquery\"), require(\"eventManager\")) :\r\n console && console.error('StyleBox does not support non-amd script loading.');\r\n}(this/* window */, function ($, eventManager) {\r\n function StyleBox(scope, stateChangeMessages, onShowMessagesPerformer, onHideMessagePerformer) {\r\n ///Initialize a new instance of StyleBox. Subscribe to messages which are passed to current instance.\r\n\r\n var self = this;\r\n Object.defineProperty(this, \"$scope\", { enumerable: true, value: $(scope) });\r\n Object.defineProperty(this, \"stateChangeMessages\", { enumerable: true, value: stateChangeMessages.slice() });\r\n\r\n //#region show messages performer\r\n if (onShowMessagesPerformer.length) {\r\n onShowMessagesPerformer.forEach(function (messageName) {\r\n eventManager.subscribe(messageName, self.show, self);\r\n });\r\n\r\n }\r\n //#endregion\r\n\r\n\r\n //#region hide mesage performer\r\n if (onHideMessagePerformer.length) {\r\n onHideMessagePerformer.forEach(function (messageName) {\r\n eventManager.subscribe(messageName, self.hide, self);\r\n });\r\n }\r\n //#endregion\r\n }\r\n\r\n StyleBox.prototype.show = function () {\r\n ///Make StyleBox visible with jQuery.show() method.\r\n this.$scope.show();\r\n\r\n var self = this;\r\n if (this.stateChangeMessages.length) {\r\n this.stateChangeMessages.forEach(function (ev) {\r\n eventManager.trigger(ev, self);\r\n });\r\n }\r\n };\r\n\r\n StyleBox.prototype.hide = function () {\r\n ///Make StyleBox hidden with jQuery.hide() method.\r\n this.$scope.hide();\r\n\r\n var self = this;\r\n if (this.stateChangeMessages.length) {\r\n this.stateChangeMessages.forEach(function (ev) {\r\n eventManager.trigger(ev, self);\r\n });\r\n }\r\n };\r\n\r\n return function initStyleBox(args) {\r\n return args.IsPageEditorEditing === true\r\n ? null\r\n : new StyleBox(args.scope,\r\n args.StateChangeMessagesTransmitting || [],\r\n args.ShowActionMessages || [],\r\n args.HideActionMessages || []);\r\n };\r\n}));\n",";(function (global, factory) {\r\n typeof define === 'function' && define.amd ? define('score_bootstrap/Components/TabPanel',[\"jquery\", \"eventManager\"], factory) :\r\n typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require(\"jquery\"), require(\"eventManager\")) :\r\n console && console.error('TabPanel does not support non-amd script loading.');\r\n}(this/* window */, function ($, eventManager) {\r\n\r\n function TabPanel(scope, stateChangeMessages, onShowMessagesPerformer, onHideMessagePerformer) {\r\n ///Initialize a new instance of TabPanel. Subscribe to messages which are passed to current instance.\r\n\r\n var self = this;\r\n Object.defineProperty(this, \"$scope\", { enumerable: true, value: $(scope) });\r\n\r\n //#region state change message transmitter registration\r\n if (stateChangeMessages.length) {\r\n this.$scope.on(\"shown.bs.dropdown hidden.bs.dropdown\", function () {\r\n stateChangeMessages.forEach(function (eventName) {\r\n window.console && window.console.info && window.console.info(\"TabPanel raises message: \\'%s\\'\", eventName);\r\n\r\n eventManager.trigger(eventName, self);\r\n });\r\n\r\n return !1;\r\n });\r\n }\r\n //#endregion\r\n\r\n //#region show messages performer\r\n if (onShowMessagesPerformer.length) {\r\n onShowMessagesPerformer.forEach(function(messageName) {\r\n eventManager.subscribe(messageName, self.show, self);\r\n });\r\n }\r\n //#endregion\r\n\r\n //#region hide mesage performer\r\n if (onHideMessagePerformer.length) {\r\n onHideMessagePerformer.forEach(function (messageName) {\r\n eventManager.subscribe(messageName, self.hide, self);\r\n });\r\n }\r\n //#endregion\r\n\r\n }\r\n\r\n TabPanel.prototype.show = function () {\r\n ///Make current tab active\r\n\r\n $(\"a[href='#\" + this.$scope.attr(\"id\") + \"']\").tab(\"show\");\r\n }\r\n\r\n TabPanel.prototype.hide = function () {\r\n ///Activate the first sibling tab in current tabset. To hide current selected tab.\r\n\r\n var siblingTabs = $(\"a[href='#\" + this.$scope.attr(\"id\") + \"']\")\r\n .closest(\".nav.nav-tabs\")\r\n .find(\"a[data-toggle=tab][href!='#\" + this.$scope.attr(\"id\") + \"']\");\r\n\r\n if (siblingTabs.length) {\r\n siblingTabs[0].tab(\"show\");\r\n } else {\r\n console.info(\"There is no sibling tabs which we can activate to hide current tab.\");\r\n }\r\n\r\n }\r\n\r\n return function initTabPanel(args) {\r\n return args.IsPageEditorEditing === true\r\n ? null\r\n : new TabPanel(args.scope,\r\n args.StateChangeMessagesTransmitting || [],\r\n args.ShowActionMessages || [],\r\n args.HideActionMessages || []);\r\n }\r\n}));\n",";(function (global, factory) {\r\n typeof define === 'function' && define.amd ? define('score_bootstrap/Components/TabSet',[\"jquery\", \"eventManager\"], factory) :\r\n typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require(\"jquery\"), require(\"eventManager\")) :\r\n console && console.error('TabSet does not support non-amd script loading.');\r\n}(this/* window */, function ($, eventManager) {\r\n \r\n function TabSet(scope, stateChangeMessages) {\r\n var self = this;\r\n Object.defineProperty(this, \"$scope\", { enumerable: true, value: $(scope) });\r\n \r\n //#region message transmitter registration\r\n if (stateChangeMessages.length) {\r\n this.$scope.on(\"shown.bs.tab\", function () {\r\n\r\n stateChangeMessages.forEach(function (eventName) {\r\n window.console && console.info(\"TabSet raises message: \\'%s\\'\", eventName);\r\n\r\n eventManager.trigger(eventName, self);\r\n });\r\n\r\n return false;\r\n });\r\n }\r\n //#endregion\r\n\r\n this._setupDeepLinking();\r\n\r\n }\r\n\r\n TabSet.prototype._setupDeepLinking = function () {\r\n var that = this;\r\n // make tabs with anchors change the URL to make them sticky\r\n this.$scope.on('shown.bs.tab',\r\n 'a[data-toggle=\"tab\"][href*=\"#tab-\"]',\r\n function () {\r\n\r\n var anchor = '';\r\n var oldHash = window.location.hash.substring(1);\r\n \r\n if ($(this).is('a[data-toggle=\"tab\"][href*=\"#tab-\"][data-anchorable=\"true\"]')) {\r\n anchor = $(this).attr(\"href\").replace(\"#tab-\", \"\");\r\n }\r\n\r\n if (anchor) {\r\n window.history && window.history.pushState && window.history.pushState(null, null, '#' + anchor);\r\n window.location.hash = anchor;\r\n } else {\r\n // if we open a tab without deep linking, we should release previously selected anchorable tab.\r\n if (oldHash && $(this).closest('.nav-tabs').find('a[data-toggle=\"tab\"][href*=\"#tab-' + oldHash + '\"][data-anchorable=\"true\"]').length) {\r\n window.location.hash = '';\r\n }\r\n // otherwise we don't care.\r\n }\r\n\r\n });\r\n\r\n // make all tabs with anchors to be visible when we walk along the browser history\r\n $(window).on(\"hashchange\", function () {\r\n if (!window.location.hash) return !1;\r\n\r\n // find a tab which should be activated within current tabset. otherwise keep tabset without any changes.\r\n var tab = that.$scope.find('a[href=#tab-' + window.location.hash.substring(1) + ']');\r\n if (tab.length) {\r\n tab.click();\r\n }\r\n });\r\n }\r\n\r\n\r\n return function initTabSet(args) {\r\n return args.IsPageEditorEditing === true\r\n ? null\r\n : new TabSet(args.scope,\r\n args.StateChangeMessagesTransmitting || []);\r\n };\r\n}));\n",";(function (global, factory) {\r\n typeof define === 'function' && define.amd ? define('score_bootstrap/Components/YoutubeVideo',[\"jquery\", \"eventManager\", \"//www.youtube.com/iframe_api\"], factory) :\r\n typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require(\"jquery\"), require(\"eventManager\"), require(\"//www.youtube.com/iframe_api\")) :\r\n console && console.error('TabSet does not support non-amd script loading.');\r\n}(this/* window */, function ($, eventManager) {\r\n\r\n function YoutubeVideo(scope, stateChangeMessages, onPlayMessagesPerformer, onPauseMessagePerformer) {\r\n ///Initialize a new instance of YoutubeVideo. Subscribe to messages which are passed to current instance.\r\n\r\n var self = this, instance = {};\r\n instance.stateChangeMessages = stateChangeMessages.slice();\r\n \r\n Object.defineProperties(this, {\r\n $scope: { enumerable: true, value: $(scope) },\r\n stateChangeMessages: {\r\n enumerable: true,\r\n get: function () {\r\n return instance.stateChangeMessages.slice();\r\n }\r\n }\r\n });\r\n \r\n this.addStateChangeMessage = function addStateChangeMessage(message) {\r\n if (!message) return;\r\n if (instance.stateChangeMessages.indexOf(message) > -1) {\r\n console.log(\"Component is already registered for event \" + message);\r\n return;\r\n }\r\n \r\n instance.stateChangeMessages.push(String(message));\r\n };\r\n\r\n //#region play message performer\r\n if (onPlayMessagesPerformer.length) {\r\n onPlayMessagesPerformer.forEach(function (messageName) {\r\n eventManager.subscribe(messageName, self.play, self);\r\n });\r\n }\r\n //#endregion\r\n\r\n //#region show messages performer\r\n if (onPauseMessagePerformer.length) {\r\n onPauseMessagePerformer.forEach(function (messageName) {\r\n eventManager.subscribe(messageName, self.pause, self);\r\n });\r\n }\r\n //#endregion\r\n\r\n\r\n if (this.stateChangeMessages.length) {\r\n this.stateChangeMessages.forEach(function (ev) {\r\n eventManager.trigger(ev, self);\r\n });\r\n }\r\n\r\n YT.ready(function () {\r\n var videoId = self.$scope.find('iframe').attr('id');\r\n \r\n Object.defineProperties(self, {\r\n videoId: { enumerable: true, value: videoId },\r\n player: { enumerable: false, value: new YT.Player(videoId) }\r\n });\r\n self.player.addEventListener(\"onStateChange\", self.transmitStateChange.bind(self));\r\n });\r\n }\r\n\r\n\r\n\r\n YoutubeVideo.prototype.play = function () {\r\n ///Start playing the video.\r\n\r\n this.$scope.find('iframe')\r\n .get(0)\r\n .contentWindow\r\n .postMessage(\r\n JSON.stringify(\r\n {\r\n 'event': 'command',\r\n 'func': 'playVideo',\r\n 'args': [],\r\n 'id': 'test-player'\r\n }), \"*\");\r\n\r\n this.transmitStateChange();\r\n }\r\n\r\n YoutubeVideo.prototype.pause = function () {\r\n ///Put the video on pause.\r\n\r\n this.$scope.find('iframe')\r\n .get(0)\r\n .contentWindow\r\n .postMessage(\r\n JSON.stringify(\r\n {\r\n 'event': 'command',\r\n 'func': 'pauseVideo',\r\n 'args': [],\r\n 'id': 'test-player'\r\n }), \"*\");\r\n\r\n this.transmitStateChange();\r\n }\r\n\r\n YoutubeVideo.prototype.transmitStateChange = function () {\r\n var messages = this.stateChangeMessages, self = this;\r\n if (messages.length) {\r\n messages.forEach(function (ev) {\r\n eventManager.trigger(ev, self, self.player);\r\n });\r\n }\r\n\r\n }\r\n // #endregion\r\n\r\n return function initYoutubeVideo(args) {\r\n return args.IsPageEditorEditing === true\r\n ? null\r\n : new YoutubeVideo(args.scope,\r\n args.StateChangeMessagesTransmitting || [],\r\n args.PlayActionMessages || [],\r\n args.PauseActionMessages || []);\r\n }\r\n}));\n","define('Beliefnet/Components/AdSlot',[\r\n \"jquery\",\r\n \"logging\",\r\n \"utilities\",\r\n \"ads\"\r\n], function ($, logging, utilities, ads) {\r\n var _ModuleName = \"Ad Slot\";\r\n\r\n /*\r\n config: {\r\n id, // string : DIV ID of Ad Slot\r\n position, // string : Position Value (eg. DT_ATF_TOP)\r\n sizes, // string : Eligable Sizes (eg. 300x250)\r\n yieldbot, // bool : Whethor or not slot is eligable for Yieldbot\r\n outofpage, // bool : Whether or not slot is out of page\r\n mobile // bool : Whether or not slot is mobile\r\n }\r\n */\r\n\r\n function AdSlot(scope, config) {\r\n \"use strict\";\r\n\r\n var $ad = $(scope);\r\n\r\n ;\r\n\r\n config.dom = $ad;\r\n config.loaded = false;\r\n var result = ads.registerAdSlot(config);\r\n\r\n if (result) {\r\n ;\r\n $ad.parent().removeClass(\"hidden\");\r\n $ad.show();\r\n } else {\r\n ;\r\n $ad.parent().remove();\r\n }\r\n\r\n return {\r\n slotId: config.id\r\n };\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initAdSlot(args) {\r\n // Do not initialize the module if we are in Experience Editor or if the ad mobility doesn't match the user's device\r\n if (args.IsExperienceEditorEditing === true || (utilities.IsPhone() !== args.Config.mobile)) {\r\n ;\r\n $(args.scope).remove();\r\n return null;\r\n }\r\n\r\n return new AdSlot(args.scope, args.Config);\r\n };\r\n});\r\n\r\n\n","define('Beliefnet/Components/AdvertiseWithUs',[\r\n \"jquery\",\r\n \"utilities\",\r\n \"logging\"\r\n], function ($, utilities, logging) {\r\n var _ModuleName = \"Advertise with Us\";\r\n function AdvertiseWithUs(scope) {\r\n \"use strict\";\r\n\r\n var $advertiseWithUs = $(scope);\r\n\r\n $advertiseWithUs.find('form.advertise-form').submit(function (e) {\r\n e.stopPropagation && e.stopPropagation();\r\n e.preventDefault && e.preventDefault();\r\n\r\n var frm = $(this);\r\n\r\n ;\r\n\r\n var email = $('input[name=emailAddress]', frm).val();\r\n if (email == '') {\r\n alert('Please enter your email address');\r\n ;\r\n return false;\r\n }\r\n\r\n if (!utilities.isAValidEmailAddress(email)) {\r\n alert('Please enter a valid email address');\r\n ;\r\n return false;\r\n }\r\n\r\n var message = $('textarea[name=message]', frm).val();\r\n if ($.trim(message) == '') {\r\n alert('Please include the message you\\'d like to send us');\r\n ;\r\n return false;\r\n }\r\n\r\n ;\r\n $.post(this.action, frm.serialize(), function () {\r\n $('.advertise-form-wrapper').html(\"Thank you for your feedback!\");\r\n ;\r\n }).fail(function ( data ) {\r\n alert('There was an issue processing your request');\r\n ;\r\n });\r\n\r\n return false;\r\n });\r\n\r\n ;\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initAdvertiseWithUs(args) {\r\n // Do not initialize the module if we are in Experience Editor\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new AdvertiseWithUs(args.scope);\r\n };\r\n});\n","\r\ndefine('Beliefnet/Components/Affix',[\r\n \"jquery\", \r\n \"utilities\",\r\n \"logging\"\r\n], function ($, utilities, logging) {\r\n var _ModuleName = \"Affix\";\r\n\r\n var _config = {\r\n scrollThrottle: 200\r\n };\r\n\r\n function Affix(scope) {\r\n \"use strict\";\r\n\r\n // Affixed element\r\n var $affixElem = $(scope);\r\n\r\n if ($affixElem.children().length == 0) {\r\n logging.warn(\"WARNING: Affix container has no child elements.\", _ModuleName);\r\n return null;\r\n }\r\n\r\n // Find containing row element\r\n var $row = $affixElem;\r\n while ($row.length && $row.parent().length && !$row.hasClass(\"row\"))\r\n $row = $row.parent();\r\n\r\n // Only affix the element if the containing row is found\r\n if ($row.length == 0 || !$row.hasClass(\"row\")) {\r\n logging.error(\"ERROR: Failed to affix element. Could not find parent row element.\", _ModuleName);\r\n return null;\r\n }\r\n\r\n // Only affix the element if the containing row is at least 1.5 times its own height\r\n if ($row.outerHeight(false) < 1.5 * $affixElem.height()) {\r\n logging.warn(\"WARNING: Element not affixed because parent row is to small.\", _ModuleName);\r\n return null;\r\n }\r\n\r\n // Cache a few dom objects for performance purposes\r\n var $window = $(window);\r\n var $document = $(document);\r\n var $body = $(document.body);\r\n\r\n // Calculate Offsets\r\n var skinOffset = $body.hasClass(\"enable-skin\") ? 110 : 0;\r\n var topOffset = $affixElem.offset().top - skinOffset;\r\n var leftOffset = $affixElem.offset().left;\r\n var bottomOffset = $document.height() - ($row.offset().top + $row.outerHeight(false));\r\n\r\n // report left offset calculation\r\n ;\r\n\r\n // Initialize the Affix functionality\r\n $affixElem.affix({\r\n offset: {\r\n top: function () {\r\n return (this.top = topOffset);\r\n },\r\n bottom: function () {\r\n return (this.bottom = bottomOffset);\r\n }\r\n }\r\n });\r\n\r\n // Fix positioning when element has padding in document\r\n $affixElem.on('affixed.bs.affix', function () {\r\n $(this).css({\r\n 'left': leftOffset\r\n });\r\n });\r\n\r\n // Remove left fix when no longer affixed\r\n $affixElem.on('affixed-top.bs.affix', function () {\r\n $(this).css({\r\n 'left': ''\r\n });\r\n // update offset calculation\r\n leftOffset = $affixElem.offset().left;\r\n });\r\n $affixElem.on('affixed-bottom.bs.affix', function () {\r\n $(this).css({\r\n 'left': ''\r\n });\r\n // update offset calculation\r\n leftOffset = $affixElem.offset().left;\r\n });\r\n\r\n var lastScrollTop = 0;\r\n // Set up Affix updates on Window Scroll\r\n var throttled = _.throttle(function () {\r\n var st = $window.scrollTop();\r\n skinOffset = $body.hasClass(\"enable-skin\") && (st > lastScrollTop) ? 120 : 0;\r\n topOffset = $row.offset().top - skinOffset;\r\n bottomOffset = $(document).height() - ($row.offset().top + $row.outerHeight(false));\r\n\r\n if (typeof $affixElem.data('bs.affix') != 'undefined') {\r\n $affixElem.data('bs.affix').options.offset.bottom = bottomOffset;\r\n $affixElem.data('bs.affix').options.offset.top = topOffset;\r\n }\r\n\r\n lastScrollTop = st;\r\n }, _config.scrollThrottle);\r\n $window.scroll(throttled);\r\n\r\n ;\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initAffix(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true || utilities.IsMobile() === true || utilities.IsTablet() === true) {\r\n return null;\r\n }\r\n\r\n return new Affix(args.scope);\r\n };\r\n});\r\n\r\n\r\n\n","define('Beliefnet/Components/AngelIntro',[\r\n \"jquery\",\r\n \"logging\"\r\n], function ($, logging) {\r\n var _ModuleName = \"Angel Intro\";\r\n var _angels = [\r\n \"The Archangel Metatron\",\r\n \"The Archangel Michael\",\r\n \"The Archangel Gabriel\",\r\n \"The Archangel Raphael\",\r\n \"The Archangel Uriel\",\r\n \"The Guardian Angel of Children\",\r\n \"The Guardian Angel of Youth\",\r\n \"The Guardian Angel of Young Love\",\r\n \"The Guardian Angel of Young Adults\",\r\n \"The Guardian Angel of Maturity\",\r\n \"The Guardian Angel of Health\",\r\n \"The Guardian Angel of Creativity\",\r\n \"The Guardian Angel of Spiritual Growth\",\r\n \"The Guardian Angel of Service\",\r\n \"The Angel Prince of the South\",\r\n \"The Angel Prince of the North\",\r\n \"The Angel Prince of the East\",\r\n \"The Angel Prince of West\",\r\n \"The Angel of Peace\",\r\n \"The Angel of Serenity\",\r\n \"The Angel of Harmony\",\r\n \"The Angel of Freedom\",\r\n \"The Angel of Trust\",\r\n \"The Angel of Faith\",\r\n \"The Angel of Reconciliation\",\r\n \"The Angel of Mercy\",\r\n \"The Angel of Forgiveness\",\r\n \"The Angel of the Miracle of Love\",\r\n \"The Angel of the Essence of Love\",\r\n \"The Angel of Eternal Love\",\r\n \"The Angel of Wisdom\",\r\n \"The Angel of Discernment\",\r\n \"The Angel of Knowing\",\r\n \"The Angel of Being\",\r\n \"The Angel of Power\",\r\n \"The Angel of Glory\"\r\n ];\r\n var _daysInMonths = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);\r\n\r\n function AngelIntro(scope) {\r\n \"use strict\";\r\n\r\n var $angelIntro = $(scope);\r\n\r\n var angelPageUrl = _getAngelPageURL();\r\n /* executed on document load */\r\n $('a.angel-of-the-day', $angelIntro).click(function () {\r\n window.location.href = angelPageUrl;\r\n });\r\n }\r\n\r\n /* Add any new functions specific to this project here */\r\n function _getAngelPageURL() {\r\n var today = new Date(),\r\n intMonth = today.getMonth(),\r\n i = 0,\r\n intDayOfYear = 0;\r\n\r\n // get rough approximation based on the month\r\n for (i = 0; i < intMonth; i++) {\r\n intDayOfYear += _daysInMonths[i];\r\n }\r\n // add to this the actual days that have passed in this month\r\n intDayOfYear += today.getDate();\r\n\r\n var angel = _angels[intDayOfYear % 36];\r\n\r\n ;\r\n ;\r\n\r\n return \"/Inspiration/Angels/Angel-Of-The-Day/\" + angel.replace(/ /g, \"-\") + \".aspx\";\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initAngelIntro(args) {\r\n // Do not initialize the module if we are in Experience Editor\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new AngelIntro(args.scope);\r\n };\r\n});\n","define('Beliefnet/Components/Article',[\r\n \"jquery\",\r\n \"utilities\",\r\n \"logging\"\r\n], function ($, utilities, logging) {\r\n var _ModuleName = \"Article\";\r\n var _showChar = 300;\r\n\r\n function Article(scope) {\r\n \"use strict\";\r\n\r\n var article = $(\".beliefnet-article\")[0];\r\n var parentWidth = article.offsetWidth;\r\n var playerHeight = Math.floor(parentWidth / 16 * 9); // 16x9 aspect ratio\r\n\r\n if (playerHeight == null)\r\n {\r\n return null;\r\n }\r\n\r\n var frame = article.getElementsByTagName('iframe')[0];\r\n\r\n // if we have a frame, and it's not an Ad from Google\r\n if (frame && ((frame.id && !frame.id.includes('google')) || !frame.id)) {\r\n frame.width = parentWidth;\r\n frame.height = playerHeight;\r\n }\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initArticle(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new Article(args.scope);\r\n };\r\n});\n","define('Beliefnet/Components/Attribution',[\r\n \"jquery\",\r\n \"logging\",\r\n \"utilities\"\r\n], function ($, logging, utilities) {\r\n var _ModuleName = \"Attribution\";\r\n var _showChar = 180;\r\n\r\n function Attribution(scope) {\r\n \"use strict\";\r\n\r\n var $attribution = $(\".writer-attribution\", scope);\r\n \r\n var content = utilities.cleanString($attribution.text());\r\n var html = utilities.cleanString($attribution.html());\r\n\r\n ;\r\n if (content.length > _showChar) {\r\n var mod = content.indexOf(' ', _showChar);\r\n _showChar = mod < content.length && mod > 0 ? mod : _showChar;\r\n var preview = utilities.htmlSubstring(html, _showChar);\r\n\r\n var output = '' + preview + ' ...read more' + html + ' show less';\r\n\r\n $attribution.html(output);\r\n }\r\n\r\n ;\r\n var $morelink = $(\".morelink\", $attribution);\r\n if ($morelink.length)\r\n {\r\n $morelink.click(function (event) {\r\n event.preventDefault();\r\n\r\n $(\"span.preview\", $attribution).toggle();\r\n $(\"span.full\", $attribution).toggle();\r\n });\r\n }\r\n\r\n ;\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initAttribution(args) {\r\n // Do not initialize the module if we are in Experience Editor\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new Attribution(args.scope);\r\n };\r\n});\n","define('Beliefnet/Components/Author',[\r\n \"jquery\",\r\n \"utilities\",\r\n \"logging\"\r\n], function ($, utilities, logging) {\r\n var _ModuleName = \"Author\";\r\n var _showChar = 300;\r\n\r\n function Author(scope) {\r\n \"use strict\";\r\n\r\n var $author = $(scope);\r\n\r\n ;\r\n\r\n var content = $author.html();\r\n if (content.length > _showChar) {\r\n var mod = content.indexOf(' ', _showChar);\r\n _showChar = mod < content.length && mod > 0 ? mod : _showChar;\r\n\r\n // Get partial and full to toggle opposite hides.\r\n var partialContentHtml = utilities.htmlSubstring(content, _showChar);\r\n var partialContent = \"\" + partialContentHtml + \"\" + 'read more
';\r\n var fullContent = \"\" + content + \"\";\r\n var html = partialContent + fullContent;\r\n\r\n $author.html(html);\r\n ;\r\n }\r\n\r\n $(\"#author-bio .serif-link\", $author).click(function (event) {\r\n event.preventDefault();\r\n\r\n if ($(this).html() == \"read more\") {\r\n $(this).html(\"\");\r\n }\r\n\r\n // Hide partial content.\r\n $(\".partialContent\", scope).toggle();\r\n\r\n // Display full content.\r\n $(\".fullContent\", scope).toggle();\r\n });\r\n\r\n ;\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initAuthor(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new Author(args.scope);\r\n };\r\n});\n","define('Beliefnet/Components/BelieveIn',[\r\n \"jquery\",\r\n \"logging\"\r\n], function ($, logging) {\r\n var _ModuleName = \"Believe In\";\r\n\r\n function BelieveIn(scope) {\r\n \"use strict\";\r\n\r\n var $believe = $(scope);\r\n\r\n $(function () {\r\n // Cache video areas and ensure they exist\r\n var $shortVideoArea = $('.video-area-short', $believe);\r\n var $longVideoArea = $('.video-area-long', $believe);\r\n\r\n if (!$shortVideoArea || !$longVideoArea) {\r\n logging.error('Failed to find both long and short video areas', _ModuleName);\r\n return;\r\n }\r\n\r\n // Cache video tabs and ensure they exist\r\n var $shortVideoTab = $('.short-video-tab', $believe);\r\n var $longVideoTab = $('.long-video-tab', $believe);\r\n\r\n if (!$shortVideoTab || !$longVideoTab) {\r\n logging.error('Failed to find both long and short video tabs', _ModuleName);\r\n return;\r\n }\r\n ;\r\n\r\n // Cache download button and ensure it exists\r\n var $downloadButton = $(\".dl-btn\", $believe);\r\n if (!$downloadButton.length) {\r\n logging.error('Failed to find download button', _ModuleName);\r\n return;\r\n }\r\n ;\r\n\r\n // Cache code box and ensure it exists\r\n var $codeBox = $(\".code-box\", $believe);\r\n if (!$codeBox.length) {\r\n logging.error(\"Failed to find code box\", _ModuleName);\r\n return;\r\n }\r\n ;\r\n\r\n // Configure Download Button\r\n ;\r\n $downloadButton.click(function (e) {\r\n var isShort = $shortVideoArea.is(\":visible\");\r\n var filename = isShort ? \"BelieveIn-Short.mp4\" : \"BelieveIn-Long.mp4\";\r\n var videoid = jwplayer(_getPlayerName($believe)).getPlaylistItem().mediaid;\r\n var fileuri = \"//content.jwplatform.com/videos/\" + videoid + \"-Ht5TfGK0.mp4\";\r\n\r\n ;\r\n ;\r\n\r\n $downloadButton.attr('download', filename) \t// set file name (you want to put formatted date here)\r\n .attr('href', fileuri) // data to download\r\n .attr('target', '_blank'); // open in new window (optional)\r\n });\r\n\r\n // Configure Short Video Tab\r\n ;\r\n $shortVideoTab.click(function (e) {\r\n e.stopPropagation && e.stopPropagation();\r\n e.preventDefault && e.preventDefault();\r\n\r\n ;\r\n\r\n // Show Short Video\r\n $longVideoArea.hide();\r\n $shortVideoArea.show();\r\n\r\n // Deactivate Long Tab\r\n $longVideoTab.removeClass('btn-prime-1').addClass('btn-prime-1-ghost');\r\n // Activate Short Tab\r\n $shortVideoTab.removeClass('btn-prime-1-ghost').addClass('btn-prime-1');\r\n\r\n _updateCodeBox($('script', $shortVideoArea).attr('src'), $codeBox);\r\n });\r\n\r\n // Configure Long Video Tab\r\n ;\r\n /* enable the 60 second version button functionality */\r\n $longVideoTab.click(function (e) {\r\n e.stopPropagation && e.stopPropagation();\r\n e.preventDefault && e.preventDefault();\r\n\r\n ;\r\n\r\n // Show Long Video\r\n $shortVideoArea.hide();\r\n $longVideoArea.show();\r\n\r\n // Deactivate Short Tab\r\n $shortVideoTab.removeClass('btn-prime-1').addClass('btn-prime-1-ghost');\r\n // Activate Long Tab\r\n $longVideoTab.removeClass('btn-prime-1-ghost').addClass('btn-prime-1');\r\n\r\n _updateCodeBox($('script', $longVideoArea).attr('src'), $codeBox);\r\n });\r\n\r\n ;\r\n });\r\n }\r\n\r\n function _getPlayerName(scope) {\r\n return $(\"div.smv-player object:visible\", scope).attr('name');\r\n }\r\n\r\n function _updateCodeBox(videoUrl, $codeBox) {\r\n var oldSrc = /src=\"([^\"]+)\"/.exec($codeBox.text())[1];\r\n\r\n if (typeof videoUrl != \"undefined\") {\r\n $codeBox.text($codeBox.text().replace(oldSrc, videoUrl));\r\n ;\r\n } else {\r\n logging.error(\"Invalid video url passed in, unable to updated code box\", _ModuleName);\r\n }\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initBelieveIn(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new BelieveIn(args.scope);\r\n };\r\n});\n","define('Beliefnet/Components/Carousel',[\r\n \"jquery\",\r\n \"logging\"\r\n], function ($, logging) {\r\n var _ModuleName = \"Carousel\";\r\n\r\n function Carousel(scope) {\r\n \"use strict\";\r\n\r\n var $carousel = $(\"#myCarousel\", scope);\r\n\r\n if ($carousel.length) {\r\n var items = $(\".item\", $carousel);\r\n var activeItem = $(\".item.active\", $carousel);\r\n if (activeItem.length == 0 && items.length > 0) {\r\n items[0].className = \"item active\";\r\n }\r\n ;\r\n } else {\r\n ;\r\n }\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initCarousel(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new Carousel(args.scope);\r\n };\r\n});\n","define('Beliefnet/Components/CenterAd',[\r\n \"jquery\",\r\n \"logging\",\r\n \"utilities\",\r\n \"ads\"\r\n], function ($, logging, utilities, ads) {\r\n var _ModuleName = \"Center Ad\";\r\n\r\n /*\r\n config: {\r\n id, // string : DIV ID of Ad Slot\r\n position, // string : Position Value (eg. DT_ATF_TOP)\r\n sizes, // string : Eligable Sizes (eg. 300x250)\r\n yieldbot, // bool : Whethor or not slot is eligable for Yieldbot\r\n outofpage, // bool : Whether or not slot is out of page\r\n mobile // bool : Whether or not slot is mobile\r\n }\r\n */\r\n\r\n function CenterAd(scope, config) {\r\n \"use strict\";\r\n\r\n var $ad = $(scope);\r\n\r\n var $container = $ad.parent();\r\n var fixedOffset = Math.ceil($ad.offset().left - (($(window).width() - $ad.width()) / 2.0));\r\n\r\n ;\r\n var styles = $container.attr('style') || '';\r\n $container.attr('style', styles + ';margin-left: -' + fixedOffset + 'px;');\r\n\r\n return;\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initCenterAd(args) {\r\n return new CenterAd(args.scope, args.Config);\r\n };\r\n});\r\n\r\n\n","define('Beliefnet/Components/ColumnistList',[\r\n \"jquery\",\r\n \"logging\"\r\n], function ($, logging) {\r\n var _ModuleName = \"Columnist List\";\r\n\r\n function ColumnistList(scope) {\r\n \"use strict\";\r\n\r\n var $columnistList = $(scope);\r\n\r\n // cache the important elements\r\n var $blogs = $(\".columnistslistblock.content-container-xs\", $columnistList);\r\n var $categories = $(\"#category li\", $columnistList);\r\n\r\n // Click function\r\n ;\r\n $categories.click(function () {\r\n var $catButton = $(this);\r\n\r\n // Get data of category.\r\n var customType = $catButton.data('filter'); // category\r\n ;\r\n\r\n // Clear active buttons\r\n ;\r\n $categories.removeClass(\"active\");\r\n\r\n // Set this category button as active\r\n ;\r\n $catButton.addClass(\"active\");\r\n\r\n // Only show blogs that apply to the category filter.\r\n if (customType == 'All') {\r\n ;\r\n $blogs.show();\r\n }\r\n else {\r\n ;\r\n $blogs\r\n .hide()\r\n .filter(function ( index, blog ) {\r\n return $(blog).data('cat').indexOf(customType) != -1;\r\n })\r\n .show();\r\n }\r\n });\r\n\r\n ;\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initColumnistList(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new ColumnistList(args.scope);\r\n };\r\n});\n","define('Beliefnet/Components/ContactUs',[\r\n \"jquery\",\r\n \"logging\",\r\n \"utilities\"\r\n], function ($, logging, utilities) {\r\n var _ModuleName = \"Contact Us\";\r\n\r\n function ContactUs(scope) {\r\n \"use strict\";\r\n\r\n var $contactForm = $('form.contact-form', scope);\r\n\r\n $contactForm.submit(function (e) {\r\n e.stopPropagation && e.stopPropagation();\r\n e.preventDefault && e.preventDefault();\r\n\r\n ;\r\n\r\n var email = $('input[name=emailAddress]', $contactForm).val();\r\n if (email == '') {\r\n alert('Please enter your email address');\r\n ;\r\n return false;\r\n }\r\n\r\n if (!utilities.isAValidEmailAddress(email)) {\r\n alert('Please enter a valid email address');\r\n ;\r\n return false;\r\n }\r\n\r\n var message = $('textarea[name=message]', $contactForm).val();\r\n if ($.trim(message) == '') {\r\n alert('Please include the message you\\'d like to send us');\r\n ;\r\n return false;\r\n }\r\n\r\n ;\r\n $.post(this.action, $contactForm.serialize(), function () {\r\n $('.contact-form-wrapper').html(\"Thank you for your feedback!\");\r\n ;\r\n }).fail(function (data) {\r\n alert('There was an issue processing your request');\r\n ;\r\n });\r\n\r\n return false;\r\n });\r\n\r\n ;\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initContactUs(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new ContactUs(args.scope);\r\n };\r\n});\r\n\n","define('Beliefnet/Components/ContributingWriters',[\r\n \"jquery\",\r\n \"logging\"\r\n], function ($, logging) {\r\n var _ModuleName = \"Contributing Writers\";\r\n var _showChar = 345;\r\n\r\n function ContributingWriters(scope, identifier) {\r\n \"use strict\";\r\n\r\n var $writerBio = $(scope);\r\n\r\n ;\r\n ;\r\n\r\n var content = $writerBio.text();\r\n\r\n ;\r\n if (content.length > _showChar) {\r\n var mod = content.indexOf(' ', _showChar);\r\n _showChar = mod < content.length && mod > 0 ? mod : _showChar;\r\n var blurb = content.substr(0, _showChar);\r\n var hiddenBlurb = content.substr(_showChar - 0, content.length - _showChar);\r\n\r\n var html = blurb\r\n + ' ...show more'\r\n + '' + hiddenBlurb + ''\r\n + ' ...show less';\r\n\r\n $writerBio.html(html);\r\n } else {\r\n ;\r\n return;\r\n }\r\n\r\n // Hide extra blurb content and \"show less\"\" link.\r\n $(\"#hidden-blurb-\" + identifier, $writerBio).toggle();\r\n $(\"#show-less-\" + identifier, $writerBio).toggle();\r\n\r\n ;\r\n $(\"a.serif-link\", $writerBio).click(function (event) {\r\n event.preventDefault();\r\n\r\n var $link = $(this);\r\n\r\n ;\r\n if ($link.attr('id') == \"show-more-\" + identifier || $link.attr('id') == \"show-less-\" + identifier) {\r\n $(\"#show-more-\" + identifier).toggle();\r\n $(\"#show-less-\" + identifier).toggle();\r\n $(\"#hidden-blurb-\" + identifier).toggle();\r\n }\r\n });\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initContributingWriters(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new ContributingWriters(args.scope, args.WriterIdentifier);\r\n };\r\n});\n","define('Beliefnet/Components/DFPPageConfig',[\r\n \"jquery\",\r\n \"logging\",\r\n \"ads\",\r\n \"analytics\"\r\n], function ($, logging, ads, analytics) {\r\n var _ModuleName = \"DFP Page Config\";\r\n\r\n function DFPPageConfig(scope, config) {\r\n \"use strict\";\r\n\r\n ;\r\n\r\n ads.registerPageConfig(config);\r\n\r\n // If audience tags defined, pass into Google Analytics Dimension 6\r\n if (config.audience && config.audience.length > 0) {\r\n analytics.SetDimension(6, config.audience[0]);\r\n }\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initDFPPageConfig(args) {\r\n // Do not initialize the module if we are in Experience Editor or if ads were preloaded\r\n if (args.IsExperienceEditorEditing === true || ads.isPreloaded()) {\r\n return null;\r\n }\r\n\r\n return new DFPPageConfig(args.scope, args.DFPPageConfig);\r\n };\r\n});\n","define('Beliefnet/Components/DisqusComments',[\r\n \"jquery\",\r\n \"underscore\",\r\n \"logging\"\r\n], function ($, _, logging) {\r\n var _ModuleName = \"Disqus Comments\";\r\n var _DisqusConfigured = false;\r\n var _DisqusLoaded = false;\r\n var _scrollOffset = 1500; // Number of pixels before Disqus element before loading starts\r\n var _scrollThrottle = 200;\r\n\r\n var $disqus;\r\n\r\n function DisqusComments(scope) {\r\n \"use strict\";\r\n\r\n if (_DisqusConfigured) {\r\n ;\r\n return;\r\n }\r\n\r\n $disqus = $(scope);\r\n\r\n if ($disqus.length) {\r\n var throttled = _.throttle(_handleScroll, _scrollThrottle);\r\n $(window).scroll(throttled);\r\n\r\n ;\r\n } else {\r\n logging.error(\"Failed to set up disqus loading\", _ModuleName);\r\n }\r\n\r\n _DisqusConfigured = true;\r\n }\r\n\r\n function _handleScroll() {\r\n // If we've scrolled within range of it, and it hasn't been loaded yet... load it\r\n if ($disqus.length && (window.innerHeight + window.scrollY) >= ($disqus.offset().top - _scrollOffset) && !_DisqusLoaded) {\r\n $(window).off(\"scroll\", this);\r\n\r\n ;\r\n _DisqusLoaded = true;\r\n\r\n var disqus_shortname = 'bnet';\r\n var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;\r\n dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';\r\n (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);\r\n }\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initDisqusComments(args) {\r\n // Do not initialize the module if we are in Experience Editor\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new DisqusComments(args.scope);\r\n };\r\n});\r\n\r\n\r\n\n","define('Beliefnet/Components/DisqusCounts',[\r\n \"jquery\",\r\n \"logging\"\r\n], function ($, logging) {\r\n var _ModuleName = \"Disqus Counts\";\r\n var _DisqusLoaded = false;\r\n\r\n function DisqusCounts(scope) {\r\n \"use strict\";\r\n\r\n // Check if already loaded\r\n if (_DisqusLoaded) {\r\n ;\r\n return;\r\n }\r\n\r\n var $commentCount = $(\".disqus-comment-count\");\r\n if ($commentCount.length) {\r\n ;\r\n var disqus_shortname = 'bnet';\r\n var dsq_comment_display = document.createElement('script');\r\n\r\n dsq_comment_display.async = true;\r\n dsq_comment_display.type = 'text/javascript';\r\n dsq_comment_display.id = 'dsq-count-scr';\r\n dsq_comment_display.src = '//' + disqus_shortname + '.disqus.com/count.js';\r\n (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq_comment_display);\r\n\r\n _DisqusLoaded = true;\r\n } else {\r\n ;\r\n }\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initDisqusCounts(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new DisqusCounts(args.scope);\r\n };\r\n});\n","define('Beliefnet/Components/GDPR',[\r\n \"jquery\",\r\n \"logging\",\r\n \"location\",\r\n \"utilities\"\r\n], function ($, logging, location, utilities) {\r\n var _ModuleName = \"GDPR\";\r\n\r\n var _config = {\r\n enabled: true,\r\n dataattr: \"bnet-gdpr\",\r\n testing: {\r\n enabled: false,\r\n param: \"bnet-gdpr-test\"\r\n }\r\n }\r\n\r\n function GDPR(scope) {\r\n \"use strict\";\r\n\r\n if (_config.enabled || (_config.testing.enabled && utilities.getParameter(document.URL, _config.testing.param) == \"true\")) {\r\n ;\r\n location.isCookieLawZone(function () {\r\n ;\r\n $('*[data-' + _config.dataattr + ']', scope).each(function (idx, elem) {\r\n var filterVals = $(elem).data(_config.dataattr);\r\n if (filterVals) {\r\n var filters = filterVals.split('|');\r\n _applyFilters(elem, filters);\r\n }\r\n });\r\n }, function () {\r\n ;\r\n });\r\n } else {\r\n ;\r\n }\r\n }\r\n\r\n function _applyFilters(elem, filters) {\r\n // Checkbox\r\n if ($(elem).is(':checkbox')) {\r\n _applyCheckbox(elem, filters);\r\n }\r\n\r\n // Defaults\r\n _applyDefault(elem, filters);\r\n }\r\n\r\n var _checkboxFilters = ['checked', 'unchecked'];\r\n function _applyCheckbox(elem, filters) {\r\n ;\r\n for (var i = 0; i < filters.length; i++) {\r\n switch (filters[i]) {\r\n case 'checked':\r\n ;\r\n $(elem).prop('checked', true);\r\n break;\r\n case 'unchecked':\r\n ;\r\n $(elem).prop('checked', false);\r\n break; \r\n }\r\n }\r\n }\r\n\r\n var _defaultFilters = ['show', 'hide'];\r\n function _applyDefault(elem, filters) {\r\n ;\r\n for (var i = 0; i < filters.length; i++) {\r\n switch (filters[i]) {\r\n case 'show':\r\n ;\r\n $(elem).show();\r\n $(elem).removeClass('hidden');\r\n break;\r\n case 'hide':\r\n ;\r\n $(elem).hide();\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initGDPR(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new GDPR(args.scope);\r\n };\r\n});\n","define('Beliefnet/Components/GoogleCustomSearch',[\r\n \"logging\"\r\n], function (logging) {\r\n var _ModuleName = \"Google Custom Search\";\r\n var _ScriptsLoaded = false;\r\n\r\n function GoogleCustomSearch(scope) {\r\n \"use strict\";\r\n\r\n if (_ScriptsLoaded) {\r\n ;\r\n return;\r\n }\r\n\r\n var cx = '010742488518275874017:ka5gvgs0dei';\r\n var gcse = document.createElement('script');\r\n gcse.type = 'text/javascript';\r\n gcse.async = true;\r\n gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +\r\n '//cse.google.com/cse.js?cx=' + cx;\r\n var s = document.getElementsByTagName('script')[0];\r\n s.parentNode.insertBefore(gcse, s);\r\n\r\n ;\r\n\r\n _ScriptsLoaded = true;\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initGoogleCustomSearch(args) {\r\n // Do not initialize the module if we are in Experience Editor\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new GoogleCustomSearch(args.scope);\r\n };\r\n});\r\n\n","\r\ndefine('Beliefnet/Components/Hero',[\r\n \"jquery\",\r\n \"logging\",\r\n \"utilities\",\r\n \"skrollr\"\r\n], function ($, logging, utilities, skrollr) {\r\n var _ModuleName = \"Hero\";\r\n var _Initialized = false;\r\n\r\n function Hero(scope) {\r\n \"use strict\";\r\n \r\n // This module can be called multiple times but only needs to run once\r\n if (_Initialized) {\r\n ;\r\n return;\r\n }\r\n\r\n // Let's make sure we actually have something to initialize\r\n if ($('[data-0]', scope).length) {\r\n // Initialize Skrollr\r\n skrollr.init({\r\n forceHeight: false\r\n });\r\n\r\n _Initialized = true;\r\n\r\n ;\r\n } else {\r\n ;\r\n } \r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initHero(args) {\r\n // Do not initialize the module if we are in Experience Editor or it is simply disabled\r\n if (args.IsExperienceEditorEditing === true || utilities.IsMobile() === true) {\r\n return null;\r\n }\r\n\r\n return new Hero(args.scope);\r\n };\r\n});\r\n\n","\r\ndefine('Beliefnet/Components/InteractiveGallery',[\r\n \"jquery\",\r\n \"utilities\",\r\n \"logging\",\r\n \"AdModules/manualloading\"\r\n], function ($, utilities, logging, manualloading) {\r\n var _ModuleName = \"Interactive Gallery\";\r\n\r\n function InteractiveGallery(scope) {\r\n \"use strict\";\r\n ;\r\n // Loop through each modal and configure the button click handlers\r\n // $('.modal', scope).each(function(idx, modal) {\r\n //var mid = $(modal).attr('id');\r\n //;\r\n $(\"a[data-toggle='modal']\", scope).on('click',function() {\r\n var mid = $($(this).attr('href'));\r\n ;\r\n _handleView($(mid));\r\n });\r\n //});\r\n }\r\n\r\n var _handleView = function ($modal) {\r\n ;\r\n if($modal.length) {\r\n var $ad = utilities.IsMobile() ? $('.visible-xs-block .DFPAdSlot', $modal) : $('.hidden-xs .DFPAdSlot', $modal);\r\n if($ad.length && $ad.attr('id').length) {\r\n ;\r\n manualloading.loadAdManually($ad.attr('id'));\r\n }\r\n }\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initInteractiveGallery(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new InteractiveGallery(args.scope);\r\n };\r\n});\r\n\r\n\r\n\n","\r\ndefine('Beliefnet/Components/JumpTo',[\r\n \"jquery\",\r\n \"underscore\",\r\n \"utilities\",\r\n \"logging\",\r\n \"AdModules/ratelimit\"\r\n], function ($, _, utilities, logging, limit) {\r\n var _ModuleName = \"Jump To\";\r\n // Number of pixel to scroll before showing jump to button\r\n var _ShowAfterScroll = 500;\r\n var $jumpToButton;\r\n\r\n function JumpTo(scope) {\r\n \"use strict\";\r\n\r\n $jumpToButton = $(scope);\r\n var $window = $(window);\r\n\r\n // If adhesion ad serves, we need to remove the jump-to button\r\n if (limit.enabled() && limit.wasServed(\"Mob_Adhesion\")) {\r\n ;\r\n $jumpToButton.remove();\r\n return;\r\n }\r\n\r\n if ($jumpToButton.length) {\r\n // Display Jump To Button After Scroll\r\n var throttled = _.throttle(_handleScroll, 500);\r\n $window.scroll(throttled);\r\n\r\n // When Clicked, Send to Top\r\n if ($jumpToButton.find('.arrow').hasClass(\"up\")) {\r\n $jumpToButton.find(\".jump-to-btn\").click(function () {\r\n ;\r\n // Scroll to top\r\n $(\"html, body\").animate({ scrollTop: 0 }, \"slow\");\r\n });\r\n }\r\n\r\n ;\r\n } else {\r\n logging.error(\"Failed to find Jump button\", _ModuleName);\r\n }\r\n }\r\n\r\n var _handleScroll = function () {\r\n var $window = $(window);\r\n\r\n if ($window.scrollTop() > _ShowAfterScroll) {\r\n $jumpToButton.fadeIn();\r\n } else {\r\n $jumpToButton.fadeOut();\r\n }\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initJumpTo(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true || !utilities.IsPhone()) {\r\n return null;\r\n }\r\n\r\n return new JumpTo(args.scope);\r\n };\r\n});\r\n\n","define('Beliefnet/Components/LinkTo',[\r\n \"jquery\",\r\n \"logging\"\r\n], function ($, logging) {\r\n var _ModuleName = \"Link To\";\r\n var _Initialized = false;\r\n\r\n function LinkTo(scope) {\r\n \"use strict\";\r\n \r\n if (_Initialized) {\r\n ;\r\n return;\r\n }\r\n\r\n var $linkTo = $(\".link-to\", scope);\r\n\r\n $linkTo.each(function () {\r\n var url = $(this).data(\"linkto\");\r\n\r\n if (typeof url != \"undefined\") {\r\n $(this).on(\"click\", function () {\r\n location.href = url;\r\n });\r\n }\r\n });\r\n\r\n _Initialized = true;\r\n\r\n ;\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initLinkTo(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new LinkTo(args.scope);\r\n };\r\n});\n","\r\ndefine('Beliefnet/Components/Navigation',[\r\n \"jquery\",\r\n \"utilities\",\r\n \"logging\",\r\n \"customScrollbar\"\r\n], function ($, utilities, logging) {\r\n var _ModuleName = \"Navigation\";\r\n\r\n function Navigation(scope) {\r\n \"use strict\";\r\n\r\n $(function () {\r\n ;\r\n var type = typeof $(\"#beliefnet-sidebar-nav\").mCustomScrollbar;\r\n if (type != 'function') { return; }\r\n\r\n $(\"#beliefnet-sidebar-nav\").mCustomScrollbar({ theme: \"minimal\" });\r\n\r\n $('#dismiss, .main-nav-overlay').on('click', function () {\r\n $('#beliefnet-sidebar-nav').removeClass('active');\r\n $('.main-nav-overlay').fadeOut();\r\n });\r\n\r\n $('#sidebarCollapse').on('click', function () {\r\n $('#beliefnet-sidebar-nav').addClass('active');\r\n $('.main-nav-overlay').fadeIn();\r\n $('.collapse.in').toggleClass('in');\r\n $('a[aria-expanded=true]').attr('aria-expanded', 'false');\r\n });\r\n\r\n if (isIphone()) {\r\n $('#index-page-subnav-toggle-button').addClass('ios');\r\n }\r\n });\r\n }\r\n\r\n function isIphone() {\r\n return /iPhone/i.test(navigator.userAgent);\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initNavigation(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new Navigation(args.scope);\r\n };\r\n\r\n});\r\n\n","define('Beliefnet/Components/NewsletterManage',[\r\n \"jquery\",\r\n \"utilities\",\r\n \"logging\"\r\n], function ($, utilities, logging) {\r\n var _ModuleName = \"Newsletter Manage\";\r\n\r\n function NewsletterManage(scope) {\r\n \"use strict\";\r\n\r\n var $form = $('form#bn-ec', scope);\r\n\r\n var emailParam = utilities.getParameter(document.URL, \"email\");\r\n if (emailParam) {\r\n $('input[name=emailAddress]', $form).val(emailParam);\r\n $form.submit();\r\n }\r\n\r\n ;\r\n $form.submit(function (e) {\r\n var email = $('input[name=emailAddress]', $form).val();\r\n\r\n ;\r\n\r\n if (email == '') {\r\n ;\r\n alert('Please enter your email address.');\r\n return false;\r\n }\r\n\r\n if (!utilities.isAValidEmailAddress(email)) {\r\n ;\r\n alert(\"Please enter a valid email address.\");\r\n return false;\r\n }\r\n\r\n ;\r\n return true;\r\n });\r\n\r\n ;\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initNewsletterManage(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new NewsletterManage(args.scope);\r\n };\r\n});\r\n\n","define('Beliefnet/Components/NewsletterRetention',[\r\n \"jquery\",\r\n \"logging\"\r\n], function ($, logging) {\r\n var _ModuleName = \"Newsletter Retention\";\r\n\r\n function NewsletterRetention(scope) {\r\n \"use strict\";\r\n\r\n var $submit = $(\".retention-signup button[type=submit]\", scope);\r\n\r\n /* executed on document load */\r\n $submit.click(function (evt) {\r\n evt.stopPropagation && evt.stopPropagation();\r\n evt.preventDefault && evt.preventDefault();\r\n\r\n var $form = $(this).parent('form');\r\n $.post('/bnapi/newsletter/subscribe', $form.serialize(), function (d) {\r\n $form.hide('slow').after('Thanks! Your preferences have been updated.
');\r\n });\r\n });\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initNewsletterRetention(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new NewsletterRetention(args.scope);\r\n };\r\n});\n","define('Beliefnet/Components/NewsletterSignup',[\r\n \"jquery\",\r\n \"utilities\",\r\n \"location\",\r\n \"logging\"\r\n], function ($, utilities, location, logging) {\r\n var _ModuleName = \"Newsletter Signup\";\r\n\r\n function NewsletterSignup(scope) {\r\n \"use strict\";\r\n\r\n var $form = $(\"form.newsletter-signup\", scope);\r\n\r\n // Initialize\r\n _init($form);\r\n\r\n ;\r\n $form.submit(function (e) {\r\n e && e.stopPropagation && e.stopPropagation();\r\n e && e.preventDefault && e.preventDefault();\r\n\r\n // client side form validation\r\n if (!_NewsletterSignupPreCheck($form)) {\r\n ;\r\n return false;\r\n }\r\n\r\n // remove the landing page since this is an ajax request, reattach after the ajax call\r\n var landingpg = $('input[name=LandingPage]', $form).detach();\r\n\r\n $.post('/bnapi/newsletter/subscribe', $form.serialize(), function (e) {\r\n e && e.stopPropagation && e.stopPropagation();\r\n e && e.preventDefault && e.preventDefault();\r\n\r\n ;\r\n // post signup stuff\r\n _NewsletterSignupPostProcess($form);\r\n\r\n // GTM Form Tracking\r\n // https://www.simoahava.com/analytics/track-form-engagement-with-google-tag-manager/\r\n window.dataLayer = window.dataLayer || [];\r\n window.dataLayer.push({\r\n event: 'formNewsletterSuccess',\r\n formId: 'newsletter-signup-form-head'\r\n });\r\n\r\n }).fail(function (jqXHR, textStatus, errorThrown) {\r\n logging.error(\"Failed to sign up user. \" + errorThrown, _ModuleName);\r\n alert('Failed to subscribe. Please try again in a few minutes.');\r\n }).done(function () {\r\n $form.append(landingpg);\r\n });\r\n\r\n return false;\r\n });\r\n\r\n ;\r\n }\r\n\r\n function _NewsletterSignupPreCheck($form) {\r\n // make sure the email address is valid\r\n var $email = $(\"input[name=email], input[name=emailAddress]\", $form);\r\n if (!$email.length) {\r\n ;\r\n alert(\"Couldn't find an email address field. Sorry for the inconvenience.\");\r\n return false;\r\n }\r\n\r\n if (!$email.length || ($email.length && $email.val() == '')) {\r\n ;\r\n alert('Please enter an email address.');\r\n return false;\r\n }\r\n\r\n if (!utilities.isAValidEmailAddress($email.val())) {\r\n ;\r\n alert('The email address entered is not valid');\r\n return false;\r\n }\r\n\r\n var anyNLSelected = false;\r\n $.each($(\"input[name=newsletter]\", $form), function (idx, el) {\r\n if (anyNLSelected) return;\r\n\r\n if (el.type == 'checkbox') {\r\n if (!anyNLSelected && el.checked) {\r\n anyNLSelected = true;\r\n return;\r\n }\r\n } else if (el.type == 'hidden') {\r\n if (!anyNLSelected && /^\\d+$/.test(el.value)) {\r\n anyNLSelected = true;\r\n return;\r\n }\r\n }\r\n });\r\n\r\n if (!anyNLSelected) {\r\n ;\r\n alert('Please select at least one newsletter offer to continue');\r\n return false;\r\n }\r\n\r\n ;\r\n return true;\r\n }\r\n\r\n function _NewsletterSignupPostProcess($form) {\r\n $form.hide();\r\n $form.html('Thanks for signing up!
');\r\n $form.show('slow');\r\n }\r\n\r\n function _init( $form ) {\r\n location.isCookieLawZone(function () {\r\n // We are in the EU\r\n ;\r\n }, function () {\r\n // We are not in the EU\r\n ;\r\n });\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initNewsletterSignup(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new NewsletterSignup(args.scope);\r\n };\r\n});\n","define('Beliefnet/Components/NewsletterSubscribe',[\r\n \"jquery\",\r\n \"logging\",\r\n \"utilities\"\r\n], function ($, logging, utilities) {\r\n var _ModuleName = \"Newsletter Subscribe\";\r\n\r\n function NewsletterSubscribe(scope) {\r\n \"use strict\";\r\n\r\n var $signupForm = $('form#fp-nl-signup', scope);\r\n\r\n ;\r\n $signupForm.submit(function (e) {\r\n ;\r\n\r\n var email = $('input[name=emailAddress]', $signupForm).val(),\r\n email2 = $('input[name=emailConfirm]', $signupForm).val(),\r\n name = $('input[name=firstName]', $signupForm).val(),\r\n zip = $('input[name=zip]', $signupForm).val();\r\n\r\n if (email == '') {\r\n ;\r\n alert('Please enter your email address.');\r\n return false;\r\n }\r\n\r\n if (!utilities.isAValidEmailAddress(email)) {\r\n ;\r\n alert(\"Please enter a valid email address.\");\r\n return false;\r\n }\r\n\r\n if (email2 == '') {\r\n ;\r\n alert('Please verify your email address.');\r\n return false;\r\n }\r\n\r\n if (email != email2) {\r\n ;\r\n alert('Your email address entries do not match, please verify your email address.')\r\n return false;\r\n }\r\n\r\n if (name == '') {\r\n ;\r\n alert('Please enter your first name.');\r\n return false;\r\n }\r\n\r\n if (zip == '') {\r\n ;\r\n alert('Please enter your zip code.');\r\n return false;\r\n }\r\n\r\n if (!$('input[name=newsletter]:checked', $signupForm).length) {\r\n ;\r\n alert('Please select at least one newsletter offer to continue!');\r\n return false;\r\n }\r\n\r\n ;\r\n return true;\r\n });\r\n\r\n ;\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initNewsletterSubscribe(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new NewsletterSubscribe(args.scope);\r\n };\r\n});\n","define('Beliefnet/Components/OMaticQuiz/NewsletterSignup',[\r\n \"jquery\",\r\n \"logging\"\r\n], function ($, logging) {\r\n \"use strict\";\r\n\r\n var _ModuleName = \"OMatic Quiz Newsletter Signup\";\r\n\r\n function Submit(scope) {\r\n ;\r\n\r\n var $form = $(scope);\r\n\r\n // process email collection form and submit\r\n var $signup = $(\"input[name=partners]\", $form);\r\n if ($signup.is(\":checked\")) {\r\n\r\n // Disable a couple things that shouldn't get submitted\r\n $('input[name=qid]', $form).prop('disabled', true);\r\n $('input[name=p]', $form).prop('disabled', true);\r\n\r\n ;\r\n // Post form back to server\r\n $.ajax({\r\n url: \"/bnapi/newsletter/subscribe\",\r\n async: false,\r\n dataType: \"json\",\r\n method: \"POST\",\r\n data: $form.serialize()\r\n }) .done(function (data) {\r\n if (data.processed) {\r\n ;\r\n }\r\n else {\r\n ;\r\n ;\r\n }\r\n })\r\n .fail(function () {\r\n logging.error(\"Failed to complete Newsletter Signup Request\", _ModuleName);\r\n })\r\n .always(function () {\r\n ;\r\n });\r\n\r\n // re-enable those elements\r\n $('input[name=qid]', $form).prop('disabled', false);\r\n $('input[name=p]', $form).prop('disabled', false);\r\n }\r\n }\r\n\r\n return {\r\n Submit: Submit\r\n }\r\n});\n","define('Beliefnet/Components/OMaticQuiz/SessionManager',[\r\n \"jquery\",\r\n \"logging\",\r\n \"utilities\"\r\n], function ($, logging, utilities) {\r\n \"use strict\";\r\n\r\n var _ModuleName = \"OMatic Quiz Session Manager\";\r\n var _SessionData = _SessionData || {};\r\n\r\n function SaveEmail(form) {\r\n ;\r\n\r\n // Store email data locally\r\n _SessionData.email = $('input[name=email]', form).val();\r\n\r\n SaveSession();\r\n }\r\n\r\n function SaveRecaptchaResponse(form) {\r\n ;\r\n\r\n // Store email data locally\r\n _SessionData.recaptchaResponse = grecaptcha.getResponse();\r\n\r\n SaveSession();\r\n }\r\n\r\n function SaveAnswer(form) {\r\n ;\r\n\r\n var answerId = $(\"input[name=answer]:not(old):checked\", form).val();\r\n var weight = $(\"input[name=options]:not(old):checked\", form).val();\r\n var question = $(\"input[name=index]\", form).val();\r\n\r\n ;\r\n ;\r\n\r\n // Make sure session answers has been initialized\r\n _SessionData.answers = _SessionData.answers || {};\r\n\r\n // Make sure session weights have been initialized\r\n _SessionData.weights = _SessionData.weights || {};\r\n\r\n logging.debug(\"Updating Session with Answer Data\", _ModuleName)\r\n // Add new answer to Session\r\n _SessionData.answers[question] = answerId;\r\n _SessionData.weights[question] = weight;\r\n\r\n SaveSession();\r\n }\r\n\r\n function GetSession(qid) {\r\n ;\r\n\r\n if (typeof qid == 'undefined') {\r\n _SessionData = {};\r\n\r\n ;\r\n return;\r\n }\r\n\r\n if (typeof _SessionData == 'undefined' || $.isEmptyObject(_SessionData)) {\r\n var cookieId = \"bnqom-\" + qid.substring(0, 5);\r\n var json = utilities.getCookie(cookieId);\r\n if (typeof json != 'undefined' && json != '') {\r\n _SessionData = JSON.parse(json);\r\n\r\n if (typeof _SessionData.uid != 'undefined') {\r\n ;\r\n }\r\n else {\r\n ;\r\n }\r\n }\r\n else {\r\n _SessionData = {};\r\n\r\n ;\r\n }\r\n }\r\n\r\n ;\r\n }\r\n\r\n function SaveSession() {\r\n ;\r\n if (typeof _SessionData != 'undefined' && typeof _SessionData.qid != 'undefined') {\r\n var cookieId = \"bnqom-\" + _SessionData.qid.substring(0, 5);\r\n ;\r\n utilities.setCookie(cookieId, JSON.stringify(_SessionData), 1); // expires in 1 day\r\n ;\r\n }\r\n }\r\n\r\n function ResetSession() {\r\n ;\r\n\r\n // Get Quiz ID\r\n var qid = $(\"input[name=qid]\").val();\r\n\r\n // Reset Session Object\r\n _SessionData = {};\r\n\r\n // Set quiz ID\r\n ValidateQuizId(qid);\r\n\r\n // Make sure session has a unique id defined\r\n InitUid();\r\n\r\n // Save the new session\r\n SaveSession();\r\n }\r\n\r\n function ValidateQuizId(qid) {\r\n if (typeof _SessionData.qid == 'undefined') {\r\n _SessionData.qid = qid;\r\n }\r\n }\r\n\r\n function InitUid() {\r\n if (typeof _SessionData.uid == 'undefined') {\r\n _SessionData.uid = utilities.Guid();\r\n\r\n ;\r\n }\r\n }\r\n\r\n function GetUserEmail() {\r\n if (typeof _SessionData.email != 'undefined') {\r\n return _SessionData.email;\r\n }\r\n }\r\n\r\n function SetUserEmail(email) {\r\n if (typeof email != 'undefined') {\r\n _SessionData.email = email;\r\n }\r\n }\r\n\r\n function GetRecaptchaResponse() {\r\n if (typeof _SessionData.recaptchaResponse != 'undefined') {\r\n return _SessionData.recaptchaResponse;\r\n }\r\n }\r\n\r\n function SetRecaptchaResponse(recaptchaResponse) {\r\n if (typeof recaptchaResponse != 'undefined') {\r\n _SessionData.recaptchaResponse = recaptchaResponse;\r\n }\r\n }\r\n\r\n function GetSessionId() {\r\n if (typeof _SessionData.uid != 'undefined') {\r\n return _SessionData.uid.substring(0, 8);\r\n }\r\n\r\n return '';\r\n }\r\n\r\n return {\r\n SaveEmail: SaveEmail,\r\n SaveRecaptchaResponse: SaveRecaptchaResponse,\r\n SaveAnswer: SaveAnswer,\r\n GetSession: GetSession,\r\n SaveSession: SaveSession,\r\n ResetSession: ResetSession,\r\n ValidateQuizId: ValidateQuizId,\r\n InitUid: InitUid,\r\n GetUserEmail: GetUserEmail,\r\n SetUserEmail: SetUserEmail,\r\n GetRecaptchaResponse: GetRecaptchaResponse,\r\n SetRecaptchaResponse: SetRecaptchaResponse,\r\n GetSessionId: GetSessionId\r\n }\r\n});\n","define('Beliefnet/Components/OMaticQuiz/QuizUtilities',[\r\n \"jquery\",\r\n \"logging\",\r\n \"utilities\"\r\n], function ($, logging, utilities) {\r\n \"use strict\";\r\n\r\n var _ModuleName = \"OMatic Quiz Utilities\";\r\n\r\n function DisableFormElements(form) {\r\n ;\r\n\r\n $('.disable-on-submit', form).each(function () {\r\n var $fld = $(this);\r\n $fld.prop('disabled', true);\r\n $fld.addClass('disabled');\r\n $fld.attr('name', '');\r\n });\r\n }\r\n\r\n function ValidateEmailCollection(form) {\r\n ;\r\n\r\n if ($('input[name=firstName]', form).val() == \"\") {\r\n alert('Please enter a name.');\r\n return false;\r\n }\r\n\r\n var recaptchaResponse = grecaptcha.getResponse();\r\n if (recaptchaResponse.length == 0) {\r\n alert('Please verify with reCAPTCHA.');\r\n return false;\r\n }\r\n\r\n var email = $('input[name=email]', form);\r\n if (email.val() == \"\") {\r\n alert('Please enter your email addresss.');\r\n return false;\r\n }\r\n\r\n if (!utilities.isAValidEmailAddress(email)) {\r\n alert('Please enter a valid email address.');\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n return {\r\n DisableFormElements: DisableFormElements,\r\n ValidateEmailCollection: ValidateEmailCollection\r\n }\r\n});\n","define('Beliefnet/Components/OMaticQuiz/QuizProcessors',[\r\n \"jquery\",\r\n \"logging\",\r\n \"Beliefnet/Components/OMaticQuiz/SessionManager\",\r\n \"Beliefnet/Components/OMaticQuiz/NewsletterSignup\",\r\n \"Beliefnet/Components/OMaticQuiz/QuizUtilities\"\r\n], function ($, logging, session, newsletter, quizutils) {\r\n \"use strict\";\r\n\r\n var _ModuleName = \"OMatic Quiz Processors\";\r\n\r\n function Intro(form) {\r\n // Reset the session\r\n session.ResetSession();\r\n\r\n // Disable form elements\r\n quizutils.DisableFormElements(form);\r\n\r\n // Move on\r\n return true;\r\n }\r\n\r\n function EmailCollection(form) {\r\n ;\r\n\r\n ;\r\n if (quizutils.ValidateEmailCollection(form)) {\r\n // Need to use AJAX for newsletter email collection submission if checkbox was enabled\r\n newsletter.Submit(form);\r\n\r\n // Save email address locally\r\n session.SaveEmail(form);\r\n\r\n // Save recaptcha response locally\r\n session.SaveRecaptchaResponse(form);\r\n\r\n // Disable Form Elements so they aren't passed in the URL\r\n quizutils.DisableFormElements(form);\r\n\r\n ;\r\n return true;\r\n }\r\n\r\n ;\r\n return false;\r\n }\r\n\r\n function Answer(form) {\r\n // Add Refresh Icon\r\n $(\"button[type=submit]\", form).each(function (button) {\r\n $(\".refresh-icon\", button)\r\n .removeClass(\"refresh-icon\")\r\n .addClass(\"fa fa-refresh fa-spin\");\r\n });\r\n\r\n // Need to store answer locally\r\n session.SaveAnswer(form);\r\n\r\n // Disable form elements so they don't get attached to URL\r\n quizutils.DisableFormElements(form);\r\n\r\n // Allow form to submit using get thus moving user forward\r\n return true;\r\n }\r\n\r\n function Result(form) {\r\n // Add Refresh Icon\r\n $(\"button[type=submit]\", form).each(function (button) {\r\n $(\".refresh-icon\", button)\r\n .removeClass(\"refresh-icon\")\r\n .addClass(\"fa fa-refresh fa-spin\");\r\n });\r\n\r\n // Need to store answer locally\r\n session.SaveAnswer(form);\r\n\r\n // Set session id\r\n $(\"input[name=sid]\", form).val(session.GetSessionId());\r\n\r\n // Disable form elements so they don't get attached to URL\r\n quizutils.DisableFormElements(form);\r\n\r\n // Allow form to submit using get thus moving user forward\r\n return true;\r\n }\r\n\r\n return {\r\n Intro: Intro,\r\n EmailCollection: EmailCollection,\r\n Answer: Answer,\r\n Result: Result\r\n }\r\n});\n","define('Beliefnet/Components/OMaticQuiz',[\r\n \"jquery\",\r\n \"utilities\",\r\n \"logging\",\r\n \"Beliefnet/Components/OMaticQuiz/SessionManager\",\r\n \"Beliefnet/Components/OMaticQuiz/QuizProcessors\",\r\n \"jqueryRadiosToSlider\"\r\n], function ($, utilities, logging, session, processors) {\r\n var _ModuleName = \"OMatic Quiz\";\r\n\r\n function OMaticQuiz(scope) {\r\n \"use strict\";\r\n\r\n // set up the fancy importance slider\r\n $(\"#radio2slider\", scope).radiosToSlider();\r\n\r\n // show/hide for the 'see my results' button on the final results pane\r\n $(\".show-extra-results\", scope).click(function () {\r\n $(\".omatic-percentages\", scope).show('slow');\r\n $(\".show-extra-results\", scope).addClass('hidden');\r\n });\r\n\r\n $(\".take-quiz-again\", scope).click(function () {\r\n var url = $(this).data('url');\r\n\r\n if (typeof url != 'undefined' && url != '') {\r\n // Save copy of old session email\r\n var email = session.GetUserEmail();\r\n\r\n // create new session\r\n session.ResetSession();\r\n\r\n // Save email again\r\n session.SetUserEmail(email);\r\n\r\n // Save Session\r\n session.SaveSession();\r\n\r\n // Send user to first question\r\n window.location.href = url + \"?p=1\";\r\n }\r\n });\r\n\r\n // show the 'next question' button when the user picks an answer\r\n $(\".qom-answer\", scope).click(function () {\r\n $(\".quiz-button button[type=submit]\", scope).removeClass('disabled');\r\n });\r\n\r\n // If an answer was selected before we were ready, go ahead and enable the 'next question' button\r\n var $earlyAnswers = $(\"input[name=answer]:not(old):checked\", scope);\r\n if ($earlyAnswers.length) {\r\n $(\".quiz-button button[type=submit]\", scope).removeClass('disabled');\r\n }\r\n\r\n // Try loading session data\r\n var qid = $(\"input[name=qid]\", scope).val();\r\n\r\n if (typeof qid != 'undefined') {\r\n session.GetSession(qid);\r\n\r\n // Set quiz ID\r\n session.ValidateQuizId(qid);\r\n\r\n //If a user starts a quiz in the middle redirect to first page\r\n redirectIfInvalidSession();\r\n\r\n // Make sure session has a unique id defined\r\n session.InitUid();\r\n\r\n // Save Session\r\n session.SaveSession();\r\n }\r\n else {\r\n logging.error(\"Invalid QID. Initialization Failed.\", _ModuleName);\r\n }\r\n\r\n // Set up form submit handlers with processors\r\n var $jsOnSubmitProcessors = $('form[data-omatic-onsubmit]', scope);\r\n if ($jsOnSubmitProcessors.length) {\r\n $jsOnSubmitProcessors.each(function (index, form) {\r\n ;\r\n $(form).submit(function () {\r\n var $form = $(this);\r\n var procName = $form.data('omatic-onsubmit');\r\n\r\n ;\r\n\r\n var result = false;\r\n\r\n try {\r\n result = processors[procName]($form);\r\n\r\n ;\r\n } catch (err) {\r\n logging.error(\"Failed to call processor \" + procName, _ModuleName);\r\n logging.error(\"Error: \" + err, _ModuleName);\r\n }\r\n\r\n return result;\r\n })\r\n });\r\n }\r\n }\r\n\r\n function redirectIfInvalidSession() {\r\n\r\n var queryString = location.search;\r\n\r\n //Skip if already at the beginning\r\n if (queryString == \"\") { return; }\r\n\r\n var sessionID = session.GetSessionId();\r\n\r\n if (sessionID == '') {\r\n //get url without query parameters\r\n var url = location.protocol + '//' + location.host + location.pathname\r\n \r\n //redirect to the begginning\r\n window.location.replace(url);\r\n }\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initOMaticQuiz(args) {\r\n\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new OMaticQuiz(args.scope);\r\n };\r\n});\n","define('Beliefnet/Components/OnePageQuiz',[\r\n \"jquery\",\r\n \"logging\"\r\n], function ($, logging) {\r\n var _ModuleName = \"One Page Quiz\";\r\n\r\n function OnePageQuiz(scope) {\r\n \"use strict\";\r\n\r\n //Scroll to top on page load\r\n $(window).scrollTop(0);\r\n\r\n var $OnePageQuiz = $(scope);\r\n\r\n ;\r\n // If one page quiz was found, initialize\r\n if ($OnePageQuiz.length) {\r\n\r\n ;\r\n /* if the user goes back, we need to make sure we display the next button so they\r\n can continue forward again */\r\n if ($(\"input[name=answer]:checked\", $OnePageQuiz).length) {\r\n $(\"button[type=submit]\", $OnePageQuiz).each(function () {\r\n $(this).removeClass(\"hidden\");\r\n });\r\n }\r\n\r\n ;\r\n /* Set up onePage Quizzes */\r\n\r\n $(\".quiz-answers input[type=radio]\", $OnePageQuiz).each(function () {\r\n // for each radio button, watch for changes\r\n $(this).click(function () {\r\n ;\r\n\r\n var $answer = $(this);\r\n var $name = $(this).attr('name');\r\n\r\n // Lets make sure we have something to work with\r\n if ($answer == null || $answer.length == 0) {\r\n logging.error(\"Something went wrong and we don't have a handle on the answer chosen\", _ModuleName);\r\n return;\r\n }\r\n\r\n // If the click did not check the radio button, just return\r\n if (!$answer.is(\":checked\")) {\r\n ;\r\n return;\r\n }\r\n\r\n // Show next question button for trivia and personality quizzes\r\n $(\"#NextButtonID\").removeClass(\"disabled\");\r\n\r\n ;\r\n // move explaination text to the \"correct\" answer\r\n var $explaination = $answer.parent().parent().parent().parent().find(\".question-explaination-text\");\r\n var answerText = $answer.parent().parent().find(\".quiz-answers .correct label span span\").text().trim();\r\n\r\n if (answerText != $explaination.text().trim()) {\r\n $answer.parent().parent().find(\".correct .explaination-text\").html($explaination.html());\r\n }\r\n\r\n // If selection was incorrect, show correct\r\n if ($answer.parent().hasClass(\"incorrect\")) {\r\n ;\r\n $answer.parent().parent().find('.correct').addClass(\"show-correct\");\r\n }\r\n\r\n ;\r\n $answer.parent().parent().find(\"input\").attr('disabled', true);\r\n\r\n //check if all questions were answered\r\n if ($('.quiz-answers:not(:has(:radio:checked))').length === 0) {\r\n ;\r\n\r\n //grab scores\r\n var score = 0;\r\n $(':radio:checked').each(function () {\r\n score = score + Number($(this).val());\r\n });\r\n\r\n //grab chosen scores for OMatic\r\n var resultArray = [];\r\n $(':radio:checked ~ label > .weight').each(function () {\r\n var rawScore = $(this).text();\r\n\r\n if (rawScore != null) {\r\n //parse result\r\n var result = rawScore.substr(0, rawScore.indexOf(\"|\"))\r\n //parse score\r\n var score = rawScore.substr(rawScore.indexOf(\"|\") + 1);\r\n\r\n if (score != null || result != null) {\r\n resultArray.push({ result: result, score: score });\r\n }\r\n }\r\n });\r\n\r\n //Omatic Results\r\n var FinalresultArray = [];\r\n for (var i = 0; i < resultArray.length; i++) {\r\n var a = resultArray[i];\r\n\r\n if (!searchFinalResults(a.result, FinalresultArray)) {\r\n FinalresultArray.push({ result: a.result, score: a.score })\r\n }\r\n else {\r\n var result = searchFinalResults(a.result, FinalresultArray);\r\n var index = FinalresultArray.indexOf(result);\r\n var currentScore = FinalresultArray[index].score\r\n var updatedScore = Number(currentScore) + Number(a.score);\r\n FinalresultArray[index].score = updatedScore;\r\n }\r\n }\r\n\r\n //Set OMatic final result\r\n var FinalResult = \"\";\r\n if (FinalresultArray.length > 0) {\r\n FinalresultArray.sort(function (a, b) {\r\n return b.score - a.score;\r\n })\r\n FinalResult = FinalresultArray[0].result;\r\n FinalResult = FinalResult.replace(/ /g, \"\")\r\n }\r\n\r\n //search array of objects\r\n function searchFinalResults(nameKey, myArray) {\r\n for (var i = 0; i < myArray.length; i++) {\r\n if (myArray[i].result === nameKey) {\r\n return myArray[i];\r\n }\r\n }\r\n }\r\n\r\n //unhide result\r\n $(\"#result\").removeClass(\"hide\");\r\n $(\".OnePageQuizResult\").each(function (element) {\r\n var result = $(this);\r\n if (FinalResult != \"\") {\r\n //Unhide OMatic result\r\n if (result.hasClass(FinalResult)) {\r\n result.removeClass(\"hide\");\r\n\r\n //Scroll to result\r\n $('html, body').animate({\r\n scrollTop: result.offset().top\r\n }, 1000);\r\n }\r\n }\r\n else {\r\n var min = result.data(\"min\");\r\n var max = result.data(\"max\");\r\n\r\n if (min <= score && score <= max)\r\n {\r\n result.removeClass(\"hide\");\r\n //Scroll to result\r\n var time = 0e3;\r\n var resultID = result.attr('id')\r\n if ($(\".explaination-text\").length > 0) { time = 2e3; }\r\n var to = setTimeout((function () { scroll(resultID, true, 0); }), time);\r\n\r\n //detect if user scrolled and remove setTimeout\r\n window.onscroll = function (e) {\r\n clearTimeout(to);\r\n }\r\n\r\n //Set score and total of questions\r\n $(\".total\").html($(\".question\").length);\r\n $(\".score\").html($(\".question\").length - $(\".show-correct\").length);\r\n }\r\n }\r\n });\r\n }\r\n\r\n scrollToNextQuestion($(this));\r\n });\r\n });\r\n\r\n ;\r\n }\r\n }\r\n\r\n function scrollToNextQuestion(aQuestion) {\r\n var question = aQuestion.closest($(\".question\"));\r\n var questionIDstring = question.attr('id');\r\n\r\n if (question == null || questionIDstring == null) {\r\n return;\r\n }\r\n\r\n //Get question number\r\n questionIDstring = questionIDstring.replace(/question/g, \"\")\r\n var questionID = parseInt(questionIDstring);\r\n\r\n //Increment id to get next question.\r\n questionID = questionID + 1;\r\n\r\n //set next question id\r\n var adIDNext = \"ad\" + questionID;\r\n var questionIDNext = \"question\" + questionID;\r\n\r\n //get question\r\n var time = 0e3;\r\n if ($(\".explaination-text\").length > 0) { time = 2e3; }\r\n\r\n var nextQuestion = $('#' + questionIDNext);\r\n if (nextQuestion.length > 0) {\r\n\r\n var to = 0;\r\n if (questionID % 2 == 0)\r\n {\r\n to = setTimeout((function () { scroll(adIDNext, false, 0); }), time);\r\n }\r\n else\r\n {\r\n to = setTimeout((function () { scroll(questionIDNext, true, 50); }), time);\r\n }\r\n\r\n //detect if user scrolled and remove setTimeout\r\n window.onscroll = function (e) {\r\n clearTimeout(to);\r\n }\r\n }\r\n }\r\n\r\n var scroll = function (id, removeHide, offset) {\r\n var element = document.getElementById(id);\r\n if (element == null) {\r\n return;\r\n }\r\n\r\n if (removeHide) {\r\n element.classList.remove(\"hide\");\r\n }\r\n \r\n var elementPosition = getOffset(element).top - offset;\r\n window.scrollTo({top: elementPosition, behavior: 'smooth'});\r\n }\r\n\r\n function getOffset(el) {\r\n const rect = el.getBoundingClientRect();\r\n return {\r\n left: rect.left + window.scrollX,\r\n top: rect.top + window.scrollY\r\n };\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initonePageQuiz(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new OnePageQuiz(args.scope);\r\n };\r\n});\n","define('Beliefnet/Components/PersonalityQuiz',[\r\n \"jquery\",\r\n \"logging\"\r\n], function ($, logging) {\r\n var _ModuleName = \"Personality Quiz\";\r\n\r\n function PersonalityQuiz(scope) {\r\n \"use strict\";\r\n\r\n var $personalityQuiz = $(scope);\r\n\r\n ;\r\n // If personality quiz was found, initialize\r\n if ($personalityQuiz.length) {\r\n ;\r\n // When personality quiz selection is made\r\n $(\"input[type=radio]\", $personalityQuiz).change(function () {\r\n _submitForm($(this), $personalityQuiz);\r\n });\r\n\r\n ;\r\n var $earlyAnswers = $(\"input[type=radio]:not(old):checked\", $personalityQuiz);\r\n if ($earlyAnswers.length) {\r\n _submitForm($earlyAnswers, $personalityQuiz);\r\n }\r\n }\r\n \r\n ;\r\n }\r\n\r\n function _submitForm($checkbox, $quiz) {\r\n ;\r\n\r\n // Find it's label\r\n var $parent = $checkbox.parent();\r\n var $label = $(\"label span\", $parent);\r\n if ($label.length) {\r\n // Add refresh icon\r\n var refresh_icon = \"\";\r\n var html = $label.html();\r\n if (html.indexOf(\"fa-refresh\")) {\r\n $label.html(html + \" \" + refresh_icon);\r\n }\r\n }\r\n\r\n // re-enable radio buttons to allow submission of answer\r\n $(\"input[type=radio]\", $quiz).prop('disabled', false);\r\n\r\n // submit the form\r\n $('form', $quiz).submit();\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initPersonalityQuiz(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new PersonalityQuiz(args.scope);\r\n };\r\n});\n","define('Beliefnet/Components/ReCaptcha',[\r\n \"jquery\",\r\n \"logging\"\r\n], function ($, logging) {\r\n var _ModuleName = \"ReCaptcha\";\r\n // uncomment this line to enable the test key on dev\r\n //var _captchaKey = '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI';\r\n\r\n // this is the production key\r\n var _captchaKey = '6LeP-BQTAAAAALk2r2JVoAJJ56qZiFfLc6XAKjt8';\r\n\r\n var _Initialized = false;\r\n\r\n var _captchaCallback = function () {\r\n var $recaptchaFields = $('.grecaptchaField');\r\n $recaptchaFields.each(function (index, field) {\r\n grecaptcha.render(\"recaptchaField\" + (index + 1), { sitekey: _captchaKey });\r\n });\r\n };\r\n\r\n function ReCaptcha(scope) {\r\n \"use strict\";\r\n\r\n $(function () {\r\n if (_Initialized) {\r\n ;\r\n return;\r\n }\r\n\r\n // Give the recaptcha forms unique id's in case of multiple instances.\r\n var $forms = $('.grecaptchaForm');\r\n if ($forms.length) {\r\n ;\r\n $forms.each(function (index, form) {\r\n $(form).attr('id', 'recaptchaForm' + (index + 1));\r\n });\r\n\r\n var $fields = $('.grecaptchaField');\r\n if ($fields.length) {\r\n ;\r\n $fields.each(function (index, field) {\r\n $(field).attr('id', 'recaptchaField' + (index + 1));\r\n });\r\n } else {\r\n logging.error(\"No ReCaptcha form fields found\", _ModuleName);\r\n return;\r\n }\r\n } else {\r\n logging.error(\"No ReCaptcha forms found\", _ModuleName);\r\n return;\r\n }\r\n\r\n ;\r\n // Attach captcha callback so it is accessible\r\n window.CaptchaCallback = _captchaCallback;\r\n\r\n $.getScript('//www.google.com/recaptcha/api.js?onload=CaptchaCallback&render=explicit')\r\n .done(function (script, textStatus) {\r\n ;\r\n })\r\n .fail(function (jqxhr, settings, exception) {\r\n logging.error(\"There was a problem loading the ReCaptcha scripts. Exception: \" + exception, _ModuleName);\r\n });\r\n\r\n _Initialized = true;\r\n ;\r\n });\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initReCaptcha(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new ReCaptcha(args.scope);\r\n };\r\n});\r\n\n","define('Beliefnet/Components/RequestAPrayer',[\r\n \"jquery\",\r\n \"utilities\",\r\n \"logging\"\r\n], function ($, utilities, logging) {\r\n var _ModuleName = \"Request A Prayer\";\r\n function RequestAPrayer(scope) {\r\n \"use strict\";\r\n\r\n var $requestAPrayer = $(scope);\r\n\r\n $requestAPrayer.find('form').submit(function (e) {\r\n e.stopPropagation && e.stopPropagation();\r\n e.preventDefault && e.preventDefault();\r\n\r\n var frm = $(this);\r\n\r\n ;\r\n\r\n //Null title\r\n var title = $('input[name=title]', frm).val();\r\n if ($.trim(title) == '') {\r\n alert('Please include the title.');\r\n ;\r\n return false;\r\n }\r\n\r\n //small title\r\n if (title.length <= 3) {\r\n alert('Please include a title greater than 3 characters.');\r\n ;\r\n return false;\r\n }\r\n\r\n //large title\r\n if (title.length > 50) {\r\n alert('Please include a title less then 50 characters.');\r\n ;\r\n return false;\r\n }\r\n\r\n //null prayer\r\n var prayer = $('textarea[name=prayer]', frm).val();\r\n if ($.trim(prayer) == '') {\r\n alert('Please include the prayer.');\r\n ;\r\n return false;\r\n }\r\n\r\n //small prayer\r\n if (prayer.length <= 3) {\r\n alert('Please include a prayer greater than 3 characters.');\r\n ;\r\n return false;\r\n }\r\n\r\n ;\r\n\r\n //$.post('/bnapi/newsletter/subscribe', $form.serialize(), function (d) {\r\n //$.post(this.action, frm.serialize(), function () {\r\n $.post('/bnapi/Prayer/SubmitUserPrayer', frm.serialize(), function (data) {\r\n $('.js-message-placeholder').html(\"Your prayer has been submitted! Please allow 24 hours for your prayer to become visible.\");\r\n ;\r\n }).fail(function (data) {\r\n alert('There was an issue processing your request');\r\n ;\r\n });\r\n\r\n return false;\r\n });\r\n\r\n ;\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initRequestAPrayer(args) {\r\n // Do not initialize the module if we are in Experience Editor\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new RequestAPrayer(args.scope);\r\n };\r\n});\n","define('Beliefnet/Components/SocialShareBar',[\r\n \"jquery\",\r\n \"logging\"\r\n], function ($, logging) {\r\n var _ModuleName = \"Social Share Bar\";\r\n var _overridesUpdated = false;\r\n\r\n function SocialShareBar(scope) {\r\n \"use strict\";\r\n\r\n // If we have not yet updated all overrides, handle now\r\n if (!_overridesUpdated) {\r\n ;\r\n // Find Share Override Element\r\n var $override = $('.share-override');\r\n if ($override.length) {\r\n // Get Override URL\r\n var overrideUrl = $override.data('url');\r\n\r\n // Get ShareBars that allow override\r\n var $overrides = $('allow-override')\r\n\r\n if ($overrides.length) {\r\n // Loop through sharebars and update pw:url attribute\r\n for (i = 0; i < $overrides.length; i++) {\r\n $overrides[i].setAttribute('pw:url', overrideUrl);\r\n }\r\n\r\n ;\r\n }\r\n }\r\n\r\n _overridesUpdated = true;\r\n }\r\n\r\n // Load Share Bar Script\r\n var s = document.createElement('script');\r\n s.type = 'text/javascript';\r\n s.async = true;\r\n s.src = 'https://i.po.st/share/script/post-widget.js#publisherKey=vshv65b92tdp1pa42tds';\r\n var x = document.getElementsByTagName('script')[0];\r\n x.parentNode.insertBefore(s, x);\r\n\r\n ;\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initSocialShareBar(args) {\r\n // Do not initialize the module if we are in Experience Editor\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new SocialShareBar(args.scope);\r\n };\r\n});\n","define('Beliefnet/Components/SocialShareBarV4',[\r\n \"jquery\",\r\n \"logging\"\r\n], function ($, logging) {\r\n var _ModuleName = \"Social Share Bar\";\r\n var _overridesUpdated = false;\r\n\r\n function SocialShareBar(scope) {\r\n \"use strict\";\r\n\r\n // If we have not yet updated all overrides, handle now\r\n if (!_overridesUpdated) {\r\n ;\r\n // Find Share Override Element\r\n var $override = $('.share-override');\r\n if ($override.length) {\r\n // Get Override URL\r\n var overrideUrl = $override.data('url');\r\n\r\n // Get ShareBars that allow override\r\n var $overrides = $('allow-override')\r\n\r\n if ($overrides.length) {\r\n // Loop through sharebars and update pw:url attribute\r\n for (i = 0; i < $overrides.length; i++) {\r\n $overrides[i].setAttribute('pw:url', overrideUrl);\r\n }\r\n\r\n ;\r\n }\r\n }\r\n\r\n _overridesUpdated = true;\r\n }\r\n\r\n // Load Share Bar Script\r\n var s = document.createElement('script');\r\n s.type = 'text/javascript';\r\n s.async = true;\r\n s.src = 'https://i.po.st/share/script/post-widget.js#publisherKey=vshv65b92tdp1pa42tds';\r\n var x = document.getElementsByTagName('script')[0];\r\n x.parentNode.insertBefore(s, x);\r\n\r\n ;\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initSocialShareBar(args) {\r\n // Do not initialize the module if we are in Experience Editor\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new SocialShareBar(args.scope);\r\n };\r\n});\n","define('Beliefnet/Components/SOTDPagination',[\r\n \"jquery\",\r\n \"logging\"\r\n], function ($, logging) {\r\n var _ModuleName = \"SOTD Pagination\";\r\n var _overridesUpdated = false;\r\n\r\n function initPagination(scope) {\r\n \"use strict\";\r\n\r\n $(\"#previous\").click(function () {\r\n var currentPage = getLowerPaginationNumber();\r\n if (currentPage > 1) {\r\n var lowerPaginationId = getLowerPaginationNumber();\r\n var newLowerId = parseInt(lowerPaginationId, 10) - 1;\r\n $('#p' + newLowerId).parent().removeClass('hide');\r\n\r\n var upperPaginationId = getUpperPaginationNumber();\r\n var newUpperId = parseInt(upperPaginationId, 10);\r\n $('#p' + newUpperId).parent().addClass('hide');\r\n }\r\n });\r\n\r\n $(\"#next\").click(function () {\r\n $(\"#previous\").parent().removeClass('hide');\r\n\r\n var lowerPaginationId = getLowerPaginationNumber();\r\n var newLowerId = parseInt(lowerPaginationId, 10);\r\n $('#p' + newLowerId).parent().addClass('hide');\r\n\r\n var upperPaginationId = getUpperPaginationNumber();\r\n var newUpperId = parseInt(upperPaginationId, 10) + 1;\r\n $('#p' + newUpperId).parent().removeClass('hide');\r\n });\r\n\r\n $(\".paginate-js\").click(function () {\r\n var currentPage = getPage();\r\n var currentPageId = currentPage;\r\n $('#saint-group-' + currentPageId).addClass('hide');\r\n $('#p' + currentPage).parent().removeClass('active');\r\n\r\n var id = $(this).attr('id').replace('p', '');\r\n var newPageId = id;\r\n $('#saint-group-' + newPageId).removeClass('hide');\r\n $('#p' + id).parent().addClass('active');\r\n });\r\n\r\n }\r\n\r\n function getPage() {\r\n var currentPage = 1;\r\n var groupCount = $('.custom-ul').length;\r\n for (var i = 1; i < groupCount; i++)\r\n {\r\n if ($('#saint-group-'+i).length && !$('#saint-group-'+i).hasClass(\"hide\"))\r\n {\r\n currentPage = i\r\n }\r\n }\r\n\r\n return currentPage;\r\n };\r\n\r\n function getLowerPaginationNumber() {\r\n var paginationNumber = 1;\r\n var groupCount = $('.paginate-js').length;\r\n for (var i = 1; i < groupCount; i++)\r\n {\r\n if ($('#p' + i).length && !$('#p' + i).parent().hasClass(\"hide\")) {\r\n paginationNumber = i\r\n break;\r\n }\r\n }\r\n\r\n return paginationNumber;\r\n };\r\n\r\n function getUpperPaginationNumber() {\r\n var paginationNumber = 1;\r\n var groupCount = $('.paginate-js').length;\r\n for (var i = groupCount; i > 0; i--)\r\n {\r\n if ($('#p' + i).length && !$('#p' + i).parent().hasClass(\"hide\")) {\r\n paginationNumber = i\r\n break;\r\n }\r\n }\r\n\r\n return paginationNumber;\r\n };\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function init(args) {\r\n // Do not initialize the module if we are in Experience Editor\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new initPagination(args.scope);\r\n };\r\n});\n","define('Beliefnet/Components/TriviaQuiz',[\r\n \"jquery\",\r\n \"logging\"\r\n], function ($, logging) {\r\n var _ModuleName = \"Trivia Quiz\";\r\n\r\n function TriviaQuiz(scope) {\r\n \"use strict\";\r\n\r\n var $triviaQuiz = $(scope);\r\n\r\n ;\r\n // If trivia quiz was found, initialize\r\n if ($triviaQuiz.length) {\r\n ;\r\n /* if the user goes back, we need to make sure we display the next button so they \r\n can continue forward again */\r\n if ($(\"input[name=answer]:checked\", $triviaQuiz).length) {\r\n $(\"button[type=submit]\", $triviaQuiz).each(function () {\r\n $(this).removeClass(\"hidden\");\r\n });\r\n }\r\n\r\n ;\r\n /* Set up Trivia Quizzes */\r\n $(\".quiz-answers input[type=radio]\", $triviaQuiz).each(function () {\r\n // for each radio button, watch for changes\r\n $(this).click(function () {\r\n ;\r\n\r\n var $answer = $(this);\r\n\r\n // Lets make sure we have something to work with\r\n if ($answer == null || $answer.length == 0) {\r\n logging.error(\"Something went wrong and we don't have a handle on the answer chosen\", _ModuleName);\r\n return;\r\n }\r\n\r\n // If the click did not check the radio button, just return\r\n if (!$answer.is(\":checked\")) {\r\n ;\r\n return;\r\n }\r\n\r\n ;\r\n // move explaination text to the \"correct\" answer\r\n var $explaination = $('.question-explaination-text', $triviaQuiz);\r\n var answerText = $('.quiz-answers .correct label span span', $triviaQuiz).text().trim();\r\n if (answerText != $explaination.text().trim()) {\r\n $(\".quiz-answers .correct .explaination-text\", $triviaQuiz).html($explaination.html());\r\n }\r\n\r\n // If selection was incorrect, show correct\r\n if ($answer.parent().hasClass(\"incorrect\")) {\r\n ;\r\n\r\n $(\".quiz-answers .correct\", $triviaQuiz).each(function () {\r\n $(this).addClass(\"show-correct\");\r\n });\r\n }\r\n\r\n ;\r\n // disable radio buttons\r\n $(\".quiz-answers input[type=radio]\", $triviaQuiz).each(function () {\r\n $(this).click(function () {\r\n return false;\r\n });\r\n });\r\n\r\n ;\r\n // show next question button\r\n $(\"button[type=submit]\", $triviaQuiz).each(function () {\r\n $(this).removeClass(\"disabled\");\r\n });\r\n });\r\n });\r\n\r\n ;\r\n // When submit button clicked, refresh icon added to button\r\n $(\"button[type=submit]\", $triviaQuiz).each(function () {\r\n $(this).click(function () {\r\n var refresh_icon = \"\";\r\n var html = $(this).html();\r\n if (html.indexOf(\"fa-refresh\") < 0) {\r\n $(this).html(refresh_icon + \" \" + html);\r\n }\r\n });\r\n });\r\n\r\n ;\r\n // If an answer was selected before we were ready, go ahead and enable the 'next question' button\r\n var $earlyAnswers = $(\"input[name=answer]:not(old):checked\", scope);\r\n if ($earlyAnswers.length) {\r\n $(\".btn-lg\", scope).removeClass('disabled');\r\n }\r\n\r\n ;\r\n }\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initTriviaQuiz(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new TriviaQuiz(args.scope);\r\n };\r\n});\n","define('Beliefnet/Components/UserPrayerPlusOne',[\r\n \"jquery\"\r\n], function ($) {\r\n var endpointUrl = \"/api/endpoint\";\r\n\r\n function MyButton(scope) {\r\n \"use strict\";\r\n\r\n var $button = $('.UserPrayerPlusOne-button', scope);\r\n var $prayerCount = $('.UserPrayerCount', scope);\r\n\r\n $button.click(function (e) {\r\n e.stopPropagation && e.stopPropagation();\r\n e.preventDefault && e.preventDefault();\r\n\r\n alert($prayerCount.text());\r\n\r\n // Increment Button Counter\r\n var count = $prayerCount.text();\r\n $prayerCount.text(count + 1);\r\n\r\n // TO DO \r\n //Server Callback\r\n //$.post(endpointUrl, null, function () {\r\n \r\n //})\r\n //.fail(function () {\r\n // alert(\"Something went wrong\");\r\n //});\r\n });\r\n\r\n }\r\n\r\n // 'args' is an object containing the data passed to the BeginUXModule HTML Helper in the component's Razor view.\r\n // The Module Loader deserializes this data from HTML, and adds a reference to the component's outer-most DOM element as args.scope\r\n return function initMyButton(args) {\r\n // Do not initialize the module if we are in Experience Editor or if we are not on a phone\r\n if (args.IsExperienceEditorEditing === true) {\r\n return null;\r\n }\r\n\r\n return new MyButton(args.scope);\r\n };\r\n});\n"]}