/home/techb158/l2hypotheques.com/wp-content/plugins/calculator-builder/assets/js
Edit: /home/techb158/l2hypotheques.com/wp-content/plugins/calculator-builder/assets/js/calchub-min.js (4694B)
/*! ========= INFORMATION ============================
- author: CalcHub
- url: https://calchub.xyz
- plugin: https://wordpress.org/plugins/calculator-builder/
==================================================== */
"use strict";const CalculatorBuilder=function(){function e(e){let t=[];const o=e.querySelectorAll("fieldset");for(let e=0;e
{"remove"===t?e.classList.remove("is-hidden"):e.classList.add("is-hidden")}))}function c(e,t,o=""){const r=e.querySelector(".has-alert");if("hide"===t&&r){r.classList.add("is-hidden");r.querySelector(".formbox__field-alert").innerHTML=""}else if("show"===t&&r){const e=r.querySelector(".formbox__field-alert");r.classList.remove("is-hidden"),e.innerHTML=o}}document.querySelectorAll(".formbox").forEach((e=>{const t=e.querySelectorAll('input[type="range"]');t.length>0&&t.forEach((e=>{const t=e.closest(".formbox__field").querySelector(".formbox__field-range-value");t&&(e.oninput=function(){t.innerHTML=this.value})}));const o={handleEvent:i,form:e};let r=e.querySelector(".formbox__btn-calc");e.querySelector(".calc-only-click")?(e.querySelectorAll("input, select, button.formbox__btn-calc").forEach((e=>{e.addEventListener("keydown",(function(e){"Enter"!==e.key&&13!==e.keyCode||e.preventDefault()}))})),r&&r.addEventListener("click",o)):e.addEventListener("submit",o);const a=new FormData(e);e.addEventListener("reset",{handleEvent:s,form:e,data:a}),e.querySelector(".calc-reset")&&(e.addEventListener("change",{handleEvent:n,form:e}),e.addEventListener("keyup",{handleEvent:n,form:e})),e.querySelector(".calc-not-change")||(e.addEventListener("change",o),e.addEventListener("keyup",o)),e.querySelector(".calc-load")&&window.addEventListener("load",o),window.addEventListener("load",{handleEvent:l,form:e})})),Element.prototype.hide=function(){this.classList.add("is-hidden")},Element.prototype.show=function(){this.classList.remove("is-hidden")},Element.prototype.addClass=function(e){this.classList.add(e)},Element.prototype.removeClass=function(e){this.classList.remove(e)},Element.prototype.addAttr=function(e,t){e=e||"",t=t||"",this.setAttribute(e,t)},Element.prototype.removeAttr=function(e){e=e||"",this.removeAttribute(e)},Element.prototype.text=function(e){e=e||"",this.innerText=e},Number.prototype.round=function(e="2"){const t=Math.pow(10,parseInt(e));return Math.round(this*t)/t}};document.addEventListener("DOMContentLoaded",(function(){new CalculatorBuilder}));const roundVal=(e,t="2")=>{const o=Math.pow(10,parseInt(t));return Math.round(e*o)/o};function checkCalcVariable(e,t){return""!==t?t:e}