(()=>{let e=document.querySelectorAll(".phone-mask"),t=document.querySelector(".credit-card-mask"),r=document.querySelector(".expiry-date-mask"),a=document.querySelector(".cvv-code-mask"),n=document.querySelectorAll(".dob-picker"),c=document.querySelectorAll(".form-check-input-payment");e&&e.forEach(function(t){t.addEventListener("input",e=>{e=e.target.value.replace(/\D/g,"");t.value=formatGeneral(e,{blocks:[3,3,4],delimiters:[" "," "]})}),registerCursorTracker({input:t,delimiter:" "})}),t&&(t.addEventListener("input",e=>{t.value=formatCreditCard(e.target.value);e=e.target.value.replace(/\D/g,""),e=getCreditCardType(e);document.querySelector(".card-type").innerHTML=e&&"unknown"!==e&&"general"!==e?`<img src="${assetsPath}img/icons/payments/${e}-cc.png" height="28"/>`:""}),registerCursorTracker({input:t,delimiter:" "})),r&&(r.addEventListener("input",e=>{r.value=formatDate(e.target.value,{delimiter:"/",datePattern:["m","y"]})}),registerCursorTracker({input:r,delimiter:"/"})),a&&a.addEventListener("input",e=>{e=e.target.value.replace(/\D/g,"");a.value=formatNumeral(e,{numeral:!0,numeralPositiveOnly:!0})}),n&&n.forEach(function(e){e.flatpickr({monthSelectorType:"static"})}),c&&c.forEach(function(e){e.addEventListener("change",function(e){"credit-card"===e.target.value?document.querySelector("#form-credit-card").classList.remove("d-none"):document.querySelector("#form-credit-card").classList.add("d-none")})})})(),$(function(){window.Helpers.initCustomOptionCheck();var e=$(".select2");e.length&&e.each(function(){var e=$(this);e.wrap('<div class="position-relative"></div>').select2({placeholder:"Select value",dropdownParent:e.parent()})})});