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Y,YAC9C,IAGA7B,EAAW8B,KAAK,kBAAkBC,SAAS,aAC3CjC,EAAYgC,KAAK,kBAAkBC,SAAS,aAGjC,IAAItB,WAAWuB,KAAKhC,EAAY,CACvCiC,UAAU,EACVC,eAAe,EACfC,aAAa,EACbC,gBAAgB,IAIpBhC,GAAgB,GAIpBK,WAAW4B,OAAO,YACtB,GACJ,CACJ,EACAnD,OAAOC,YAAYC,4BAA4BkD,WAAY","sources":["webpack://advanced-web/./UI/js/core/modules/responsiveTabsCarouselBlock.js"],"sourcesContent":["(function () {\r\n\r\n window.oneadvanced = window.oneadvanced || {};\r\n window.oneadvanced.responsivetabscarouselblock = window.oneadvanced.responsivetabscarouselblock || {};\r\n window.oneadvanced.responsivetabscarouselblock.init = function () {\r\n //console.log(\"initialising responsivetabscarouselblock...\");\r\n var responsiveTabsCarousels = document.querySelectorAll('[data-tc-block-id]');\r\n if (responsiveTabsCarousels.length) {\r\n for (var rtc = 0; rtc < responsiveTabsCarousels.length; rtc++) {\r\n rtcHandler(responsiveTabsCarousels[rtc].getAttribute('data-tc-block-id'));\r\n }\r\n }\r\n function rtcHandler(blockId) {\r\n 'use strict';\r\n var $tc_content = $('#tabs_carousel_content_' + blockId);\r\n var $tc_titles = $('#tabs_carousel_titles_' + blockId);\r\n var $tabs_titles_containers = $('.tabs-titles-container');\r\n var $tabId = $('#block' + blockId);\r\n\r\n // init variables to keep track of if Foundation or Slick have already been initialised\r\n var $tc_carousel_init = false;\r\n var $tc_tabs_init = false;\r\n\r\n $(window).on('changed.zf.mediaquery load', function (event, newSize, oldSize) {\r\n if (!newSize) {\r\n newSize = Foundation.MediaQuery.current;\r\n }\r\n\r\n // ResponsiveTabsCarouselBlock switch from tabs in 'medium' and up to a carousel in 'small'\r\n // here we check Foundation's media query and if small run the code for the carousel\r\n // else we run the tabs\r\n if (newSize == \"small\") {\r\n\r\n // Both Foundation and Slick have intermittent issues which follow resizing\r\n // so we check if they've already been initialised and reset them back to their\r\n // default HTML before proceeding\r\n if ($tc_tabs_init) {\r\n $tc_titles.foundation('_destroy');\r\n\r\n $tc_tabs_init = false;\r\n }\r\n if ($tc_carousel_init) {\r\n $tc_content.slick('unslick');\r\n $tc_titles.slick('unslick');\r\n $tabs_titles_containers.data('in-slick', false);\r\n }\r\n\r\n // Initialised Slick Carousel\r\n $tc_content.slick({\r\n slidesToShow: 1,\r\n slidesToScroll: 1,\r\n arrows: false,\r\n fade: true,\r\n asNavFor: $tc_titles,\r\n mobileFirst: true,\r\n adaptiveHeight: true\r\n });\r\n\r\n $tc_titles.slick({\r\n slidesToShow: 1,\r\n slidesToScroll: 1,\r\n asNavFor: $tc_content,\r\n dots: false,\r\n centerMode: true,\r\n focusOnSelect: true,\r\n respondTo: 'slider',\r\n mobileFirst: true,\r\n variableWidth: true\r\n });\r\n\r\n // update data attribute which CSS will use to apply the arrows\r\n $tabs_titles_containers.data('in-slick', true);\r\n\r\n // Set initialise flag\r\n $tc_carousel_init = true;\r\n } else {\r\n // We're not in 'small' any more, so we want tabs please\r\n\r\n // Same check here to see if we've initilised and reset if so\r\n if ($tc_tabs_init) {\r\n $tc_titles.foundation('_destroy');\r\n }\r\n if ($tc_carousel_init) {\r\n $tc_content.slick('unslick');\r\n $tc_titles.slick('unslick');\r\n $tabs_titles_containers.data('in-slick', false);\r\n\r\n $tc_carousel_init = false;\r\n }\r\n\r\n //listen for the tabs initialized event and if it does initializes then remove the fallback class no-tabsjs\r\n $tabId.on('init.zf.tabs', function () {\r\n //console.log($(this));\r\n //console.log(\"tabs are initialized, removed the fallback class\");\r\n $(this).children('div.inner').removeClass('no-tabsjs');\r\n });\r\n\r\n // set first tab content and title to is-active\r\n $tc_titles.find('li:first-child').addClass('is-active');\r\n $tc_content.find('li:first-child').addClass('is-active');\r\n\r\n // Initialise tabs\r\n var tabs = new Foundation.Tabs($tc_titles, {\r\n deepLink: false,\r\n updateHistory: false,\r\n matchHeight: false,\r\n deepLinkSmudge: false\r\n });\r\n\r\n // Set initialised flag\r\n $tc_tabs_init = true;\r\n }\r\n\r\n // ensure that equalizer is run each time the browser is resized\r\n Foundation.reInit('equalizer');\r\n });\r\n }\r\n };\r\n window.oneadvanced.responsivetabscarouselblock.hasLoaded = true;\r\n\r\n})();"],"names":["window","oneadvanced","responsivetabscarouselblock","init","responsiveTabsCarousels","document","querySelectorAll","length","rtc","rtcHandler","getAttribute","blockId","$tc_content","$","$tc_titles","$tabs_titles_containers","$tabId","$tc_carousel_init","$tc_tabs_init","on","event","newSize","oldSize","Foundation","MediaQuery","current","foundation","slick","data","slidesToShow","slidesToScroll","arrows","fade","asNavFor","mobileFirst","adaptiveHeight","dots","centerMode","focusOnSelect","respondTo","variableWidth","this","children","removeClass","find","addClass","Tabs","deepLink","updateHistory","matchHeight","deepLinkSmudge","reInit","hasLoaded"],"sourceRoot":""}