{"version":3,"sources":["../../core/modules/subnav.js","../../core/ef_plugins/clearsearchtext.js","../../core/modules/searchcancel.js","browsetourssubnav.js"],"names":["define","$","Modernizr","enquire","init","applyStickToSubnavOnDesktop","window","innerWidth","stickSubNav","removeClassesAndBodyPadding","close","$el","removeClass","document","off","body","style","paddingTop","subnav","classList","remove","scrollY","spaceAboveSubnav","offsetHeight","add","console","log","querySelector","main","offsetTop","EFTOURS","device","isTouch","isMobile","hasClass","on","evt","$this","this","$parent","parent","preventDefault","stopPropagation","addClass","event","target","parents","is","addEventListener","jQuery","undefined","ClearSearchText","element","options","$element","metadata","data","extend","defaults","_defaults","_name","pluginName","textEnteredClass","prototype","$wrapper","_insertButton","_keyupListen","trigger","plugin","$button","after","_setClass","_clickListen","_removeClass","val","trim","focus","destroy","removeData","fn","each","clearsearchtext","searchcancel","e","searchTourQuery","test"],"mappings":"AAAA,AAAAA,OAAA,uBAAA,SAAA,YAAA,eAAA,aAAA,SAAAC,EAAAC,EAAAC,GACA,OACAC,KAAA,WASA,QAAAC,KACAC,OAAAC,WAAA,KACAC,IAEAC,IAKA,QAAAC,GAAAC,GACAA,EAAAC,YAAA,eACAX,EAAAY,UAAAC,IAAA,qBAGA,QAAAL,KACAI,SAAAE,KAAAC,MAAAC,WAAA,MACAC,EAAAC,UAAAC,OAAA,SAGA,QAAAZ,KACAF,OAAAe,SAAAC,GACAT,SAAAE,KAAAC,MAAAC,WAAAC,EAAAK,aAAA,KACAL,EAAAC,UAAAK,IAAA,UAEAf,IAhCAgB,QAAAC,IAAA,SAIA,IAAAR,GAAAL,SAAAc,cAAA,WACAC,EAAAf,SAAAc,cAAA,SACAL,EAAAM,EAAAC,SA+BA,IAAAC,QAAAC,OAAAC,QAGA,CACA,KAAAC,GAAAhC,EAAA,WAAAiC,SAAA,gBAEAjC,GAAA,2CAAAkC,GAAA,eAAA,SAAAC,GACA,GAAAC,GAAApC,EAAAqC,MACAC,EAAAF,EAAAG,OAAA,sBACAJ,GAAAK,iBACA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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACzEA,AD0EA;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACzIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"publicsite/modules/browsetourssubnav.js","sourcesContent":["define('core/modules/subnav',[\"jquery\", \"modernizr\", \"libs/enquire\", \"waypoints\"], function ($, Modernizr, enquire) {\r\n return {\r\n init: function() {\r\n console.log('subnav');\r\n \r\n //Find the subnav container. Then find its parent container to calculate the pixel\r\n // distance from the top of the body to the top of the subnav.\r\n var subnav = document.querySelector('.subnav');\r\n var main = document.querySelector('#main');\r\n var spaceAboveSubnav = main.offsetTop;\r\n\r\n function applyStickToSubnavOnDesktop() {\r\n if (window.innerWidth > 1024) {\r\n stickSubNav();\r\n } else {\r\n removeClassesAndBodyPadding();\r\n }\r\n }\r\n\r\n // helper function to close subnav on mobile\r\n function close($el) {\r\n $el.removeClass('subnav-open');\r\n $(document).off('touchstart.subnav');\r\n }\r\n\r\n function removeClassesAndBodyPadding() {\r\n document.body.style.paddingTop = '0px';\r\n subnav.classList.remove('stuck');\r\n }\r\n \r\n function stickSubNav() {\r\n if (window.scrollY >= spaceAboveSubnav) {\r\n document.body.style.paddingTop = subnav.offsetHeight + 'px';\r\n subnav.classList.add('stuck');\r\n } else {\r\n removeClassesAndBodyPadding();\r\n }\r\n }\r\n \r\n // test for touch functionality\r\n if (!EFTOURS.device.isTouch) { \r\n window.addEventListener('resize', applyStickToSubnavOnDesktop); \r\n window.addEventListener('scroll', applyStickToSubnavOnDesktop); \r\n } else {\r\n const isMobile = $('.subnav').hasClass('subnav-mobile');\r\n \r\n $('.subnav-haschildren > .subnav-item-link').on('click.subnav', function(evt) {\r\n var $this = $(this),\r\n $parent = $this.parent('.subnav-haschildren');\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n \r\n // if already open, close\r\n if ($parent.hasClass('subnav-open')) {\r\n close($parent);\r\n }\r\n else {\r\n // add open class\r\n $parent.addClass('subnav-open');\r\n \r\n // if not full-width nav, it's ok to turn it off when you click outside, otherwise, let them scroll down\r\n if (!isMobile) {\r\n $(document).on('touchstart.subnav', function(event) {\r\n if (!$(event.target).parents('.subnav-haschildren').is($parent)) {\r\n close($parent);\r\n }\r\n });\r\n }\r\n }\r\n });\r\n }\r\n }\r\n }\r\n });\n","/* \r\n * CLEAR SEARCH TEXT\r\n * Sets up behavior in text search fields to display an x symbol on the right of the field\r\n * when text has been entered, which users can click to clear out all text entered into the\r\n * field. \r\n * USAGE: $('input[type=\"search\"]').clearsearchtext();\r\n */\r\n\r\n\r\n;\r\ndefine('core/ef_plugins/clearsearchtext',[\"jquery\"], function (jQuery) {\r\n (function ($, window, document, undefined) {\r\n // deps: [\"jquery\"]\r\n var pluginName = 'clearsearchtext', // CHANGE: 'plugin' to your plugin name\r\n defaults = {\r\n textEnteredClass: \"clearsearchtext-text-entered\"\r\n };\r\n\r\n // The actual plugin constructor\r\n function ClearSearchText(element, options) { // CHANGE: Plugin to your plugin name capitalized\r\n // grab the element the plugin was called on\r\n this.element = element;\r\n\r\n // also save the element as a jquery object\r\n this.$element = $(element);\r\n\r\n // get per-element inline configuration settings\r\n this.metadata = this.$element.data('clearsearchtext-options'); // CHANGE 'plugin-options' to your plugin name -options\r\n\r\n // merge all the configs\r\n this.options = $.extend({}, defaults, options, this.metadata);\r\n\r\n // save the defaults\r\n this._defaults = defaults;\r\n\r\n // save the plugin name\r\n this._name = pluginName;\r\n\r\n // call init function\r\n this.init();\r\n }\r\n\r\n // Define this sucker\r\n ClearSearchText.prototype = {\r\n // CHANGE: Plugin to your plugin name capitalized\r\n init: function () {\r\n this.$wrapper = this.$element.parent();\r\n // make sure all the correct classes are in place\r\n if (!this.$element.hasClass('clearsearchtext-input'))\r\n this.$wrapper.addClass('clearsearchtext-input');\r\n if (!this.$wrapper.hasClass('clearsearchtext-wrapper'))\r\n this.$wrapper.addClass('clearsearchtext-wrapper');\r\n\r\n // insert x button\r\n this._insertButton();\r\n // setup listener\r\n this._keyupListen();\r\n\r\n // fire keyup on load to check if there is already text in the field\r\n this.$element.trigger('keyup');\r\n },\r\n\r\n _insertButton: function () {\r\n var plugin = this;\r\n plugin.$button = $('x');\r\n plugin.$element.after(plugin.$button);\r\n },\r\n\r\n _setClass: function () {\r\n var plugin = this;\r\n\r\n plugin.$wrapper.addClass(plugin.options.textEnteredClass);\r\n plugin._clickListen();\r\n },\r\n\r\n _removeClass: function () {\r\n var plugin = this;\r\n\r\n plugin.$wrapper.removeClass(plugin.options.textEnteredClass);\r\n plugin.$element.off('click.clearsearchtext');\r\n },\r\n\r\n _keyupListen: function () {\r\n var plugin = this;\r\n\r\n plugin.$element.on('keyup.clearsearchtext, change.clearsearchtext', function () {\r\n var $this = $(this);\r\n if ($this.val().trim() != '') {\r\n plugin._setClass();\r\n } else {\r\n plugin._removeClass();\r\n }\r\n });\r\n },\r\n\r\n _clickListen: function () {\r\n var plugin = this;\r\n\r\n plugin.$button.on('click.clearsearchtext', function (event) {\r\n event.preventDefault();\r\n plugin.$element.val('');\r\n plugin._removeClass();\r\n plugin.$element.focus();\r\n });\r\n },\r\n\r\n destroy: function () {\r\n var plugin = this;\r\n\r\n // remove listeners\r\n plugin.$element.off('keyup.clearsearchtext, change.clearsearchtext');\r\n\r\n // remove classes\r\n plugin._removeClass();\r\n this.$wrapper.removeClass('clearsearchtext-input');\r\n this.$wrapper.removeClass('clearsearchtext-wrapper');\r\n\r\n // remove the button\r\n plugin.$button.remove();\r\n\r\n // remove the data\r\n plugin.$element.removeData('plugin_' + pluginName);\r\n }\r\n };\r\n\r\n // Turn this into a jquery plugin & prevent multiple instantiations\r\n $.fn[pluginName] = function (options) {\r\n return this.each(function () {\r\n if (!$.data(this, 'plugin_' + pluginName)) {\r\n $.data(this, 'plugin_' + pluginName,\r\n new ClearSearchText(this, options)); // CHANGE: Plugin to plugin constructor defined above\r\n }\r\n });\r\n }\r\n\r\n })(jQuery, window, document);\r\n});\n","define('core/modules/searchcancel',[\"jquery\", \"core/ef_plugins/clearsearchtext\"], function ($) {\r\n return {\r\n init: function() {\r\n console.log('searchcancel');\r\n\r\n /* Provide an X that users can click to clear the search field. The search tours\r\n ** bar could be dropped onto pages other than the search page (e.g., the US and Canada page). */\r\n $('.js-clearsearchtext').clearsearchtext();\r\n }\r\n }\r\n \r\n});\n","define('publicsite/modules/browsetourssubnav',['jquery', 'core/modules/subnav', 'core/modules/searchcancel'], function ($, subnav, searchcancel) {\r\n return {\r\n /* logic for the desktop version of the browse tours subnav w/inline search box */\r\n init: function() {\r\n subnav.init();\r\n searchcancel.init();\r\n\r\n $(\".browsetours-subnav-search-form\").on(\"submit\",function (e) {\r\n var searchTourQuery = $(\".search-box\").val();\r\n if (!searchTourQuery || /^\\s*$/.test(searchTourQuery)) {\r\n e.preventDefault();\r\n }\r\n });\r\n }\r\n }\r\n\r\n});\n"]}