(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(e){var n=function(e){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(n)?n:n+""}function n(t,n){for(var o=0;o<n.length;o++){var i=n[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,e(i.key),i)}}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},o(t)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}const a=gutenverseCoreFrontend;function r(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(r=function(){return!!t})()}var c=function(e){function c(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),e=this,i=arguments,n=o(n=c),function(e,n){if(n&&("object"==t(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(e)}(e,r()?Reflect.construct(n,i||[],o(e).constructor):n.apply(e,i));var e,n,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}(c,e),u=c,l=[{key:"init",value:function(){var t=this;this._elements.map(function(e){t._tabItems(e)})}},{key:"_tabItems",value:function(t){var e=(0,a.u)(t),n={headingItems:e.find(".tab-heading-item"),bodyItems:e.find(".tab-body-item"),mobileTabs:e.find(".tab-heading-mobile"),mobileLabel:e.find(".tab-title span"),mobileItems:e.find(".tab-option-item")};this._addClickEvents(n)}},{key:"_addClickEvents",value:function(t){var e=this;t.headingItems.on("click",function(n){var o=(0,a.u)(n.currentTarget).data("id");e._activateTab(o,t)}),t.mobileItems.on("click",function(n){var o=(0,a.u)(n.currentTarget).data("id");e._activateTab(o,t)}),t.mobileTabs.on("click",function(t){var e=(0,a.u)(t.currentTarget);e.hasClass("open")?e.removeClass("open"):e.addClass("open")}),t.headingItems.map(function(e){(0,a.u)(e).hasClass("active")&&t.bodyItems.map(function(t){(0,a.u)(t).data("id")===(0,a.u)(e).data("id")&&(0,a.u)(t).addClass("active")})})}},{key:"_activateHeading",value:function(t,e){e.headingItems.map(function(e){var n=(0,a.u)(e),o=n.data("id")===t?"addClass":"removeClass";n[o]("active")})}},{key:"_activateBody",value:function(t,e){e.bodyItems.map(function(e){var n=(0,a.u)(e),o=n.data("id")===t?"addClass":"removeClass";n[o]("active")})}},{key:"_activateMobile",value:function(t,e){e.mobileItems.map(function(n){var o=(0,a.u)(n),i=o.data("id")===t?"addClass":"removeClass";if(o[i]("active"),o.data("id")===t){var r=o.children();e.mobileLabel.html(r.html())}})}},{key:"_activateTab",value:function(t,e){this._activateHeading(t,e),this._activateBody(t,e),this._activateMobile(t,e)}}],l&&n(u.prototype,l),Object.defineProperty(u,"prototype",{writable:!1}),u;var u,l}(a.Default),u=(0,a.u)(".guten-tabs");u&&new c(u)})();