1document.addEventListener("DOMContentLoaded",()=>{D(),B(),T(),$(),O(),R(),H(),U(),V(),K(),z(),J()});function B(){if(window.location.pathname.includes("/register/confirmation")){const n=document.getElementById("print-button");n&&n.addEventListener("click",function(e){return e.preventDefault(),window.print(),!1}),q()}}function q(){const p=document.getElementById("password-setup-form");if(p){x(p);return}const n=document.querySelector('form input[name="action"][value="users/save-user"]');if(!n)return;const e=n.closest("form"),o=document.getElementById("newPassword"),a=document.getElementById("confirmPassword"),s=e.querySelector('button[type="submit"]');if(!o||!a||!s)return;function g(){const u=o.value,d=a.value;a.style.borderColor="";const f=a.parentNode.querySelector(".password-error");if(f&&f.remove(),d&&u!==d){a.style.borderColor="#dc3545";const c=document.createElement("small");return c.className="form-text text-danger password-error",c.textContent="Passwords do not match",a.parentNode.appendChild(c),s.disabled=!0,!1}else return u&&d&&u===d?(a.style.borderColor="#28a745",s.disabled=!1,!0):(s.disabled=u.length<6||d.length<6,u.length>=6&&d.length>=6)}o.addEventListener("input",g),a.addEventListener("input",g),e.addEventListener("submit",function(u){const d=o.value,f=a.value;return d.length<6?(u.preventDefault(),alert("Password must be at least 6 characters long."),o.focus(),!1):d!==f?(u.preventDefault(),alert("Passwords do not match. Please make sure both password fields are identical."),a.focus(),!1):(s.disabled=!0,s.innerHTML='<i class="fas fa-spinner fa-spin"></i> Setting Password...',!0)}),g()}function x(p){const n=document.getElementById("newPassword"),e=document.getElementById("confirmPassword"),o=document.getElementById("set-password-btn"),a=document.getElementById("password-errors"),s=document.getElementById("password-error-list"),g=document.getElementById("password-success"),u=document.getElementById("password-loading"),d=document.getElementById("password-strength"),f=document.getElementById("password-match");if(!n||!e||!o)return;function c(l){const y=[];return l.length<8&&y.push("Password must be at least 8 characters long"),/[a-z]/.test(l)||y.push("Password must contain at least one lowercase letter"),/[0-9]/.test(l)||y.push("Password must contain at least one number"),{valid:y.length===0,errors:y}}function m(){const l=n.value,y=c(l);if(!d)return y;if(l.length===0)d.innerHTML="";else if(y.valid)d.innerHTML='<small class="text-success"><i class="fas fa-check"></i> Strong password</small>';else{const v=y.errors.length,w=v>2?"danger":v>1?"warning":"info";d.innerHTML=`<small class="text-${w}"><i class="fas fa-info-circle"></i> ${v} requirement${v!==1?"s":""} remaining</small>`}return y}function t(){const l=n.value,y=e.value;return f?y.length===0?(f.innerHTML="",!1):l===y?(f.innerHTML='<small class="text-success"><i class="fas fa-check"></i> Passwords match</small>',!0):(f.innerHTML='<small class="text-danger"><i class="fas fa-times"></i> Passwords do not match</small>',!1):!0}function i(){const l=m(),y=t(),v=l.valid&&y&&n.value.length>0;o.disabled=!v,v?o.classList.remove("btn-disabled"):o.classList.add("btn-disabled")}function r(l){!a||!s||(s.innerHTML=l.map(y=>`<li>${y}</li>`).join(""),a.style.display="block",g.style.display="none")}function h(){!g||!a||(a.style.display="none",g.style.display="block",setTimeout(()=>{p.style.display="none"},1500))}n.addEventListener("input",i),e.addEventListener("input",i),p.addEventListener("submit",function(l){l.preventDefault();const y=n.value,v=e.value,w=c(y);if(!w.valid)return r(w.errors),!1;if(y!==v)return r(["Passwords do not match"]),!1;o.disabled=!0,o.style.display="none",u.style.display="inline";const P=new FormData(p);return fetch(window.location.href,{method:"POST",body:P,headers:{"X-Requested-With":"XMLHttpRequest"}}).then(b=>b.json()).then(b=>{b.success?(h(),typeof clearPasswordSetupFlags=="function"&&clearPasswordSetupFlags()):(r(b.errors||["Failed to set password. Please try again."]),o.disabled=!1,o.style.display="inline-block",u.style.display="none")}).catch(b=>{console.error("Password setup error:",b),r(["Network error. Please check your connection and try again."]),o.disabled=!1,o.style.display="inline-block",u.style.display="none"}),!1}),i()}function D(){window.location.pathname.includes("/register/checkout")&&(document.querySelectorAll(".quantity-controls form").forEach(e
1=>{e.addEventListener("submit",function(o){const a=e.querySelector("button");return a&&a.disabled?(o.preventDefault(),!1):(e.classList.add("submitting"),!0)})}),document.querySelectorAll("form .remove-btn").forEach(e=>{const o=e.closest("form");o&&o.addEventListener("submit",function(){return o.classList.add("submitting"),e.disabled=!0,!0})}))}function T(){const p=document.querySelectorAll('input[type="radio"][name^="purchasables["]'),n=document.getElementById("paybutton"),e=document.getElementById("paylink"),o=document.getElementById("pay-agree"),a=document.getElementById("cart-form");if(!p.length)return;function s(){let t=0,i=!1;a.querySelectorAll(".dynamic-purchasable-field, .materials-field").forEach(l=>l.remove()),p.forEach(l=>{if(l.checked){const y=l.value;parseFloat(l.dataset.price);const v=l.dataset.paymentOption,w=parseFloat(l.dataset.fullPaymentPrice),P=g(v);P&&(i=!0);const b=document.createElement("input");b.type="hidden",b.name=`purchasables[${t}][id]`,b.value=y,b.className="dynamic-purchasable-field",a.appendChild(b);const E=document.createElement("input");if(E.type="hidden",E.name=`purchasables[${t}][qty]`,E.value="1",E.className="dynamic-purchasable-field",a.appendChild(E),P){const I=u(v);if(I){const C=document.createElement("input");C.type="hidden",C.name=`purchasables[${t}][subscriptionPlan]`,C.value=I,C.className="dynamic-purchasable-field",a.appendChild(C)}const F=d(w,v),L=document.createElement("input");L.type="hidden",L.name=`purchasables[${t}][monthlyAmount]`,L.value=F,L.className="dynamic-purchasable-field",a.appendChild(L);const k=f(v),M=document.createElement("input");M.type="hidden",M.name=`purchasables[${t}][subscriptionMonths]`,M.value=k,M.className="dynamic-purchasable-field",a.appendChild(M)}const S=document.createElement("input");S.type="hidden",S.name=`purchasables[${t}][paymentType]`,S.value=P?"subscription":"one-time",S.className="dynamic-purchasable-field",a.appendChild(S),t++}}),window.materialsData&&window.materialsData.selectedMaterials&&Array.from(window.materialsData.selectedMaterials).forEach((y,v)=>{const w=document.querySelector(`input[data-material-id="${y}"]`);if(w&&w.checked){const P=parseFloat(w.dataset.price),b=w.dataset.sku,E=document.createElement("input");E.type="hidden",E.name=`materials[${v}][id]`,E.value=y,E.className="materials-field",a.appendChild(E);const S=document.createElement("input");S.type="hidden",S.name=`materials[${v}][sku]`,S.value=b,S.className="materials-field",a.appendChild(S);const I=document.createElement("input");I.type="hidden",I.name=`materials[${v}][price]`,I.value=P,I.className="materials-field",a.appendChild(I)}});const h=Array.from(p).some(l=>l.checked&&!g(l.dataset.paymentOption));if(i&&h){const l=document.createElement("input");l.type="hidden",l.name="mixedCart",l.value="1",l.className="dynamic-purchasable-field",a.appendChild(l)}c(),m()}function g(t){return t&&t!=="paymentInFull"&&(t.toLowerCase().includes("month")||t.includes("payment2Months")||t.includes("payment3Months")||t.includes("payment4Months")||t.includes("payment5Months")||t.includes("payment6Months")||t.includes("payment12Months"))}function u(t){return{payment2Months:"payment2months",payment3Months:"payment3months",payment4Months:"payment4months",payment5Months:"payment5months",payment6Months:"payment6months",payment12Months:"payment12months"}[t]||null}function d(t,i){const r=f(i);if(!r)return t;const h=t/r,l=Math.round(h*100)/100,y=l*r;return Math.abs(y-t)<.01?l:Math.round(h*100)/100}function f(t){return{payment2Months:2,payment3Months:3,payment4Months:4,payment5Months:5,payment6Months:6,payment12Months:12}[t]||null}function c(){const t={};p.forEach(i=>{const r=i.name;t[r]||(t[r]=[]),t[r].push(i)}),Object.values(t).forEach(i=>{const r=i.some(h=>h.checked);i.forEach(h=>{const l=h.closest(".payment-option");r?h.checked?(l.style.opacity="1",l.style.color=""):(l.style.opacity="0.3",l.style.color="#ccc"):(l.style.opacity="1",l.style.color="")})})}function m(){const t=document.querySelectorAll('input[type="radio"][name^="purchasables["]:checked').length>0,i=o&&o.checked,r=t&&i;e&&(e.disabled=!r),n&&e&&(r?(n.style.display="none",e.style.display="block"):(n.style.display="block",e.style.display="none"))}
1p.forEach(t=>{t.addEventListener("change",()=>{s(),m()})}),o&&o.addEventListener("change",m),s()}window.initCartFunctionality=T;window.initCheckoutControls=D;window.initPrintButton=B;function $(){if(!window.location.pathname.includes("/register/checkout"))return;const n=document.querySelectorAll(".customer-field"),e=document.getElementById("customerInfoForm");if(!n.length||!e)return;_();let o;function a(){clearTimeout(o),o=setTimeout(()=>{s()},500)}n.forEach(c=>{c.addEventListener("input",()=>{c.style.borderColor="#ffc107",a()}),c.addEventListener("change",()=>{a()})});function s(){const c=new FormData(e);d(),fetch(window.location.href,{method:"POST",body:c,headers:{"X-Requested-With":"XMLHttpRequest"}}).then(m=>{m.ok?g():(u(),console.error("Error updating cart address"))}).catch(m=>{console.error("Error updating cart address:",m),u()})}function g(){n.forEach(c=>{c.style.borderColor="#28a745"}),setTimeout(()=>{n.forEach(c=>{c.style.borderColor=""})},1500)}function u(){n.forEach(c=>{c.style.borderColor="#dc3545"}),setTimeout(()=>{n.forEach(c=>{c.style.borderColor=""})},2e3)}function d(){if(!document.getElementById("paymentFormFinal"))return;[{customer:"email",payment:"payment_email"},{customer:"billingAddress[firstName]",payment:"payment_billingAddress_firstName"},{customer:"billingAddress[lastName]",payment:"payment_billingAddress_lastName"},{customer:"billingAddress[address1]",payment:"payment_billingAddress_address1"},{customer:"billingAddress[city]",payment:"payment_billingAddress_city"},{customer:"billingAddress[stateValue]",payment:"payment_billingAddress_stateValue"},{customer:"billingAddress[zipCode]",payment:"payment_billingAddress_zipCode"},{customer:"billingAddress[countryId]",payment:"payment_billingAddress_countryId"}].forEach(t=>{let i;if(t.customer==="billingAddress[stateValue]"){const h=e.querySelector(".state-dropdown"),l=e.querySelector(".state-text");h&&h.style.display!=="none"&&!h.disabled?i=h:l&&l.style.display!=="none"&&!l.disabled&&(i=l)}else i=e.querySelector(`[name="${t.customer}"]`);const r=document.getElementById(t.payment);i&&r&&(r.value=i.value)})}d();const f=document.getElementById("paymentFormFinal");f&&f.addEventListener("submit",function(c){c.preventDefault(),d();const m=["payment_email","payment_billingAddress_firstName","payment_billingAddress_lastName","payment_billingAddress_address1","payment_billingAddress_city","payment_billingAddress_stateValue","payment_billingAddress_zipCode"];let t=[];if(m.forEach(r=>{const h=document.getElementById(r);(!h||!h.value.trim())&&t.push(r.replace("payment_","").replace("billingAddress_",""))}),t.length>0)return A(`Please fill in all required information before completing your purchase. 2Missing: `+t.join(", ")),!1;N();const i=new FormData(f);fetch(f.action,{method:"POST",body:i,credentials:"same-origin"}).then(r=>r.json()).then(r=>{r.success?r.redirect?window.location.href=r.redirect:window.location.href="/register/confirmation?number="+(r.orderNumber||""):(window.hideLoadingOverlay&&window.hideLoadingOverlay(),A(r.error||"An error occurred during checkout. Please try again."))}).catch(r=>{window.hideLoadingOverlay&&window.hideLoadingOverlay(),console.error("Checkout error:",r),A("An error occurred during checkout. Please try again.")})})}function A(p){const n=document.getElementById("payment-errors"),e=document.getElementById("payment-error-message");n&&e?(e.textContent=p,n.style.display="block",n.scrollIntoView({behavior:"smooth",block:"center"})):alert(p)}function N(){const p=document.getElementById("payment-errors");p&&(p.style.display="none")}function _(){const p=document.querySelector('[name="billingAddress[countryId]"]'),n=document.querySelector(".state-dropdown"),e=document.querySelector(".state-text");if(!p||!n||!e)return;function o(s){s==="236"?(n.style.display="",n.disabled=!1,e.style.display="none",e.disabled=!0,e.value&&!a(e.value)?(e.value="",n.value=""):e.value&&(n.value=e.value.toUpperCase(),e.value="")):(n.style.display="none",n.disabled=!0,e.style.display="",e.disabled=!1,n.value&&(e.value=n.value,n.value=""))}function a(s){return["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY","DC"].includes(s.toUpperCase())}p.addEventListener("change",function(){o(this.value)}),o(p.value)}function O(){const p=document.querySelectorAll('input[type="radio"][name^="purchasables["]');if(p.length===0)return;function n(s){if(s==="paymentInFull")return 1;if(s&&s.startsWith("payment")&&s.endsWith("Months")){const g=s.replace("payment","").replace("Months","");return parseInt(g)||1}return 1}function e(s){const g=s.nextElementSibling;if(!g)return;const u=g.querySelector("h5");if(!u)return;let d=parseFloat(s.dataset.fullPaymentPrice);const f=s.closest("form");if(f){const t=f.querySelector('[data-payment-option="fullPaymentPlan"], [data-payment-option="paymentInFull"]');t&&(d=parseFloat(t.dataset.price))}if(!d)return;const c=s.dataset.paymentOption||o(s),m=n(c);if(m===1)u.innerHTML=`Payment in Full: $${d.toFixed(2)}`;else{const t=d/m,i=Math.round(t*100)/100,r=i*m,h=Math.abs(r-d)<.01?r.toFixed(2):d.toFixed(2);u.innerHTML=`${m} Monthly Payments: <strong>$${i.toFixed(2)}/month</strong> Ã ${m} months = $${h} total`}}function o(s){if(s.dataset.paymentOption)return s.dataset.paymentOption;const g=s.nextElementSibling;if(g){const u=g.textContent.toLowerCase();if(u.includes("payment in full")||u.includes("pay in full"))return"paymentInFull";if(u.includes("2 month"))return"payment2Months";if(u.includes("3 month"))return"payment3Months";if(u.includes("4 month"))return"payment4Months";if(u.includes("5 month"))return"payment5Months";if(u.includes("6 month"))return"payment6Months";if(u.includes("12 month"))return"payment12Months"}return"paymentInFull"}function a(){let s=0;document.querySelectorAll('input[type="radio"][name^="purchasables["]:checked').forEach(d=>{const f=parseFloat(d.dataset.price);f&&(s+=f)});const u=document.getElementById("cart-total");u&&(u.textContent=`$${s.toFixed(2)}`)}
2p.forEach(s=>{e(s),s.addEventListener("change",function(){e(this),a()})}),a()}function R(){if(!window.location.pathname.includes("/register/checkout"))return;const n=document.getElementById("registerButton"),e=document.getElementById("applyCouponBtn"),o=document.getElementById("couponCode");if(document.getElementById("validation-summary"),!n)return;const a=["firstName","lastName","email","phone","address","city","state","postalCode","country","number","month","year","cvv"];n.disabled=!1,n.classList.remove("disabled"),e&&o&&(o.value.trim()?(e.disabled=!1,e.classList.remove("disabled")):(e.disabled=!0,e.classList.add("disabled")),o.addEventListener("input",function(){this.value.trim()?(e.disabled=!1,e.classList.remove("disabled")):(e.disabled=!0,e.classList.add("disabled"))}));function s(d,f=!0){let c=document.getElementById(d)||document.querySelector(`[name="${d}"]`);if(d==="state"){const i=document.getElementById("state"),r=document.getElementById("state_text");i&&!i.disabled&&i.style.display!=="none"?c=i:r&&!r.disabled&&r.style.display!=="none"&&(c=r)}const m=document.getElementById(`${d}-error`);if(!c)return!0;let t=!0;if(!c.value.trim())t=!1;else switch(d){case"email":/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(c.value.trim())||(t=!1);break;case"phone":const r=c.value.replace(/\D/g,"");(r.length<7||r.length>15)&&(t=!1);break;case"postalCode":c.value.trim().length<5&&(t=!1);break;case"month":const h=parseInt(c.value);(isNaN(h)||h<1||h>12)&&(t=!1);break;case"year":const l=c.value.trim(),y=new Date().getFullYear();if(l.length===2){const w=parseInt(l),P=y%100;(isNaN(w)||w<P||w>(P+20)%100)&&(t=!1)}else if(l.length===4){const w=parseInt(l);(isNaN(w)||w<y||w>y+20)&&(t=!1)}else t=!1;break;case"number":const v=c.value.replace(/[\s\-]/g,"");(v.length<13||v.length>16||!/^\d+$/.test(v))&&(t=!1);break;case"cvv":/^\d{3,4}$/.test(c.value.trim())||(t=!1);break}return f&&(t?c.classList.remove("is-invalid"):c.classList.add("is-invalid"),m&&(m.style.display="none",m.textContent="")),t}function g(){let d=!0,f=null;const t=u()===0?["firstName","lastName","email","phone"]:a;return t.forEach(i=>{const r=document.getElementById(i)||document.querySelector(`[name="${i}"]`),h=document.getElementById(`${i}-error`);r&&r.classList.remove("is-invalid"),h&&(h.style.display="none",h.textContent="")}),t.forEach(i=>{if(!s(i,!0)&&(d=!1,!f)){const r=document.getElementById(i)||document.querySelector(`[name="${i}"]`);r&&(f=r)}}),!d&&f&&f.focus(),d}function u(){const d=[document.querySelector("table tr.table-active th:last-child h4"),document.getElementById("cart-total"),document.querySelector("[data-cart-total]")];for(const f of d)if(f&&f.textContent){const c=f.textContent.match(/\$([0-9,]+\.?[0-9]*)/);if(c)return parseFloat(c[1].replace(/,/g,""))}return 0}a.forEach(d=>{let f=document.getElementById(d)||document.querySelector(`[name="${d}"]`);if(f&&(f.addEventListener("input",function(){this.classList.remove("is-invalid")}),f.addEventListener("change",function(){this.classList.remove("is-invalid")})),d==="state"){const c=document.getElementById("state_text");c&&(c.addEventListener("input",function(){this.classList.remove("is-invalid")}),c.addEventListener("change",function(){this.classList.remove("is-invalid")}))}}),window.validateFormOnSubmit=g}function H(){if(!window.location.pathname.includes("/register/checkout"))return;const n=document.getElementById("paymentFormFinal"),e=document.getElementById("registerButton"),o=document.getElementById("authorizeKeys");!n||!e||!o||n.addEventListener("submit",function(a){var u,d,f,c;a.preventDefault();const s={cardNumber:((u=document.getElementById("cardNumber"))==null?void 0:u.value)||"",month:((d=document.getElementById("month"))==null?void 0:d.value)||"",year:((f=document.getElementById("year"))==null?void 0:f.value)||"",cardCode:((c=document.getElementById("cvv"))==null?void 0:c.value)||""},g={clientKey:o.dataset.clientkey,apiLoginID:o.dataset.apiloginid};if(!g.clientKey||!g.apiLoginID){alert("Authorize.net keys are missing.");return}Accept.dispatchData({authData:g,cardData:s},function(m){if(m.messages.resultCode==="Error"){let t="";m.messages.message.forEach(i=>
2{t+=`${i.code}: ${i.text} 3`}),alert(`â AcceptJS Error: 4`+t),e.disabled=!1,e.innerHTML="Register"}else{const t=document.getElementById("acceptJsData"),i=document.getElementById("dataDescriptor"),r=document.getElementById("dataValue");t&&i&&r&&(i.value=m.opaqueData.dataDescriptor,r.value=m.opaqueData.dataValue,t.value=JSON.stringify({descriptor:m.opaqueData.dataDescriptor,value:m.opaqueData.dataValue})),n.submit()}})})}function V(){if(!window.location.pathname.includes("/register/checkout"))return;const n=document.querySelectorAll('input[name="phone"]');n.length&&n.forEach(e=>{e.addEventListener("input",function(o){let a=e.value.replace(/\D/g,"");a.length>15&&(a=a.slice(0,15));let s=a;a.length===10?s=`(${a.slice(0,3)}) ${a.slice(3,6)}-${a.slice(6)}`:a.length<10&&a.length>6?s=`(${a.slice(0,3)}) ${a.slice(3,6)}-${a.slice(6)}`:a.length<=6&&a.length>3?s=`(${a.slice(0,3)}) ${a.slice(3)}`:a.length<=3&&a.length>0?s=`(${a}`:a.length>10&&(s=a.replace(/(\d{3,4})(?=\d)/g,"$1 ").trim()),e.value=s})})}function z(){if(!window.MATERIALS_ADDON_ENABLED||!window.location.pathname.includes("/register/class"))return;window.materialsData={selectedMaterials:new Set,materialsTotal:0,availableMaterials:{}},window.initCartFunctionality&&document.getElementById("cart-form")&&document.querySelectorAll('input[type="radio"][name^="purchasables["]').forEach(g=>{g.addEventListener("change",function(){setTimeout(()=>{e()},100)})});function e(){const a=document.querySelector('input[type="radio"][name^="purchasables["]:checked');if(a){const s=a.dataset.courseId;typeof window.showMaterialsForCourse=="function"&&window.showMaterialsForCourse(s)}}window.prepareMaterialsForCheckout=function(){!window.materialsData||!window.materialsData.selectedMaterials||sessionStorage.setItem("selectedMaterials",JSON.stringify({materials:Array.from(window.materialsData.selectedMaterials),total:window.materialsData.materialsTotal,data:window.materialsData.availableMaterials}))};const o=document.getElementById("cart-form");o&&o.addEventListener("submit",function(a){window.prepareMaterialsForCheckout()})}function K(){if(!window.location.pathname.includes("/register/checkout"))return;const n=document.getElementById("number");n&&(n.addEventListener("input",function(e){let o=n.value.replace(/\D/g,"");o.length>16&&(o=o.slice(0,16)),n.value=o}),n.addEventListener("paste",function(e){setTimeout(()=>{let o=n.value.replace(/\D/g,"");o.length>16&&(o=o.slice(0,16)),n.value=o},0)}))}function U(){if(!window.location.pathname.includes("/register/checkout"))return;const n=["Initializing","Validating payment details","Processing payment","Creating your account","Setting up subscription","Finalizing registration"];let e=0,o=null;function a(m){const t=document.getElementById("progress-text");t&&m<n.length&&(t.innerHTML=n[m]+'<span class="dots">...</span>')}function s(){e=0,a(e),o=setInterval(function(){e++,e<n.length?a(e):clearInterval(o)},1500)}function g(){o&&(clearInterval(o),o=null)}let u=!1;function d(m,t){if(u)return!1;u=!0,typeof showLoadingState=="function"&&showLoadingState(),typeof updateProgressToStep=="function"&&updateProgressToStep("payment");const i=document.querySelector("table tr.table-active th:nth-child(5) h4")||document.querySelector("table tr.table-active h4"),r=i?i.textContent.trim():"",h=r.includes("$0.00")||r.includes("$0");document.getElementById("registerButton").disabled=!0,document.getElementById("registerButton").innerHTML='<i class="fas fa-spinner fa-spin"></i> Processing...';const l=document.getElementById("loading-overlay");if(l&&(l.style.display="flex",s()),h){typeof updateProgressToStep=="function"&&updateProgressToStep("account");const v=m.querySelector('input[name="token"]'),w=m.querySelector('input[name="tokenDescriptor"]');v&&(v.value="ZERO_TOTAL_ORDER"),w&&(w.value="ZERO_TOTAL_ORDER"),m.submit();return}const y=document.getElementById("authorizeKeys");typeof Accept<"u"&&y?(typeof updateProgressToStep=="function"&&updateProgressToStep("authorization"),f(m)):(typeof updateProgressToStep=="function"&&updateProgressToStep("account"),m.submit())}function f(m,t){var y,v,w,P;const i={cardNumber:((y=document.getElementById("number"))==null?void 0:y.value)||"",month:((v=document.getElementById("month"))==null?void 0:v.value)||"",year:((w=document.getElementById("year"))==null?void 0:w.value)||"",cardCode:((P=document.getElementById("cvv"))==null?void 0:P.value)||""};if(!i.cardNumber||i.cardNumber.length<13){alert("Invalid card number"),u=!1;return}if(!i.month||!i.year||!i.cardCode){alert("Missing expiration or CVV"),u=!1;return}const r=document.getElementById("authorizeKeys");if(!r){alert("Authorize.net keys not found."),u=!1;return}const h={clientKey:r.dataset.clientkey,apiLoginID:r.dataset.apiloginid};if(!h.clientKey||!h.apiLoginID){alert("Authorize.net credentials are missing or invalid."),u=!1;return}const l={authData:h,cardData:i};Accept.dispatchData(l,function(b){var S;const E=(S=b.messages)==null?void 0:S.resultCode;if(E==="Error"){console.error("â AcceptJS ERROR",b.messages.message);let I="";b.messages.message.forEach(L=>{I+=`${L.code}: ${L.text} 5`}),alert(`â AcceptJS Error: 6`+I),u=!1;const F=document.getElementById("registerButton");F&&(F.disabled=!1,F.innerHTML="REGISTER")}else E==="Ok"?(m.querySelector('input[name="token"]').value=b.opaqueData.dataValue,m.querySelector('input[name="tokenDescriptor"]').value=b.opaqueData.dataDescriptor,m.submit()):console.warn("â ï¸ AcceptJS returned unknown resultCode:",E)})}
6function c(){const m=document.getElementById("paymentFormFinal"),t=m.querySelector('input[name="token"]');t&&(t.value="TEST_TOKEN_FOR_DIRECT_SUBMIT"),m.submit()}window.sendPaymentDataToAnet=d,window.startProgressUpdates=s,window.stopProgressUpdates=g,window.updateProgressText=a,window.testDirectSubmit=c,typeof showLoadingState<"u"&&(window.showLoadingState=showLoadingState),typeof hideLoadingState<"u"&&(window.hideLoadingState=hideLoadingState)}function J(){const p=document.querySelector(".navbar-toggler"),n=document.querySelector("#navbarSupportedContent");if(!p||!n)return;let e=!1;function o(){n.classList.toggle("show");const s=n.classList.contains("show");p.setAttribute("aria-expanded",s.toString())}p.addEventListener("touchstart",function(s){e=!0},{passive:!0}),p.addEventListener("touchend",function(s){e&&(s.preventDefault(),s.stopPropagation(),o(),setTimeout(()=>{e=!1},300))},{passive:!1}),p.addEventListener("click",function(s){if(e){s.preventDefault(),s.stopPropagation();return}s.preventDefault(),s.stopPropagation(),o()}),n.querySelectorAll(".nav-link").forEach(s=>{s.addEventListener("click",function(){setTimeout(()=>{n.classList.remove("show"),p.setAttribute("aria-expanded","false")},150)})}),document.addEventListener("click",function(s){!(n.contains(s.target)||p.contains(s.target))&&n.classList.contains("show")&&(n.classList.remove("show"),p.setAttribute("aria-expanded","false"))}),window.addEventListener("resize",function(){window.innerWidth>=768&&n.classList.contains("show")&&(n.classList.remove("show"),p.setAttribute("aria-expanded","false"))})}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.