(()=>{"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 r=n.call(e,"string");if("object"!=t(r))return r;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 r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,e(o.key),o)}}function r(t){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},r(t)}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}const i=gutenverseCoreFrontend;function c(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(c=function(){return!!t})()}var u=function(e){function u(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),e=this,o=arguments,n=r(n=u),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,c()?Reflect.construct(n,o||[],r(e).constructor):n.apply(e,o));var e,n,o}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&&o(t,e)}(u,e),f=u,(l=[{key:"init",value:function(){var t=this;this._elements.map(function(e){t.__searchItems(e)})}},{key:"__searchItems",value:function(t){var e=(0,i.u)(t),n={form:e.find(".gutenverse-search-form"),inputField:e.find(".gutenverse-search-form").find(".gutenverse-search-input"),closeIcon:e.find(".gutenverse-search-form").find(".close-icon")};this.__firstLoad(n),this.__addActionToForm(n.form),this.__addClickEvents(n)}},{key:"__firstLoad",value:function(t){t.closeIcon.first().style.visibility="hidden"}},{key:"__addActionToForm",value:function(t){var e;t.attr("action",null===(e=window)||void 0===e||null===(e=e.GutenverseData)||void 0===e?void 0:e.homeUrl)}},{key:"__addClickEvents",value:function(t){t.closeIcon.on("click",function(){t.inputField.first().value="",t.closeIcon.first().style.visibility="hidden"}),t.inputField.on("input",function(e){var n=e.target.value;t.closeIcon.first().style.visibility=""!==n?"visible":"hidden"})}}])&&n(f.prototype,l),Object.defineProperty(f,"prototype",{writable:!1}),f;var f,l}(i.Default),f=(0,i.u)(".guten-search");f&&new u(f)})();