document.addEventListener("DOMContentLoaded",function(e){let t=document.querySelector(".credit-card-mask"),r=document.querySelector(".phone-number-mask"),n=document.querySelector(".date-mask"),a=document.querySelector(".time-mask"),i=document.querySelector(".numeral-mask"),u=document.querySelector(".block-mask"),l=document.querySelector(".delimiter-mask"),m=document.querySelector(".custom-delimiter-mask"),o=document.querySelector(".prefix-mask");if(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="20"/>`:""}),registerCursorTracker({input:t,delimiter:" "})),r&&(r.addEventListener("input",e=>{e=e.target.value.replace(/\D/g,"");r.value=formatGeneral(e,{blocks:[3,3,4],delimiters:[" "," "]})}),registerCursorTracker({input:r,delimiter:" "})),n&&(n.addEventListener("input",e=>{n.value=formatDate(e.target.value,{delimiter:"-",datePattern:["Y","m","d"]})}),registerCursorTracker({input:n,delimiter:"-"})),a&&(a.addEventListener("input",e=>{a.value=formatTime(e.target.value,{timePattern:["h","m","s"]})}),registerCursorTracker({input:a,delimiter:":"})),i&&i.addEventListener("input",e=>{i.value=formatNumeral(e.target.value,{numeralThousandsGroupStyle:"thousand"})}),u&&(u.addEventListener("input",e=>{u.value=formatGeneral(e.target.value,{blocks:[4,3,3],delimiters:[" "," "]})}),registerCursorTracker({input:u,delimiter:" "})),l&&(l.addEventListener("input",e=>{l.value=formatGeneral(e.target.value,{blocks:[3,3,3],delimiter:"·"})}),registerCursorTracker({input:l,delimiter:"."})),m&&(m.addEventListener("input",e=>{m.value=formatGeneral(e.target.value,{delimiters:[".",".","-"],blocks:[3,3,3,2],uppercase:!0})}),registerCursorTracker({input:m,delimiters:[".","-"]})),o){let t={prefix:"+63",blocks:[3,3,3,4],delimiter:" "};registerCursorTracker({input:o,delimiter:" "}),o.value=formatGeneral("",t),o.addEventListener("input",e=>{o.value=formatGeneral(e.target.value,t)})}let d=document.getElementById("maxLength-example1").getAttribute("maxlength"),s=document.getElementById("input-maxlength-info"),c=document.getElementById("maxLength-example1"),g=(window.Helpers.maxLengthCount(c,s,d),c.addEventListener("input",function(){window.Helpers.maxLengthCount(c,s,d)}),document.getElementById("maxLength-example2").getAttribute("maxlength")),p=document.getElementById("textarea-maxlength-info"),v=document.getElementById("maxLength-example2");window.Helpers.maxLengthCount(v,p,g),v.addEventListener("input",function(){window.Helpers.maxLengthCount(v,p,g)});var f,h,k=$(".form-repeater");k.length&&(f=2,h=1,k.on("submit",function(e){e.preventDefault()}),k.repeater({show:function(){var r=$(this).find(".form-control, .form-select"),n=$(this).find(".form-label");r.each(function(e){var t="form-repeater-"+f+"-"+h;$(r[e]).attr("id",t),$(n[e]).attr("for",t),h++}),f++,$(this).slideDown()},hide:function(e){confirm("Are you sure you want to delete this element?")&&$(this).slideUp(e)}}))});