/home/silvwabw/public_html/wp-content/plugins/gutenverse-form/assets/js/frontend/input-select.js
(()=>{"use strict";var e,t,r,n,o={},i={};function c(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return o[e](r,r.exports,c),r.exports}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function u(e){var t=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}c.m=o,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var o=Object.create(null);c.r(o);var i={};e=e||[null,t({}),t([]),t(t)];for(var a=2&n&&r;("object"==typeof a||"function"==typeof a)&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach(e=>i[e]=()=>r[e]);return i.default=()=>r,c.d(o,i),o},c.d=(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce((t,r)=>(c.f[r](e,t),t),[])),c.u=e=>"chunk-choices.js",c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r={},n="gutenverse-form:",c.l=(e,t,o,i)=>{if(r[e])r[e].push(t);else{var a,u;if(void 0!==o)for(var s=document.getElementsByTagName("script"),l=0;l<s.length;l++){var f=s[l];if(f.getAttribute("src")==e||f.getAttribute("data-webpack")==n+o){a=f;break}}a||(u=!0,(a=document.createElement("script")).charset="utf-8",c.nc&&a.setAttribute("nonce",c.nc),a.setAttribute("data-webpack",n+o),a.src=e),r[e]=[t];var p=(t,n)=>{a.onerror=a.onload=null,clearTimeout(d);var o=r[e];if(delete r[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach(e=>e(n)),t)return t(n)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),u&&document.head.appendChild(a)}},c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;c.g.importScripts&&(e=c.g.location+"");var t=c.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c.p=e})(),(()=>{var e={718:0};c.f.j=(t,r)=>{var n=c.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var o=new Promise((r,o)=>n=e[t]=[r,o]);r.push(n[2]=o);var i=c.p+c.u(t),a=new Error;c.l(i,r=>{if(c.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,n[1](a)}},"chunk-"+t,t)}};var t=(t,r)=>{var n,o,[i,a,u]=r,s=0;if(i.some(t=>0!==e[t])){for(n in a)c.o(a,n)&&(c.m[n]=a[n]);u&&u(c)}for(t&&t(r);s<i.length;s++)o=i[s],c.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=self.webpackChunkgutenverse_form=self.webpackChunkgutenverse_form||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();const p=gutenverseCoreFrontend;function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(d=function(){return!!e})()}var y=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n=arguments,r=l(r=t),function(e,t){if(t&&("object"==a(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,d()?Reflect.construct(r,n||[],l(e).constructor):r.apply(e,n));var e,r,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),r=t,(n=[{key:"_createIcon",value:function(e){if(!e)return null;if("string"==typeof e){var t=document.createElement("i");return t.className=e,t}var r=e.type,n=e.props;if(!r)return null;var o=document.createElement(r);return n&&(n.className&&(o.className=n.className),n.dangerouslySetInnerHTML&&(o.innerHTML=n.dangerouslySetInnerHTML.__html),n["aria-hidden"]&&o.setAttribute("aria-hidden",n["aria-hidden"])),o}},{key:"init",value:function(){var e=this;this.choiceInstance=null,this._elements.map(function(t){e._selectItems(t)})}},{key:"_choiceFunc",value:function(e){return c.e(317).then(c.t.bind(c,374,23)).then(function(t){return new(0,t.default)(e,{removeItemButton:!0,shouldSort:!1})})}},{key:"_selectItems",value:function(e){var t=this;(0,p.u)(e).find(".gutenverse-input-select").map(function(r){t.choiceInstance=t._choiceFunc(r);var n=r.getAttribute("data-dropdown");if(n){var o=JSON.parse(n),i=o.iconClose,c=o.iconOpen,a=o.useCustomDropdown;setTimeout(function(){var r=(0,p.u)(e).find(".choices");a&&r.addClass("custom-dropdown"),r.find(".choices__inner").each(function(e){e.style.position="relative";var n=t._createIcon(c);n&&e.appendChild(n);var o=r.first();o.addEventListener("showDropdown",function(){n&&n.remove(),(n=t._createIcon(i))&&e.appendChild(n)}),o.addEventListener("hideDropdown",function(){n&&n.remove(),(n=t._createIcon(c))&&e.appendChild(n)})});var n="";if((0,p.u)(e).nodes[0].classList.forEach(function(e){n+=".".concat(e)}),!document.getElementById("choices-hide-arrow-style")){var o=document.createElement("style");o.id="choices-hide-arrow-style",o.textContent="\n ".concat(n,' .choices[data-type*="select-one"]::after {\n display: none;\n }\n '),document.head.appendChild(o)}},100)}})}},{key:"destroy",value:function(){this.choiceInstance.destroy()}}])&&s(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(p.Default),h=(0,p.u)(".guten-form-input-select");h&&new y(h)})();