| Current Path : /home/smartconb/www/armencom33/media/com_eventgallery/dist/ |
| Current File : /home/smartconb/www/armencom33/media/com_eventgallery/dist/eventgallery-checkout-change.js |
/*! For license information please see eventgallery-checkout-change.js.LICENSE.txt */
(function(){var __webpack_modules__={9259:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";function removeElement(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}function mergeObjects(e,t){if(null===t||null===e)return e;for(var n in t)e[n]=t[n];return e}function getElementWidth(e){return e?parseFloat(getComputedStyle(e,null).width.replace("px","")):0}function getElementHeight(e){return e?parseFloat(getComputedStyle(e,null).height.replace("px","")):0}function calcBorderWidth(e,t){for(var n=0,r=0;r<e.length;r++)for(var o=getComputedStyle(e[r],null),i=0;i<t.length;i++){var l=parseFloat(o[t[i]]);isNaN(l)||(n+=l)}return n}function addUrlHashParameter(e,t,n){var r=removeUrlHashParameter(e,t).split("#"),o=r[0],i=r.length>1?r[1].split("&"):[];return i.push(encodeURIComponent(t)+"="+encodeURIComponent(n)),i.length>0?o+"#"+i.join("&"):o}function getUrlHashParameterValue(e,t){var n,r=e.split("#"),o=r.length>1?r[1].split("&"):[];if(o.length>0)for(var i=encodeURIComponent(t)+"=",l=0;l<o.length;l++)0===o[l].indexOf(i,0)&&(n=o[l].replace(i,""));return n}function removeUrlHashParameter(e,t){var n=e.split("#"),r=n[0],o=n.length>1?n[1].split("&"):[];if(o.length>0){for(var i=encodeURIComponent(t)+"=",l=[],c=0;c<o.length;c++)0===o[c].indexOf(i,0)||l.push(o[c]);o=l}return o.length>0?r+"#"+o.join("&"):r}function addUrlParameter(e,t,n){var r,o=removeUrlParameter(e,t).split("#"),i=o[0].split("?");return r=1===i.length?i[0]+"?"+encodeURIComponent(t)+"="+encodeURIComponent(n):i.join("?")+"&"+encodeURIComponent(t)+"="+encodeURIComponent(n),o.length>1?r+"#"+o[1]:r}function removeUrlParameter(e,t){var n,r=e.split("#"),o=r[0].split("?");if(o.length>1){for(var i=encodeURIComponent(t)+"=",l=o[1].split("&"),c=0;c<l.length;c++)0===l[c].indexOf(i,0)&&l.splice(c,1);n=l.length>0?o[0]+"?"+l.join("&"):o[0]}else n=o[0];return r.length>1?n+"#"+r[1]:n}function setCSSStyle(e,t,n){for(var r=0;r<e.length;r++)e[r].style[t]=n}function getOuterHeight(e){var t=e.offsetHeight,n=getComputedStyle(e);return t+(parseInt(n.marginTop)+parseInt(n.marginBottom))}function getParents(e){var t=[];if(null===e)return t;for(;null!=e.parentElement;){var n=e.parentElement;t.push(n),e=n}return t}function getParent(e,t){for(var n=getParents(e),r=0;r<n.length;r++)if(n[r].matches(t))return n[r];return null}function insertAndExecute(htmlElement,newContent){htmlElement.innerHTML=newContent;for(var scripts=Array.prototype.slice.call(htmlElement.getElementsByTagName("script")),i=0;i<scripts.length;i++)if(""!==scripts[i].src){var tag=document.createElement("script");tag.src=scripts[i].src,document.getElementsByTagName("head")[0].appendChild(tag)}else try{eval(scripts[i].innerHTML)}catch(e){console.error(e)}}function forEach(e,t){if(!e)return 0;for(var n=0;n<e.length;n++)t(e[n],n);return e.length}__webpack_require__.d(__webpack_exports__,{forEach:function(){return forEach},getParent:function(){return getParent}});var serializeForm=function(e){for(var t=[],n=e.querySelectorAll("input,select,textarea"),r=0;r<n.length;r++){var o=n[r];if(o.name&&!o.disabled&&"file"!==o.type&&"reset"!==o.type&&"submit"!==o.type&&"button"!==o.type)if("select-multiple"===o.type)for(var i=0;i<o.options.length;i++)o.options[i].selected&&t.push(encodeURIComponent(o.name)+"="+encodeURIComponent(o.options[i].value));else("checkbox"!==o.type&&"radio"!==o.type||o.checked)&&t.push(encodeURIComponent(o.name)+"="+encodeURIComponent(o.value))}return t.join("&")}},2929:function(e,t,n){"use strict";var r=function(){function e(){}return e.removeHtmlElementNode=function(e){null!==e.parentNode&&e.parentNode.removeChild(e)},e.createNewEvent=function(e,t){var n=null;return"function"==typeof CustomEvent?n=new CustomEvent(e,{detail:t}):((n=document.createEvent("Event")).initEvent(e,!0,!0),n.detail=t),n},e}(),o=n(9259);function i(){for(var e=document.querySelectorAll("input[name=paymentid]"),t=0;t<e.length;t++){var n=e[t],i=(0,o.getParent)(n,".payment-container").querySelector(".payment-body");n.checked?(document.dispatchEvent(r.createNewEvent("eventgallery.payment.selected",{field:n})),i&&(i.style.display="block")):(document.dispatchEvent(r.createNewEvent("eventgallery.payment.unselected",{field:n})),i&&(i.style.display="none"))}}function l(){for(var e=document.querySelectorAll("input[name=shippingid]"),t=0;t<e.length;t++){var n=e[t],r=(0,o.getParent)(n,".shipping-container").querySelector(".shipping-body");n.checked?r&&(r.style.display="block"):r&&(r.style.display="none")}}document.addEventListener("DOMContentLoaded",(function(){for(var e=document.querySelectorAll("input[name=paymentid]"),t=0;t<e.length;t++)e[t].addEventListener("click",(function(e){i()}));i();for(var n=document.querySelectorAll("input[name=shippingid]"),r=0;r<n.length;r++)n[r].addEventListener("click",(function(e){l()}));l()}))},2403:function(e,t,n){"use strict";n.r(t);var r=n(9259);document.addEventListener("DOMContentLoaded",(function(){var e,t;function n(){var e=document.querySelectorAll(".eventgallery-checkout-address input");(0,r.forEach)(e,(function(e){e.isRequired=!!e.getAttribute("required"),e.isDisabled=!!e.getAttribute("disabled")}))}function o(){(0,r.forEach)(document.querySelectorAll(".shipping-address"),(function(e){e.setAttribute("disabled","disabled")})),(0,r.forEach)(document.querySelectorAll(".shipping-address-fieldset .is-required"),(function(e){e.classList.remove("required")})),document.querySelector(".shipping-address-fieldset").style.display="none",n()}function i(){(0,r.forEach)(document.querySelectorAll(".shipping-address"),(function(e){e.removeAttribute("disabled")})),(0,r.forEach)(document.querySelectorAll(".shipping-address-fieldset .is-required"),(function(e){e.classList.add("required")})),document.querySelector(".shipping-address-fieldset").style.display="block",n()}function l(){document.querySelector("#shiptodifferentaddress-false").getAttribute("checked")?o():i()}function c(e){(0,r.forEach)(document.querySelectorAll(e+" .eg-is-required"),(function(e){e.classList.remove("required")})),(0,r.forEach)(document.querySelectorAll(e+" .eg-is-required"),(function(e){e.removeAttribute("required")})),(0,r.forEach)(document.querySelectorAll(e+" input"),(function(e){e.setAttribute("disabled","disabled")})),(0,r.forEach)(document.querySelectorAll(e+" textarea"),(function(e){e.setAttribute("disabled","disabled")})),l(),(0,r.forEach)(document.querySelectorAll(e),(function(e){e.style.display="none"}))}function u(e){(0,r.forEach)(document.querySelectorAll(e+" .eg-is-required"),(function(e){e.classList.add("required")})),(0,r.forEach)(document.querySelectorAll(e+" .eg-is-required"),(function(e){e.setAttribute("required","required")})),(0,r.forEach)(document.querySelectorAll(e+" input"),(function(e){e.removeAttribute("disabled")})),(0,r.forEach)(document.querySelectorAll(e+" textarea"),(function(e){e.removeAttribute("disabled")})),l(),(0,r.forEach)(document.querySelectorAll(e),(function(e){e.style.display="block"}))}function a(e){"false"===e.dataset.needsAddressData?(c(".eventgallery-checkout-form-with-address"),u(".eventgallery-checkout-form-without-address")):(c(".eventgallery-checkout-form-without-address"),u(".eventgallery-checkout-form-with-address")),n()}null===(e=document.getElementById("shiptodifferentaddress-false"))||void 0===e||e.addEventListener("click",(function(e){return o()})),null===(t=document.getElementById("shiptodifferentaddress-true"))||void 0===t||t.addEventListener("click",(function(e){return i()})),(0,r.forEach)(document.querySelectorAll("input[name=shippingid]"),(function(e){e.addEventListener("click",(function(){a(e)}))})),(0,r.forEach)(document.querySelectorAll("[required]"),(function(e){e.classList.add("eg-is-required")})),l();var d=document.querySelectorAll("input[name=shippingid][checked=checked]");if(d.length>0)a(d[0]);else{var s=document.querySelectorAll("input[name=shippingid]");s.length>0?s[0].click():(c(".eventgallery-checkout-form-with-address"),c(".eventgallery-checkout-form-without-address"))}}))},4689:function(){document.addEventListener("checkout-address-country-changed",(function(e){!function(e){var t=e.target,n=t.id,r=t.options[t.selectedIndex].value,o=n.replace("_country","_state"),i=document.getElementById(o);if(i){for(var l=i.querySelectorAll("optgroup"),c=0;c<l.length;c++){var u=l[c];u.id===o+"_"+r||u.id===o+"_nocountry"?u.style.display="block":u.style.display="none"}"none"===i.options[i.selectedIndex].parentElement.style.display&&(i.selectedIndex=0)}}(e)}))},750:function(e,t,n){n(2929),n(2403),n(4689)}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=function(e,t){for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__(750)})();
//# sourceMappingURL=eventgallery-checkout-change.js.map