PageSourceSearch

https://bioethicstoday.org/wp-content/themes/JTF3/build/js/common/script-common.min.js?ver=3.48.0

js bioethicstoday.org collected 2026-10-01 10:32:27 UTC 86,769 bytes, 2 lines download raw bytes

1"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _regeneratorRuntime(){"use strict";_regeneratorRuntime=function _regeneratorRuntime(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t)})})}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a)},function(t){invoke("throw",t,i,a)}):e.resolve(h).then(function(t){u.value=t,i(u)},function(t){return invoke("throw",t,i,a)})}a(c.arg)}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r)})}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg)}}}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&
vendor: 4,480 bytes, line 1
1(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this}),define(g,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y}}
1,catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}
1var ExternalLinks=function(){function ExternalLinks(){var _this=this;_classCallCheck(this,ExternalLinks);setTimeout(function(){_this.init()},ExternalLinks.TIMEOUT_MS)}return _createClass(ExternalLinks,[{key:"init",value:function init(){var blankLinks=document.querySelectorAll(ExternalLinks.SELECTOR_BLANK_LINKS);blankLinks.forEach(function(link){var oldTitle=link.getAttribute(ExternalLinks.ATTR_TITLE);if(oldTitle&&oldTitle.trim()!==""){link.setAttribute(ExternalLinks.ATTR_TITLE,"".concat(oldTitle," - ").concat(ExternalLinks.PROP_NEW_WINDOW_TEXT))}else{link.setAttribute(ExternalLinks.ATTR_TITLE,ExternalLinks.PROP_NEW_WINDOW_TEXT)}})}}])}();_defineProperty(ExternalLinks,"TIMEOUT_MS",2000);_defineProperty(ExternalLinks,"SELECTOR_BLANK_LINKS","a[target=\"_blank\"]");_defineProperty(ExternalLinks,"ATTR_TITLE","title");_defineProperty(ExternalLinks,"PROP_NEW_WINDOW_TEXT","opens a new window");document.addEventListener("DOMContentLoaded",function(){new ExternalLinks});var AnimatedCounter=function(){function AnimatedCounter(instance){_classCallCheck(this,AnimatedCounter);this.instance=instance;this.counters=instance.querySelectorAll(AnimatedCounter.SELECTOR_CLASS_COUNTER);this.scrollHandler=this.handleScroll.bind(this);this.onFirstLoad();this.scrollEvents()}return _createClass(AnimatedCounter,[{key:"animate",value:function animate(counter){var suffix=counter.dataset[AnimatedCounter.ATTR_SUFFIX]||"";var min=parseInt(counter.dataset[AnimatedCounter.ATTR_MIN])||AnimatedCounter.PROP_DEFAULT_MIN;var max=parseInt(counter.dataset[AnimatedCounter.ATTR_MAX])||AnimatedCounter.PROP_DEFAULT_MAX;var duration=parseFloat(counter.dataset[AnimatedCounter.ATTR_DURATION])||AnimatedCounter.PROP_DEFAULT_DURATION;counter.classList.add(AnimatedCounter.CLASS_NAME_ACTIVE);var steps=max-min;if(steps===0){counter.innerHTML=min+suffix;return}var intervalTime=duration*AnimatedCounter.PROP_MILLISECONDS_PER_SECOND/steps;var current=min;var interval=setInterval(function(){counter.innerHTML=current+suffix;current++;if(current>max){clearInterval(interval)}},intervalTime)}},{key:"isInViewport",value:function isInViewport(element){var rect=element.getBoundingClientRect();return rect.top<window.innerHeight&&rect.bottom>0&&rect.left<window.innerWidth&&rect.right>0}},{key:"onFirstLoad",value:function onFirstLoad(){var _this2=this;this.counters.forEach(function(counter){if(_this2.isInViewport(counter)){if(!counter.classList.contains(AnimatedCounter.CLASS_NAME_ACTIVE)){_this2.animate(counter)}}})}},{key:"handleScroll",value:function handleScroll(){var _this3=this;var allAnimated=true;this.counters.forEach(function(counter){if(_this3.isInViewport(counter)){if(!counter.classList.contains(AnimatedCounter.CLASS_NAME_ACTIVE)){_this3.animate(counter)}}if(!counter.classList.contains(AnimatedCounter.CLASS_NAME_ACTIVE)){allAnimated=false}});if(allAnimated){window.removeEventListener("scroll",this.scrollHandler)}}},{key:"scrollEvents",value:function scrollEvents(){window.addEventListener("scroll",this.scrollHandler)}}])}();_defineProperty(AnimatedCounter,"SELECTOR_CLASS_BLOCK",".wp-block-jtf-jtf-animatedcounter");_defineProperty(AnimatedCounter,"SELECTOR_CLASS_COUNTER",".jtf__animatedcounter--counter");_defineProperty(AnimatedCounter,"CLASS_NAME_ACTIVE","jtf__animatedcounter--counter--active");_defineProperty(AnimatedCounter,"ATTR_SUFFIX","suffix");_defineProperty(AnimatedCounter,"ATTR_MIN","min");_defineProperty(AnimatedCounter,"ATTR_MAX","max");_defineProperty(AnimatedCounter,"ATTR_DURATION","duration");_defineProperty(AnimatedCounter,"PROP_DEFAULT_MIN",0);_defineProperty(AnimatedCounter,"PROP_DEFAULT_MAX",100);_defineProperty(AnimatedCounter,"PROP_DEFAULT_DURATION",2);_defineProperty(AnimatedCounter,"PROP_MILLISECONDS_PER_SECOND",1000);document.addEventListener("DOMContentLoaded",function(){var blocks=document.querySelectorAll(AnimatedCounter.SELECTOR_CLASS_BLOCK);blocks.forEach(function(block){new AnimatedCounter(block)})});document.addEventListener("DOMContentLoaded",function(){var JTFCAROUSEL=function(){function JTFCAROUSEL(context,wpAdmin){var _this4=this;_classCallCheck(this,JTFCAROUSEL);this.context=context;this.carouselInner=this.context.querySelector(JTFCAROUSEL.SELECTOR_CLASS_INNER);this.carouselContainer=this.context.querySelector(JTFCAROUSEL.SELECTOR_CLASS_CONTAINER);this.carouselNav=this.context.querySelector(JTFCAROUSEL.SELECTOR_CLASS_NAV_CONTAINER);if(!this.context||!this.carouselContainer||!this.carouselNav){setTimeout(function(){new JTFCAROUSEL(_this4.context,wpAdmin)},300);return}this.carouselInnerChildren=this.carouselInner.getAttribute(JTFCAROUSEL.ATTR_DATA_CHILDREN);this.timelinePanelCount=1;this.carouselContainerWidth=this.context.offsetWidth;this.timeline=this.context.querySelector(JTFCAROUSEL.SELECTOR_CLASS_TIMELINE);this.fixedContainer=this.context.querySelector(JTFCAROUSEL.SELECTOR_CLASS_FIXED_CONTAINER);this.isMobile=window.innerWidth<JTFCAROUSEL.BREAKPOINT_MOBILE;this.individualPanel=this.context.querySelectorAll(JTFCAROUSEL.SELECTOR_CLASS_ITEM);this.imageNoCrop=this.context.querySelectorAll(JTFCAROUSEL.SELECTOR_CLASS_IMAGE_NO_CROP);
1this.staticBackground=this.context.querySelector(JTFCAROUSEL.SELECTOR_CLASS_STATIC_BG);this.tempBackground=this.context.querySelector(JTFCAROUSEL.SELECTOR_CLASS_TRANS_BG);this.wpAdmin=wpAdmin;this.playPauseControl=this.context.querySelector(JTFCAROUSEL.SELECTOR_CLASS_PLAY_PAUSE_CONTROL);if(!this.playPauseControl){this.playPauseControl=this.context.ownerDocument.createElement("div");this.playPauseControl.className="jtf__carouselblock--play_pause_control jtf__carouselblock--navigation"}this.carouselDots=this.context.querySelector(JTFCAROUSEL.SELECTOR_CLASS_DOTS);this.interval=null;this.mobileReduction=!!this.context.getAttribute(JTFCAROUSEL.ATTR_DATA_MOBILEREDUCTION)||false;this.autoSlide=this.carouselContainer.getAttribute(JTFCAROUSEL.ATTR_DATA_AUTOSLIDE)||"noneset";this.autoSlideDelay=this.carouselContainer.getAttribute(JTFCAROUSEL.ATTR_DATA_AUTOSLIDEDELAY)*1000||5000;this.currentPosition=0;this.imageMaxHeight=0;this.backgroundImages=this.context.getAttribute(JTFCAROUSEL.ATTR_DATA_SLIDESBGIMAGES);this.containerStyle=this.carouselContainer.getAttribute("style")||"";this.arrowStyle=this.carouselNav.getAttribute(JTFCAROUSEL.ATTR_DATA_ARROWSTYLE)===JTFCAROUSEL.PROP_ARROW_STYLE_DEFAULT?JTFCAROUSEL.PROP_ARROW_STYLE_DEFAULT_ICON:JTFCAROUSEL.PROP_ARROW_STYLE_CIRCLE_ICON;this.playIcon="<i class=\"fa-solid fa-play\"></i>";this.pauseIcon="<i class=\"fa-solid fa-pause\"></i>";this.playPauseButton="<button type=\"button\" href=\"javascript:void(0);\" aria-controls=\"carouselblock--items\" aria-label=\"Stop automatic slide show\" ".concat(JTFCAROUSEL.ATTR_DATA_STATE,"=\"").concat(JTFCAROUSEL.PROP_STATE_ENABLED,"\" ><i class=\"fa-solid fa-pause\"></i></button>");this.previousButton="<button type=\"button\" class=\"jtf__carouselblock--prev jtf__carouselblock--navigation\" style=\"".concat(this.containerStyle,"\" href=\"javascript:void(0);\" aria-controls=\"carouselblock--items\" aria-label=\"previous slide\" ><i class=\"far ").concat(this.arrowStyle,"left\" ></i></button>");this.nextButton="<button type=\"button\" class=\"jtf__carouselblock--next jtf__carouselblock--navigation\" href=\"javascript:void(0);\" style=\"".concat(this.containerStyle,"\" aria-controls=\"carouselblock--items\" aria-label=\"next slide \" ><i class=\"far ").concat(this.arrowStyle,"right\" ></i></button>");this.startAutomatic="Start automatic slide show";this.stopAutomatic="Stop automatic slide show";this.reboot();this.loadCarousel()}return _createClass(JTFCAROUSEL,[{key:"navigateCarousel",value:function navigateCarousel(){var transformValue;var baseWidth=this.fixedContainer?this.fixedContainer.offsetWidth:this.carouselContainerWidth;var slideWidth=this.timeline&&!this.isMobile?baseWidth/this.timelinePanelCount:baseWidth;transformValue=-(this.currentPosition*slideWidth*this.canvasMobileWidth());this.carouselInner.style.transform="translateX(".concat(transformValue,"px)");this.carouselInner.style.transitionDuration="1s"}},{key:"canvasMobileWidth",value:function canvasMobileWidth(){return this.isMobile&&this.mobileReduction?JTFCAROUSEL.MOBILE_REDUCTION_NUMBER:1}},{key:"setMaxImageHeight",value:function setMaxImageHeight(){var _this5=this;if(this.imageNoCrop.length>0){var cssPanelImageEl=this.context.querySelectorAll(JTFCAROUSEL.SELECTOR_CLASS_PANEL_IMAGE);cssPanelImageEl.forEach(function(img){img.style.visibility="hidden"});cssPanelImageEl.forEach(function(img){if(img.complete){_this5.setMaxHeight(img)}else{img.addEventListener("load",function(){setTimeout(function(){_this5.setMaxHeight(img)},JTFCAROUSEL.TIMER_POINT_THREE_SECONDS)})}});cssPanelImageEl.forEach(function(img){if(img.complete){_this5.setPanelImageCss(img)}else{img.addEventListener("load",function(){setTimeout(function(){_this5.setPanelImageCss(img,true)},JTFCAROUSEL.TIMER_POINT_THREE_SECONDS)})}})}}},{key:"setMaxHeight",value:function setMaxHeight(img){var imgHeight=img.offsetHeight;if(imgHeight&&parseInt(imgHeight,10)>this.imageMaxHeight){this.imageMaxHeight=parseInt(imgHeight,10)}}},{key:"setPanelImageCss",value:function setPanelImageCss(img){var uncached=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;img.style.height=this.imageMaxHeight+"px";img.style.objectFit="contain";img.style.marginBottom="1rem";img.style.visibility="visible";if(uncached){img.style.opacity="0";this.fadeIn(img,JTFCAROUSEL.TIMER_POINT_THREE_SECONDS)}}},{key:"fadeIn",value:function fadeIn(element,duration){element.style.opacity="0";element.style.transition="opacity ".concat(duration,"ms");setTimeout(function(){element.style.opacity="1"},10)}},{key:"fadeOut",value:function fadeOut(element){element.style.transition="opacity 400ms";element.style.opacity="0";setTimeout(function(){element.style.display="none"},400)}}
1,{key:"changeBackgroundImage",value:function changeBackgroundImage(){if(JTFCAROUSEL.PROP_STATE_ENABLED===this.backgroundImages){var targetBackgroundImage="";var currentBackgroundImage="";var currentPosition=Number(this.currentPosition);this.individualPanel.forEach(function(panel){var dataId=parseInt(panel.getAttribute(JTFCAROUSEL.ATTR_DATA_ID),10);var imgEl=panel.querySelector(JTFCAROUSEL.SELECTOR_CLASS_PANEL_IMAGE);var imgSrc=imgEl?imgEl.getAttribute("src"):"";if(currentPosition===dataId){currentBackgroundImage=imgSrc;targetBackgroundImage=imgSrc}});if(this.tempBackground){this.tempBackground.style.backgroundImage="url(".concat(currentBackgroundImage,")")}if(this.staticBackground){this.staticBackground.style.backgroundImage="url(".concat(targetBackgroundImage,")")}if(this.tempBackground){this.tempBackground.style.display="block"}if(this.staticBackground){this.staticBackground.style.display="block"}if(this.tempBackground){this.fadeOut(this.tempBackground)}}}},{key:"changeAriaDisplayStates",value:function changeAriaDisplayStates(){var currentPosition=Number(this.currentPosition);this.individualPanel.forEach(function(panel){var isHidden=currentPosition===parseInt(panel.getAttribute(JTFCAROUSEL.ATTR_DATA_ID),10)?JTFCAROUSEL.PROP_STATE_FALSE:JTFCAROUSEL.PROP_STATE_TRUE;panel.setAttribute(JTFCAROUSEL.ATTR_ARIA_HIDDEN,isHidden);var buttons=panel.querySelectorAll("button, a[role=\"button\"], a");buttons.forEach(function(el){if(isHidden===JTFCAROUSEL.PROP_STATE_TRUE){el.setAttribute("tabindex","-1")}else{el.removeAttribute("tabindex")}})})}},{key:"setActiveDot",value:function setActiveDot(){var dots=this.context.querySelectorAll(JTFCAROUSEL.SELECTOR_CLASS_DOT);if(!dots||dots.length===0){return}var currentPosition=Number(this.currentPosition);var activeDotEl=this.context.querySelector(JTFCAROUSEL.SELECTOR_CLASS_DOT_ACTIVE);if(activeDotEl){activeDotEl.classList.remove(JTFCAROUSEL.CLASS_NAME_DOT_ACTIVE)}dots.forEach(function(dot){var isActive=parseInt(dot.getAttribute(JTFCAROUSEL.ATTR_DATA_TARGET),10)===currentPosition;if(isActive){dot.classList.add(JTFCAROUSEL.CLASS_NAME_DOT_ACTIVE)}dot.setAttribute(JTFCAROUSEL.ATTR_ARIA_SELECTED,isActive?JTFCAROUSEL.PROP_STATE_TRUE:JTFCAROUSEL.PROP_STATE_FALSE)})}},{key:"moveToNextSlide",value:function moveToNextSlide(){var calcNewPosition=Number(this.currentPosition)+1;if(calcNewPosition<parseInt(this.carouselInnerChildren,10)){this.currentPosition=calcNewPosition}else{this.currentPosition=0}this.changeBackgroundImage();this.changeAriaDisplayStates();this.setActiveDot();this.navigateCarousel()}},{key:"moveToPrevSlide",value:function moveToPrevSlide(){this.carouselContainer.setAttribute("data-max",JTFCAROUSEL.PROP_STATE_FALSE);var calcNewPosition=Number(this.currentPosition)-1;if(Number(this.currentPosition)>0){this.currentPosition=calcNewPosition}else{this.currentPosition=parseInt(this.carouselInnerChildren,10)-1}this.changeBackgroundImage();this.changeAriaDisplayStates();this.setActiveDot();this.navigateCarousel()}},{key:"autoSlideCarousel",value:function autoSlideCarousel(){this.currentPosition=Number(this.currentPosition)<parseInt(this.carouselInnerChildren,10)-1?Number(this.currentPosition)+1:0;this.changeBackgroundImage();this.changeAriaDisplayStates();this.setActiveDot();this.navigateCarousel()}},{key:"createSwipeEventListener",value:function createSwipeEventListener(element){var startX=0;var startY=0;var suppressClickUntil=0;var onStart=function onStart(x,y){startX=x;startY=y};var onEnd=function onEnd(x,y){var deltaX=x-startX;var deltaY=y-startY;var minimumDistance=50;if(Math.abs(deltaX)<Math.abs(deltaY)){return}if(Math.abs(deltaX)<minimumDistance){return}suppressClickUntil=Date.now()+500;element.dispatchEvent(new CustomEvent(deltaX>0?"swiperight":"swipeleft"))};var onClick=function onClick(e){if(Date.now()>suppressClickUntil){return}e.preventDefault();e.stopPropagation();suppressClickUntil=0};element.addEventListener("touchstart",function(e){var t=e.changedTouches[0];onStart(t.clientX,t.clientY)});element.addEventListener("touchend",function(e){var t=e.changedTouches[0];onEnd(t.clientX,t.clientY)});element.addEventListener("click",onClick,true)}},{key:"startAutoSlide",value:function startAutoSlide(){var _this6=this;clearInterval(this.interval);this.interval=setInterval(function(){_this6.autoSlideCarousel()},this.autoSlideDelay);this.updatePauseButtonUi(true)}},{key:"stopAutoSlide",value:function stopAutoSlide(){clearInterval(this.interval);this.interval=null;this.updatePauseButtonUi(false)}},{key:"updatePauseButtonUi",value:function updatePauseButtonUi(isPlaying){var pauseButton=this.context.querySelector(JTFCAROUSEL.SELECTOR_CLASS_PLAY_PAUSE_BUTTON);if(!pauseButton){return}if(isPlaying){pauseButton.setAttribute(JTFCAROUSEL.ATTR_DATA_STATE,JTFCAROUSEL.PROP_STATE_ENABLED);pauseButton.setAttribute(JTFCAROUSEL.ATTR_ARIA_LABEL,this.stopAutomatic);pauseButton.innerHTML=this.pauseIcon;this.carouselInner.setAttribute(JTFCAROUSEL.ATTR_ARIA_LIVE,"off")}else{pauseButton.setAttribute(JTFCAROUSEL.ATTR_DATA_STATE,JTFCAROUSEL.PROP_STATE_DISABLED);pauseButton.setAttribute(JTFCAROUSEL.ATTR_ARIA_LABEL,this.startAutomatic);pauseButton.innerHTML=this.playIcon;this.carouselInner.setAttribute(JTFCAROUSEL.ATTR_ARIA_LIVE,"polite")}}},{key:"checkIsPlaying",value:function checkIsPlaying(){var pauseButton=this.context.querySelector(JTFCAROUSEL.SELECTOR_CLASS_PLAY_PAUSE_BUTTON);return pauseButton&&pauseButton.getAttribute(JTFCAROUSEL.ATTR_DATA_STATE)===JTFCAROUSEL.PROP_STATE_ENABLED}}
1,{key:"loadCarousel",value:function loadCarousel(){var _this7=this;if(this.context.__jtfCarouselEventsBound){this.setActiveDot();this.changeAriaDisplayStates();return}this.context.__jtfCarouselEventsBound=true;this.changeBackgroundImage();this.changeAriaDisplayStates();this.setActiveDot();if(JTFCAROUSEL.PROP_STATE_ENABLED===this.autoSlide){this.startAutoSlide();this.context.addEventListener("click",function(e){var pauseButton=e.target.closest(JTFCAROUSEL.SELECTOR_CLASS_PLAY_PAUSE_BUTTON);if(!pauseButton){return}e.stopPropagation();if(_this7.checkIsPlaying()){_this7.stopAutoSlide()}else{_this7.startAutoSlide()}});var _mouseEnterHandler=function mouseEnterHandler(e){e.stopPropagation();_this7.stopAutoSlide();_this7.context.removeEventListener("mouseenter",_mouseEnterHandler)};this.context.addEventListener("mouseenter",_mouseEnterHandler,{once:true})}var carouselContainer=this.context.querySelector(JTFCAROUSEL.SELECTOR_CLASS_CONTAINER);if(carouselContainer){this.createSwipeEventListener(carouselContainer);carouselContainer.addEventListener("swiperight",function(){if(_this7.checkIsPlaying()){_this7.stopAutoSlide()}_this7.moveToPrevSlide()});carouselContainer.addEventListener("swipeleft",function(){if(_this7.checkIsPlaying()){_this7.stopAutoSlide()}_this7.moveToNextSlide()})}this.context.addEventListener("click",function(e){var prevButton=e.target.closest(JTFCAROUSEL.SELECTOR_CLASS_PREV);if(prevButton){e.stopPropagation();if(_this7.checkIsPlaying()){_this7.stopAutoSlide()}_this7.moveToPrevSlide()}});this.context.addEventListener("keyup",function(e){if(e.which===JTFCAROUSEL.KEYCODE_LEFT_ARROW){if(_this7.checkIsPlaying()){_this7.stopAutoSlide()}_this7.moveToPrevSlide()}});this.context.addEventListener("click",function(e){var nextButton=e.target.closest(JTFCAROUSEL.SELECTOR_CLASS_NEXT);if(nextButton){e.stopPropagation();if(_this7.checkIsPlaying()){_this7.stopAutoSlide()}_this7.moveToNextSlide()}});this.context.addEventListener("keyup",function(e){if(e.which===JTFCAROUSEL.KEYCODE_RIGHT_ARROW){if(_this7.checkIsPlaying()){_this7.stopAutoSlide()}_this7.moveToNextSlide()}});this.context.addEventListener("click",function(e){var dotButton=e.target.closest(JTFCAROUSEL.SELECTOR_CLASS_DOT);if(dotButton){var position=parseInt(dotButton.getAttribute(JTFCAROUSEL.ATTR_DATA_TARGET),10);if(Number.isNaN(position)){return}if(Number(_this7.currentPosition)===position){_this7.changeBackgroundImage();_this7.changeAriaDisplayStates();_this7.setActiveDot();return}_this7.currentPosition=position;if(_this7.checkIsPlaying()){_this7.stopAutoSlide()}_this7.changeBackgroundImage();_this7.changeAriaDisplayStates();_this7.setActiveDot();_this7.navigateCarousel()}})}},{key:"generateNavigation",value:function generateNavigation(slideCount){if(!this.carouselDots){this.removeNavigation();return}var totalSlides=parseInt(slideCount,10)||0;var hasExcludeDotsClass=function hasExcludeDotsClass(el){if(!el||!el.classList){return false}return el.classList.contains("exclude-dots")||el.classList.contains("jtf__carouselblock--exclude-dots")};var currentDots=this.carouselNav.querySelector(JTFCAROUSEL.SELECTOR_CLASS_DOTS);var shouldExcludeDots=hasExcludeDotsClass(currentDots);var existingDots=currentDots?currentDots.querySelectorAll(JTFCAROUSEL.SELECTOR_CLASS_DOT):[];var hasPrev=!!this.carouselNav.querySelector(JTFCAROUSEL.SELECTOR_CLASS_PREV);var hasNext=!!this.carouselNav.querySelector(JTFCAROUSEL.SELECTOR_CLASS_NEXT);var hasPlayPause=!!this.carouselNav.querySelector(JTFCAROUSEL.SELECTOR_CLASS_PLAY_PAUSE_BUTTON);var shouldHavePlayPause=this.autoSlide===JTFCAROUSEL.PROP_STATE_ENABLED;if(currentDots&&hasPrev&&hasNext&&(shouldHavePlayPause?hasPlayPause:true)&&(shouldExcludeDots&&existingDots.length===0||!shouldExcludeDots&&existingDots.length===totalSlides)){this.carouselDots=currentDots;if(!shouldExcludeDots){this.setActiveDot()}return}this.carouselNav.innerHTML=this.carouselDots.outerHTML;this.carouselDots=this.carouselNav.querySelector(JTFCAROUSEL.SELECTOR_CLASS_DOTS);if(!this.carouselDots){this.removeNavigation();return}var rebuiltExcludeDots=hasExcludeDotsClass(this.carouselDots);this.carouselDots.insertAdjacentHTML("beforebegin",this.previousButton);if(shouldHavePlayPause&&this.playPauseControl){this.playPauseControl.innerHTML="";this.playPauseControl.insertAdjacentHTML("beforeend",this.playPauseButton);this.carouselDots.insertAdjacentElement("beforebegin",this.playPauseControl)}this.carouselDots.innerHTML="";if(!rebuiltExcludeDots){for(var x=0;x<totalSlides;x++){var activeClass=x===0?JTFCAROUSEL.CLASS_NAME_DOT_ACTIVE:"";var ariaSelect=x===0?JTFCAROUSEL.PROP_STATE_TRUE:JTFCAROUSEL.PROP_STATE_FALSE;this.carouselDots.insertAdjacentHTML("beforeend","<button type=\"button\" class=\"jtf__carouselblock--dot ".concat(activeClass,"\" ").concat(JTFCAROUSEL.ATTR_ARIA_SELECTED,"=\"").concat(ariaSelect,"\" ").concat(JTFCAROUSEL.ATTR_DATA_TARGET,"=\"").concat(x,"\" style=\"").concat(this.containerStyle,"\" role=\"tab\" ").concat(JTFCAROUSEL.ATTR_ARIA_LABEL,"=\"Slide ").concat(x+1,"\" ").concat(JTFCAROUSEL.ATTR_ARIA_CONTROLS,"=\"carouselblock--item--").concat(x+1,"\"><i class=\"fas fa-circle\"></i></button>"))}}this.carouselDots.insertAdjacentHTML("afterend",this.nextButton);if(!rebuiltExcludeDots){this.setActiveDot()}}},{key:"removeNavigation",value:function removeNavigation(){var container=this.context.querySelector(JTFCAROUSEL.SELECTOR_CLASS_NAV_CONTAINER);if(container){container.innerHTML=""}}},{key:"reboot",value:function reboot(){var _this8=this;this.currentPosition=0;if(this.timeline){var maxTimelinePanels=Math.min(4,this.individualPanel.length);if(window.innerWidth<JTFCAROUSEL.BREAKPOINT_TABLET){this.timelinePanelCount=window.innerWidth<JTFCAROUSEL.BREAKPOINT_MOBILE?1:2}else{this.timelinePanelCount=window.innerWidth<JTFCAROUSEL.BREAKPOINT_MOBILE?1:maxTimelinePanels}this.carouselInner.setAttribute(JTFCAROUSEL.ATTR_DATA_CHILDREN,this.timelinePanelCount)}
1var baseWidth=this.fixedContainer?this.fixedContainer.offsetWidth:this.carouselContainerWidth;var widthMultiplier=this.canvasMobileWidth();var itemWidth=this.timeline?baseWidth/this.timelinePanelCount*widthMultiplier:baseWidth*widthMultiplier;this.carouselInner.style.transform="translateX(0)";var panelCss={width:itemWidth+"px",display:"inline-flex"};if(this.wpAdmin.length>0){setTimeout(function(){if(_this8.carouselInnerChildren>1||_this8.timeline){_this8.generateNavigation(_this8.carouselInnerChildren,_this8.context)}else{_this8.removeNavigation()}_this8.individualPanel.forEach(function(panel){panel.style.width=panelCss.width;panel.style.display=panelCss.display});_this8.setMaxImageHeight()},JTFCAROUSEL.TIMER_POINT_THREE_SECONDS)}else{if(this.carouselInnerChildren>1||this.timeline){this.generateNavigation(this.carouselInnerChildren)}else{this.removeNavigation()}this.individualPanel.forEach(function(panel){panel.style.width=panelCss.width;panel.style.display=panelCss.display});this.setMaxImageHeight()}}}])}();_defineProperty(JTFCAROUSEL,"MOBILE_REDUCTION_NUMBER",0.8);_defineProperty(JTFCAROUSEL,"BREAKPOINT_TABLET",768);_defineProperty(JTFCAROUSEL,"BREAKPOINT_MOBILE",576);_defineProperty(JTFCAROUSEL,"KEYCODE_LEFT_ARROW",37);_defineProperty(JTFCAROUSEL,"KEYCODE_RIGHT_ARROW",39);_defineProperty(JTFCAROUSEL,"TIMER_POINT_THREE_SECONDS",300);_defineProperty(JTFCAROUSEL,"CLASS_NAME_DOT_ACTIVE","jtf__carouselblock--dot-active");_defineProperty(JTFCAROUSEL,"SELECTOR_CLASS_DOT_ACTIVE",".jtf__carouselblock--dot-active");_defineProperty(JTFCAROUSEL,"SELECTOR_CLASS_PLAY_PAUSE_BUTTON",".jtf__carouselblock--play_pause_control button");_defineProperty(JTFCAROUSEL,"SELECTOR_CLASS_PREV",".jtf__carouselblock--prev");_defineProperty(JTFCAROUSEL,"SELECTOR_CLASS_CONTAINER",".jtf__carouselblock--container");_defineProperty(JTFCAROUSEL,"SELECTOR_CLASS_DOT",".jtf__carouselblock--dot");_defineProperty(JTFCAROUSEL,"SELECTOR_CLASS_NEXT",".jtf__carouselblock--next");_defineProperty(JTFCAROUSEL,"SELECTOR_CLASS_PANEL_IMAGE",".jtf__carouselblock--cell-image img");_defineProperty(JTFCAROUSEL,"SELECTOR_CLASS_INNER",".jtf__carouselblock--inner");_defineProperty(JTFCAROUSEL,"SELECTOR_CLASS_TIMELINE",".jtf__carouselblock--timeline");_defineProperty(JTFCAROUSEL,"SELECTOR_CLASS_FIXED_CONTAINER",".jtf__carouselblock--fixedcontainer");_defineProperty(JTFCAROUSEL,"SELECTOR_CLASS_ITEM",".jtf__carouselblock--item");_defineProperty(JTFCAROUSEL,"SELECTOR_CLASS_IMAGE_NO_CROP",".jtf__carouselblock--cell-image-no-crop");_defineProperty(JTFCAROUSEL,"SELECTOR_CLASS_STATIC_BG",".jtf__carouselblock--staticbg");_defineProperty(JTFCAROUSEL,"SELECTOR_CLASS_TRANS_BG",".jtf__carouselblock--transbg");_defineProperty(JTFCAROUSEL,"SELECTOR_CLASS_PLAY_PAUSE_CONTROL",".jtf__carouselblock--play_pause_control");_defineProperty(JTFCAROUSEL,"SELECTOR_CLASS_DOTS",".jtf__carouselblock--dots");_defineProperty(JTFCAROUSEL,"SELECTOR_CLASS_NAV_CONTAINER",".jtf__carouselblock--nav");_defineProperty(JTFCAROUSEL,"ATTR_DATA_CHILDREN","data-children");_defineProperty(JTFCAROUSEL,"ATTR_DATA_MOBILEREDUCTION","data-mobilereduction");_defineProperty(JTFCAROUSEL,"ATTR_DATA_AUTOSLIDE","data-autoslide");_defineProperty(JTFCAROUSEL,"ATTR_DATA_AUTOSLIDEDELAY","data-autoslidedelay");_defineProperty(JTFCAROUSEL,"ATTR_DATA_SLIDESBGIMAGES","data-slidesbgimages");_defineProperty(JTFCAROUSEL,"ATTR_DATA_ARROWSTYLE","data-arrowstyle");_defineProperty(JTFCAROUSEL,"ATTR_DATA_STATE","data-state");_defineProperty(JTFCAROUSEL,"ATTR_DATA_TARGET","data-target");_defineProperty(JTFCAROUSEL,"ATTR_DATA_ID","data-id");_defineProperty(JTFCAROUSEL,"ATTR_ARIA_HIDDEN","aria-hidden");_defineProperty(JTFCAROUSEL,"ATTR_ARIA_SELECTED","aria-selected");_defineProperty(JTFCAROUSEL,"ATTR_ARIA_CONTROLS","aria-controls");_defineProperty(JTFCAROUSEL,"ATTR_ARIA_LABEL","aria-label");_defineProperty(JTFCAROUSEL,"ATTR_ARIA_LIVE","aria-live");_defineProperty(JTFCAROUSEL,"PROP_STATE_ENABLED","enabled");_defineProperty(JTFCAROUSEL,"PROP_STATE_DISABLED","disabled");_defineProperty(JTFCAROUSEL,"PROP_STATE_TRUE","true");
1_defineProperty(JTFCAROUSEL,"PROP_STATE_FALSE","false");_defineProperty(JTFCAROUSEL,"PROP_ARROW_STYLE_DEFAULT","defaultArrow");_defineProperty(JTFCAROUSEL,"PROP_ARROW_STYLE_DEFAULT_ICON","fa-angle-");_defineProperty(JTFCAROUSEL,"PROP_ARROW_STYLE_CIRCLE_ICON","fa-circle-chevron-");var INIT_ATTR="data-jtf-carousel-initialised";var BLOCK_SELECTOR=".wp-block-jtf-jtf-carousel";var initBlock=function initBlock(block,isAdmin){if(!block||block.getAttribute(INIT_ATTR)===JTFCAROUSEL.PROP_STATE_TRUE){return}block.setAttribute(INIT_ATTR,JTFCAROUSEL.PROP_STATE_TRUE);var adminContext=isAdmin?[block.ownerDocument.documentElement]:[];new JTFCAROUSEL(block,adminContext)};var initInDocument=function initInDocument(doc){var isAdmin=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!doc){return}doc.querySelectorAll(BLOCK_SELECTOR).forEach(function(block){initBlock(block,isAdmin)})};var initFromNode=function initFromNode(node,isAdmin){if(!node||node.nodeType!==1){return}if(node.matches&&node.matches(BLOCK_SELECTOR)){initBlock(node,isAdmin)}if(node.querySelectorAll){node.querySelectorAll(BLOCK_SELECTOR).forEach(function(block){initBlock(block,isAdmin)})}};var observeDocument=function observeDocument(doc,isAdmin){if(!doc||doc.__jtfCarouselObserverBound){return}doc.__jtfCarouselObserverBound=true;var debounceId=null;var pendingNodes=new Set;var flush=function flush(){pendingNodes.forEach(function(node){initFromNode(node,isAdmin)});pendingNodes.clear();debounceId=null};var observer=new MutationObserver(function(mutations){mutations.forEach(function(mutation){mutation.addedNodes.forEach(function(node){pendingNodes.add(node)})});if(debounceId){clearTimeout(debounceId)}debounceId=setTimeout(flush,120)});observer.observe(doc.body||doc.documentElement,{childList:true,subtree:true});initInDocument(doc,isAdmin)};var bindFrame=function bindFrame(frame){if(!frame||frame.__jtfCarouselFrameBound){return}frame.__jtfCarouselFrameBound=true;var setupFrameDoc=function setupFrameDoc(){var frameDoc;try{frameDoc=frame.contentDocument||(frame.contentWindow?frame.contentWindow.document:null)}catch(err){frameDoc=null}if(!frameDoc){return}observeDocument(frameDoc,true)};frame.addEventListener("load",setupFrameDoc);setupFrameDoc()};var bootstrap=function bootstrap(){var isAdmin=!!(document.body&&document.body.classList.contains("wp-admin"));if(!isAdmin){initInDocument(document,false);return}observeDocument(document,true);document.querySelectorAll("iframe").forEach(function(frame){bindFrame(frame)});if(!document.__jtfCarouselFrameObserverBound){document.__jtfCarouselFrameObserverBound=true;var frameObserver=new MutationObserver(function(mutations){mutations.forEach(function(mutation){mutation.addedNodes.forEach(function(node){if(!node||node.nodeType!==1){return}if(node.matches&&node.matches("iframe")){bindFrame(node)}if(node.querySelectorAll){node.querySelectorAll("iframe").forEach(function(frame){bindFrame(frame)})}})})});frameObserver.observe(document.body||document.documentElement,{childList:true,subtree:true})}};bootstrap()});document.addEventListener("DOMContentLoaded",function(){var CTA=function(){function CTA(instance){_classCallCheck(this,CTA);this.instance=instance;this.init()}return _createClass(CTA,[{key:"resizeOnWindowChange",value:function resizeOnWindowChange(){var images=this.instance.querySelectorAll(CTA.SELECTOR_CLASS_IMG_SQUARE);images.forEach(function(img){if(!img.closest(CTA.SELECTOR_CLASS_CENTRE)){var thisWidth=img.offsetWidth;img.style.height="".concat(thisWidth,"px")}})}},{key:"init",value:function init(){var _this9=this;this.resizeOnWindowChange();window.addEventListener("resize",function(){_this9.resizeOnWindowChange()})}}])}();_defineProperty(CTA,"CLASS_NAME_IMG_SQUARE","jtf__ctablock--img-square");_defineProperty(CTA,"CLASS_NAME_CENTRE","jtf__ctablock--centre");_defineProperty(CTA,"SELECTOR_CLASS_IMG_SQUARE",".jtf__ctablock--img-square");_defineProperty(CTA,"SELECTOR_CLASS_CENTRE",".jtf__ctablock--centre");_defineProperty(CTA,"SELECTOR_CLASS_BLOCK",".wp-block-jtf-jtf-cta");_defineProperty(CTA,"TIMEOUT_DELAY",1000);setTimeout(function(){var blocks=document.querySelectorAll(CTA.SELECTOR_CLASS_BLOCK);if(blocks.length>0){blocks.forEach(function(block){new CTA(block)})}},CTA.TIMEOUT_DELAY)});document.addEventListener("DOMContentLoaded",function(){var EVENTSGMAP=function(){function EVENTSGMAP(context,id){_classCallCheck(this,EVENTSGMAP);this.geocoder=null;this.gmom=context.getAttribute(EVENTSGMAP.ATTR_GMOM);this.id=id;this.context=context;this.map=null;this.init()}return _createClass(EVENTSGMAP,[{key:"getCoords",value:function(){var _getCoords=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(){var address,response,data;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:address=this.context.getAttribute(EVENTSGMAP.ATTR_ADDRESS);_context.prev=1;_context.next=4;return fetch(EVENTSGMAP.OPENSTREETMAP_URL+address);case 4:response=_context.sent;_context.next=7;return response.json();case 7:data=_context.sent;this.renderOpenMap(data);_context.next=13;break;case 11:_context.prev=11;_context.t0=_context["catch"](1);case 13:case"end":return _context.stop()}},_callee,this,[[1,11]])}));function getCoords(){return _getCoords.apply(this,arguments)}return getCoords}()},{key:"renderOpenMap",value:function renderOpenMap(coords){var location=[coords[0].lat,coords[0].lon];var mapOptions={center:location,zoom:EVENTSGMAP.ZOOM_LEVEL};var map=new L.map(this.id,mapOptions);var layer=new L.TileLayer(EVENTSGMAP.TILE_LAYER_URL);L.marker(location).addTo(map);map.addLayer(layer)}}
1,{key:"init",value:function init(){if(this.gmom===EVENTSGMAP.PROP_OPEN){this.getCoords().then(function(){})}else{this.geocoder=new google.maps.Geocoder;var latlng=new google.maps.LatLng(EVENTSGMAP.DEFAULT_LAT,EVENTSGMAP.DEFAULT_LNG);var mapOptions={zoom:EVENTSGMAP.ZOOM_LEVEL,center:latlng};this.map=new google.maps.Map(document.getElementById(this.id),mapOptions);this.codeAddress()}}},{key:"codeAddress",value:function codeAddress(){var _this10=this;var address=document.getElementById(this.id).getAttribute(EVENTSGMAP.ATTR_ADDRESS);this.geocoder.geocode({"address":address},function(results,status){if(status===EVENTSGMAP.PROP_OK){_this10.map.setCenter(results[0].geometry.location);new google.maps.Marker({map:_this10.map,position:results[0].geometry.location})}})}}])}();_defineProperty(EVENTSGMAP,"SELECTOR_CLASS_EVENTS",".wp-block-jtf-jtf-events");_defineProperty(EVENTSGMAP,"SELECTOR_CLASS_GMAP",".jtf__eventsblock--gmap");_defineProperty(EVENTSGMAP,"ATTR_GMOM","data-gmom");_defineProperty(EVENTSGMAP,"ATTR_ADDRESS","data-address");_defineProperty(EVENTSGMAP,"PROP_OPEN","open");_defineProperty(EVENTSGMAP,"PROP_OK","OK");_defineProperty(EVENTSGMAP,"ZOOM_LEVEL",16);_defineProperty(EVENTSGMAP,"DEFAULT_LAT",-34.397);_defineProperty(EVENTSGMAP,"DEFAULT_LNG",150.644);_defineProperty(EVENTSGMAP,"OPENSTREETMAP_URL","https://nominatim.openstreetmap.org/search?format=json&q=");_defineProperty(EVENTSGMAP,"TILE_LAYER_URL","https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png");var eventsBlocks=document.querySelectorAll(EVENTSGMAP.SELECTOR_CLASS_EVENTS);if(eventsBlocks.length>0){var gmapBlocks=document.querySelectorAll(EVENTSGMAP.SELECTOR_CLASS_GMAP);gmapBlocks.forEach(function(block){var id=block.getAttribute("id");new EVENTSGMAP(block,id)})}});var GroupBlock=function(){function GroupBlock(context){_classCallCheck(this,GroupBlock);this.instance=context;this.resizeHandler=this.onActionEvents.bind(this);this.scrollHandler=this.onActionEvents.bind(this);this.onActionEvents()}return _createClass(GroupBlock,[{key:"onActionEvents",value:function onActionEvents(){window.addEventListener("resize",this.resizeHandler);window.addEventListener("scroll",this.scrollHandler);this.checkAnimations()}},{key:"checkAnimations",value:function checkAnimations(){var _this11=this;var animations=document.querySelectorAll(GroupBlock.SELECTOR_CLASS_ANIMATION);animations.forEach(function(element){if(_this11.isInViewport(element)){var animationType=element.getAttribute(GroupBlock.ATTR_ANIMATION);element.classList.add(GroupBlock.CLASS_NAME_ANIMATION_PREFIX+animationType)}})}},{key:"isInViewport",value:function isInViewport(element){var elementTop=element.getBoundingClientRect().top+window.scrollY;var viewportTop=window.scrollY;var viewportBottom=viewportTop+window.innerHeight;return elementTop<viewportBottom}}])}();_defineProperty(GroupBlock,"SELECTOR_CLASS_BLOCK",".wp-block-jtf-jtf-group");_defineProperty(GroupBlock,"SELECTOR_CLASS_ANIMATION",".jtf__animation");_defineProperty(GroupBlock,"CLASS_NAME_ANIMATION_PREFIX","jtf__animation--");_defineProperty(GroupBlock,"ATTR_ANIMATION","data-animation");document.addEventListener("DOMContentLoaded",function(){var blocks=document.querySelectorAll(GroupBlock.SELECTOR_CLASS_BLOCK);blocks.forEach(function(block){new GroupBlock(block)})});var MediaBlock=function(){function MediaBlock(context){_classCallCheck(this,MediaBlock);this.instance=context;this.init();this.embedVideo()}return _createClass(MediaBlock,[{key:"init",value:function init(){var _this12=this;if(this.instance.querySelector(MediaBlock.SELECTOR_CLASS_MEDIA_BLOCK_YT)){this.loadYouTubeAPI()}if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",function(){_this12.resizeOnWindowChange()})}else{this.resizeOnWindowChange()}window.addEventListener("resize",function(){_this12.resizeOnWindowChange()});var tabToggleExists=document.querySelector(MediaBlock.SELECTOR_CLASS_TAB_TOGGLE);var tabContentExists=document.querySelector(MediaBlock.SELECTOR_CLASS_TAB_CONTENT);if(tabToggleExists&&tabContentExists){var tabItems=document.querySelectorAll(MediaBlock.SELECTOR_CLASS_TAB_ITEM);
1tabItems.forEach(function(tabItem){tabItem.addEventListener("click",function(){var tabId=tabItem.getAttribute(MediaBlock.ATTR_ID);var tabContentElem=document.getElementById("".concat(tabId,"Content"));if(tabContentElem&&tabContentElem.contains(_this12.instance)){setTimeout(function(){_this12.resizeOnWindowChange()},MediaBlock.PROP_RESIZE_TIMEOUT)}})})}}},{key:"embedVideo",value:function embedVideo(){var _this13=this;this.instance.addEventListener("click",function(e){var placeholder=e.target.closest(MediaBlock.SELECTOR_CLASS_PLACEHOLDER);if(!placeholder){return}e.preventDefault();var parent=placeholder.parentElement;var videoID=parent.getAttribute(MediaBlock.ATTR_URL);var videoType=parent.getAttribute(MediaBlock.ATTR_TYPE);var thisAspectH=placeholder.getAttribute(MediaBlock.ATTR_ASPECT_H);var thisAspectW=placeholder.getAttribute(MediaBlock.ATTR_ASPECT_W);var thisWidth=placeholder.offsetWidth;var oneOfThisWidth=thisWidth/thisAspectW;placeholder.remove();switch(videoType){case MediaBlock.PROP_VIDEO_TYPE_VIMEO:{parent.insertAdjacentHTML("beforeend","<iframe width=\"100%\" height=\"".concat(oneOfThisWidth*thisAspectH,"px\" src=\"https://player.vimeo.com/video/").concat(videoID,"?badge=0&autopause=0&player_id=0&autoplay=1\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen loading=\"lazy\"></iframe><script src=\"https://player.vimeo.com/api/player.js\"></script>"));break}case MediaBlock.PROP_VIDEO_TYPE_YOUTUBE:{_this13.createYoutubeIframeEmbed(parent,oneOfThisWidth,thisAspectH,videoID);break}case MediaBlock.PROP_VIDEO_TYPE_WISTIA:{parent.insertAdjacentHTML("beforeend","<script src=\"https://fast.wistia.com/embed/medias/".concat(videoID,".jsonp\" async></script>")+"<script src=\"https://fast.wistia.com/assets/external/E-v1.js\" async></script>"+"<div class=\"wistia_embed wistia_async_".concat(videoID," autoPlay=true\" style=\"height:").concat(oneOfThisWidth*thisAspectH,"px;width:100%\">&nbsp;</div>"));break}case MediaBlock.PROP_VIDEO_TYPE_BILIBILI:{parent.insertAdjacentHTML("beforeend","<iframe width=\"100%\" height=\"".concat(oneOfThisWidth*thisAspectH,"px\" src=\"https://player.bilibili.com/player.html?bvid=").concat(videoID,"&autoplay=1\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen loading=\"lazy\"></iframe>"));break}case MediaBlock.PROP_VIDEO_TYPE_GOTOWEBINAR:{parent.insertAdjacentHTML("beforeend","<iframe width=\"100%\" height=\"".concat(oneOfThisWidth*thisAspectH,"px\" src=\"https://app.gotowebinar.com/unified/index.html#/embedded/recording/").concat(videoID,"?source=G2S-EMBEDDED\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen loading=\"lazy\"></iframe>"));break}default:{break}}})}},{key:"createYoutubeIframeEmbed",value:function createYoutubeIframeEmbed(parent,oneOfThisWidth,thisAspectH,videoID){new YT.Player(parent,{height:"".concat(oneOfThisWidth*thisAspectH,"px"),width:"100%",videoId:videoID,playerVars:{"autoplay":1,"playsinline":1,"rel":0,"modestbranding":1,"showinfo":0,"controls":1},events:{"onReady":function onReady(event){event.target.playVideo()}}})}},{key:"loadYouTubeAPI",value:function loadYouTubeAPI(){if(document.querySelector("script[src=\"".concat(MediaBlock.PROP_API_SRC_YOUTUBE,"\"]"))){return}var tag=document.createElement("script");var firstScriptTag=document.getElementsByTagName("script")[0];tag.src=MediaBlock.PROP_API_SRC_YOUTUBE;firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)}},{key:"resizeOnWindowChange",value:function resizeOnWindowChange(){var mediaBlock=this.instance.querySelector(MediaBlock.SELECTOR_CLASS_MEDIA_BLOCK);if(!mediaBlock){return}var button=mediaBlock.querySelector("button");if(!button){return}var thisAspectH=button.getAttribute(MediaBlock.ATTR_ASPECT_H);var thisAspectW=button.getAttribute(MediaBlock.ATTR_ASPECT_W);var thisWidth=mediaBlock.offsetWidth;var oneOfThisWidth=thisWidth/thisAspectW;var newHeight=oneOfThisWidth*thisAspectH;var placeholder=this.instance.querySelector(MediaBlock.SELECTOR_CLASS_PLACEHOLDER);if(placeholder){placeholder.style.height="".concat(newHeight,"px")}var iframe=mediaBlock.querySelector("iframe");
1if(iframe){iframe.setAttribute("height","".concat(oneOfThisWidth*thisAspectH,"px"))}}}])}();_defineProperty(MediaBlock,"SELECTOR_CLASS_BLOCK",".wp-block-jtf-jtf-youtube");_defineProperty(MediaBlock,"SELECTOR_CLASS_MEDIA_BLOCK",".jtf__mediablock");_defineProperty(MediaBlock,"SELECTOR_CLASS_PLACEHOLDER",".jtf__mediablock__placeholder");_defineProperty(MediaBlock,"SELECTOR_CLASS_MEDIA_BLOCK_YT",".jtf__mediablock--yt");_defineProperty(MediaBlock,"SELECTOR_CLASS_TAB_TOGGLE",".wp-block-jtf-jtf-tab-toggle-content");_defineProperty(MediaBlock,"SELECTOR_CLASS_TAB_CONTENT",".jtf__tabtoggleblock__content");_defineProperty(MediaBlock,"SELECTOR_CLASS_TAB_ITEM",".jtf__tabtoggleblock__items__item");_defineProperty(MediaBlock,"SELECTOR_CLASS_ADMIN",".wp-admin");_defineProperty(MediaBlock,"ATTR_URL","data-url");_defineProperty(MediaBlock,"ATTR_TYPE","data-type");_defineProperty(MediaBlock,"ATTR_ASPECT_H","data-aspecth");_defineProperty(MediaBlock,"ATTR_ASPECT_W","data-aspectw");_defineProperty(MediaBlock,"ATTR_ID","id");_defineProperty(MediaBlock,"PROP_ADMIN_TIMEOUT",4000);_defineProperty(MediaBlock,"PROP_RESIZE_TIMEOUT",100);_defineProperty(MediaBlock,"PROP_VIDEO_TYPE_VIMEO","vm");_defineProperty(MediaBlock,"PROP_VIDEO_TYPE_YOUTUBE","yt");_defineProperty(MediaBlock,"PROP_VIDEO_TYPE_WISTIA","ws");_defineProperty(MediaBlock,"PROP_VIDEO_TYPE_BILIBILI","bb");_defineProperty(MediaBlock,"PROP_VIDEO_TYPE_GOTOWEBINAR","gtw");_defineProperty(MediaBlock,"PROP_API_SRC_YOUTUBE","https://www.youtube.com/iframe_api");if(document.querySelector(MediaBlock.SELECTOR_CLASS_ADMIN)){setTimeout(function(){var blocks=document.querySelectorAll(MediaBlock.SELECTOR_CLASS_BLOCK);blocks.forEach(function(block){new MediaBlock(block)})},MediaBlock.PROP_ADMIN_TIMEOUT)}else{document.addEventListener("DOMContentLoaded",function(){var blocks=document.querySelectorAll(MediaBlock.SELECTOR_CLASS_BLOCK);blocks.forEach(function(block){new MediaBlock(block)})})}var MiniModal=function(){function MiniModal(context){_classCallCheck(this,MiniModal);this.context=context;this.trigger=context.querySelector(MiniModal.SELECTOR_CLASS_TRIGGER);this.close=context.querySelector(MiniModal.SELECTOR_CLASS_CLOSE);this.modalContent=context.querySelector(MiniModal.SELECTOR_CLASS_CONTENT);this.trapFocusHandler=null;this.clickMapping()}return _createClass(MiniModal,[{key:"clickMapping",value:function clickMapping(){var _this14=this;this.trigger.addEventListener("click",function(){var isActive=_this14.trigger.classList.contains(MiniModal.CLASS_NAME_ACTIVE);if(isActive){_this14.modalContent.classList.remove(MiniModal.CLASS_NAME_ACTIVE);_this14.trigger.classList.remove(MiniModal.CLASS_NAME_ACTIVE);_this14.releaseFocus()}else{_this14.modalContent.classList.add(MiniModal.CLASS_NAME_ACTIVE);_this14.trigger.classList.add(MiniModal.CLASS_NAME_ACTIVE);_this14.modalContent.focus();_this14.trapFocus()}});this.close.addEventListener("click",function(){_this14.modalContent.classList.remove(MiniModal.CLASS_NAME_ACTIVE);_this14.trigger.classList.remove(MiniModal.CLASS_NAME_ACTIVE);_this14.trigger.focus();_this14.releaseFocus()});this.modalContent.addEventListener("keydown",function(e){if(e.key===MiniModal.KEYCODE_ESCAPE){_this14.modalContent.classList.remove(MiniModal.CLASS_NAME_ACTIVE);_this14.trigger.classList.remove(MiniModal.CLASS_NAME_ACTIVE);_this14.trigger.focus();_this14.releaseFocus()}})}},{key:"trapFocus",value:function trapFocus(){var focusableSelector="a, button, input, textarea, select, [".concat(MiniModal.ATTR_TABINDEX,"]:not([").concat(MiniModal.ATTR_TABINDEX,"=\"-1\"])");var focusableElements=Array.from(this.modalContent.querySelectorAll(focusableSelector));var firstElement=focusableElements[0];var lastElement=focusableElements[focusableElements.length-1];this.trapFocusHandler=function(e){if(e.key===MiniModal.KEYCODE_TAB){if(e.shiftKey){if(document.activeElement===firstElement){e.preventDefault();lastElement.focus()}}else{if(document.activeElement===lastElement){e.preventDefault();firstElement.focus()}}}};this.modalContent.addEventListener("keydown",this.trapFocusHandler)}},{key:"releaseFocus",value:function releaseFocus(){if(this.trapFocusHandler){this.modalContent.removeEventListener("keydown",this.trapFocusHandler);this.trapFocusHandler=null}}}])}();_defineProperty(MiniModal,"CLASS_NAME_ACTIVE","jtf__minimodal--modal--active");_defineProperty(MiniModal,"SELECTOR_CLASS_MINIMODAL",".jtf__minimodal");_defineProperty(MiniModal,"SELECTOR_CLASS_TRIGGER",".jtf__minimodal--modal--trigger--button");_defineProperty(MiniModal,"SELECTOR_CLASS_CLOSE",".jtf__minimodal--modal--close--button");_defineProperty(MiniModal,"SELECTOR_CLASS_CONTENT",".jtf__minimodal--modal--content");_defineProperty(MiniModal,"KEYCODE_ESCAPE","Escape");_defineProperty(MiniModal,"KEYCODE_TAB","Tab");_defineProperty(MiniModal,"ATTR_TABINDEX","tabindex");document.addEventListener("DOMContentLoaded",function(){var modals=document.querySelectorAll(MiniModal.SELECTOR_CLASS_MINIMODAL);
1modals.forEach(function(modal){new MiniModal(modal)})});document.addEventListener("DOMContentLoaded",function(){var JTFSELECTOR=function(){function JTFSELECTOR(){_classCallCheck(this,JTFSELECTOR);this.init()}return _createClass(JTFSELECTOR,[{key:"navigateCarousel",value:function navigateCarousel(){var inner=document.querySelector(JTFSELECTOR.SELECTOR_CLASS_INNER);var container=document.querySelector(JTFSELECTOR.SELECTOR_CLASS_CONTAINER);var position=parseInt(container.getAttribute(JTFSELECTOR.ATTR_DATA_POSITION));var translateX=-(inner.offsetWidth*position);inner.style.transform="translateX(".concat(translateX,"px)")}},{key:"setActiveDot",value:function setActiveDot(active){var activeDot=document.querySelector(JTFSELECTOR.SELECTOR_CLASS_DOT_ACTIVE);if(activeDot){activeDot.classList.remove(JTFSELECTOR.CLASS_NAME_DOT_ACTIVE)}var dots=document.querySelectorAll(JTFSELECTOR.SELECTOR_CLASS_DOT);dots.forEach(function(dot){if(parseInt(dot.getAttribute(JTFSELECTOR.ATTR_DATA_TARGET))===parseInt(active)){dot.classList.add(JTFSELECTOR.CLASS_NAME_DOT_ACTIVE)}})}},{key:"loadCarousel",value:function loadCarousel(){var _this15=this;document.addEventListener("click",function(e){if(e.target.closest(JTFSELECTOR.SELECTOR_CLASS_PREV)){var parent=document.querySelector(JTFSELECTOR.SELECTOR_CLASS_CONTAINER);var position=parseInt(parent.getAttribute(JTFSELECTOR.ATTR_DATA_POSITION));parent.setAttribute("data-max","false");if(position>0){parent.setAttribute(JTFSELECTOR.ATTR_DATA_POSITION,position-1);_this15.setActiveDot(position-1);_this15.navigateCarousel()}if(position===1){e.target.closest(JTFSELECTOR.SELECTOR_CLASS_PREV).classList.add(JTFSELECTOR.CLASS_NAME_NAVIGATION_INACTIVE)}}if(e.target.closest(JTFSELECTOR.SELECTOR_CLASS_NEXT)){var _parent=document.querySelector(JTFSELECTOR.SELECTOR_CLASS_CONTAINER);var _position=parseInt(_parent.getAttribute(JTFSELECTOR.ATTR_DATA_POSITION));var inner=document.querySelector(JTFSELECTOR.SELECTOR_CLASS_INNER);var innerChildren=parseInt(inner.getAttribute(JTFSELECTOR.ATTR_DATA_CHILDREN));var prev=document.querySelector(JTFSELECTOR.SELECTOR_CLASS_PREV);prev.classList.remove(JTFSELECTOR.CLASS_NAME_NAVIGATION_INACTIVE);if(_position+1<innerChildren){_parent.setAttribute(JTFSELECTOR.ATTR_DATA_POSITION,_position+1);_this15.setActiveDot(_position+1);_this15.navigateCarousel()}else{prev.classList.add(JTFSELECTOR.CLASS_NAME_NAVIGATION_INACTIVE);_parent.setAttribute(JTFSELECTOR.ATTR_DATA_POSITION,0);_this15.setActiveDot(0);_this15.navigateCarousel()}}if(e.target.closest(JTFSELECTOR.SELECTOR_CLASS_DOT)){var dot=e.target.closest(JTFSELECTOR.SELECTOR_CLASS_DOT);var _position2=parseInt(dot.getAttribute(JTFSELECTOR.ATTR_DATA_TARGET));var _prev=document.querySelector(JTFSELECTOR.SELECTOR_CLASS_PREV);var container=document.querySelector(JTFSELECTOR.SELECTOR_CLASS_CONTAINER);container.setAttribute(JTFSELECTOR.ATTR_DATA_POSITION,_position2);_this15.setActiveDot(_position2);if(_position2===0){_prev.classList.add(JTFSELECTOR.CLASS_NAME_NAVIGATION_INACTIVE)}else{_prev.classList.remove(JTFSELECTOR.CLASS_NAME_NAVIGATION_INACTIVE)}_this15.navigateCarousel()}})}},{key:"generateNavigation",value:function generateNavigation(slideCount){var parent=document.querySelector(JTFSELECTOR.SELECTOR_CLASS_DOTS);var grandParent=document.querySelector(JTFSELECTOR.SELECTOR_CLASS_NAV);var container=document.querySelector(JTFSELECTOR.SELECTOR_CLASS_CONTAINER);var currentPosition=container.getAttribute(JTFSELECTOR.ATTR_DATA_POSITION);var styleAttr=container.getAttribute(JTFSELECTOR.ATTR_STYLE)||"";grandParent.innerHTML="";grandParent.appendChild(parent);var prevButton=document.createElement("a");prevButton.className="jtf__selectorblock--prev jtf__selectorblock--navigation";if(currentPosition==="0"){prevButton.classList.add(JTFSELECTOR.CLASS_NAME_NAVIGATION_INACTIVE)}prevButton.setAttribute("style",styleAttr);prevButton.href="javascript:void(0);";prevButton.innerHTML="<i class=\"far fa-angle-left\"></i>";parent.parentNode.insertBefore(prevButton,parent);var nextButton=document.createElement("a");nextButton.className="jtf__selectorblock--next jtf__selectorblock--navigation";nextButton.href="javascript:void(0);";nextButton.setAttribute("style",styleAttr);nextButton.innerHTML="<i class=\"far fa-angle-right\"></i>";parent.parentNode.insertBefore(nextButton,parent.nextSibling);parent.innerHTML="";for(var x=0;x<slideCount;x++){var dotLink=document.createElement("a");dotLink.href="#";dotLink.className="jtf__selectorblock--dot";if(x===0){dotLink.classList.add(JTFSELECTOR.CLASS_NAME_DOT_ACTIVE)}dotLink.setAttribute(JTFSELECTOR.ATTR_DATA_TARGET,x);dotLink.setAttribute("style",styleAttr);dotLink.innerHTML="<i class=\"fas fa-circle\"></i>";parent.appendChild(dotLink)}}},{key:"removeNavigation",value:function removeNavigation(){var containers=document.querySelectorAll(JTFSELECTOR.SELECTOR_CLASS_NAVIGATION);
1containers.forEach(function(container){container.innerHTML=""})}},{key:"reboot",value:function reboot(){var _this16=this;var panelItemCount=JTFSELECTOR.PANEL_ITEM_COUNT;if(window.innerWidth<JTFSELECTOR.MOBILE_BREAKPOINT){panelItemCount=1}var container=document.querySelector(JTFSELECTOR.SELECTOR_CLASS_CONTAINER);var itemWidth=container.offsetWidth/panelItemCount;var inner=document.querySelector(JTFSELECTOR.SELECTOR_CLASS_INNER);container.setAttribute(JTFSELECTOR.ATTR_DATA_POSITION,0);inner.style.transform="translateX(0)";var wpAdmin=document.querySelector(JTFSELECTOR.SELECTOR_CLASS_WP_ADMIN);if(wpAdmin){setTimeout(function(){var items=document.querySelectorAll(JTFSELECTOR.SELECTOR_CLASS_ITEM);var childElCount=Math.ceil(items.length/panelItemCount);inner.setAttribute(JTFSELECTOR.ATTR_DATA_CHILDREN,childElCount);if(childElCount>1){_this16.generateNavigation(childElCount)}else{_this16.removeNavigation()}items.forEach(function(item){item.style.width="".concat(itemWidth,"px");item.style.display="inline-block"})},JTFSELECTOR.TIMEOUT_DELAY)}else{var select=document.querySelector(JTFSELECTOR.SELECTOR_CLASS_SELECT);var currentSelection=select?select.value:null;var items=document.querySelectorAll(JTFSELECTOR.SELECTOR_CLASS_ITEM);var matchingItems=currentSelection?document.querySelectorAll("".concat(JTFSELECTOR.SELECTOR_CLASS_ITEM,"[").concat(JTFSELECTOR.ATTR_DATA_PARENT,"=\"").concat(currentSelection,"\"]")):items;var childElCount=Math.ceil(matchingItems.length/panelItemCount);inner.setAttribute(JTFSELECTOR.ATTR_DATA_CHILDREN,childElCount);if(childElCount>1){this.generateNavigation(childElCount)}else{this.removeNavigation()}items.forEach(function(item){item.style.width="".concat(itemWidth,"px");if(currentSelection&&item.getAttribute(JTFSELECTOR.ATTR_DATA_PARENT)===currentSelection){item.style.display="inline-block"}else if(!currentSelection){item.style.display="inline-block"}else{item.style.display="none"}})}}},{key:"init",value:function init(){var _this17=this;var container=document.querySelector(JTFSELECTOR.SELECTOR_CLASS_CONTAINER);if(container){container.setAttribute(JTFSELECTOR.ATTR_DATA_POSITION,0)}document.addEventListener("click",function(e){if(e.target.closest(JTFSELECTOR.SELECTOR_CLASS_BUTTON)){e.preventDefault();_this17.reboot()}});this.loadCarousel()}}])}();_defineProperty(JTFSELECTOR,"SELECTOR_CLASS_INNER",".jtf__selectorblock--inner");_defineProperty(JTFSELECTOR,"SELECTOR_CLASS_CONTAINER",".jtf__selectorblock--container");_defineProperty(JTFSELECTOR,"SELECTOR_CLASS_DOT_ACTIVE",".jtf__selectorblock--dot-active");_defineProperty(JTFSELECTOR,"SELECTOR_CLASS_DOT",".jtf__selectorblock--dot");_defineProperty(JTFSELECTOR,"SELECTOR_CLASS_PREV",".jtf__selectorblock--prev");_defineProperty(JTFSELECTOR,"SELECTOR_CLASS_NEXT",".jtf__selectorblock--next");_defineProperty(JTFSELECTOR,"SELECTOR_CLASS_DOTS",".jtf__selectorblock--dots");_defineProperty(JTFSELECTOR,"SELECTOR_CLASS_NAV",".jtf__selectorblock--nav");_defineProperty(JTFSELECTOR,"SELECTOR_CLASS_ITEM",".jtf__selectorblock--item");_defineProperty(JTFSELECTOR,"SELECTOR_CLASS_SELECT",".jtf__selectorblock--selector-select");_defineProperty(JTFSELECTOR,"SELECTOR_CLASS_BUTTON",".jtf__selectorblock--selector-button");_defineProperty(JTFSELECTOR,"SELECTOR_CLASS_NAVIGATION",".jtf__selectorblock--navigation");_defineProperty(JTFSELECTOR,"SELECTOR_CLASS_WP_ADMIN",".wp-admin");_defineProperty(JTFSELECTOR,"SELECTOR_CLASS_BLOCK",".wp-block-jtf-jtf-selector");_defineProperty(JTFSELECTOR,"CLASS_NAME_DOT_ACTIVE","jtf__selectorblock--dot-active");_defineProperty(JTFSELECTOR,"CLASS_NAME_NAVIGATION_INACTIVE","jtf__selectorblock--navigation-inactive");_defineProperty(JTFSELECTOR,"ATTR_DATA_POSITION","data-position");_defineProperty(JTFSELECTOR,"ATTR_DATA_CHILDREN","data-children");_defineProperty(JTFSELECTOR,"ATTR_DATA_TARGET","data-target");_defineProperty(JTFSELECTOR,"ATTR_DATA_PARENT","data-parent");_defineProperty(JTFSELECTOR,"ATTR_STYLE","style");_defineProperty(JTFSELECTOR,"PANEL_ITEM_COUNT",3);_defineProperty(JTFSELECTOR,"MOBILE_BREAKPOINT",600);_defineProperty(JTFSELECTOR,"TIMEOUT_DELAY",300);var wpAdmin=document.querySelector(JTFSELECTOR.SELECTOR_CLASS_WP_ADMIN);if(wpAdmin){new JTFSELECTOR}else{var blocks=document.querySelectorAll(JTFSELECTOR.SELECTOR_CLASS_BLOCK);if(blocks.length>0){blocks.forEach(function(){new JTFSELECTOR})}}});document.addEventListener("DOMContentLoaded",function(){var TABTOGGLECONTENT=function(){function TABTOGGLECONTENT(instance){_classCallCheck(this,TABTOGGLECONTENT);this.instance=instance;this.init()}return _createClass(TABTOGGLECONTENT,[{key:"init",value:function init(
1){var _this18=this;var itemsEl=this.instance.querySelector("."+TABTOGGLECONTENT.CLASS_NAME_ITEMS);var blockName=itemsEl?itemsEl.getAttribute(TABTOGGLECONTENT.ATTR_DATA_BLOCKNAME):"";var selectedItem=this.instance.querySelector("."+TABTOGGLECONTENT.CLASS_NAME_ITEM_SELECTED);var itemName=selectedItem?selectedItem.getAttribute(TABTOGGLECONTENT.ATTR_DATA_ITEMNAME):"";if(blockName&&itemName){this.hideAllContent(blockName,itemName)}this.instance.addEventListener("click",function(e){var item=e.target.closest("."+TABTOGGLECONTENT.CLASS_NAME_ITEM);if(item){itemName=item.getAttribute(TABTOGGLECONTENT.ATTR_DATA_ITEMNAME);_this18.activateTab(item,blockName,itemName)}});this.instance.addEventListener("keydown",function(e){var currentTab=e.target.closest("."+TABTOGGLECONTENT.CLASS_NAME_ITEM);if(currentTab){var allTabs=Array.from(_this18.instance.querySelectorAll("."+TABTOGGLECONTENT.CLASS_NAME_ITEM));var currentIndex=allTabs.indexOf(currentTab);var targetTab=null;switch(e.key){case TABTOGGLECONTENT.KEYCODE_ARROW_RIGHT:case TABTOGGLECONTENT.KEYCODE_ARROW_DOWN:{e.preventDefault();targetTab=currentIndex<allTabs.length-1?allTabs[currentIndex+1]:allTabs[0];break}case TABTOGGLECONTENT.KEYCODE_ARROW_LEFT:case TABTOGGLECONTENT.KEYCODE_ARROW_UP:{e.preventDefault();targetTab=currentIndex>0?allTabs[currentIndex-1]:allTabs[allTabs.length-1];break}case TABTOGGLECONTENT.KEYCODE_HOME:{e.preventDefault();targetTab=allTabs[0];break}case TABTOGGLECONTENT.KEYCODE_END:{e.preventDefault();targetTab=allTabs[allTabs.length-1];break}default:{break}}if(targetTab){var targetItemName=targetTab.getAttribute(TABTOGGLECONTENT.ATTR_DATA_ITEMNAME);_this18.activateTab(targetTab,blockName,targetItemName);targetTab.focus()}}});var targetElement=this.instance.querySelector("."+TABTOGGLECONTENT.CLASS_NAME_TABS_LEFT);if(targetElement){var colParent=targetElement.closest(TABTOGGLECONTENT.SELECTOR_CLASS_COL_12);if(colParent){colParent.classList.add(TABTOGGLECONTENT.CLASS_NAME_COL_CONTAINER)}}}},{key:"activateTab",value:function activateTab(targetTab,blockName,itemName){var items=this.instance.querySelectorAll("."+TABTOGGLECONTENT.CLASS_NAME_ITEM);items.forEach(function(item){item.classList.remove(TABTOGGLECONTENT.CLASS_NAME_ITEM_SELECTED);item.setAttribute(TABTOGGLECONTENT.ATTR_ARIA_SELECTED,"false");item.setAttribute(TABTOGGLECONTENT.ATTR_TABINDEX,"-1")});targetTab.classList.add(TABTOGGLECONTENT.CLASS_NAME_ITEM_SELECTED);targetTab.setAttribute(TABTOGGLECONTENT.ATTR_ARIA_SELECTED,"true");targetTab.setAttribute(TABTOGGLECONTENT.ATTR_TABINDEX,"0");if(blockName&&itemName){this.hideAllContent(blockName,itemName)}}},{key:"hideAllContent",value:function hideAllContent(blockName,itemName){var blockNameClass="."+TABTOGGLECONTENT.CLASS_NAME_CONTENT+"__blockname--"+blockName;var blockElements=document.querySelectorAll(blockNameClass);if(blockElements.length>0){var itemNameClass="."+TABTOGGLECONTENT.CLASS_NAME_CONTENT+"__itemname--"+itemName;blockElements.forEach(function(el){el.style.display="none"});var targetElements=document.querySelectorAll(blockNameClass+itemNameClass);targetElements.forEach(function(el){el.style.display="block";el.style.opacity="0";setTimeout(function(){el.style.transition="opacity 0.4s";el.style.opacity="1"},10)})}}}])}();_defineProperty(TABTOGGLECONTENT,"CLASS_NAME_ITEMS","jtf__tabtoggleblock__items");_defineProperty(TABTOGGLECONTENT,"CLASS_NAME_ITEM","jtf__tabtoggleblock__items__item");_defineProperty(TABTOGGLECONTENT,"CLASS_NAME_ITEM_SELECTED","jtf__tabtoggleblock__items__item--selected");_defineProperty(TABTOGGLECONTENT,"CLASS_NAME_CONTENT","jtf__tabtoggleblock__content");_defineProperty(TABTOGGLECONTENT,"CLASS_NAME_TABS_LEFT","jtf__tabtoggleblock--tabsleft");_defineProperty(TABTOGGLECONTENT,"CLASS_NAME_COL_CONTAINER","jtf__tabtoggleblock--colcontainer");_defineProperty(TABTOGGLECONTENT,"SELECTOR_CLASS_BLOCK",".wp-block-jtf-jtf-tab-toggle-content");_defineProperty(TABTOGGLECONTENT,"SELECTOR_CLASS_COL_12",".col-12");_defineProperty(TABTOGGLECONTENT,"ATTR_DATA_BLOCKNAME","data-blockname");_defineProperty(TABTOGGLECONTENT,"ATTR_DATA_ITEMNAME","data-itemname");_defineProperty(TABTOGGLECONTENT,"ATTR_ARIA_SELECTED","aria-selected");_defineProperty(TABTOGGLECONTENT,"ATTR_TABINDEX","tabindex");_defineProperty(TABTOGGLECONTENT,"KEYCODE_ARROW_RIGHT","ArrowRight");_defineProperty(TABTOGGLECONTENT,"KEYCODE_ARROW_DOWN","ArrowDown");_defineProperty(TABTOGGLECONTENT,"KEYCODE_ARROW_LEFT","ArrowLeft");_defineProperty(TABTOGGLECONTENT,"KEYCODE_ARROW_UP","ArrowUp");_defineProperty(TABTOGGLECONTENT,"KEYCODE_HOME","Home");_defineProperty(TABTOGGLECONTENT,"KEYCODE_END","End");var blocks=document.querySelectorAll(TABTOGGLECONTENT.SELECTOR_CLASS_BLOCK);if(blocks.length>0){blocks.forEach(function(block){new TABTOGGLECONTENT(block)})}});document.addEventListener("DOMContentLoaded",function(){var TFOIFA=function(){function TFOIFA(instance){_classCallCheck(this,TFOIFA);this.instance=instance;this.classTfoIfaBlock=TFOIFA.CLASS_NAME_TFOIFA_BLOCK;this.instanceId=0;this.init()}
1return _createClass(TFOIFA,[{key:"constructButtonHref",value:function constructButtonHref(acronym,apc,title,button){var href;switch(apc){case TFOIFA.PROP_APC_YES_IN_DOVE:case TFOIFA.PROP_APC_YES_IN_API_DOVE:case TFOIFA.PROP_APC_NO_DOVE:{var processed_title=title.toLowerCase().replace(/[.,\/#!$%\^&\*;:{}=\-_`~()]/g,"").replace(/ /g,"-");href=TFOIFA.DOVE_BASE_URL+processed_title+TFOIFA.DOVE_JOURNAL_SUFFIX;break}default:{href=button.getAttribute(TFOIFA.ATTR_DATA_TFO);href+=acronym;break}}return href}},{key:"fadeIn",value:function fadeIn(element){element.style.display="inline-block";element.style.opacity="0";element.style.transition="opacity 0.4s";setTimeout(function(){element.style.opacity="1"},10)}},{key:"fadeOut",value:function fadeOut(element){element.style.opacity="1";element.style.transition="opacity 0.4s";setTimeout(function(){element.style.opacity="0";setTimeout(function(){element.style.display="none"},400)},10)}},{key:"init",value:function init(){var _this19=this;var blockEl=this.instance.querySelector("."+this.classTfoIfaBlock);if(blockEl){this.instanceId=blockEl.getAttribute(TFOIFA.ATTR_DATA_ID)}this.instance.addEventListener("click",function(e){var clearBtn=e.target.closest("."+TFOIFA.CLASS_NAME_CLEAR);if(clearBtn){e.preventDefault();var input=_this19.instance.querySelector("."+TFOIFA.CLASS_NAME_INPUT);if(input){input.value=""}var ifaButtonsContainer=_this19.instance.querySelector("."+TFOIFA.CLASS_NAME_BUTTONS_IFA);if(ifaButtonsContainer){var ifaButton=_this19.instance.querySelector("."+TFOIFA.CLASS_NAME_BUTTON_IFA);if(ifaButton){_this19.fadeOut(ifaButton)}}var aasButtonsContainer=_this19.instance.querySelector("."+TFOIFA.CLASS_NAME_BUTTONS_AAS);if(aasButtonsContainer){var aasbutton=_this19.instance.querySelector("."+TFOIFA.CLASS_NAME_BUTTON_AAS);if(aasbutton){_this19.fadeOut(aasbutton)}}}});this.instance.addEventListener("change",function(e){var input=e.target.closest("."+TFOIFA.CLASS_NAME_INPUT);if(input){var title=input.value;var datalistId="journals-"+_this19.instanceId;var datalist=document.getElementById(datalistId);if(datalist){var options=Array.from(datalist.querySelectorAll("option"));var matchedOption=options.find(function(option){return option.value===title});if(matchedOption){var acronym=matchedOption.getAttribute(TFOIFA.ATTR_DATA_ACR);var apc=matchedOption.getAttribute(TFOIFA.ATTR_DATA_APC);e.preventDefault();e.stopPropagation();var ifaButtonsContainer=_this19.instance.querySelector("."+TFOIFA.CLASS_NAME_BUTTONS_IFA);if(ifaButtonsContainer){var ifaButton=_this19.instance.querySelector("."+TFOIFA.CLASS_NAME_BUTTON_IFA);if(ifaButton){_this19.fadeIn(ifaButton);var href=_this19.constructButtonHref(acronym,apc,title,ifaButton);ifaButton.setAttribute(TFOIFA.ATTR_HREF,href)}}var aasButtonsContainer=_this19.instance.querySelector("."+TFOIFA.CLASS_NAME_BUTTONS_AAS);if(aasButtonsContainer){var aasbutton=_this19.instance.querySelector("."+TFOIFA.CLASS_NAME_BUTTON_AAS);if(aasbutton){_this19.fadeIn(aasbutton);var _href=_this19.constructButtonHref(acronym,apc,title,aasbutton);aasbutton.setAttribute(TFOIFA.ATTR_HREF,_href)}}var countSpan=_this19.instance.querySelector("."+TFOIFA.CLASS_NAME_COUNT+" span");if(countSpan){countSpan.innerHTML="1"}}}}})}}])}();_defineProperty(TFOIFA,"CLASS_NAME_TFOIFA_BLOCK","jtf__tfoifablock");_defineProperty(TFOIFA,"CLASS_NAME_CLEAR","jtf__tfoifablock--clear");_defineProperty(TFOIFA,"CLASS_NAME_INPUT","jtf__tfoifablock--input");_defineProperty(TFOIFA,"CLASS_NAME_BUTTONS_IFA","jtf__tfoifablock--buttons-ifa");_defineProperty(TFOIFA,"CLASS_NAME_BUTTON_IFA","jtf__tfoifablock--externalbutton-ifa");_defineProperty(TFOIFA,"CLASS_NAME_BUTTONS_AAS","jtf__tfoifablock--buttons-aims_and_scope");_defineProperty(TFOIFA,"CLASS_NAME_BUTTON_AAS","jtf__tfoifablock--externalbutton-aas");_defineProperty(TFOIFA,"CLASS_NAME_COUNT","jtf__tfoifablock--count");_defineProperty(TFOIFA,"SELECTOR_CLASS_WP_ADMIN",".wp-admin");_defineProperty(TFOIFA,"SELECTOR_CLASS_BLOCK",".wp-block-jtf-jtf-tfoifa");_defineProperty(TFOIFA,"ATTR_DATA_ID","data-id");_defineProperty(TFOIFA,"ATTR_DATA_ACR","data-acr");_defineProperty(TFOIFA,"ATTR_DATA_APC","data-apc");_defineProperty(TFOIFA,"ATTR_DATA_TFO","data-tfo");_defineProperty(TFOIFA,"ATTR_HREF","href");_defineProperty(TFOIFA,"PROP_APC_YES_IN_DOVE","yes_in_dove");_defineProperty(TFOIFA,"PROP_APC_YES_IN_API_DOVE","yes_in_api_dove");_defineProperty(TFOIFA,"PROP_APC_NO_DOVE","no_dove");_defineProperty(TFOIFA,"TIMEOUT_DELAY",1000);_defineProperty(TFOIFA,"DOVE_BASE_URL","https://www.dovepress.com/");_defineProperty(TFOIFA,"DOVE_JOURNAL_SUFFIX","-journal");var wpAdmin=document.querySelector(TFOIFA.SELECTOR_CLASS_WP_ADMIN);if(wpAdmin){setTimeout(function(){var blocks=document.querySelectorAll(TFOIFA.SELECTOR_CLASS_BLOCK);if(blocks.length>0){blocks.forEach(function(block){new TFOIFA(block)})}},TFOIFA.TIMEOUT_DELAY)}else{var blocks=document.querySelectorAll(TFOIFA.SELECTOR_CLASS_BLOCK);if(blocks.length>0){blocks.forEach(function(block){new TFOIFA(block)})}}});document.addEventListener("DOMContentLoaded",function(){var TEXTTOSPEECH=function(){function TEXTTOSPEECH(instance){_classCallCheck(this,TEXTTOSPEECH);this.instance=instance;this.getAudioFromServer()}return _createClass(TEXTTOSPEECH,[{key:"getAudioFromServer",value:function(){var _getAudioFromServer=_asyncToGenerator(_regeneratorRuntime().mark(function _callee2(){var ttsElement,playerId,response,fetchResponseData;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:ttsElement=this.instance.querySelector(TEXTTOSPEECH.SELECTOR_CLASS_TTS);if(ttsElement){_context2.next=3;break}return _context2.abrupt("return");case 3:playerId=ttsElement.getAttribute(TEXTTOSPEECH.ATTR_DATA_PLAYERID);_context2.prev=4;_context2.next=7;return fetch("".concat(TEXTTOSPEECH.API_ENDPOINT,"?playerid=").concat(playerId,"&auth=").concat(localObject.jtfRegKey),{method:"GET",headers:{"Content-Type":"application/json"}});case 7:response=_context2.sent;if(response.ok){_context2.next=10;break}throw new Error("Error! status: ".concat(response.status));case 10:_context2.next=12;return response.json();case 12:fetchResponseData=_context2.sent;if(fetchResponseData!==TEXTTOSPEECH.PROP_AUTH_FAIL&&fetchResponseData!==TEXTTOSPEECH.PROP_NO_AUDIO_DATA){this.createAudioPlayer(fetchResponseData,playerId)}_context2.next=18;break;case 16:_context2.prev=16;_context2.t0=_context2["catch"](4);case 18:case"end":return _context2.stop()}},_callee2,this,[[4,16]])}));function getAudioFromServer(){return _getAudioFromServer.apply(this,arguments)}return getAudioFromServer}()},{key:"createAudioPlayer",value:function createAudioPlayer(audioUrl,playerId){if(audioUrl&&playerId){var audioElements=this.instance.querySelectorAll("audio");
1audioElements.forEach(function(el){el.remove()});var labelId="jtf__tts--label-"+playerId;var audioElement=document.createElement("audio");audioElement.controls=true;audioElement.autoplay=false;audioElement.src=audioUrl;audioElement.setAttribute("aria-labelledby",labelId);var container=document.getElementById("jtf__tts--"+playerId);if(container){container.appendChild(audioElement)}audioElement.addEventListener(TEXTTOSPEECH.EVENT_PLAY,function(e){if(typeof dataLayer!=="undefined"){dataLayer.push({"event":TEXTTOSPEECH.EVENT_TTS_AUDIO,"ttsAudioAction":TEXTTOSPEECH.EVENT_PLAY,"ttsAudioTitle":e.target.src})}});audioElement.addEventListener(TEXTTOSPEECH.EVENT_ENDED,function(e){if(typeof dataLayer!=="undefined"){dataLayer.push({"event":TEXTTOSPEECH.EVENT_TTS_AUDIO,"ttsAudioAction":TEXTTOSPEECH.EVENT_ENDED,"ttsAudioTitle":e.target.src})}})}}}])}();_defineProperty(TEXTTOSPEECH,"SELECTOR_CLASS_TTS",".jtf__tts");_defineProperty(TEXTTOSPEECH,"SELECTOR_CLASS_WP_ADMIN",".wp-admin");_defineProperty(TEXTTOSPEECH,"SELECTOR_CLASS_BLOCK",".wp-block-jtf-jtf-tts");_defineProperty(TEXTTOSPEECH,"ATTR_DATA_PLAYERID","data-playerid");_defineProperty(TEXTTOSPEECH,"TIMEOUT_DELAY_ADMIN",9000);_defineProperty(TEXTTOSPEECH,"API_ENDPOINT","/wp-json/jtf/v1/audio/retrievetts");_defineProperty(TEXTTOSPEECH,"PROP_AUTH_FAIL","auth_fail");_defineProperty(TEXTTOSPEECH,"PROP_NO_AUDIO_DATA","no_audio_data");_defineProperty(TEXTTOSPEECH,"EVENT_PLAY","play");_defineProperty(TEXTTOSPEECH,"EVENT_ENDED","ended");_defineProperty(TEXTTOSPEECH,"EVENT_TTS_AUDIO","ttsAudioEvent");var wpAdmin=document.querySelector(TEXTTOSPEECH.SELECTOR_CLASS_WP_ADMIN);if(wpAdmin){setTimeout(function(){var blocks=document.querySelectorAll(TEXTTOSPEECH.SELECTOR_CLASS_BLOCK);if(blocks.length>0){blocks.forEach(function(block){new TEXTTOSPEECH(block)})}},TEXTTOSPEECH.TIMEOUT_DELAY_ADMIN)}else{var blocks=document.querySelectorAll(TEXTTOSPEECH.SELECTOR_CLASS_BLOCK);if(blocks.length>0){blocks.forEach(function(block){new TEXTTOSPEECH(block)})}}});document.addEventListener("DOMContentLoaded",function(){var TWITTER=function(){function TWITTER(context){_classCallCheck(this,TWITTER);this.context=context;this.init()}return _createClass(TWITTER,[{key:"shuffle",value:function shuffle(array){var currentIndex=array.length;while(currentIndex!==0){var randomIndex=Math.floor(Math.random()*currentIndex);currentIndex-=1;var temporaryValue=array[currentIndex];array[currentIndex]=array[randomIndex];array[randomIndex]=temporaryValue}return array}},{key:"getSuffix",value:function getSuffix(date){if(date>3&&date<21){return"th"}switch(date%10){case 1:{return"st"}case 2:{return"nd"}case 3:{return"rd"}default:{return"th"}}}},{key:"addUrl",value:function addUrl(text){return text.replace(/(\b(https?|ftp|file):\/\/[\-A-Z0-9+&@#\/%?=~_|!:,.;]*[\-A-Z09+&@#\/%=~_|])/img,"<a href=\"$1\">$1</a>")}},{key:"setImage",value:function(){var _setImage=_asyncToGenerator(_regeneratorRuntime().mark(function _callee3(){var images,_iterator,_step,img,data,imageIds,response,json;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:images=this.context.querySelectorAll(TWITTER.SELECTOR_CLASS_IMAGE);if(!(images.length>0)){_context3.next=37;break}_iterator=_createForOfIteratorHelper(images);_context3.prev=3;_iterator.s();case 5:if((_step=_iterator.n()).done){_context3.next=29;break}img=_step.value;data=img.getAttribute(TWITTER.ATTR_DATA_IMG);if(!(data&&data!=="0")){_context3.next=26;break}imageIds=data.split(",");imageIds=this.shuffle(imageIds);_context3.prev=11;_context3.next=14;return fetch(TWITTER.MEDIA_API_ENDPOINT+imageIds[0]);case 14:response=_context3.sent;_context3.next=17;return response.json();case 17:json=_context3.sent;this.lazyLoadBgImage(img,json.media_details.sizes.medium.source_url);_context3.next=24;break;case 21:_context3.prev=21;_context3.t0=_context3["catch"](11);this.lazyLoadBgImage(img,TWITTER.DEFAULT_IMAGE_URL);case 24:_context3.next=27;break;case 26:this.lazyLoadBgImage(img,TWITTER.DEFAULT_IMAGE_URL);case 27:_context3.next=5;break;case 29:_context3.next=34;break;case 31:_context3.prev=31;_context3.t1=_context3["catch"](3);_iterator.e(_context3.t1);case 34:_context3.prev=34;_iterator.f();return _context3.finish(34);case 37:case"end":return _context3.stop()}},_callee3,this,[[3,31,34,37],[11,21]])}));function setImage(){return _setImage.apply(this,arguments)}return setImage}()},{key:"lazyLoadBgImage",value:function lazyLoadBgImage(element,imageUrl){if(imageUrl){var callback=function callback(entries){entries.forEac
1h(function(entry){if(entry.isIntersecting){element.style.backgroundImage="url(".concat(imageUrl,")")}})};var options={root:null,rootMargin:TWITTER.INTERSECTION_ROOT_MARGIN,threshold:0};var observer=new IntersectionObserver(callback,options);observer.observe(element)}}},{key:"init",value:function init(){var _this20=this;var themeRandomEl=this.context.querySelector(TWITTER.SELECTOR_CLASS_THEME_RANDOM);if(themeRandomEl){var rand=Math.floor(Math.random()*TWITTER.THEME_RANDOM_MAX)+1;this.context.classList.add(TWITTER.CLASS_NAME_THEME_PREFIX+rand)}var hashtagElements=this.context.querySelectorAll(TWITTER.SELECTOR_CLASS_HASHTAGS);hashtagElements.forEach(function(hashtagEl){var data=hashtagEl.getAttribute(TWITTER.ATTR_DATA_HASH);if(data){var hashtags=data.split(",");hashtags=_this20.shuffle(hashtags);hashtagEl.innerHTML="";var loopLimit=hashtags.length<=5?hashtags.length:TWITTER.HASHTAG_LOOP_LIMIT;for(var x=0;x<loopLimit;x++){var tagEle=document.createElement("a");tagEle.className=TWITTER.CLASS_NAME_HASHTAG;tagEle.href=TWITTER.TWITTER_HASHTAG_URL+hashtags[x].trim();tagEle.target="_blank";tagEle.innerHTML="#"+hashtags[x].trim();tagEle.setAttribute(TWITTER.ATTR_ARIA_LABEL,"Open hashtag "+hashtags[x].trim()+" on Twitter");hashtagEl.appendChild(tagEle)}}});var latestEl=this.context.querySelector(TWITTER.SELECTOR_CLASS_LATEST);if(latestEl){var handle=latestEl.getAttribute(TWITTER.ATTR_DATA_HANDLE);fetch(TWITTER.TWITTER_API_ENDPOINT+handle).then(function(response){return response.json()}).then(function(json){var _json$;var monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];var date=new Date(json[0]["created_at"]);var dayNumber=date.getDate();var month=monthNames[date.getMonth()];var handleIconContainer=document.createElement("a");handleIconContainer.className=TWITTER.CLASS_NAME_ICON_HANDLE;var tweetHandle=document.createElement("a");tweetHandle.className=TWITTER.CLASS_NAME_HANDLE;tweetHandle.href=TWITTER.TWITTER_PROFILE_URL+handle;var tweetBird=document.createElement("i");tweetBird.className="fab fa-twitter";handleIconContainer.appendChild(tweetBird);handleIconContainer.appendChild(tweetHandle);tweetHandle.innerHTML="@"+handle;var tweetData=document.createElement("div");tweetData.className=TWITTER.CLASS_NAME_TWEET;var tweetDate=document.createElement("div");tweetDate.className=TWITTER.CLASS_NAME_TWEET_DATE;tweetDate.innerHTML=month+" "+dayNumber+_this20.getSuffix(dayNumber);tweetData.innerHTML=_this20.addUrl(json[0]["full_text"]);latestEl.innerHTML="";latestEl.appendChild(handleIconContainer);latestEl.appendChild(tweetData);latestEl.appendChild(tweetDate);var mediaItem=json===null||json===void 0||(_json$=json[0])===null||_json$===void 0||(_json$=_json$["extended_entities"])===null||_json$===void 0||(_json$=_json$["media"])===null||_json$===void 0||(_json$=_json$[0])===null||_json$===void 0?void 0:_json$["media_url"];if(mediaItem){var imageEl=_this20.context.querySelector(TWITTER.SELECTOR_CLASS_IMAGE);if(imageEl){imageEl.style.backgroundImage="url(".concat(mediaItem,")")}}else{_this20.setImage().then(function(){})}}).catch(function(){_this20.setImage().then(function(){})})}else{this.setImage().then(function(){})}}}])}();_defineProperty(TWITTER,"SELECTOR_CLASS_BLOCK",".wp-block-jtf-jtf-twitter");_defineProperty(TWITTER,"SELECTOR_CLASS_IMAGE",".jtf__twitterblock--image");_defineProperty(TWITTER,"SELECTOR_CLASS_HASHTAGS",".jtf__twitterblock--hashtags");_defineProperty(TWITTER,"SELECTOR_CLASS_LATEST",".jtf__twitterblock--latest");_defineProperty(TWITTER,"SELECTOR_CLASS_THEME_RANDOM",".jtf__twitterblock--theme-random");_defineProperty(TWITTER,"CLASS_NAME_THEME_PREFIX","jtf__twitterblock--theme");_defineProperty(TWITTER,"CLASS_NAME_HASHTAG","jtf__twitterblock--hashtag");_defineProperty(TWITTER,"CLASS_NAME_ICON_HANDLE","jtf__twitterblock--iconandhandle");_defineProperty(TWITTER,"CLASS_NAME_HANDLE","jtf__twitterblock--handle");_defineProperty(TWITTER,"CLASS_NAME_TWEET","jtf__twitterblock--tweet");_defineProperty(TWITTER,"CLASS_NAME_TWEET_DATE","jtf__twitterblock--tweetdate");_defineProperty(TWITTER,"ATTR_DATA_IMG","data-img");_defineProperty(TWITTER,"ATTR_DATA_HASH","data-hash");_defineProperty(TWITTER,"ATTR_DATA_HANDLE","data-handle");_defineProperty(TWITTER,"ATTR_ARIA_LABEL","aria-label");_defineProperty(TWITTER,"TIMEOUT_DELAY",1000);_defineProperty(TWITTER,"THEME_RANDOM_MAX",4);_defineProperty(TWITTER,"HASHTAG_LOOP_LIMIT",6);_defineProperty(TWITTER,"DEFAULT_IMAGE_URL","https://covers.tandf.co.uk/covers/TANF_MR.jpg");_defineProperty(TWITTER,"TWITTER_HASHTAG_URL","https://twitter.com/hashtag/");_defineProperty(TWITTER,"TWITTER_PROFILE_URL","https://twitter.com/");_defineProperty(TWITTER,"TWITTER_API_ENDPOINT","/wp-json/jtf/v1/twitter/single?account=");_defineProperty(TWITTER,"MEDIA_API_ENDPOINT","/wp-json/wp/v2/media/");_defineProperty(TWITTER,"INTERSECTION_ROOT_MARGIN","150px 0px 0px 0px");setTimeout(function(){var blocks=document.querySelectorAll(TWITTER.SELECTOR_CLASS_BLOCK);if(blocks.length>0){blocks.forEach(function(block){new TWITTER(block)})}},TWITTER.TIMEOUT_DELAY)});var BlockEditorIframe=function(){function BlockEditorIframe(){_classCallCheck(this,BlockEditorIframe);this.preventExternalActions()}return _createClass(BlockEditorIframe,[{key:"preventExternalActions",value:function preventExternalActions(){var blockEditorIframe=document.querySelector(BlockEditorIframe.SELECTOR_BLOCK_EDITOR_IFRAME_BODY);if(blockEditorIframe){blockEditorIframe.querySelectorAll("a, button[type=\"submit\"], input[type=\"submit\"], .wp-block-jtf-jtf-youtube").forEach(function(el){if(el.matches(".wp-block-jtf-jtf-youtube")){var btn=el.querySelector(".jtf__mediablock button");if(btn){btn.addEventListener("click",function(event){event.stopPropagation()})}}else{el.addEventListener("click",function(event){event.preventDefault()})}})}}}])}();_defineProperty(BlockEditorIframe,"SELECTOR_BLOCK_EDITOR_IFRAME_BODY",".block-editor-iframe__body");_defineProperty(BlockEditorIframe,"INSTANTIATION_DELAY",2000);document.addEventListener("DOMContentLoaded",function(){var blockEditorIframeBody=null;setTimeout(function(){blockEditorIframeBody=document.querySelector(BlockEditorIframe.SELECTOR_BLOCK_EDITOR_IFRAME_BODY);if(blockEditorIframeBody){new BlockEditorIframe}},BlockEditorIframe.INSTANTIATION_DELAY)});
2//# sourceMappingURL=script-common.min.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.