@rtstic.dev/pulse 0.0.31 → 0.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ "use strict";(()=>{var D=Object.create;var R=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var V=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var U=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of q(t))!C.call(e,o)&&o!==r&&R(e,o,{get:()=>t[o],enumerable:!(n=w(t,o))||n.enumerable});return e};var B=(e,t,r)=>(r=e!=null?D(x(e)):{},U(t||!e||!e.__esModule?R(r,"default",{value:e,enumerable:!0}):r,e));console.log("Book a demo form script loaded");var P=["text","email","phone","checkbox","radio","select","legal"],Y=["true","atleast-one","only-one"],l={REQUIRED_INPUT:"ERR_REQUIRED",REQUIRED_LEGAL:"ERR_LEGAL_REQUIRED",REQUIRED_SELECT:"ERR_SELECT_REQUIRED",ATLEAST_ONE:"ERR_ATLEAST_ONE",ONLY_ONE_NONE:"ERR_ONLY_ONE_NONE",ONLY_ONE_EXCEEDED:"ERR_ONLY_ONE_EXCEEDED",INVALID_EMAIL:"ERR_INVALID_EMAIL",INVALID_PHONE:"ERR_INVALID_PHONE",PHONE_TOO_SHORT:"ERR_PHONE_TOO_SHORT",PHONE_TOO_LONG:"ERR_PHONE_TOO_LONG",PHONE_INVALID_COUNTRY:"ERR_PHONE_INVALID_COUNTRY"},c={[l.REQUIRED_INPUT]:"This field is required.",[l.REQUIRED_LEGAL]:"You must accept this to continue.",[l.REQUIRED_SELECT]:"Please select an option.",[l.ATLEAST_ONE]:"Please select at least one option.",[l.ONLY_ONE_NONE]:"Please select one option.",[l.ONLY_ONE_EXCEEDED]:"Only one option can be selected.",[l.INVALID_EMAIL]:"Please enter a valid email address.",[l.INVALID_PHONE]:"Please enter a valid phone number.",[l.PHONE_TOO_SHORT]:"Phone number is too short.",[l.PHONE_TOO_LONG]:"Phone number is too long.",[l.PHONE_INVALID_COUNTRY]:"Invalid country code."},y="pulse-form-error",_=new Map;function v(e){try{let t=e.getSelectedCountryData?.();if(!t?.dialCode)return;document.querySelectorAll('input[pulse-form-field="country-code"]').forEach(n=>{n.value=`+${t.dialCode}`})}catch(t){console.warn("[PulseForm] Error filling country code:",t)}}function Q(){let e=window.intlTelInput;if(!e){console.warn(`[PulseForm] intlTelInput not found on window. Make sure you include the intl-tel-input script before this script.
2
+ e.g. <script src="https://cdn.jsdelivr.net/npm/intl-tel-input@25/build/js/intlTelInput.min.js"><\/script>`);return}document.querySelectorAll('[pulse-form-block="phone"] input[type="tel"]').forEach(r=>{try{let n=e(r,{initialCountry:"us",separateDialCode:!0,strictMode:!1,loadUtils:()=>import("https://cdn.jsdelivr.net/npm/intl-tel-input@25/build/js/utils.js")});_.set(r,n),v(n),r.addEventListener("countrychange",()=>{v(n)}),console.log(`[PulseForm] intl-tel-input initialized for "${r.closest("[pulse-form-block]")?.getAttribute("pulse-field-name")||"unknown"}"`)}catch(n){console.warn("[PulseForm] Failed to init intl-tel-input:",n)}})}var G={0:l.INVALID_PHONE,1:l.PHONE_INVALID_COUNTRY,2:l.PHONE_TOO_SHORT,3:l.PHONE_TOO_LONG,4:l.INVALID_PHONE};function $(e){return e?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?null:{code:l.INVALID_EMAIL,message:c[l.INVALID_EMAIL]}:null}function j(e){let t=e.value.trim();if(!t)return null;let r=_.get(e);if(r)try{if(r.isValidNumber())return null;let o=r.getValidationError?.()??0,s=G[o]||l.INVALID_PHONE;return{code:s,message:c[s]}}catch{return{code:l.INVALID_PHONE,message:c[l.INVALID_PHONE]}}let n=t.replace(/\D/g,"");return n.length<7?{code:l.PHONE_TOO_SHORT,message:c[l.PHONE_TOO_SHORT]}:n.length>15?{code:l.PHONE_TOO_LONG,message:c[l.PHONE_TOO_LONG]}:null}function W(e){let t=e.querySelector("input, textarea");return t?t.value.trim():null}function X(e){let t=e.querySelector('input[type="email"]');return t?t.value.trim():null}function z(e){let t=e.querySelector('input[type="tel"]');return t?t.value.trim():null}function J(e){let t=e.querySelectorAll('input[type="checkbox"]'),r=[];return t.forEach(n=>{if(n.checked){let o=n.getAttribute("data-name")?.trim();r.push(o||n.value||"on")}}),r}function K(e){let t=e.querySelectorAll('input[type="radio"]');for(let r of t)if(r.checked)return r.closest("label")?.textContent?.trim()||r.value||"on";return null}function Z(e){let t=e.querySelector("select");if(!t)return null;let r=t.value.trim();return!r||t.selectedIndex===0?null:r}function ee(e){let t=e.querySelector('input[type="checkbox"]');return t?t.checked:!1}function M(e,t){switch(e){case"text":return W(t);case"email":return X(t);case"phone":return z(t);case"checkbox":return J(t);case"radio":return K(t);case"select":return Z(t);case"legal":return ee(t);default:return null}}function S(e){let t=e.getAttribute("required-selection")?.trim().toLowerCase();return!t||!Y.includes(t)?null:t}function te(e){return e.getAttribute("mirror-value")?.trim().toLowerCase()==="true"}function I(e,t,r,n){if(t)switch(t){case"true":{if(e==="legal"&&r!==!0)return{code:l.REQUIRED_LEGAL,message:c[l.REQUIRED_LEGAL]};if(e==="select"&&!r)return{code:l.REQUIRED_SELECT,message:c[l.REQUIRED_SELECT]};if((e==="text"||e==="email"||e==="phone")&&(!r||typeof r=="string"&&r===""))return{code:l.REQUIRED_INPUT,message:c[l.REQUIRED_INPUT]};break}case"atleast-one":{if(Array.isArray(r)?r.length===0:!r)return{code:l.ATLEAST_ONE,message:c[l.ATLEAST_ONE]};break}case"only-one":{if(Array.isArray(r)){if(r.length===0)return{code:l.ONLY_ONE_NONE,message:c[l.ONLY_ONE_NONE]};if(r.length>1)return{code:l.ONLY_ONE_EXCEEDED,message:c[l.ONLY_ONE_EXCEEDED]}}else if(!r)return{code:l.ONLY_ONE_NONE,message:c[l.ONLY_ONE_NONE]};break}}if(e==="email"&&typeof r=="string"&&r){let o=$(r);if(o)return o}if(e==="phone"&&typeof r=="string"&&r){let o=n.querySelector('input[type="tel"]');if(o){let s=j(o);if(s)return s}}return null}function N(e){let t=document.querySelectorAll("[pulse-form-block]"),r=[];return t.forEach(n=>{let o=n.getAttribute("pulse-form-block")?.trim().toLowerCase();if(!o||!P.includes(o))return;let s=o,a=n.getAttribute("pulse-field-name")?.trim();if(!a)return;let u=S(n),d=te(n),f=M(s,n),m=e?I(s,u,f,n):null;r.push({"form-block":s,"field-name":a,value:f,required:u,"mirror-value":d,error:m})}),r}function F(){document.querySelectorAll(`.${y}`).forEach(e=>e.remove()),document.querySelectorAll("[pulse-form-block]").forEach(e=>e.classList.remove("has-error"))}function ne(e){let t=e.querySelector(`.${y}`);t&&t.remove(),e.classList.remove("has-error")}function k(e,t){let r=e.querySelector(`.${y}`);r&&r.remove();let n=document.createElement("span");n.className=y,n.textContent=t.message,n.setAttribute("data-error-code",t.code),n.setAttribute("data-field-name",e.getAttribute("pulse-field-name")?.trim()||""),e.classList.add("has-error"),e.appendChild(n)}function re(e){F(),document.querySelectorAll("[pulse-form-block]").forEach(r=>{let n=r.getAttribute("pulse-field-name")?.trim();if(!n)return;let o=e.find(s=>s["field-name"]===n);!o||!o.error||k(r,o.error)})}function oe(){let e=document.querySelector("[pulse-form-block].has-error");if(!e)return;e.scrollIntoView({behavior:"smooth",block:"center"});let t=e.querySelector("input, textarea, select");t&&setTimeout(()=>t.focus(),400)}function L(){let e=i.filter(r=>r["mirror-value"]===!0);if(e.length===0)return;let t=document.querySelectorAll("[pulse-form-block-mirror]");e.forEach(r=>{let n=r["field-name"],o=!1;t.forEach(s=>{if(s.getAttribute("pulse-form-block-mirror")?.trim()!==n)return;o=!0;let u=s.querySelector("input, textarea, select");if(!u){console.warn(`[PulseForm] Mirror target for "${n}" found, but no input element inside it.`);return}let d=r.value;typeof d=="string"?u.value=d:typeof d=="boolean"?u instanceof HTMLInputElement&&u.type==="checkbox"?u.checked=d:u.value=String(d):Array.isArray(d)?u.value=d.join(", "):u.value=""}),o||console.warn(`[PulseForm] No mirror target found for field "${n}". Add an element with attribute pulse-form-block-mirror="${n}" to mirror this value.`)})}var le={"Financial Services":"david",Sports:"steven",Beauty:"albany",Music:"steven","Customer Packaged Goods":"david",Other:"david"};function ie(){let e=i.find(n=>n["field-name"]==="industry");if(!e||typeof e.value!="string"||!e.value)return;let t=le[e.value];document.querySelectorAll("[hs-calender]").forEach(n=>{let o=n.getAttribute("hs-calender")?.trim();t&&o===t?n.setAttribute("hs-calender-active","true"):n.setAttribute("hs-calender-active","false")})}function p(){let e=i.find(n=>n["field-name"]==="flow-type");if(!e)return;let t=e.value;document.querySelectorAll("[form-flow]").forEach(n=>{n.getAttribute("form-flow")?.trim()===t?n.setAttribute("form-flow-active","true"):n.setAttribute("form-flow-active","false")}),t==="White Glove services"&&ie()}function h(){let e=i.find(o=>o["field-name"]==="flow-type");if(!e)return;let t=e.value,r=i.findIndex(o=>o["field-name"]==="industry"),n=i.findIndex(o=>o["field-name"]==="what-are-you-looking-for");r!==-1&&(i[r]={...i[r],required:null}),n!==-1&&(i[n]={...i[n],required:null}),t==="White Glove services"&&r!==-1?i[r]={...i[r],required:"true"}:t==="Pulse demo"&&n!==-1&&(i[n]={...i[n],required:"atleast-one"}),window.PulseFormData=i}var i=[];function O(e,t,r){let n=i.findIndex(o=>o["field-name"]===e);n!==-1&&(i[n]={...i[n],value:t,error:r},window.PulseFormData=i,h(),L(),p())}function se(e){let t=e.getAttribute("pulse-form-block")?.trim().toLowerCase(),r=e.getAttribute("pulse-field-name")?.trim();if(!r)return;let n=S(e),o=M(t,e);if(e.classList.contains("has-error")){let a=I(t,n,o,e);a?(k(e,a),O(r,o,a)):(ne(e),O(r,o,null))}else O(r,o,null)}function ue(){document.querySelectorAll("[pulse-form-block]").forEach(t=>{let r=t.getAttribute("pulse-form-block")?.trim().toLowerCase();if(!r||!P.includes(r))return;let n=()=>se(t);switch(r){case"text":case"email":{let o=t.querySelector("input, textarea");o&&(o.addEventListener("input",n),o.addEventListener("change",n));break}case"phone":{let o=t.querySelector('input[type="tel"]');o&&(o.addEventListener("input",n),o.addEventListener("change",n),o.addEventListener("keyup",n),o.addEventListener("countrychange",n));break}case"checkbox":case"legal":{t.querySelectorAll('input[type="checkbox"]').forEach(o=>o.addEventListener("change",n));break}case"radio":{t.querySelectorAll('input[type="radio"]').forEach(o=>o.addEventListener("change",n));break}case"select":{let o=t.querySelector("select");o&&o.addEventListener("change",n);break}}})}var H={get fields(){return i},refresh(){return i=N(!1),window.PulseFormData=i,h(),L(),p(),i},validate(){i=N(!0),window.PulseFormData=i,h();let t=document.querySelectorAll("[pulse-form-block]");i.forEach((n,o)=>{let s=Array.from(t).find(u=>u.getAttribute("pulse-field-name")?.trim()===n["field-name"]);if(!s)return;let a=I(n["form-block"],n.required,n.value,s);i[o]={...i[o],error:a}}),window.PulseFormData=i;let r=i.every(n=>n.error===null);return L(),p(),re(i),r||oe(),{fields:i,isValid:r}},clearErrors(){F(),i=i.map(e=>({...e,error:null})),window.PulseFormData=i,h(),L(),p()},ERROR_CODES:l,ERROR_MESSAGES:c};document.addEventListener("DOMContentLoaded",()=>{let e=document.querySelectorAll("[pulse-form-block]").length;console.log(`[PulseForm] Initialized \u2014 found ${e} form blocks.`),Q(),i=N(!1),window.PulseFormData=i,h(),L(),p(),ue();let t=document.getElementById("trigger-webflow-form-submit");t&&t.addEventListener("click",r=>{r.preventDefault();let{isValid:n}=H.validate();if(!n)return;let o=document.getElementById("webflow-form-submit");o?o.click():console.warn('[PulseForm] Button with id "webflow-form-submit" not found.');let s=document.getElementById("hubspot-form-submit");s?s.click():console.warn('[PulseForm] Button with id "hubspot-form-submit" not found.')}),window.PulseForm=H});function ce(){let e=["Jordan","Morgan","Riley","Avery","Quinn","Casey","Blake","Harper","Sage","Rowan"],t=["Nakamura","Lindqvist","Okafor","Brennan","Castellano","Pham","Eriksen","Moreira","Ashworth","Dubois"],r=["inbox.co","mailbox.org","zipmail.net","postly.io","demobox.dev"],n=m=>m[Math.floor(Math.random()*m.length)],o=()=>Math.random().toString(36).substring(2,8),s=n(e),a=n(t),u=`${s.toLowerCase()}.${o()}@${n(r)}`,d=`${2e9+Math.floor(Math.random()*8e9)}`,f={"first-name":s,"last-name":a,email:u,phone:d,"anything-else":"Ignore this is a test form submission"};Object.entries(f).forEach(([m,b])=>{let T=document.querySelector(`[pulse-field-name="${m}"]`);if(!T)return;if(m==="phone"){let E=T.querySelector('input[type="tel"]');if(!E)return;let A=_.get(E);A?A.setNumber(`+1${b}`):E.value=b,E.dispatchEvent(new Event("input",{bubbles:!0})),E.dispatchEvent(new Event("change",{bubbles:!0})),E.dispatchEvent(new Event("keyup",{bubbles:!0}));return}let g=m==="anything-else"?T.querySelector("textarea"):T.querySelector("input");g&&(g.value=b,g.dispatchEvent(new Event("input",{bubbles:!0})),g.dispatchEvent(new Event("change",{bubbles:!0})))}),console.log("[PulseForm][DEV] Auto-filled:",f)}setTimeout(ce,500);})();
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/form/book-a-demo.ts"],
4
+ "sourcesContent": ["export { };\n// \u2500\u2500\u2500 Types \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nconsole.log(\"Book a demo form script loaded\");\n\ntype FormBlockType = \"text\" | \"email\" | \"phone\" | \"checkbox\" | \"radio\" | \"select\" | \"legal\";\ntype RequiredSelection = \"true\" | \"atleast-one\" | \"only-one\";\n\ninterface PulseFormField {\n \"form-block\": FormBlockType;\n \"field-name\": string;\n value: string | string[] | boolean | null;\n required: RequiredSelection | null;\n \"mirror-value\": boolean;\n error: { code: string; message: string } | null;\n}\n\n// \u2500\u2500\u2500 Constants \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst VALID_BLOCK_TYPES: FormBlockType[] = [\n \"text\",\n \"email\",\n \"phone\",\n \"checkbox\",\n \"radio\",\n \"select\",\n \"legal\",\n];\n\nconst VALID_REQUIRED_VALUES: RequiredSelection[] = [\n \"true\",\n \"atleast-one\",\n \"only-one\",\n];\n\n// \u2500\u2500\u2500 Error Codes & Messages \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst ERROR_CODES = {\n REQUIRED_INPUT: \"ERR_REQUIRED\",\n REQUIRED_LEGAL: \"ERR_LEGAL_REQUIRED\",\n REQUIRED_SELECT: \"ERR_SELECT_REQUIRED\",\n ATLEAST_ONE: \"ERR_ATLEAST_ONE\",\n ONLY_ONE_NONE: \"ERR_ONLY_ONE_NONE\",\n ONLY_ONE_EXCEEDED: \"ERR_ONLY_ONE_EXCEEDED\",\n INVALID_EMAIL: \"ERR_INVALID_EMAIL\",\n INVALID_PHONE: \"ERR_INVALID_PHONE\",\n PHONE_TOO_SHORT: \"ERR_PHONE_TOO_SHORT\",\n PHONE_TOO_LONG: \"ERR_PHONE_TOO_LONG\",\n PHONE_INVALID_COUNTRY: \"ERR_PHONE_INVALID_COUNTRY\",\n} as const;\n\nconst ERROR_MESSAGES: Record<string, string> = {\n [ERROR_CODES.REQUIRED_INPUT]: \"This field is required.\",\n [ERROR_CODES.REQUIRED_LEGAL]: \"You must accept this to continue.\",\n [ERROR_CODES.REQUIRED_SELECT]: \"Please select an option.\",\n [ERROR_CODES.ATLEAST_ONE]: \"Please select at least one option.\",\n [ERROR_CODES.ONLY_ONE_NONE]: \"Please select one option.\",\n [ERROR_CODES.ONLY_ONE_EXCEEDED]: \"Only one option can be selected.\",\n [ERROR_CODES.INVALID_EMAIL]: \"Please enter a valid email address.\",\n [ERROR_CODES.INVALID_PHONE]: \"Please enter a valid phone number.\",\n [ERROR_CODES.PHONE_TOO_SHORT]: \"Phone number is too short.\",\n [ERROR_CODES.PHONE_TOO_LONG]: \"Phone number is too long.\",\n [ERROR_CODES.PHONE_INVALID_COUNTRY]: \"Invalid country code.\",\n};\n\nconst ERROR_SPAN_CLASS = \"pulse-form-error\";\n\n// \u2500\u2500\u2500 intl-tel-input \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst itiInstances = new Map<HTMLInputElement, any>();\n\nfunction fillCountryCodeInput(iti: any): void {\n try {\n const countryData = iti.getSelectedCountryData?.();\n if (!countryData?.dialCode) return;\n\n const inputs = document.querySelectorAll<HTMLInputElement>(\n 'input[pulse-form-field=\"country-code\"]'\n );\n inputs.forEach((input) => {\n input.value = `+${countryData.dialCode}`;\n });\n } catch (err) {\n console.warn(\"[PulseForm] Error filling country code:\", err);\n }\n}\n\nfunction initIntlTelInput(): void {\n const intlTelInput = (window as any).intlTelInput;\n if (!intlTelInput) {\n console.warn(\n \"[PulseForm] intlTelInput not found on window. \" +\n \"Make sure you include the intl-tel-input script before this script.\\n\" +\n 'e.g. <script src=\"https://cdn.jsdelivr.net/npm/intl-tel-input@25/build/js/intlTelInput.min.js\"></script>'\n );\n return;\n }\n\n const phoneInputs = document.querySelectorAll<HTMLInputElement>(\n '[pulse-form-block=\"phone\"] input[type=\"tel\"]'\n );\n\n phoneInputs.forEach((input) => {\n try {\n const iti = intlTelInput(input, {\n initialCountry: \"us\",\n separateDialCode: true,\n strictMode: false,\n // @ts-ignore \u2014 runtime CDN import, not a TS module\n loadUtils: () => import(\"https://cdn.jsdelivr.net/npm/intl-tel-input@25/build/js/utils.js\"),\n });\n\n itiInstances.set(input, iti);\n\n fillCountryCodeInput(iti);\n\n input.addEventListener(\"countrychange\", () => {\n fillCountryCodeInput(iti);\n });\n\n console.log(\n `[PulseForm] intl-tel-input initialized for \"${input.closest(\"[pulse-form-block]\")?.getAttribute(\"pulse-field-name\") || \"unknown\"}\"`\n );\n } catch (err) {\n console.warn(\"[PulseForm] Failed to init intl-tel-input:\", err);\n }\n });\n}\n\n// \u2500\u2500\u2500 Format Validators \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst PHONE_ITI_ERROR_MAP: Record<number, string> = {\n 0: ERROR_CODES.INVALID_PHONE,\n 1: ERROR_CODES.PHONE_INVALID_COUNTRY,\n 2: ERROR_CODES.PHONE_TOO_SHORT,\n 3: ERROR_CODES.PHONE_TOO_LONG,\n 4: ERROR_CODES.INVALID_PHONE,\n};\n\nfunction validateEmail(value: string): PulseFormField[\"error\"] {\n if (!value) return null;\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (!emailRegex.test(value)) {\n return { code: ERROR_CODES.INVALID_EMAIL, message: ERROR_MESSAGES[ERROR_CODES.INVALID_EMAIL] };\n }\n return null;\n}\n\nfunction validatePhone(input: HTMLInputElement): PulseFormField[\"error\"] {\n const value = input.value.trim();\n if (!value) return null;\n\n const iti = itiInstances.get(input);\n\n if (iti) {\n try {\n if (iti.isValidNumber()) return null;\n const errorCode: number = iti.getValidationError?.() ?? 0;\n const code = PHONE_ITI_ERROR_MAP[errorCode] || ERROR_CODES.INVALID_PHONE;\n return { code, message: ERROR_MESSAGES[code] };\n } catch {\n return { code: ERROR_CODES.INVALID_PHONE, message: ERROR_MESSAGES[ERROR_CODES.INVALID_PHONE] };\n }\n }\n\n // Fallback: basic digit length\n const digits = value.replace(/\\D/g, \"\");\n if (digits.length < 7)\n return { code: ERROR_CODES.PHONE_TOO_SHORT, message: ERROR_MESSAGES[ERROR_CODES.PHONE_TOO_SHORT] };\n if (digits.length > 15)\n return { code: ERROR_CODES.PHONE_TOO_LONG, message: ERROR_MESSAGES[ERROR_CODES.PHONE_TOO_LONG] };\n return null;\n}\n\n// \u2500\u2500\u2500 Value Extractors \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction extractTextValue(wrapper: HTMLElement): string | null {\n const input = wrapper.querySelector<HTMLInputElement | HTMLTextAreaElement>(\n \"input, textarea\"\n );\n if (!input) return null;\n return input.value.trim();\n}\n\nfunction extractEmailValue(wrapper: HTMLElement): string | null {\n const input = wrapper.querySelector<HTMLInputElement>('input[type=\"email\"]');\n if (!input) return null;\n return input.value.trim();\n}\n\nfunction extractPhoneValue(wrapper: HTMLElement): string | null {\n const input = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (!input) return null;\n return input.value.trim();\n}\n\nfunction extractCheckboxValues(wrapper: HTMLElement): string[] {\n const checkboxes = wrapper.querySelectorAll<HTMLInputElement>(\n 'input[type=\"checkbox\"]'\n );\n const values: string[] = [];\n checkboxes.forEach((cb) => {\n if (cb.checked) {\n const name = cb.getAttribute(\"data-name\")?.trim();\n values.push(name || cb.value || \"on\");\n }\n });\n return values;\n}\n\nfunction extractRadioValue(wrapper: HTMLElement): string | null {\n const radios = wrapper.querySelectorAll<HTMLInputElement>(\n 'input[type=\"radio\"]'\n );\n for (const radio of radios) {\n if (radio.checked) {\n const label = radio.closest(\"label\")?.textContent?.trim();\n return label || radio.value || \"on\";\n }\n }\n return null;\n}\n\nfunction extractSelectValue(wrapper: HTMLElement): string | null {\n const select = wrapper.querySelector<HTMLSelectElement>(\"select\");\n if (!select) return null;\n const val = select.value.trim();\n if (!val || select.selectedIndex === 0) return null;\n return val;\n}\n\nfunction extractLegalValue(wrapper: HTMLElement): boolean {\n const checkbox = wrapper.querySelector<HTMLInputElement>(\n 'input[type=\"checkbox\"]'\n );\n if (!checkbox) return false;\n return checkbox.checked;\n}\n\n// \u2500\u2500\u2500 Core Parser \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction extractValue(\n type: FormBlockType,\n wrapper: HTMLElement\n): PulseFormField[\"value\"] {\n switch (type) {\n case \"text\":\n return extractTextValue(wrapper);\n case \"email\":\n return extractEmailValue(wrapper);\n case \"phone\":\n return extractPhoneValue(wrapper);\n case \"checkbox\":\n return extractCheckboxValues(wrapper);\n case \"radio\":\n return extractRadioValue(wrapper);\n case \"select\":\n return extractSelectValue(wrapper);\n case \"legal\":\n return extractLegalValue(wrapper);\n default:\n return null;\n }\n}\n\nfunction parseRequired(wrapper: HTMLElement): RequiredSelection | null {\n const raw = wrapper.getAttribute(\"required-selection\")?.trim().toLowerCase();\n if (!raw || !VALID_REQUIRED_VALUES.includes(raw as RequiredSelection))\n return null;\n return raw as RequiredSelection;\n}\n\nfunction parseMirrorValue(wrapper: HTMLElement): boolean {\n return wrapper.getAttribute(\"mirror-value\")?.trim().toLowerCase() === \"true\";\n}\n\n// \u2500\u2500\u2500 Validation Logic (per field) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction getFieldError(\n type: FormBlockType,\n required: RequiredSelection | null,\n value: PulseFormField[\"value\"],\n wrapper: HTMLElement\n): PulseFormField[\"error\"] {\n // 1. Required checks\n if (required) {\n switch (required) {\n case \"true\": {\n if (type === \"legal\" && value !== true)\n return { code: ERROR_CODES.REQUIRED_LEGAL, message: ERROR_MESSAGES[ERROR_CODES.REQUIRED_LEGAL] };\n if (type === \"select\" && !value)\n return { code: ERROR_CODES.REQUIRED_SELECT, message: ERROR_MESSAGES[ERROR_CODES.REQUIRED_SELECT] };\n if (\n (type === \"text\" || type === \"email\" || type === \"phone\") &&\n (!value || (typeof value === \"string\" && value === \"\"))\n )\n return { code: ERROR_CODES.REQUIRED_INPUT, message: ERROR_MESSAGES[ERROR_CODES.REQUIRED_INPUT] };\n break;\n }\n\n case \"atleast-one\": {\n const empty = Array.isArray(value) ? value.length === 0 : !value;\n if (empty)\n return { code: ERROR_CODES.ATLEAST_ONE, message: ERROR_MESSAGES[ERROR_CODES.ATLEAST_ONE] };\n break;\n }\n\n case \"only-one\": {\n if (Array.isArray(value)) {\n if (value.length === 0)\n return { code: ERROR_CODES.ONLY_ONE_NONE, message: ERROR_MESSAGES[ERROR_CODES.ONLY_ONE_NONE] };\n if (value.length > 1)\n return { code: ERROR_CODES.ONLY_ONE_EXCEEDED, message: ERROR_MESSAGES[ERROR_CODES.ONLY_ONE_EXCEEDED] };\n } else if (!value) {\n return { code: ERROR_CODES.ONLY_ONE_NONE, message: ERROR_MESSAGES[ERROR_CODES.ONLY_ONE_NONE] };\n }\n break;\n }\n }\n }\n\n // 2. Format checks (only when there's a value)\n if (type === \"email\" && typeof value === \"string\" && value) {\n const emailError = validateEmail(value);\n if (emailError) return emailError;\n }\n\n if (type === \"phone\" && typeof value === \"string\" && value) {\n const phoneInput = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (phoneInput) {\n const phoneError = validatePhone(phoneInput);\n if (phoneError) return phoneError;\n }\n }\n\n return null;\n}\n\n// \u2500\u2500\u2500 Collect Fields \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction collectFormFields(withValidation: boolean): PulseFormField[] {\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n const fields: PulseFormField[] = [];\n\n wrappers.forEach((wrapper) => {\n const rawType = wrapper\n .getAttribute(\"pulse-form-block\")\n ?.trim()\n .toLowerCase();\n\n if (!rawType || !VALID_BLOCK_TYPES.includes(rawType as FormBlockType))\n return;\n\n const blockType = rawType as FormBlockType;\n const fieldName = wrapper.getAttribute(\"pulse-field-name\")?.trim();\n if (!fieldName) return;\n\n const required = parseRequired(wrapper);\n const mirrorValue = parseMirrorValue(wrapper);\n const value = extractValue(blockType, wrapper);\n const error = withValidation\n ? getFieldError(blockType, required, value, wrapper)\n : null;\n\n fields.push({\n \"form-block\": blockType,\n \"field-name\": fieldName,\n value,\n required,\n \"mirror-value\": mirrorValue,\n error,\n });\n });\n\n return fields;\n}\n\n// \u2500\u2500\u2500 Error UI \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction clearAllErrors(): void {\n document\n .querySelectorAll<HTMLElement>(`.${ERROR_SPAN_CLASS}`)\n .forEach((el) => el.remove());\n\n document\n .querySelectorAll<HTMLElement>(\"[pulse-form-block]\")\n .forEach((el) => el.classList.remove(\"has-error\"));\n}\n\nfunction clearErrorOnWrapper(wrapper: HTMLElement): void {\n const span = wrapper.querySelector(`.${ERROR_SPAN_CLASS}`);\n if (span) span.remove();\n wrapper.classList.remove(\"has-error\");\n}\n\nfunction showErrorOnWrapper(\n wrapper: HTMLElement,\n error: { code: string; message: string }\n): void {\n const existing = wrapper.querySelector(`.${ERROR_SPAN_CLASS}`);\n if (existing) existing.remove();\n\n const span = document.createElement(\"span\");\n span.className = ERROR_SPAN_CLASS;\n span.textContent = error.message;\n span.setAttribute(\"data-error-code\", error.code);\n span.setAttribute(\n \"data-field-name\",\n wrapper.getAttribute(\"pulse-field-name\")?.trim() || \"\"\n );\n\n wrapper.classList.add(\"has-error\");\n wrapper.appendChild(span);\n}\n\nfunction renderErrors(fields: PulseFormField[]): void {\n clearAllErrors();\n\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n\n wrappers.forEach((wrapper) => {\n const fieldName = wrapper.getAttribute(\"pulse-field-name\")?.trim();\n if (!fieldName) return;\n\n const field = fields.find((f) => f[\"field-name\"] === fieldName);\n if (!field || !field.error) return;\n\n showErrorOnWrapper(wrapper, field.error);\n });\n}\n\nfunction focusFirstError(): void {\n const first = document.querySelector<HTMLElement>(\n `[pulse-form-block].has-error`\n );\n if (!first) return;\n\n first.scrollIntoView({ behavior: \"smooth\", block: \"center\" });\n\n const focusable = first.querySelector<HTMLElement>(\n \"input, textarea, select\"\n );\n if (focusable) setTimeout(() => focusable.focus(), 400);\n}\n\n// \u2500\u2500\u2500 Mirror Value Fill \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction fillMirrorValues(): void {\n // 1. Get all fields with mirror-value true\n const mirrorFields = _currentFields.filter((f) => f[\"mirror-value\"] === true);\n if (mirrorFields.length === 0) return;\n\n // 2. Select all mirror target elements\n const mirrorTargets = document.querySelectorAll<HTMLElement>(\"[pulse-form-block-mirror]\");\n\n // 3. For each mirror field, find matching target and fill\n mirrorFields.forEach((field) => {\n const fieldName = field[\"field-name\"];\n let found = false;\n\n mirrorTargets.forEach((target) => {\n const mirrorAttr = target.getAttribute(\"pulse-form-block-mirror\")?.trim();\n if (mirrorAttr !== fieldName) return;\n\n found = true;\n\n // Find the input inside the mirror target and fill it\n const input = target.querySelector<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>(\n \"input, textarea, select\"\n );\n\n if (!input) {\n console.warn(\n `[PulseForm] Mirror target for \"${fieldName}\" found, but no input element inside it.`\n );\n return;\n }\n\n // Set value based on type\n const value = field.value;\n if (typeof value === \"string\") {\n input.value = value;\n } else if (typeof value === \"boolean\") {\n if (input instanceof HTMLInputElement && input.type === \"checkbox\") {\n input.checked = value;\n } else {\n input.value = String(value);\n }\n } else if (Array.isArray(value)) {\n input.value = value.join(\", \");\n } else {\n input.value = \"\";\n }\n });\n\n if (!found) {\n console.warn(\n `[PulseForm] No mirror target found for field \"${fieldName}\". ` +\n `Add an element with attribute pulse-form-block-mirror=\"${fieldName}\" to mirror this value.`\n );\n }\n });\n}\n\n// \u2500\u2500\u2500 Flow Type \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst INDUSTRY_CALENDER_MAP: Record<string, string> = {\n \"Financial Services\": \"david\",\n \"Sports\": \"steven\",\n \"Beauty\": \"albany\",\n \"Music\": \"steven\",\n \"Customer Packaged Goods\": \"david\",\n \"Other\": \"david\",\n};\n\nfunction setWhiteGloveCalender(): void {\n // 1. Get the value of field-name=\"industry\" from the JSON\n const industryField = _currentFields.find((f) => f[\"field-name\"] === \"industry\");\n if (!industryField || typeof industryField.value !== \"string\" || !industryField.value) return;\n\n const activePerson = INDUSTRY_CALENDER_MAP[industryField.value];\n\n // 2. Select all elements with attribute \"hs-calender\"\n const calenderElements = document.querySelectorAll<HTMLElement>(\"[hs-calender]\");\n\n // 3. Set hs-calender-active based on matching person\n calenderElements.forEach((el) => {\n const elCalenderValue = el.getAttribute(\"hs-calender\")?.trim();\n if (activePerson && elCalenderValue === activePerson) {\n el.setAttribute(\"hs-calender-active\", \"true\");\n } else {\n el.setAttribute(\"hs-calender-active\", \"false\");\n }\n });\n}\n\nfunction updateFlowType(): void {\n // 1. Get the value of field-name=\"flow-type\" from the JSON\n const flowField = _currentFields.find((f) => f[\"field-name\"] === \"flow-type\");\n if (!flowField) return;\n\n const flowValue = flowField.value;\n\n // 2. Select all elements with attribute \"form-flow\"\n const flowElements = document.querySelectorAll<HTMLElement>(\"[form-flow]\");\n\n // 3. Set form-flow-active based on matching value\n flowElements.forEach((el) => {\n const elFlowValue = el.getAttribute(\"form-flow\")?.trim();\n if (elFlowValue === flowValue) {\n el.setAttribute(\"form-flow-active\", \"true\");\n } else {\n el.setAttribute(\"form-flow-active\", \"false\");\n }\n });\n\n // 4. If White Glove services, update calender assignments\n if (flowValue === \"White Glove services\") {\n setWhiteGloveCalender();\n }\n}\n\n// \u2500\u2500\u2500 Conditional Required \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction updateConditionalRequired(): void {\n const flowField = _currentFields.find((f) => f[\"field-name\"] === \"flow-type\");\n if (!flowField) return;\n\n const flowValue = flowField.value;\n\n // Reset both fields to not required first\n const industryIdx = _currentFields.findIndex((f) => f[\"field-name\"] === \"industry\");\n const lookingForIdx = _currentFields.findIndex((f) => f[\"field-name\"] === \"what-are-you-looking-for\");\n\n if (industryIdx !== -1) {\n _currentFields[industryIdx] = { ..._currentFields[industryIdx], required: null };\n }\n if (lookingForIdx !== -1) {\n _currentFields[lookingForIdx] = { ..._currentFields[lookingForIdx], required: null };\n }\n\n // Set required based on flow-type value\n if (flowValue === \"White Glove services\" && industryIdx !== -1) {\n _currentFields[industryIdx] = { ..._currentFields[industryIdx], required: \"true\" };\n } else if (flowValue === \"Pulse demo\" && lookingForIdx !== -1) {\n _currentFields[lookingForIdx] = { ..._currentFields[lookingForIdx], required: \"atleast-one\" };\n }\n\n (window as any).PulseFormData = _currentFields;\n}\n\n// \u2500\u2500\u2500 Reactive State \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nlet _currentFields: PulseFormField[] = [];\n\nfunction updateFieldInState(\n fieldName: string,\n value: PulseFormField[\"value\"],\n error: PulseFormField[\"error\"]\n): void {\n const idx = _currentFields.findIndex((f) => f[\"field-name\"] === fieldName);\n if (idx === -1) return;\n _currentFields[idx] = { ..._currentFields[idx], value, error };\n (window as any).PulseFormData = _currentFields;\n updateConditionalRequired();\n fillMirrorValues();\n updateFlowType();\n}\n\nfunction handleFieldChange(wrapper: HTMLElement): void {\n const rawType = wrapper\n .getAttribute(\"pulse-form-block\")\n ?.trim()\n .toLowerCase() as FormBlockType;\n const fieldName = wrapper.getAttribute(\"pulse-field-name\")?.trim();\n if (!fieldName) return;\n\n const required = parseRequired(wrapper);\n const value = extractValue(rawType, wrapper);\n const hasError = wrapper.classList.contains(\"has-error\");\n\n if (hasError) {\n const error = getFieldError(rawType, required, value, wrapper);\n if (!error) {\n clearErrorOnWrapper(wrapper);\n updateFieldInState(fieldName, value, null);\n } else {\n showErrorOnWrapper(wrapper, error);\n updateFieldInState(fieldName, value, error);\n }\n } else {\n updateFieldInState(fieldName, value, null);\n }\n}\n\nfunction bindChangeListeners(): void {\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n\n wrappers.forEach((wrapper) => {\n const type = wrapper\n .getAttribute(\"pulse-form-block\")\n ?.trim()\n .toLowerCase() as FormBlockType | undefined;\n\n if (!type || !VALID_BLOCK_TYPES.includes(type)) return;\n\n const onChange = () => handleFieldChange(wrapper);\n\n switch (type) {\n case \"text\":\n case \"email\": {\n const input = wrapper.querySelector<HTMLInputElement | HTMLTextAreaElement>(\n \"input, textarea\"\n );\n if (input) {\n input.addEventListener(\"input\", onChange);\n input.addEventListener(\"change\", onChange);\n }\n break;\n }\n\n case \"phone\": {\n const phoneInput = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (phoneInput) {\n phoneInput.addEventListener(\"input\", onChange);\n phoneInput.addEventListener(\"change\", onChange);\n phoneInput.addEventListener(\"keyup\", onChange);\n phoneInput.addEventListener(\"countrychange\", onChange);\n }\n break;\n }\n\n case \"checkbox\":\n case \"legal\": {\n wrapper\n .querySelectorAll<HTMLInputElement>('input[type=\"checkbox\"]')\n .forEach((cb) => cb.addEventListener(\"change\", onChange));\n break;\n }\n\n case \"radio\": {\n wrapper\n .querySelectorAll<HTMLInputElement>('input[type=\"radio\"]')\n .forEach((r) => r.addEventListener(\"change\", onChange));\n break;\n }\n\n case \"select\": {\n const select = wrapper.querySelector<HTMLSelectElement>(\"select\");\n if (select) select.addEventListener(\"change\", onChange);\n break;\n }\n }\n });\n}\n\n// \u2500\u2500\u2500 Public API \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst PulseForm = {\n get fields(): PulseFormField[] {\n return _currentFields;\n },\n\n refresh(): PulseFormField[] {\n _currentFields = collectFormFields(false);\n (window as any).PulseFormData = _currentFields;\n updateConditionalRequired();\n fillMirrorValues();\n updateFlowType();\n return _currentFields;\n },\n\n validate(): { fields: PulseFormField[]; isValid: boolean } {\n const fields = collectFormFields(true);\n\n _currentFields = fields;\n (window as any).PulseFormData = _currentFields;\n updateConditionalRequired();\n\n // Re-validate fields whose required was changed by updateConditionalRequired\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n _currentFields.forEach((field, idx) => {\n const wrapper = Array.from(wrappers).find(\n (w) => w.getAttribute(\"pulse-field-name\")?.trim() === field[\"field-name\"]\n );\n if (!wrapper) return;\n const error = getFieldError(\n field[\"form-block\"],\n field.required,\n field.value,\n wrapper\n );\n _currentFields[idx] = { ..._currentFields[idx], error };\n });\n\n (window as any).PulseFormData = _currentFields;\n const isValid = _currentFields.every((f) => f.error === null);\n\n fillMirrorValues();\n updateFlowType();\n\n renderErrors(_currentFields);\n if (!isValid) focusFirstError();\n\n return { fields: _currentFields, isValid };\n },\n\n clearErrors(): void {\n clearAllErrors();\n _currentFields = _currentFields.map((f) => ({ ...f, error: null }));\n (window as any).PulseFormData = _currentFields;\n updateConditionalRequired();\n fillMirrorValues();\n updateFlowType();\n },\n\n ERROR_CODES,\n ERROR_MESSAGES,\n};\n\n// \u2500\u2500\u2500 Initialize on DOM Ready \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n const count = document.querySelectorAll(\"[pulse-form-block]\").length;\n console.log(`[PulseForm] Initialized \u2014 found ${count} form blocks.`);\n\n initIntlTelInput();\n\n _currentFields = collectFormFields(false);\n (window as any).PulseFormData = _currentFields;\n updateConditionalRequired();\n fillMirrorValues();\n updateFlowType();\n\n bindChangeListeners();\n\n // \u2500\u2500\u2500 Submit Button \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const triggerBtn = document.getElementById(\"trigger-webflow-form-submit\");\n if (triggerBtn) {\n triggerBtn.addEventListener(\"click\", (e) => {\n e.preventDefault();\n const { isValid } = PulseForm.validate();\n if (!isValid) return;\n\n const submitBtn = document.getElementById(\"webflow-form-submit\") as HTMLButtonElement | null;\n if (submitBtn) {\n submitBtn.click();\n } else {\n console.warn('[PulseForm] Button with id \"webflow-form-submit\" not found.');\n }\n\n const hubspotBtn = document.getElementById(\"hubspot-form-submit\") as HTMLButtonElement | null;\n if (hubspotBtn) {\n hubspotBtn.click();\n } else {\n console.warn('[PulseForm] Button with id \"hubspot-form-submit\" not found.');\n }\n });\n }\n\n (window as any).PulseForm = PulseForm;\n});\n\n// \u2500\u2500\u2500 \u26A0\uFE0F DEV ONLY \u2014 Remove or disable in production \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction devAutoFill(): void {\n const firstNames = [\"Jordan\", \"Morgan\", \"Riley\", \"Avery\", \"Quinn\", \"Casey\", \"Blake\", \"Harper\", \"Sage\", \"Rowan\"];\n const lastNames = [\"Nakamura\", \"Lindqvist\", \"Okafor\", \"Brennan\", \"Castellano\", \"Pham\", \"Eriksen\", \"Moreira\", \"Ashworth\", \"Dubois\"];\n const domains = [\"inbox.co\", \"mailbox.org\", \"zipmail.net\", \"postly.io\", \"demobox.dev\"];\n\n const pick = (arr: string[]) => arr[Math.floor(Math.random() * arr.length)];\n const rand = () => Math.random().toString(36).substring(2, 8);\n\n const firstName = pick(firstNames);\n const lastName = pick(lastNames);\n const email = `${firstName.toLowerCase()}.${rand()}@${pick(domains)}`;\n const phone = `${2000000000 + Math.floor(Math.random() * 8000000000)}`;\n\n const fieldMap: Record<string, string> = {\n \"first-name\": firstName,\n \"last-name\": lastName,\n \"email\": email,\n \"phone\": phone,\n \"anything-else\": \"Ignore this is a test form submission\",\n };\n\n Object.entries(fieldMap).forEach(([fieldName, value]) => {\n const wrapper = document.querySelector<HTMLElement>(\n `[pulse-field-name=\"${fieldName}\"]`\n );\n if (!wrapper) return;\n\n if (fieldName === \"phone\") {\n const phoneInput = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (!phoneInput) return;\n const iti = itiInstances.get(phoneInput);\n if (iti) {\n iti.setNumber(`+1${value}`);\n } else {\n phoneInput.value = value;\n }\n phoneInput.dispatchEvent(new Event(\"input\", { bubbles: true }));\n phoneInput.dispatchEvent(new Event(\"change\", { bubbles: true }));\n phoneInput.dispatchEvent(new Event(\"keyup\", { bubbles: true }));\n return;\n }\n\n const el = fieldName === \"anything-else\"\n ? wrapper.querySelector<HTMLTextAreaElement>(\"textarea\")\n : wrapper.querySelector<HTMLInputElement>(\"input\");\n if (!el) return;\n\n el.value = value;\n el.dispatchEvent(new Event(\"input\", { bubbles: true }));\n el.dispatchEvent(new Event(\"change\", { bubbles: true }));\n });\n\n console.log(\"[PulseForm][DEV] Auto-filled:\", fieldMap);\n}\n\nsetTimeout(devAutoFill, 500);\n// \u2500\u2500\u2500 \u26A0\uFE0F END DEV ONLY \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,UAAQ,IAAI,gCAAgC;AAgB5C,MAAM,oBAAqC;AAAA,IACvC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAEA,MAAM,wBAA6C;AAAA,IAC/C;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAIA,MAAM,cAAc;AAAA,IAChB,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,eAAe;AAAA,IACf,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,gBAAgB;AAAA,IAChB,uBAAuB;AAAA,EAC3B;AAEA,MAAM,iBAAyC;AAAA,IAC3C,CAAC,YAAY,cAAc,GAAG;AAAA,IAC9B,CAAC,YAAY,cAAc,GAAG;AAAA,IAC9B,CAAC,YAAY,eAAe,GAAG;AAAA,IAC/B,CAAC,YAAY,WAAW,GAAG;AAAA,IAC3B,CAAC,YAAY,aAAa,GAAG;AAAA,IAC7B,CAAC,YAAY,iBAAiB,GAAG;AAAA,IACjC,CAAC,YAAY,aAAa,GAAG;AAAA,IAC7B,CAAC,YAAY,aAAa,GAAG;AAAA,IAC7B,C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C,UAAU,IACrD,QAAQ,cAAgC,OAAO;AACrD,UAAI,CAAC,GAAI;AAET,SAAG,QAAQ;AACX,SAAG,cAAc,IAAI,MAAM,SAAS,EAAE,SAAS,KAAK,CAAC,CAAC;AACtD,SAAG,cAAc,IAAI,MAAM,UAAU,EAAE,SAAS,KAAK,CAAC,CAAC;AAAA,IAC3D,CAAC;AAED,YAAQ,IAAI,iCAAiC,QAAQ;AAAA,EACzD;AAEA,aAAW,aAAa,GAAG;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ .w-form-formradioinput--inputType-custom.w--redirected-focus{box-shadow:none}.radio-checked{display:none}.w-form-formradioinput.w--redirected-checked~.radio-checked{display:flex}.w-checkbox-input--inputType-custom.w--redirected-focus{box-shadow:none}.w-input:focus,.w-select:focus{border-color:transparent;outline:0}.radio-inner-label{color:var(--text-colors--subtext)}input[type=radio]:checked+.radio-inner-label{color:var(--text-colors--title)}.checkbox-label{color:var(--text-colors--subtext)}.w-checkbox-input--inputType-custom.w--redirected-checked{background-color:#f66025;border-color:#f66025}input[type=checkbox]:checked+.checkbox-label{color:var(--text-colors--title)}.checkbox-field:has(input[type=checkbox]:checked){border-color:#f66025}.radio-inner-label,.checkbox-label{transition:color .3s ease}.checkbox-field{transition:border-color .3s ease}.w-checkbox-input--inputType-custom{transition:background-color .3s ease,border-color .3s ease}span.pulse-form-error{color:#e55757;font-size:var(--_text-size---body--s);line-height:var(--_line-height---line-height-body--s);font-weight:var(--_font-weight---font-weight-body--s);letter-spacing:var(--_letter-spacing---letter-spacing-body--s)}[data-error-code=ERR_LEGAL_REQUIRED]{padding-left:18px}[form-flow-active=false]{display:none}[form-flow-active=true]{display:flex}[fullwidth]{width:100%}[hs-calender-active=true]{display:block;width:100%}[hs-calender-active=false]{display:none}
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/form/styles.css"],
4
+ "sourcesContent": [".w-form-formradioinput--inputType-custom.w--redirected-focus {\n box-shadow: none;\n}\n\n/* Hide by default */\n.radio-checked {\n display: none;\n}\n\n/* Show when the custom radio is checked */\n.w-form-formradioinput.w--redirected-checked~.radio-checked {\n display: flex;\n}\n\n.w-checkbox-input--inputType-custom.w--redirected-focus {\n box-shadow: none;\n}\n\n.w-input:focus,\n.w-select:focus {\n border-color: transparent;\n outline: 0;\n}\n\n/* Default state */\n.radio-inner-label {\n color: var(--text-colors--subtext);\n}\n\n/* When radio is checked */\ninput[type=\"radio\"]:checked+.radio-inner-label {\n color: var(--text-colors--title);\n}\n\n/* Default (unchecked) */\n.checkbox-label {\n color: var(--text-colors--subtext);\n}\n\n/* When checked */\ninput[type=\"checkbox\"]:checked+.checkbox-label {\n color: var(--text-colors--title);\n}\n\n.w-checkbox-input--inputType-custom.w--redirected-checked {\n background-color: #F66025;\n border-color: #F66025;\n}\n\n/* Change label color when checked */\ninput[type=\"checkbox\"]:checked+.checkbox-label {\n color: var(--text-colors--title);\n}\n\n/* Change parent border when checked */\n.checkbox-field:has(input[type=\"checkbox\"]:checked) {\n border-color: #F66025;\n}\n\n/* Smooth color transition for labels */\n.radio-inner-label,\n.checkbox-label {\n transition: color 300ms ease;\n}\n\n/* Smooth border transition for parent checkbox field */\n.checkbox-field {\n transition: border-color 300ms ease;\n}\n\n/* Smooth background + border transition for custom checkbox input */\n.w-checkbox-input--inputType-custom {\n transition: background-color 300ms ease, border-color 300ms ease;\n}\n\nspan.pulse-form-error {\n color: #e55757;\n font-size: var(--_text-size---body--s);\n line-height: var(--_line-height---line-height-body--s);\n font-weight: var(--_font-weight---font-weight-body--s);\n letter-spacing: var(--_letter-spacing---letter-spacing-body--s);\n}\n\n[data-error-code=\"ERR_LEGAL_REQUIRED\"] {\n padding-left: 18px;\n}\n\n[form-flow-active=\"false\"] {\n display: none;\n}\n\n[form-flow-active=\"true\"] {\n display: flex;\n}\n\n[fullwidth] {\n width: 100%;\n}\n\n[hs-calender-active=\"true\"] {\n display: block;\n width: 100%;\n}\n\n[hs-calender-active=\"false\"] {\n display: none;\n}"],
5
+ "mappings": ";AAAA,CAAC,uCAAuC,CAAC;AACrC,cAAY;AAChB;AAGA,CAAC;AACG,WAAS;AACb;AAGA,CAAC,qBAAqB,CAAC,sBAAqB,EAAC,CAL5C;AAMG,WAAS;AACb;AAEA,CAAC,kCAAkC,CAdM;AAerC,cAAY;AAChB;AAEA,CAAC,OAAO;AACR,CAAC,QAAQ;AACL,gBAAc;AACd,WAAS;AACb;AAGA,CAAC;AACG,SAAO,IAAI;AACf;AAGA,KAAK,CAAC,WAAa,SAAQ,EAAC,CAL3B;AAMG,SAAO,IAAI;AACf;AAGA,CAAC;AACG,SAAO,IAAI;AACf;AAGA,KAAK,CAAC,cAAgB,SAAQ,EAAC,CAL9B;AAMG,SAAO,IAAI;AACf;AAEA,CA9BC,kCA8BkC,CAlCZ;AAmCnB,oBAAkB;AAClB,gBAAc;AAClB;AAGA,KAAK,CAAC,cAAgB,SAAQ,EAAC,CAf9B;AAgBG,SAAO,IAAI;AACf;AAGA,CAAC,cAAc,KAAK,KAAK,CAAC,cAAgB;AACtC,gBAAc;AAClB;AAGA,CAnCC;AAoCD,CA1BC;AA2BG,cAAY,MAAM,MAAM;AAC5B;AAGA,CAXC;AAYG,cAAY,aAAa,MAAM;AACnC;AAGA,CAzDC;AA0DG,cAAY,iBAAiB,MAAM,IAAI,EAAE,aAAa,MAAM;AAChE;AAEA,IAAI,CAAC;AACD,SAAO;AACP,aAAW,IAAI;AACf,eAAa,IAAI;AACjB,eAAa,IAAI;AACjB,kBAAgB,IAAI;AACxB;AAEA,CAAC;AACG,gBAAc;AAClB;AAEA,CAAC;AACG,WAAS;AACb;AAEA,CAAC;AACG,WAAS;AACb;AAEA,CAAC;AACG,SAAO;AACX;AAEA,CAAC;AACG,WAAS;AACT,SAAO;AACX;AAEA,CAAC;AACG,WAAS;AACb;",
6
+ "names": []
7
+ }
@@ -1 +1 @@
1
- "use strict";(()=>{document.addEventListener("DOMContentLoaded",()=>{let b=window.matchMedia("(min-width: 992px)"),u=null;function h(){let a=[{identifier:"1",autoplayDuration:"11000ms"},{identifier:"2",autoplayDuration:"5000ms"},{identifier:"3",autoplayDuration:"8000ms"}];function m(t){return t.endsWith("ms")?parseInt(t.replace("ms",""),10):t.endsWith("s")?parseFloat(t.replace("s",""))*1e3:0}function c(t){document.querySelectorAll("[pulse-tab-content]").forEach(n=>{let i=n.getAttribute("pulse-tab-content");n.setAttribute("active-tabcontent",i===t?"true":"false")}),document.querySelectorAll("[pulse-tab-link]").forEach(n=>{let i=n.getAttribute("pulse-tab-link");n.setAttribute("active-tablink",i===t?"true":"false")}),v(t)}function v(t){document.querySelectorAll("[pulse-tab-content]").forEach(o=>{let n=o.getAttribute("pulse-tab-content"),i=o.querySelector("video");i&&(n===t?(i.loop=!0,i.play().catch(()=>{})):(i.pause(),i.currentTime=0,i.loop=!1))})}function T(t){let e=a.find(o=>o.identifier===t);return e?m(e.autoplayDuration):0}function L(t){return a.findIndex(e=>e.identifier===t)}let l=null,s=0;function f(){let t=a[s],e=m(t.autoplayDuration);c(t.identifier),g(t.identifier,e),s=(s+1)%a.length,l=window.setTimeout(f,e)}function y(){d(),s=0,f()}function d(){l!==null&&(clearTimeout(l),l=null)}function g(t,e){document.querySelectorAll("[pulse-tab-link]").forEach(n=>{let i=n.getAttribute("pulse-tab-link"),r=n.querySelector("[tablink-path]");r&&(r.style.transition="none",r.style.width="0%",i===t&&(r.getBoundingClientRect(),r.style.transition=`width ${e}ms linear`,r.style.width="100%"))})}return document.querySelectorAll("[pulse-tab-link]").forEach(t=>{t.addEventListener("click",()=>{let e=t.getAttribute("pulse-tab-link");if(!e)return;d(),c(e);let o=T(e);g(e,o);let n=L(e);n!==-1&&(s=(n+1)%a.length),l=window.setTimeout(f,o)})}),c(a[0].identifier),y(),window.activateTab=c,window.startTabAutoplay=y,window.stopTabAutoplay=d,d}function p(a){a.matches?u||(u=h()):u&&(u(),u=null)}p(b),b.addEventListener("change",p)});})();
1
+ "use strict";(()=>{document.addEventListener("DOMContentLoaded",()=>{let b=window.matchMedia("(min-width: 992px)"),u=null;function h(){let a=[{identifier:"1",autoplayDuration:"22000ms"},{identifier:"2",autoplayDuration:"12000ms"},{identifier:"3",autoplayDuration:"18000ms"}];function m(t){return t.endsWith("ms")?parseInt(t.replace("ms",""),10):t.endsWith("s")?parseFloat(t.replace("s",""))*1e3:0}function c(t){document.querySelectorAll("[pulse-tab-content]").forEach(n=>{let i=n.getAttribute("pulse-tab-content");n.setAttribute("active-tabcontent",i===t?"true":"false")}),document.querySelectorAll("[pulse-tab-link]").forEach(n=>{let i=n.getAttribute("pulse-tab-link");n.setAttribute("active-tablink",i===t?"true":"false")}),v(t)}function v(t){document.querySelectorAll("[pulse-tab-content]").forEach(o=>{let n=o.getAttribute("pulse-tab-content"),i=o.querySelector("video");i&&(n===t?(i.loop=!0,i.play().catch(()=>{})):(i.pause(),i.currentTime=0,i.loop=!1))})}function T(t){let e=a.find(o=>o.identifier===t);return e?m(e.autoplayDuration):0}function L(t){return a.findIndex(e=>e.identifier===t)}let l=null,s=0;function f(){let t=a[s],e=m(t.autoplayDuration);c(t.identifier),g(t.identifier,e),s=(s+1)%a.length,l=window.setTimeout(f,e)}function y(){d(),s=0,f()}function d(){l!==null&&(clearTimeout(l),l=null)}function g(t,e){document.querySelectorAll("[pulse-tab-link]").forEach(n=>{let i=n.getAttribute("pulse-tab-link"),r=n.querySelector("[tablink-path]");r&&(r.style.transition="none",r.style.width="0%",i===t&&(r.getBoundingClientRect(),r.style.transition=`width ${e}ms linear`,r.style.width="100%"))})}return document.querySelectorAll("[pulse-tab-link]").forEach(t=>{t.addEventListener("click",()=>{let e=t.getAttribute("pulse-tab-link");if(!e)return;d(),c(e);let o=T(e);g(e,o);let n=L(e);n!==-1&&(s=(n+1)%a.length),l=window.setTimeout(f,o)})}),c(a[0].identifier),y(),window.activateTab=c,window.startTabAutoplay=y,window.stopTabAutoplay=d,d}function p(a){a.matches?u||(u=h()):u&&(u(),u=null)}p(b),b.addEventListener("change",p)});})();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/home/tabs-v2.ts"],
4
- "sourcesContent": ["type TabConfig = {\n identifier: string;\n autoplayDuration: string;\n};\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n const mediaQuery = window.matchMedia(\"(min-width: 992px)\");\n let cleanup: (() => void) | null = null;\n\n function initPulseTabs(): () => void {\n const tabConfigs: TabConfig[] = [\n { identifier: \"1\", autoplayDuration: \"11000ms\" },\n { identifier: \"2\", autoplayDuration: \"5000ms\" },\n { identifier: \"3\", autoplayDuration: \"8000ms\" }\n ];\n\n function parseDuration(duration: string): number {\n if (duration.endsWith(\"ms\")) {\n return parseInt(duration.replace(\"ms\", \"\"), 10);\n }\n if (duration.endsWith(\"s\")) {\n return parseFloat(duration.replace(\"s\", \"\")) * 1000;\n }\n return 0;\n }\n\n function activateTab(identifier: string): void {\n const tabContents = document.querySelectorAll<HTMLElement>(\"[pulse-tab-content]\");\n tabContents.forEach(el => {\n const value = el.getAttribute(\"pulse-tab-content\");\n el.setAttribute(\"active-tabcontent\", value === identifier ? \"true\" : \"false\");\n });\n\n const tabLinks = document.querySelectorAll<HTMLElement>(\"[pulse-tab-link]\");\n tabLinks.forEach(el => {\n const value = el.getAttribute(\"pulse-tab-link\");\n el.setAttribute(\"active-tablink\", value === identifier ? \"true\" : \"false\");\n });\n\n handleTabVideos(identifier);\n }\n\n function handleTabVideos(activeIdentifier: string): void {\n const tabContents = document.querySelectorAll<HTMLElement>(\"[pulse-tab-content]\");\n\n tabContents.forEach(tab => {\n const identifier = tab.getAttribute(\"pulse-tab-content\");\n const video = tab.querySelector<HTMLVideoElement>(\"video\");\n\n if (!video) return;\n\n if (identifier === activeIdentifier) {\n video.loop = true;\n video.play().catch(() => { });\n } else {\n video.pause();\n video.currentTime = 0;\n video.loop = false;\n }\n });\n }\n\n function getDurationForIdentifier(identifier: string): number {\n const config = tabConfigs.find(tab => tab.identifier === identifier);\n return config ? parseDuration(config.autoplayDuration) : 0;\n }\n\n function getIndexForIdentifier(identifier: string): number {\n return tabConfigs.findIndex(tab => tab.identifier === identifier);\n }\n\n let autoplayTimeout: number | null = null;\n let currentIndex = 0;\n\n function autoplayNext(): void {\n const config = tabConfigs[currentIndex];\n const delay = parseDuration(config.autoplayDuration);\n\n activateTab(config.identifier);\n handleTabLinkPathAnimation(config.identifier, delay);\n\n currentIndex = (currentIndex + 1) % tabConfigs.length;\n autoplayTimeout = window.setTimeout(autoplayNext, delay);\n }\n\n function startAutoplay(): void {\n stopAutoplay();\n currentIndex = 0;\n autoplayNext();\n }\n\n function stopAutoplay(): void {\n if (autoplayTimeout !== null) {\n clearTimeout(autoplayTimeout);\n autoplayTimeout = null;\n }\n }\n\n function handleTabLinkPathAnimation(\n activeIdentifier: string,\n durationMs: number\n ): void {\n const tabLinks = document.querySelectorAll<HTMLElement>(\"[pulse-tab-link]\");\n\n tabLinks.forEach(link => {\n const identifier = link.getAttribute(\"pulse-tab-link\");\n const path = link.querySelector<HTMLElement>(\"[tablink-path]\");\n\n if (!path) return;\n\n path.style.transition = \"none\";\n path.style.width = \"0%\";\n\n if (identifier === activeIdentifier) {\n path.getBoundingClientRect();\n path.style.transition = `width ${durationMs}ms linear`;\n path.style.width = \"100%\";\n }\n });\n }\n\n const tabLinks = document.querySelectorAll<HTMLElement>(\"[pulse-tab-link]\");\n tabLinks.forEach(link => {\n link.addEventListener(\"click\", () => {\n const identifier = link.getAttribute(\"pulse-tab-link\");\n if (!identifier) return;\n\n stopAutoplay();\n activateTab(identifier);\n\n const duration = getDurationForIdentifier(identifier);\n handleTabLinkPathAnimation(identifier, duration);\n\n const index = getIndexForIdentifier(identifier);\n if (index !== -1) {\n currentIndex = (index + 1) % tabConfigs.length;\n }\n\n autoplayTimeout = window.setTimeout(autoplayNext, duration);\n });\n });\n\n activateTab(tabConfigs[0].identifier);\n startAutoplay();\n\n (window as any).activateTab = activateTab;\n (window as any).startTabAutoplay = startAutoplay;\n (window as any).stopTabAutoplay = stopAutoplay;\n\n return stopAutoplay;\n }\n\n function handleBreakpoint(e: MediaQueryList | MediaQueryListEvent): void {\n if (e.matches) {\n if (!cleanup) {\n cleanup = initPulseTabs();\n }\n } else {\n if (cleanup) {\n cleanup();\n cleanup = null;\n }\n }\n }\n\n handleBreakpoint(mediaQuery);\n mediaQuery.addEventListener(\"change\", handleBreakpoint);\n});"],
5
- "mappings": ";;;AAKA,WAAS,iBAAiB,oBAAoB,MAAM;AAChD,UAAM,aAAa,OAAO,WAAW,oBAAoB;AACzD,QAAI,UAA+B;AAEnC,aAAS,gBAA4B;AACjC,YAAM,aAA0B;AAAA,QAC5B,EAAE,YAAY,KAAK,kBAAkB,UAAU;AAAA,QAC/C,EAAE,YAAY,KAAK,kBAAkB,SAAS;AAAA,QAC9C,EAAE,YAAY,KAAK,kBAAkB,SAAS;AAAA,MAClD;AAEA,eAAS,cAAc,UAA0B;AAC7C,YAAI,SAAS,SAAS,IAAI,GAAG;AACzB,iBAAO,SAAS,SAAS,QAAQ,MAAM,EAAE,GAAG,EAAE;AAAA,QAClD;AACA,YAAI,SAAS,SAAS,GAAG,GAAG;AACxB,iBAAO,WAAW,SAAS,QAAQ,KAAK,EAAE,CAAC,IAAI;AAAA,QACnD;AACA,eAAO;AAAA,MACX;AAEA,eAAS,YAAY,YAA0B;AAC3C,cAAM,cAAc,SAAS,iBAA8B,qBAAqB;AAChF,oBAAY,QAAQ,QAAM;AACtB,gBAAM,QAAQ,GAAG,aAAa,mBAAmB;AACjD,aAAG,aAAa,qBAAqB,UAAU,aAAa,SAAS,OAAO;AAAA,QAChF,CAAC;AAED,cAAMA,YAAW,SAAS,iBAA8B,kBAAkB;AAC1E,QAAAA,UAAS,QAAQ,QAAM;AACnB,gBAAM,QAAQ,GAAG,aAAa,gBAAgB;AAC9C,aAAG,aAAa,kBAAkB,UAAU,aAAa,SAAS,OAAO;AAAA,QAC7E,CAAC;AAED,wBAAgB,UAAU;AAAA,MAC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ener(\"DOMContentLoaded\", () => {\n const mediaQuery = window.matchMedia(\"(min-width: 992px)\");\n let cleanup: (() => void) | null = null;\n\n function initPulseTabs(): () => void {\n const tabConfigs: TabConfig[] = [\n { identifier: \"1\", autoplayDuration: \"22000ms\" },\n { identifier: \"2\", autoplayDuration: \"12000ms\" },\n { identifier: \"3\", autoplayDuration: \"18000ms\" }\n ];\n\n function parseDuration(duration: string): number {\n if (duration.endsWith(\"ms\")) {\n return parseInt(duration.replace(\"ms\", \"\"), 10);\n }\n if (duration.endsWith(\"s\")) {\n return parseFloat(duration.replace(\"s\", \"\")) * 1000;\n }\n return 0;\n }\n\n function activateTab(identifier: string): void {\n const tabContents = document.querySelectorAll<HTMLElement>(\"[pulse-tab-content]\");\n tabContents.forEach(el => {\n const value = el.getAttribute(\"pulse-tab-content\");\n el.setAttribute(\"active-tabcontent\", value === identifier ? \"true\" : \"false\");\n });\n\n const tabLinks = document.querySelectorAll<HTMLElement>(\"[pulse-tab-link]\");\n tabLinks.forEach(el => {\n const value = el.getAttribute(\"pulse-tab-link\");\n el.setAttribute(\"active-tablink\", value === identifier ? \"true\" : \"false\");\n });\n\n handleTabVideos(identifier);\n }\n\n function handleTabVideos(activeIdentifier: string): void {\n const tabContents = document.querySelectorAll<HTMLElement>(\"[pulse-tab-content]\");\n\n tabContents.forEach(tab => {\n const identifier = tab.getAttribute(\"pulse-tab-content\");\n const video = tab.querySelector<HTMLVideoElement>(\"video\");\n\n if (!video) return;\n\n if (identifier === activeIdentifier) {\n video.loop = true;\n video.play().catch(() => { });\n } else {\n video.pause();\n video.currentTime = 0;\n video.loop = false;\n }\n });\n }\n\n function getDurationForIdentifier(identifier: string): number {\n const config = tabConfigs.find(tab => tab.identifier === identifier);\n return config ? parseDuration(config.autoplayDuration) : 0;\n }\n\n function getIndexForIdentifier(identifier: string): number {\n return tabConfigs.findIndex(tab => tab.identifier === identifier);\n }\n\n let autoplayTimeout: number | null = null;\n let currentIndex = 0;\n\n function autoplayNext(): void {\n const config = tabConfigs[currentIndex];\n const delay = parseDuration(config.autoplayDuration);\n\n activateTab(config.identifier);\n handleTabLinkPathAnimation(config.identifier, delay);\n\n currentIndex = (currentIndex + 1) % tabConfigs.length;\n autoplayTimeout = window.setTimeout(autoplayNext, delay);\n }\n\n function startAutoplay(): void {\n stopAutoplay();\n currentIndex = 0;\n autoplayNext();\n }\n\n function stopAutoplay(): void {\n if (autoplayTimeout !== null) {\n clearTimeout(autoplayTimeout);\n autoplayTimeout = null;\n }\n }\n\n function handleTabLinkPathAnimation(\n activeIdentifier: string,\n durationMs: number\n ): void {\n const tabLinks = document.querySelectorAll<HTMLElement>(\"[pulse-tab-link]\");\n\n tabLinks.forEach(link => {\n const identifier = link.getAttribute(\"pulse-tab-link\");\n const path = link.querySelector<HTMLElement>(\"[tablink-path]\");\n\n if (!path) return;\n\n path.style.transition = \"none\";\n path.style.width = \"0%\";\n\n if (identifier === activeIdentifier) {\n path.getBoundingClientRect();\n path.style.transition = `width ${durationMs}ms linear`;\n path.style.width = \"100%\";\n }\n });\n }\n\n const tabLinks = document.querySelectorAll<HTMLElement>(\"[pulse-tab-link]\");\n tabLinks.forEach(link => {\n link.addEventListener(\"click\", () => {\n const identifier = link.getAttribute(\"pulse-tab-link\");\n if (!identifier) return;\n\n stopAutoplay();\n activateTab(identifier);\n\n const duration = getDurationForIdentifier(identifier);\n handleTabLinkPathAnimation(identifier, duration);\n\n const index = getIndexForIdentifier(identifier);\n if (index !== -1) {\n currentIndex = (index + 1) % tabConfigs.length;\n }\n\n autoplayTimeout = window.setTimeout(autoplayNext, duration);\n });\n });\n\n activateTab(tabConfigs[0].identifier);\n startAutoplay();\n\n (window as any).activateTab = activateTab;\n (window as any).startTabAutoplay = startAutoplay;\n (window as any).stopTabAutoplay = stopAutoplay;\n\n return stopAutoplay;\n }\n\n function handleBreakpoint(e: MediaQueryList | MediaQueryListEvent): void {\n if (e.matches) {\n if (!cleanup) {\n cleanup = initPulseTabs();\n }\n } else {\n if (cleanup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B;AACjC,iBAAK,sBAAsB;AAC3B,iBAAK,MAAM,aAAa,SAAS,UAAU;AAC3C,iBAAK,MAAM,QAAQ;AAAA,UACvB;AAAA,QACJ,CAAC;AAAA,MACL;AAEA,YAAM,WAAW,SAAS,iBAA8B,kBAAkB;AAC1E,eAAS,QAAQ,UAAQ;AACrB,aAAK,iBAAiB,SAAS,MAAM;AACjC,gBAAM,aAAa,KAAK,aAAa,gBAAgB;AACrD,cAAI,CAAC,WAAY;AAEjB,uBAAa;AACb,sBAAY,UAAU;AAEtB,gBAAM,WAAW,yBAAyB,UAAU;AACpD,qCAA2B,YAAY,QAAQ;AAE/C,gBAAM,QAAQ,sBAAsB,UAAU;AAC9C,cAAI,UAAU,IAAI;AACd,4BAAgB,QAAQ,KAAK,WAAW;AAAA,UAC5C;AAEA,4BAAkB,OAAO,WAAW,cAAc,QAAQ;AAAA,QAC9D,CAAC;AAAA,MACL,CAAC;AAED,kBAAY,WAAW,CAAC,EAAE,UAAU;AACpC,oBAAc;AAEd,MAAC,OAAe,cAAc;AAC9B,MAAC,OAAe,mBAAmB;AACnC,MAAC,OAAe,kBAAkB;AAElC,aAAO;AAAA,IACX;AAEA,aAAS,iBAAiB,GAA+C;AACrE,UAAI,EAAE,SAAS;AACX,YAAI,CAAC,SAAS;AACV,oBAAU,cAAc;AAAA,QAC5B;AAAA,MACJ,OAAO;AACH,YAAI,SAAS;AACT,kBAAQ;AACR,oBAAU;AAAA,QACd;AAAA,MACJ;AAAA,IACJ;AAEA,qBAAiB,UAAU;AAC3B,eAAW,iBAAiB,UAAU,gBAAgB;AAAA,EAC1D,CAAC;",
6
6
  "names": ["tabLinks"]
7
7
  }
@@ -1 +1,2 @@
1
- "use strict";(()=>{var t={multiplier:4,duration:100,selector:"[rtstic-marquee='list']"};function u(e=t){try{(!e.multiplier||e.multiplier<2)&&(console.warn("[rtstic-marquee] Warning: multiplier should be at least 2, using default of 4"),e.multiplier=t.multiplier),(!e.duration||e.duration<=0)&&(console.warn("[rtstic-marquee] Warning: duration should be greater than 0, using default of 20"),e.duration=t.duration);let r=document.querySelector(e.selector);if(!r)return console.error(`[rtstic-marquee] Error: Element with selector "${e.selector}" not found`),!1;let i=r.innerHTML;if(!i.trim())return console.warn("[rtstic-marquee] Warning: Marquee element is empty"),!1;let n="";for(let l=0;l<e.multiplier;l++)n+=i;return r.innerHTML=n,r.style.setProperty("--multiplier",e.multiplier.toString()),r.style.setProperty("--duration",`${e.duration/e.multiplier}s`),console.log(`[rtstic-marquee] Successfully initialized with multiplier: ${e.multiplier}, duration: ${e.duration}s`),!0}catch(r){return r instanceof Error?console.error(`[rtstic-marquee] Error: ${r.message}`):console.error("[rtstic-marquee] Error: An unknown error occurred"),!1}}function o(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{u()}):u()}o();})();
1
+ "use strict";(()=>{var F=Object.create;var I=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var C=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var V=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of D(t))!x.call(e,o)&&o!==n&&I(e,o,{get:()=>t[o],enumerable:!(r=k(t,o))||r.enumerable});return e};var w=(e,t,n)=>(n=e!=null?F(q(e)):{},V(t||!e||!e.__esModule?I(n,"default",{value:e,enumerable:!0}):n,e));console.log("Book a demo form script loaded");var R=["text","email","phone","checkbox","radio","select","legal"],U=["true","atleast-one","only-one"],l={REQUIRED_INPUT:"ERR_REQUIRED",REQUIRED_LEGAL:"ERR_LEGAL_REQUIRED",REQUIRED_SELECT:"ERR_SELECT_REQUIRED",ATLEAST_ONE:"ERR_ATLEAST_ONE",ONLY_ONE_NONE:"ERR_ONLY_ONE_NONE",ONLY_ONE_EXCEEDED:"ERR_ONLY_ONE_EXCEEDED",INVALID_EMAIL:"ERR_INVALID_EMAIL",INVALID_PHONE:"ERR_INVALID_PHONE",PHONE_TOO_SHORT:"ERR_PHONE_TOO_SHORT",PHONE_TOO_LONG:"ERR_PHONE_TOO_LONG",PHONE_INVALID_COUNTRY:"ERR_PHONE_INVALID_COUNTRY"},c={[l.REQUIRED_INPUT]:"This field is required.",[l.REQUIRED_LEGAL]:"You must accept this to continue.",[l.REQUIRED_SELECT]:"Please select an option.",[l.ATLEAST_ONE]:"Please select at least one option.",[l.ONLY_ONE_NONE]:"Please select one option.",[l.ONLY_ONE_EXCEEDED]:"Only one option can be selected.",[l.INVALID_EMAIL]:"Please enter a valid email address.",[l.INVALID_PHONE]:"Please enter a valid phone number.",[l.PHONE_TOO_SHORT]:"Phone number is too short.",[l.PHONE_TOO_LONG]:"Phone number is too long.",[l.PHONE_INVALID_COUNTRY]:"Invalid country code."},g="pulse-form-error",y=new Map;function A(e){try{let t=e.getSelectedCountryData?.();if(!t?.dialCode)return;document.querySelectorAll('input[pulse-form-field="country-code"]').forEach(r=>{r.value=`+${t.dialCode}`})}catch(t){console.warn("[PulseForm] Error filling country code:",t)}}function Y(){let e=window.intlTelInput;if(!e){console.warn(`[PulseForm] intlTelInput not found on window. Make sure you include the intl-tel-input script before this script.
2
+ e.g. <script src="https://cdn.jsdelivr.net/npm/intl-tel-input@25/build/js/intlTelInput.min.js"><\/script>`);return}document.querySelectorAll('[pulse-form-block="phone"] input[type="tel"]').forEach(n=>{try{let r=e(n,{initialCountry:"us",separateDialCode:!0,strictMode:!1,loadUtils:()=>import("https://cdn.jsdelivr.net/npm/intl-tel-input@25/build/js/utils.js")});y.set(n,r),A(r),n.addEventListener("countrychange",()=>{A(r)}),console.log(`[PulseForm] intl-tel-input initialized for "${n.closest("[pulse-form-block]")?.getAttribute("pulse-field-name")||"unknown"}"`)}catch(r){console.warn("[PulseForm] Failed to init intl-tel-input:",r)}})}var Q={0:l.INVALID_PHONE,1:l.PHONE_INVALID_COUNTRY,2:l.PHONE_TOO_SHORT,3:l.PHONE_TOO_LONG,4:l.INVALID_PHONE};function $(e){return e?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?null:{code:l.INVALID_EMAIL,message:c[l.INVALID_EMAIL]}:null}function G(e){let t=e.value.trim();if(!t)return null;let n=y.get(e);if(n)try{if(n.isValidNumber())return null;let o=n.getValidationError?.()??0,i=Q[o]||l.INVALID_PHONE;return{code:i,message:c[i]}}catch{return{code:l.INVALID_PHONE,message:c[l.INVALID_PHONE]}}let r=t.replace(/\D/g,"");return r.length<7?{code:l.PHONE_TOO_SHORT,message:c[l.PHONE_TOO_SHORT]}:r.length>15?{code:l.PHONE_TOO_LONG,message:c[l.PHONE_TOO_LONG]}:null}function B(e){let t=e.querySelector("input, textarea");return t?t.value.trim():null}function j(e){let t=e.querySelector('input[type="email"]');return t?t.value.trim():null}function X(e){let t=e.querySelector('input[type="tel"]');return t?t.value.trim():null}function W(e){let t=e.querySelectorAll('input[type="checkbox"]'),n=[];return t.forEach(r=>{if(r.checked){let o=r.getAttribute("data-name")?.trim();n.push(o||r.value||"on")}}),n}function z(e){let t=e.querySelectorAll('input[type="radio"]');for(let n of t)if(n.checked)return n.closest("label")?.textContent?.trim()||n.value||"on";return null}function J(e){let t=e.querySelector("select");if(!t)return null;let n=t.value.trim();return!n||t.selectedIndex===0?null:n}function K(e){let t=e.querySelector('input[type="checkbox"]');return t?t.checked:!1}function v(e,t){switch(e){case"text":return B(t);case"email":return j(t);case"phone":return X(t);case"checkbox":return W(t);case"radio":return z(t);case"select":return J(t);case"legal":return K(t);default:return null}}function H(e){let t=e.getAttribute("required-selection")?.trim().toLowerCase();return!t||!U.includes(t)?null:t}function Z(e){return e.getAttribute("mirror-value")?.trim().toLowerCase()==="true"}function S(e,t,n,r){if(t)switch(t){case"true":{if(e==="legal"&&n!==!0)return{code:l.REQUIRED_LEGAL,message:c[l.REQUIRED_LEGAL]};if(e==="select"&&!n)return{code:l.REQUIRED_SELECT,message:c[l.REQUIRED_SELECT]};if((e==="text"||e==="email"||e==="phone")&&(!n||typeof n=="string"&&n===""))return{code:l.REQUIRED_INPUT,message:c[l.REQUIRED_INPUT]};break}case"atleast-one":{if(Array.isArray(n)?n.length===0:!n)return{code:l.ATLEAST_ONE,message:c[l.ATLEAST_ONE]};break}case"only-one":{if(Array.isArray(n)){if(n.length===0)return{code:l.ONLY_ONE_NONE,message:c[l.ONLY_ONE_NONE]};if(n.length>1)return{code:l.ONLY_ONE_EXCEEDED,message:c[l.ONLY_ONE_EXCEEDED]}}else if(!n)return{code:l.ONLY_ONE_NONE,message:c[l.ONLY_ONE_NONE]};break}}if(e==="email"&&typeof n=="string"&&n){let o=$(n);if(o)return o}if(e==="phone"&&typeof n=="string"&&n){let o=r.querySelector('input[type="tel"]');if(o){let i=G(o);if(i)return i}}return null}function _(e){let t=document.querySelectorAll("[pulse-form-block]"),n=[];return t.forEach(r=>{let o=r.getAttribute("pulse-form-block")?.trim().toLowerCase();if(!o||!R.includes(o))return;let i=o,m=r.getAttribute("pulse-field-name")?.trim();if(!m)return;let u=H(r),a=Z(r),f=v(i,r),d=e?S(i,u,f,r):null;n.push({"form-block":i,"field-name":m,value:f,required:u,"mirror-value":a,error:d})}),n}function M(){document.querySelectorAll(`.${g}`).forEach(e=>e.remove()),document.querySelectorAll("[pulse-form-block]").forEach(e=>e.classList.remove("has-error"))}function ee(e){let t=e.querySelector(`.${g}`);t&&t.remove(),e.classList.remove("has-error")}function P(e,t){let n=e.querySelector(`.${g}`);n&&n.remove();let r=document.createElement("span");r.className=g,r.textContent=t.message,r.setAttribute("data-error-code",t.code),r.setAttribute("data-field-name",e.getAttribute("pulse-field-name")?.trim()||""),e.classList.add("has-error"),e.appendChild(r)}function te(e){M(),document.querySelectorAll("[pulse-form-block]").forEach(n=>{let r=n.getAttribute("pulse-field-name")?.trim();if(!r)return;let o=e.find(i=>i["field-name"]===r);!o||!o.error||P(n,o.error)})}function ne(){let e=document.querySelector("[pulse-form-block].has-error");if(!e)return;e.scrollIntoView({behavior:"smooth",block:"center"});let t=e.querySelector("input, textarea, select");t&&setTimeout(()=>t.focus(),400)}function L(){let e=s.filter(n=>n["mirror-value"]===!0);if(e.length===0)return;let t=document.querySelectorAll("[pulse-form-block-mirror]");e.forEach(n=>{let r=n["field-name"],o=!1;t.forEach(i=>{if(i.getAttribute("pulse-form-block-mirror")?.trim()!==r)return;o=!0;let u=i.querySelector("input, textarea, select");if(!u){console.warn(`[PulseForm] Mirror target for "${r}" found, but no input element inside it.`);return}let a=n.value;typeof a=="string"?u.value=a:typeof a=="boolean"?u instanceof HTMLInputElement&&u.type==="checkbox"?u.checked=a:u.value=String(a):Array.isArray(a)?u.value=a.join(", "):u.value=""}),o||console.warn(`[PulseForm] No mirror target found for field "${r}". Add an element with attribute pulse-form-block-mirror="${r}" to mirror this value.`)})}var re={"Financial Services":"david",Sports:"steven",Beauty:"albany",Music:"steven","Customer Packaged Goods":"david",Other:"david"};function oe(){let e=s.find(r=>r["field-name"]==="industry");if(!e||typeof e.value!="string"||!e.value)return;let t=re[e.value];document.querySelectorAll("[hs-calender]").forEach(r=>{let o=r.getAttribute("hs-calender")?.trim();t&&o===t?r.setAttribute("hs-calender-active","true"):r.setAttribute("hs-calender-active","false")})}function p(){let e=s.find(r=>r["field-name"]==="flow-type");if(!e)return;let t=e.value;document.querySelectorAll("[form-flow]").forEach(r=>{r.getAttribute("form-flow")?.trim()===t?r.setAttribute("form-flow-active","true"):r.setAttribute("form-flow-active","false")}),t==="White Glove services"&&oe()}var s=[];function N(e,t,n){let r=s.findIndex(o=>o["field-name"]===e);r!==-1&&(s[r]={...s[r],value:t,error:n},window.PulseFormData=s,L(),p())}function le(e){let t=e.getAttribute("pulse-form-block")?.trim().toLowerCase(),n=e.getAttribute("pulse-field-name")?.trim();if(!n)return;let r=H(e),o=v(t,e);if(e.classList.contains("has-error")){let m=S(t,r,o,e);m?(P(e,m),N(n,o,m)):(ee(e),N(n,o,null))}else N(n,o,null)}function ie(){document.querySelectorAll("[pulse-form-block]").forEach(t=>{let n=t.getAttribute("pulse-form-block")?.trim().toLowerCase();if(!n||!R.includes(n))return;let r=()=>le(t);switch(n){case"text":case"email":{let o=t.querySelector("input, textarea");o&&(o.addEventListener("input",r),o.addEventListener("change",r));break}case"phone":{let o=t.querySelector('input[type="tel"]');o&&(o.addEventListener("input",r),o.addEventListener("change",r),o.addEventListener("keyup",r),o.addEventListener("countrychange",r));break}case"checkbox":case"legal":{t.querySelectorAll('input[type="checkbox"]').forEach(o=>o.addEventListener("change",r));break}case"radio":{t.querySelectorAll('input[type="radio"]').forEach(o=>o.addEventListener("change",r));break}case"select":{let o=t.querySelector("select");o&&o.addEventListener("change",r);break}}})}var se={get fields(){return s},refresh(){return s=_(!1),window.PulseFormData=s,L(),p(),s},validate(){let e=_(!0),t=e.every(n=>n.error===null);return s=e,window.PulseFormData=s,L(),p(),te(e),t||ne(),{fields:e,isValid:t}},clearErrors(){M(),s=s.map(e=>({...e,error:null})),window.PulseFormData=s,L(),p()},ERROR_CODES:l,ERROR_MESSAGES:c};document.addEventListener("DOMContentLoaded",()=>{let e=document.querySelectorAll("[pulse-form-block]").length;console.log(`[PulseForm] Initialized \u2014 found ${e} form blocks.`),Y(),s=_(!1),window.PulseFormData=s,L(),p(),ie(),window.PulseForm=se});function ue(){let e=["Jordan","Morgan","Riley","Avery","Quinn","Casey","Blake","Harper","Sage","Rowan"],t=["Nakamura","Lindqvist","Okafor","Brennan","Castellano","Pham","Eriksen","Moreira","Ashworth","Dubois"],n=["inbox.co","mailbox.org","zipmail.net","postly.io","demobox.dev"],r=d=>d[Math.floor(Math.random()*d.length)],o=()=>Math.random().toString(36).substring(2,8),i=r(e),m=r(t),u=`${i.toLowerCase()}.${o()}@${r(n)}`,a=`${2e9+Math.floor(Math.random()*8e9)}`,f={"first-name":i,"last-name":m,email:u,phone:a,"anything-else":"Ignore this is a test form submission"};Object.entries(f).forEach(([d,O])=>{let h=document.querySelector(`[pulse-field-name="${d}"]`);if(!h)return;if(d==="phone"){let E=h.querySelector('input[type="tel"]');if(!E)return;let b=y.get(E);b?b.setNumber(`+1${O}`):E.value=O,E.dispatchEvent(new Event("input",{bubbles:!0})),E.dispatchEvent(new Event("change",{bubbles:!0})),E.dispatchEvent(new Event("keyup",{bubbles:!0}));return}let T=d==="anything-else"?h.querySelector("textarea"):h.querySelector("input");T&&(T.value=O,T.dispatchEvent(new Event("input",{bubbles:!0})),T.dispatchEvent(new Event("change",{bubbles:!0})))}),console.log("[PulseForm][DEV] Auto-filled:",f)}setTimeout(ue,500);})();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/marquee/index.ts"],
4
- "sourcesContent": ["/**\n * rtstic-marquee TypeScript Implementation\n * Initializes infinite marquee with error checking and warnings\n */\n\ninterface MarqueeConfig {\n multiplier: number;\n duration: number;\n selector: string;\n}\n\nconst DEFAULT_CONFIG: MarqueeConfig = {\n multiplier: 4,\n duration: 100,\n selector: \"[rtstic-marquee='list']\"\n};\n\n/**\n * Initialize the marquee component\n * @param config - Configuration object for marquee\n * @returns boolean - Success status\n */\nfunction initializeMarquee(config: MarqueeConfig = DEFAULT_CONFIG): boolean {\n try {\n // Validate config\n if (!config.multiplier || config.multiplier < 2) {\n console.warn('[rtstic-marquee] Warning: multiplier should be at least 2, using default of 4');\n config.multiplier = DEFAULT_CONFIG.multiplier;\n }\n\n if (!config.duration || config.duration <= 0) {\n console.warn('[rtstic-marquee] Warning: duration should be greater than 0, using default of 20');\n config.duration = DEFAULT_CONFIG.duration;\n }\n\n // Find marquee element\n const marquee: HTMLElement | null = document.querySelector(config.selector);\n\n if (!marquee) {\n console.error(`[rtstic-marquee] Error: Element with selector \"${config.selector}\" not found`);\n return false;\n }\n\n // Check if marquee has content\n const originalHTML: string = marquee.innerHTML;\n if (!originalHTML.trim()) {\n console.warn('[rtstic-marquee] Warning: Marquee element is empty');\n return false;\n }\n\n // Create duplicated content\n let duplicatedHTML: string = '';\n for (let i = 0; i < config.multiplier; i++) {\n duplicatedHTML += originalHTML;\n }\n\n marquee.innerHTML = duplicatedHTML;\n\n // Set CSS variables\n marquee.style.setProperty('--multiplier', config.multiplier.toString());\n marquee.style.setProperty('--duration', `${config.duration / config.multiplier}s`);\n\n console.log(`[rtstic-marquee] Successfully initialized with multiplier: ${config.multiplier}, duration: ${config.duration}s`);\n return true;\n } catch (error: unknown) {\n if (error instanceof Error) {\n console.error(`[rtstic-marquee] Error: ${error.message}`);\n } else {\n console.error('[rtstic-marquee] Error: An unknown error occurred');\n }\n return false;\n }\n}\n\n/**\n * Initialize on DOM load\n */\nfunction onDOMReady(): void {\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', () => {\n initializeMarquee();\n });\n } else {\n // DOM is already ready\n initializeMarquee();\n }\n}\n\n// Start initialization\nonDOMReady();\n\n// Export for use in other modules if needed\nexport { initializeMarquee, DEFAULT_CONFIG };\nexport type { MarqueeConfig };"],
5
- "mappings": ";;;AAWA,MAAM,iBAAgC;AAAA,IAClC,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,UAAU;AAAA,EACd;AAOA,WAAS,kBAAkB,SAAwB,gBAAyB;AACxE,QAAI;AAEA,UAAI,CAAC,OAAO,cAAc,OAAO,aAAa,GAAG;AAC7C,gBAAQ,KAAK,+EAA+E;AAC5F,eAAO,aAAa,eAAe;AAAA,MACvC;AAEA,UAAI,CAAC,OAAO,YAAY,OAAO,YAAY,GAAG;AAC1C,gBAAQ,KAAK,kFAAkF;AAC/F,eAAO,WAAW,eAAe;AAAA,MACrC;AAGA,YAAM,UAA8B,SAAS,cAAc,OAAO,QAAQ;AAE1E,UAAI,CAAC,SAAS;AACV,gBAAQ,MAAM,kDAAkD,OAAO,QAAQ,aAAa;AAC5F,eAAO;AAAA,MACX;AAGA,YAAM,eAAuB,QAAQ;AACrC,UAAI,CAAC,aAAa,KAAK,GAAG;AACtB,gBAAQ,KAAK,oDAAoD;AACjE,eAAO;AAAA,MACX;AAGA,UAAI,iBAAyB;AAC7B,eAAS,IAAI,GAAG,IAAI,OAAO,YAAY,KAAK;AACxC,0BAAkB;AAAA,MACtB;AAEA,cAAQ,YAAY;AAGpB,cAAQ,MAAM,YAAY,gBAAgB,OAAO,WAAW,SAAS,CAAC;AACtE,cAAQ,MAAM,YAAY,cAAc,GAAG,OAAO,WAAW,OAAO,UAAU,GAAG;AAEjF,cAAQ,IAAI,8DAA8D,OAAO,UAAU,eAAe,OAAO,QAAQ,GAAG;AAC5H,aAAO;AAAA,IACX,SAAS,OAAgB;AACrB,UAAI,iBAAiB,OAAO;AACxB,gBAAQ,MAAM,2BAA2B,MAAM,OAAO,EAAE;AAAA,MAC5D,OAAO;AACH,gBAAQ,MAAM,mDAAmD;AAAA,MACrE;AACA,aAAO;AAAA,IACX;AAAA,EACJ;AAKA,WAAS,aAAmB;AACxB,QAAI,SAAS,eAAe,WAAW;AACnC,eAAS,iBAAiB,oBAAoB,MAAM;AAChD,0BAAkB;AAAA,MACtB,CAAC;AAAA,IACL,OAAO;AAEH,wBAAkB;AAAA,IACtB;AAAA,EACJ;AAGA,aAAW;",
4
+ "sourcesContent": ["export { };\n// \u2500\u2500\u2500 Types \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nconsole.log(\"Book a demo form script loaded\");\n\ntype FormBlockType = \"text\" | \"email\" | \"phone\" | \"checkbox\" | \"radio\" | \"select\" | \"legal\";\ntype RequiredSelection = \"true\" | \"atleast-one\" | \"only-one\";\n\ninterface PulseFormField {\n \"form-block\": FormBlockType;\n \"field-name\": string;\n value: string | string[] | boolean | null;\n required: RequiredSelection | null;\n \"mirror-value\": boolean;\n error: { code: string; message: string } | null;\n}\n\n// \u2500\u2500\u2500 Constants \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst VALID_BLOCK_TYPES: FormBlockType[] = [\n \"text\",\n \"email\",\n \"phone\",\n \"checkbox\",\n \"radio\",\n \"select\",\n \"legal\",\n];\n\nconst VALID_REQUIRED_VALUES: RequiredSelection[] = [\n \"true\",\n \"atleast-one\",\n \"only-one\",\n];\n\n// \u2500\u2500\u2500 Error Codes & Messages \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst ERROR_CODES = {\n REQUIRED_INPUT: \"ERR_REQUIRED\",\n REQUIRED_LEGAL: \"ERR_LEGAL_REQUIRED\",\n REQUIRED_SELECT: \"ERR_SELECT_REQUIRED\",\n ATLEAST_ONE: \"ERR_ATLEAST_ONE\",\n ONLY_ONE_NONE: \"ERR_ONLY_ONE_NONE\",\n ONLY_ONE_EXCEEDED: \"ERR_ONLY_ONE_EXCEEDED\",\n INVALID_EMAIL: \"ERR_INVALID_EMAIL\",\n INVALID_PHONE: \"ERR_INVALID_PHONE\",\n PHONE_TOO_SHORT: \"ERR_PHONE_TOO_SHORT\",\n PHONE_TOO_LONG: \"ERR_PHONE_TOO_LONG\",\n PHONE_INVALID_COUNTRY: \"ERR_PHONE_INVALID_COUNTRY\",\n} as const;\n\nconst ERROR_MESSAGES: Record<string, string> = {\n [ERROR_CODES.REQUIRED_INPUT]: \"This field is required.\",\n [ERROR_CODES.REQUIRED_LEGAL]: \"You must accept this to continue.\",\n [ERROR_CODES.REQUIRED_SELECT]: \"Please select an option.\",\n [ERROR_CODES.ATLEAST_ONE]: \"Please select at least one option.\",\n [ERROR_CODES.ONLY_ONE_NONE]: \"Please select one option.\",\n [ERROR_CODES.ONLY_ONE_EXCEEDED]: \"Only one option can be selected.\",\n [ERROR_CODES.INVALID_EMAIL]: \"Please enter a valid email address.\",\n [ERROR_CODES.INVALID_PHONE]: \"Please enter a valid phone number.\",\n [ERROR_CODES.PHONE_TOO_SHORT]: \"Phone number is too short.\",\n [ERROR_CODES.PHONE_TOO_LONG]: \"Phone number is too long.\",\n [ERROR_CODES.PHONE_INVALID_COUNTRY]: \"Invalid country code.\",\n};\n\nconst ERROR_SPAN_CLASS = \"pulse-form-error\";\n\n// \u2500\u2500\u2500 intl-tel-input \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst itiInstances = new Map<HTMLInputElement, any>();\n\nfunction fillCountryCodeInput(iti: any): void {\n try {\n const countryData = iti.getSelectedCountryData?.();\n if (!countryData?.dialCode) return;\n\n const inputs = document.querySelectorAll<HTMLInputElement>(\n 'input[pulse-form-field=\"country-code\"]'\n );\n inputs.forEach((input) => {\n input.value = `+${countryData.dialCode}`;\n });\n } catch (err) {\n console.warn(\"[PulseForm] Error filling country code:\", err);\n }\n}\n\nfunction initIntlTelInput(): void {\n const intlTelInput = (window as any).intlTelInput;\n if (!intlTelInput) {\n console.warn(\n \"[PulseForm] intlTelInput not found on window. \" +\n \"Make sure you include the intl-tel-input script before this script.\\n\" +\n 'e.g. <script src=\"https://cdn.jsdelivr.net/npm/intl-tel-input@25/build/js/intlTelInput.min.js\"></script>'\n );\n return;\n }\n\n const phoneInputs = document.querySelectorAll<HTMLInputElement>(\n '[pulse-form-block=\"phone\"] input[type=\"tel\"]'\n );\n\n phoneInputs.forEach((input) => {\n try {\n const iti = intlTelInput(input, {\n initialCountry: \"us\",\n separateDialCode: true,\n strictMode: false,\n // @ts-ignore \u2014 runtime CDN import, not a TS module\n loadUtils: () => import(\"https://cdn.jsdelivr.net/npm/intl-tel-input@25/build/js/utils.js\"),\n });\n\n itiInstances.set(input, iti);\n\n fillCountryCodeInput(iti);\n\n input.addEventListener(\"countrychange\", () => {\n fillCountryCodeInput(iti);\n });\n\n console.log(\n `[PulseForm] intl-tel-input initialized for \"${input.closest(\"[pulse-form-block]\")?.getAttribute(\"pulse-field-name\") || \"unknown\"}\"`\n );\n } catch (err) {\n console.warn(\"[PulseForm] Failed to init intl-tel-input:\", err);\n }\n });\n}\n\n// \u2500\u2500\u2500 Format Validators \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst PHONE_ITI_ERROR_MAP: Record<number, string> = {\n 0: ERROR_CODES.INVALID_PHONE,\n 1: ERROR_CODES.PHONE_INVALID_COUNTRY,\n 2: ERROR_CODES.PHONE_TOO_SHORT,\n 3: ERROR_CODES.PHONE_TOO_LONG,\n 4: ERROR_CODES.INVALID_PHONE,\n};\n\nfunction validateEmail(value: string): PulseFormField[\"error\"] {\n if (!value) return null;\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (!emailRegex.test(value)) {\n return { code: ERROR_CODES.INVALID_EMAIL, message: ERROR_MESSAGES[ERROR_CODES.INVALID_EMAIL] };\n }\n return null;\n}\n\nfunction validatePhone(input: HTMLInputElement): PulseFormField[\"error\"] {\n const value = input.value.trim();\n if (!value) return null;\n\n const iti = itiInstances.get(input);\n\n if (iti) {\n try {\n if (iti.isValidNumber()) return null;\n const errorCode: number = iti.getValidationError?.() ?? 0;\n const code = PHONE_ITI_ERROR_MAP[errorCode] || ERROR_CODES.INVALID_PHONE;\n return { code, message: ERROR_MESSAGES[code] };\n } catch {\n return { code: ERROR_CODES.INVALID_PHONE, message: ERROR_MESSAGES[ERROR_CODES.INVALID_PHONE] };\n }\n }\n\n // Fallback: basic digit length\n const digits = value.replace(/\\D/g, \"\");\n if (digits.length < 7)\n return { code: ERROR_CODES.PHONE_TOO_SHORT, message: ERROR_MESSAGES[ERROR_CODES.PHONE_TOO_SHORT] };\n if (digits.length > 15)\n return { code: ERROR_CODES.PHONE_TOO_LONG, message: ERROR_MESSAGES[ERROR_CODES.PHONE_TOO_LONG] };\n return null;\n}\n\n// \u2500\u2500\u2500 Value Extractors \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction extractTextValue(wrapper: HTMLElement): string | null {\n const input = wrapper.querySelector<HTMLInputElement | HTMLTextAreaElement>(\n \"input, textarea\"\n );\n if (!input) return null;\n return input.value.trim();\n}\n\nfunction extractEmailValue(wrapper: HTMLElement): string | null {\n const input = wrapper.querySelector<HTMLInputElement>('input[type=\"email\"]');\n if (!input) return null;\n return input.value.trim();\n}\n\nfunction extractPhoneValue(wrapper: HTMLElement): string | null {\n const input = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (!input) return null;\n return input.value.trim();\n}\n\nfunction extractCheckboxValues(wrapper: HTMLElement): string[] {\n const checkboxes = wrapper.querySelectorAll<HTMLInputElement>(\n 'input[type=\"checkbox\"]'\n );\n const values: string[] = [];\n checkboxes.forEach((cb) => {\n if (cb.checked) {\n const name = cb.getAttribute(\"data-name\")?.trim();\n values.push(name || cb.value || \"on\");\n }\n });\n return values;\n}\n\nfunction extractRadioValue(wrapper: HTMLElement): string | null {\n const radios = wrapper.querySelectorAll<HTMLInputElement>(\n 'input[type=\"radio\"]'\n );\n for (const radio of radios) {\n if (radio.checked) {\n const label = radio.closest(\"label\")?.textContent?.trim();\n return label || radio.value || \"on\";\n }\n }\n return null;\n}\n\nfunction extractSelectValue(wrapper: HTMLElement): string | null {\n const select = wrapper.querySelector<HTMLSelectElement>(\"select\");\n if (!select) return null;\n const val = select.value.trim();\n if (!val || select.selectedIndex === 0) return null;\n return val;\n}\n\nfunction extractLegalValue(wrapper: HTMLElement): boolean {\n const checkbox = wrapper.querySelector<HTMLInputElement>(\n 'input[type=\"checkbox\"]'\n );\n if (!checkbox) return false;\n return checkbox.checked;\n}\n\n// \u2500\u2500\u2500 Core Parser \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction extractValue(\n type: FormBlockType,\n wrapper: HTMLElement\n): PulseFormField[\"value\"] {\n switch (type) {\n case \"text\":\n return extractTextValue(wrapper);\n case \"email\":\n return extractEmailValue(wrapper);\n case \"phone\":\n return extractPhoneValue(wrapper);\n case \"checkbox\":\n return extractCheckboxValues(wrapper);\n case \"radio\":\n return extractRadioValue(wrapper);\n case \"select\":\n return extractSelectValue(wrapper);\n case \"legal\":\n return extractLegalValue(wrapper);\n default:\n return null;\n }\n}\n\nfunction parseRequired(wrapper: HTMLElement): RequiredSelection | null {\n const raw = wrapper.getAttribute(\"required-selection\")?.trim().toLowerCase();\n if (!raw || !VALID_REQUIRED_VALUES.includes(raw as RequiredSelection))\n return null;\n return raw as RequiredSelection;\n}\n\nfunction parseMirrorValue(wrapper: HTMLElement): boolean {\n return wrapper.getAttribute(\"mirror-value\")?.trim().toLowerCase() === \"true\";\n}\n\n// \u2500\u2500\u2500 Validation Logic (per field) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction getFieldError(\n type: FormBlockType,\n required: RequiredSelection | null,\n value: PulseFormField[\"value\"],\n wrapper: HTMLElement\n): PulseFormField[\"error\"] {\n // 1. Required checks\n if (required) {\n switch (required) {\n case \"true\": {\n if (type === \"legal\" && value !== true)\n return { code: ERROR_CODES.REQUIRED_LEGAL, message: ERROR_MESSAGES[ERROR_CODES.REQUIRED_LEGAL] };\n if (type === \"select\" && !value)\n return { code: ERROR_CODES.REQUIRED_SELECT, message: ERROR_MESSAGES[ERROR_CODES.REQUIRED_SELECT] };\n if (\n (type === \"text\" || type === \"email\" || type === \"phone\") &&\n (!value || (typeof value === \"string\" && value === \"\"))\n )\n return { code: ERROR_CODES.REQUIRED_INPUT, message: ERROR_MESSAGES[ERROR_CODES.REQUIRED_INPUT] };\n break;\n }\n\n case \"atleast-one\": {\n const empty = Array.isArray(value) ? value.length === 0 : !value;\n if (empty)\n return { code: ERROR_CODES.ATLEAST_ONE, message: ERROR_MESSAGES[ERROR_CODES.ATLEAST_ONE] };\n break;\n }\n\n case \"only-one\": {\n if (Array.isArray(value)) {\n if (value.length === 0)\n return { code: ERROR_CODES.ONLY_ONE_NONE, message: ERROR_MESSAGES[ERROR_CODES.ONLY_ONE_NONE] };\n if (value.length > 1)\n return { code: ERROR_CODES.ONLY_ONE_EXCEEDED, message: ERROR_MESSAGES[ERROR_CODES.ONLY_ONE_EXCEEDED] };\n } else if (!value) {\n return { code: ERROR_CODES.ONLY_ONE_NONE, message: ERROR_MESSAGES[ERROR_CODES.ONLY_ONE_NONE] };\n }\n break;\n }\n }\n }\n\n // 2. Format checks (only when there's a value)\n if (type === \"email\" && typeof value === \"string\" && value) {\n const emailError = validateEmail(value);\n if (emailError) return emailError;\n }\n\n if (type === \"phone\" && typeof value === \"string\" && value) {\n const phoneInput = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (phoneInput) {\n const phoneError = validatePhone(phoneInput);\n if (phoneError) return phoneError;\n }\n }\n\n return null;\n}\n\n// \u2500\u2500\u2500 Collect Fields \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction collectFormFields(withValidation: boolean): PulseFormField[] {\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n const fields: PulseFormField[] = [];\n\n wrappers.forEach((wrapper) => {\n const rawType = wrapper\n .getAttribute(\"pulse-form-block\")\n ?.trim()\n .toLowerCase();\n\n if (!rawType || !VALID_BLOCK_TYPES.includes(rawType as FormBlockType))\n return;\n\n const blockType = rawType as FormBlockType;\n const fieldName = wrapper.getAttribute(\"pulse-field-name\")?.trim();\n if (!fieldName) return;\n\n const required = parseRequired(wrapper);\n const mirrorValue = parseMirrorValue(wrapper);\n const value = extractValue(blockType, wrapper);\n const error = withValidation\n ? getFieldError(blockType, required, value, wrapper)\n : null;\n\n fields.push({\n \"form-block\": blockType,\n \"field-name\": fieldName,\n value,\n required,\n \"mirror-value\": mirrorValue,\n error,\n });\n });\n\n return fields;\n}\n\n// \u2500\u2500\u2500 Error UI \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction clearAllErrors(): void {\n document\n .querySelectorAll<HTMLElement>(`.${ERROR_SPAN_CLASS}`)\n .forEach((el) => el.remove());\n\n document\n .querySelectorAll<HTMLElement>(\"[pulse-form-block]\")\n .forEach((el) => el.classList.remove(\"has-error\"));\n}\n\nfunction clearErrorOnWrapper(wrapper: HTMLElement): void {\n const span = wrapper.querySelector(`.${ERROR_SPAN_CLASS}`);\n if (span) span.remove();\n wrapper.classList.remove(\"has-error\");\n}\n\nfunction showErrorOnWrapper(\n wrapper: HTMLElement,\n error: { code: string; message: string }\n): void {\n const existing = wrapper.querySelector(`.${ERROR_SPAN_CLASS}`);\n if (existing) existing.remove();\n\n const span = document.createElement(\"span\");\n span.className = ERROR_SPAN_CLASS;\n span.textContent = error.message;\n span.setAttribute(\"data-error-code\", error.code);\n span.setAttribute(\n \"data-field-name\",\n wrapper.getAttribute(\"pulse-field-name\")?.trim() || \"\"\n );\n\n wrapper.classList.add(\"has-error\");\n wrapper.appendChild(span);\n}\n\nfunction renderErrors(fields: PulseFormField[]): void {\n clearAllErrors();\n\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n\n wrappers.forEach((wrapper) => {\n const fieldName = wrapper.getAttribute(\"pulse-field-name\")?.trim();\n if (!fieldName) return;\n\n const field = fields.find((f) => f[\"field-name\"] === fieldName);\n if (!field || !field.error) return;\n\n showErrorOnWrapper(wrapper, field.error);\n });\n}\n\nfunction focusFirstError(): void {\n const first = document.querySelector<HTMLElement>(\n `[pulse-form-block].has-error`\n );\n if (!first) return;\n\n first.scrollIntoView({ behavior: \"smooth\", block: \"center\" });\n\n const focusable = first.querySelector<HTMLElement>(\n \"input, textarea, select\"\n );\n if (focusable) setTimeout(() => focusable.focus(), 400);\n}\n\n// \u2500\u2500\u2500 Mirror Value Fill \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction fillMirrorValues(): void {\n // 1. Get all fields with mirror-value true\n const mirrorFields = _currentFields.filter((f) => f[\"mirror-value\"] === true);\n if (mirrorFields.length === 0) return;\n\n // 2. Select all mirror target elements\n const mirrorTargets = document.querySelectorAll<HTMLElement>(\"[pulse-form-block-mirror]\");\n\n // 3. For each mirror field, find matching target and fill\n mirrorFields.forEach((field) => {\n const fieldName = field[\"field-name\"];\n let found = false;\n\n mirrorTargets.forEach((target) => {\n const mirrorAttr = target.getAttribute(\"pulse-form-block-mirror\")?.trim();\n if (mirrorAttr !== fieldName) return;\n\n found = true;\n\n // Find the input inside the mirror target and fill it\n const input = target.querySelector<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>(\n \"input, textarea, select\"\n );\n\n if (!input) {\n console.warn(\n `[PulseForm] Mirror target for \"${fieldName}\" found, but no input element inside it.`\n );\n return;\n }\n\n // Set value based on type\n const value = field.value;\n if (typeof value === \"string\") {\n input.value = value;\n } else if (typeof value === \"boolean\") {\n if (input instanceof HTMLInputElement && input.type === \"checkbox\") {\n input.checked = value;\n } else {\n input.value = String(value);\n }\n } else if (Array.isArray(value)) {\n input.value = value.join(\", \");\n } else {\n input.value = \"\";\n }\n });\n\n if (!found) {\n console.warn(\n `[PulseForm] No mirror target found for field \"${fieldName}\". ` +\n `Add an element with attribute pulse-form-block-mirror=\"${fieldName}\" to mirror this value.`\n );\n }\n });\n}\n\n// \u2500\u2500\u2500 Flow Type \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst INDUSTRY_CALENDER_MAP: Record<string, string> = {\n \"Financial Services\": \"david\",\n \"Sports\": \"steven\",\n \"Beauty\": \"albany\",\n \"Music\": \"steven\",\n \"Customer Packaged Goods\": \"david\",\n \"Other\": \"david\",\n};\n\nfunction setWhiteGloveCalender(): void {\n // 1. Get the value of field-name=\"industry\" from the JSON\n const industryField = _currentFields.find((f) => f[\"field-name\"] === \"industry\");\n if (!industryField || typeof industryField.value !== \"string\" || !industryField.value) return;\n\n const activePerson = INDUSTRY_CALENDER_MAP[industryField.value];\n\n // 2. Select all elements with attribute \"hs-calender\"\n const calenderElements = document.querySelectorAll<HTMLElement>(\"[hs-calender]\");\n\n // 3. Set hs-calender-active based on matching person\n calenderElements.forEach((el) => {\n const elCalenderValue = el.getAttribute(\"hs-calender\")?.trim();\n if (activePerson && elCalenderValue === activePerson) {\n el.setAttribute(\"hs-calender-active\", \"true\");\n } else {\n el.setAttribute(\"hs-calender-active\", \"false\");\n }\n });\n}\n\nfunction updateFlowType(): void {\n // 1. Get the value of field-name=\"flow-type\" from the JSON\n const flowField = _currentFields.find((f) => f[\"field-name\"] === \"flow-type\");\n if (!flowField) return;\n\n const flowValue = flowField.value;\n\n // 2. Select all elements with attribute \"form-flow\"\n const flowElements = document.querySelectorAll<HTMLElement>(\"[form-flow]\");\n\n // 3. Set form-flow-active based on matching value\n flowElements.forEach((el) => {\n const elFlowValue = el.getAttribute(\"form-flow\")?.trim();\n if (elFlowValue === flowValue) {\n el.setAttribute(\"form-flow-active\", \"true\");\n } else {\n el.setAttribute(\"form-flow-active\", \"false\");\n }\n });\n\n // 4. If White Glove services, update calender assignments\n if (flowValue === \"White Glove services\") {\n setWhiteGloveCalender();\n }\n}\n\n// \u2500\u2500\u2500 Reactive State \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nlet _currentFields: PulseFormField[] = [];\n\nfunction updateFieldInState(\n fieldName: string,\n value: PulseFormField[\"value\"],\n error: PulseFormField[\"error\"]\n): void {\n const idx = _currentFields.findIndex((f) => f[\"field-name\"] === fieldName);\n if (idx === -1) return;\n _currentFields[idx] = { ..._currentFields[idx], value, error };\n (window as any).PulseFormData = _currentFields;\n fillMirrorValues();\n updateFlowType();\n}\n\nfunction handleFieldChange(wrapper: HTMLElement): void {\n const rawType = wrapper\n .getAttribute(\"pulse-form-block\")\n ?.trim()\n .toLowerCase() as FormBlockType;\n const fieldName = wrapper.getAttribute(\"pulse-field-name\")?.trim();\n if (!fieldName) return;\n\n const required = parseRequired(wrapper);\n const value = extractValue(rawType, wrapper);\n const hasError = wrapper.classList.contains(\"has-error\");\n\n if (hasError) {\n const error = getFieldError(rawType, required, value, wrapper);\n if (!error) {\n clearErrorOnWrapper(wrapper);\n updateFieldInState(fieldName, value, null);\n } else {\n showErrorOnWrapper(wrapper, error);\n updateFieldInState(fieldName, value, error);\n }\n } else {\n updateFieldInState(fieldName, value, null);\n }\n}\n\nfunction bindChangeListeners(): void {\n const wrappers = document.querySelectorAll<HTMLElement>(\"[pulse-form-block]\");\n\n wrappers.forEach((wrapper) => {\n const type = wrapper\n .getAttribute(\"pulse-form-block\")\n ?.trim()\n .toLowerCase() as FormBlockType | undefined;\n\n if (!type || !VALID_BLOCK_TYPES.includes(type)) return;\n\n const onChange = () => handleFieldChange(wrapper);\n\n switch (type) {\n case \"text\":\n case \"email\": {\n const input = wrapper.querySelector<HTMLInputElement | HTMLTextAreaElement>(\n \"input, textarea\"\n );\n if (input) {\n input.addEventListener(\"input\", onChange);\n input.addEventListener(\"change\", onChange);\n }\n break;\n }\n\n case \"phone\": {\n const phoneInput = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (phoneInput) {\n phoneInput.addEventListener(\"input\", onChange);\n phoneInput.addEventListener(\"change\", onChange);\n phoneInput.addEventListener(\"keyup\", onChange);\n phoneInput.addEventListener(\"countrychange\", onChange);\n }\n break;\n }\n\n case \"checkbox\":\n case \"legal\": {\n wrapper\n .querySelectorAll<HTMLInputElement>('input[type=\"checkbox\"]')\n .forEach((cb) => cb.addEventListener(\"change\", onChange));\n break;\n }\n\n case \"radio\": {\n wrapper\n .querySelectorAll<HTMLInputElement>('input[type=\"radio\"]')\n .forEach((r) => r.addEventListener(\"change\", onChange));\n break;\n }\n\n case \"select\": {\n const select = wrapper.querySelector<HTMLSelectElement>(\"select\");\n if (select) select.addEventListener(\"change\", onChange);\n break;\n }\n }\n });\n}\n\n// \u2500\u2500\u2500 Public API \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst PulseForm = {\n get fields(): PulseFormField[] {\n return _currentFields;\n },\n\n refresh(): PulseFormField[] {\n _currentFields = collectFormFields(false);\n (window as any).PulseFormData = _currentFields;\n fillMirrorValues();\n updateFlowType();\n return _currentFields;\n },\n\n validate(): { fields: PulseFormField[]; isValid: boolean } {\n const fields = collectFormFields(true);\n const isValid = fields.every((f) => f.error === null);\n\n _currentFields = fields;\n (window as any).PulseFormData = _currentFields;\n fillMirrorValues();\n updateFlowType();\n\n renderErrors(fields);\n if (!isValid) focusFirstError();\n\n return { fields, isValid };\n },\n\n clearErrors(): void {\n clearAllErrors();\n _currentFields = _currentFields.map((f) => ({ ...f, error: null }));\n (window as any).PulseFormData = _currentFields;\n fillMirrorValues();\n updateFlowType();\n },\n\n ERROR_CODES,\n ERROR_MESSAGES,\n};\n\n// \u2500\u2500\u2500 Initialize on DOM Ready \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n const count = document.querySelectorAll(\"[pulse-form-block]\").length;\n console.log(`[PulseForm] Initialized \u2014 found ${count} form blocks.`);\n\n initIntlTelInput();\n\n _currentFields = collectFormFields(false);\n (window as any).PulseFormData = _currentFields;\n fillMirrorValues();\n updateFlowType();\n\n bindChangeListeners();\n\n (window as any).PulseForm = PulseForm;\n});\n\n// \u2500\u2500\u2500 \u26A0\uFE0F DEV ONLY \u2014 Remove or disable in production \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction devAutoFill(): void {\n const firstNames = [\"Jordan\", \"Morgan\", \"Riley\", \"Avery\", \"Quinn\", \"Casey\", \"Blake\", \"Harper\", \"Sage\", \"Rowan\"];\n const lastNames = [\"Nakamura\", \"Lindqvist\", \"Okafor\", \"Brennan\", \"Castellano\", \"Pham\", \"Eriksen\", \"Moreira\", \"Ashworth\", \"Dubois\"];\n const domains = [\"inbox.co\", \"mailbox.org\", \"zipmail.net\", \"postly.io\", \"demobox.dev\"];\n\n const pick = (arr: string[]) => arr[Math.floor(Math.random() * arr.length)];\n const rand = () => Math.random().toString(36).substring(2, 8);\n\n const firstName = pick(firstNames);\n const lastName = pick(lastNames);\n const email = `${firstName.toLowerCase()}.${rand()}@${pick(domains)}`;\n const phone = `${2000000000 + Math.floor(Math.random() * 8000000000)}`;\n\n const fieldMap: Record<string, string> = {\n \"first-name\": firstName,\n \"last-name\": lastName,\n \"email\": email,\n \"phone\": phone,\n \"anything-else\": \"Ignore this is a test form submission\",\n };\n\n Object.entries(fieldMap).forEach(([fieldName, value]) => {\n const wrapper = document.querySelector<HTMLElement>(\n `[pulse-field-name=\"${fieldName}\"]`\n );\n if (!wrapper) return;\n\n if (fieldName === \"phone\") {\n const phoneInput = wrapper.querySelector<HTMLInputElement>('input[type=\"tel\"]');\n if (!phoneInput) return;\n const iti = itiInstances.get(phoneInput);\n if (iti) {\n iti.setNumber(`+1${value}`);\n } else {\n phoneInput.value = value;\n }\n phoneInput.dispatchEvent(new Event(\"input\", { bubbles: true }));\n phoneInput.dispatchEvent(new Event(\"change\", { bubbles: true }));\n phoneInput.dispatchEvent(new Event(\"keyup\", { bubbles: true }));\n return;\n }\n\n const el = fieldName === \"anything-else\"\n ? wrapper.querySelector<HTMLTextAreaElement>(\"textarea\")\n : wrapper.querySelector<HTMLInputElement>(\"input\");\n if (!el) return;\n\n el.value = value;\n el.dispatchEvent(new Event(\"input\", { bubbles: true }));\n el.dispatchEvent(new Event(\"change\", { bubbles: true }));\n });\n\n console.log(\"[PulseForm][DEV] Auto-filled:\", fieldMap);\n}\n\nsetTimeout(devAutoFill, 500);\n// \u2500\u2500\u2500 \u26A0\uFE0F END DEV ONLY \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,UAAQ,IAAI,gCAAgC;AAgB5C,MAAM,oBAAqC;AAAA,IACvC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAEA,MAAM,wBAA6C;AAAA,IAC/C;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAIA,MAAM,cAAc;AAAA,IAChB,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,eAAe;AA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ACX,SAAG,cAAc,IAAI,MAAM,SAAS,EAAE,SAAS,KAAK,CAAC,CAAC;AACtD,SAAG,cAAc,IAAI,MAAM,UAAU,EAAE,SAAS,KAAK,CAAC,CAAC;AAAA,IAC3D,CAAC;AAED,YAAQ,IAAI,iCAAiC,QAAQ;AAAA,EACzD;AAEA,aAAW,aAAa,GAAG;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtstic.dev/pulse",
3
- "version": "0.0.31",
3
+ "version": "0.0.33",
4
4
  "description": "pulse website",
5
5
  "license": "license-of-your-project",
6
6
  "keywords": [],