| 1 |
var bitform_init=function(){"use strict";const t=["hidden_token_field","initAllCustomFlds","initAddOtherOpt","setSliderFieldValue","setBitInputMaskToInput","initCheckDisableOnMax","initTextLengthHelper","initPasswordStrengthHelper","validate_focus","submit_form","bit_form_abandonment","setFieldValues","bit_multi_step_form","bit_conversational_form","bfTogglePasswordVisibility"],n=new WeakSet;function e(e=null){(e?[e]:function(){const t=new Set(Object.keys(window.bf_globals||{}));return document.querySelectorAll("script.bf-form-config[data-bf-form]").forEach(n=>{const e=n.dataset.bfForm;e&&t.add(e)}),Array.from(t)}()).forEach(e=>function(e){const o=document.getElementById(e);o&&(n.has(o)||(function(t){window.bf_globals||(window.bf_globals={});const n=window.bf_globals[t];if(n?.fields)return!0;const e=document.querySelector(`script.bf-form-config[data-bf-form="${t}"]`);if(!e)return!1;const o=function(t){try{return JSON.parse(t)}catch(t){}const n=t.indexOf('{"');if(n<0)return null;let e=t.lastIndexOf("}");for(let o=0;o<5&&e>n;o+=1)try{return JSON.parse(t.slice(n,e+1))}catch(n){e=t.lastIndexOf("}",e-1)}return null}(e.textContent);o&&(window.bf_globals[t]={inits:{},contentId:t,...n||{},...o})}(e),window.bf_globals?.[e]?.fields&&(t.forEach(t=>{const n=globalThis[t];if("function"==typeof n)try{n(e)}catch(n){const o=window.bf_globals[e];o.initErrors=o.initErrors||{},o.initErrors[t]=String(n&&n.message||n)}}),n.add(o),o.dataset.bfInited="true")))}(e))}return window.bitformInit=e,document.addEventListener("bitform/reinit",t=>{e(t?.detail?.contentId||null)}),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{e()}):e(),window.addEventListener("load",()=>{e()}),e}(); |