@rtstic.dev/pulse 0.0.61 → 0.0.64
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.
- package/dist/form/book-a-demo.js +2 -679
- package/dist/form/index.js +7 -11382
- package/dist/form/index.js.map +2 -2
- package/dist/form/pricing.css +0 -2
- package/dist/form/pricing.js +7 -11139
- package/dist/form/styles.css +1 -140
- package/dist/form/utm-propagation.js +1 -0
- package/dist/form/utm-propagation.js.map +7 -0
- package/dist/global/accordions-v2.js +1 -262
- package/dist/global/accordions.js +1 -237
- package/dist/global/faqs.js +1 -124
- package/dist/global/loader.js +1 -76
- package/dist/global/styles.css +1 -252
- package/dist/home/depth.js +3 -243
- package/dist/home/hero-animation/loader.js +8164 -74577
- package/dist/home/hero-animation/scroll.js +1 -401
- package/dist/home/hero-animation/styles.css +1 -233
- package/dist/home/hero-animation/torch.js +1 -62
- package/dist/home/horizontal-scroll.css +1 -49
- package/dist/home/horizontal-scroll.js +1 -140
- package/dist/home/tabs-v2.js +1 -134
- package/dist/home/tabs.js +1 -163
- package/dist/lever/styles.css +1 -31
- package/dist/marquee/index.js +2 -557
- package/dist/marquee/styles.css +1 -26
- package/dist/slider/freescroll-cards.js +1 -51
- package/dist/slider/freescroll-slider.js +1 -31
- package/dist/slider/testimonial.js +1 -30
- package/package.json +1 -1
package/dist/form/styles.css
CHANGED
|
@@ -1,140 +1 @@
|
|
|
1
|
-
|
|
2
|
-
.w-form-formradioinput--inputType-custom.w--redirected-focus {
|
|
3
|
-
box-shadow: none;
|
|
4
|
-
}
|
|
5
|
-
.radio-checked {
|
|
6
|
-
display: none;
|
|
7
|
-
}
|
|
8
|
-
.w-form-formradioinput.w--redirected-checked ~ .radio-checked {
|
|
9
|
-
display: flex;
|
|
10
|
-
}
|
|
11
|
-
.w-checkbox-input--inputType-custom.w--redirected-focus {
|
|
12
|
-
box-shadow: none;
|
|
13
|
-
}
|
|
14
|
-
.w-input:focus,
|
|
15
|
-
.w-select:focus {
|
|
16
|
-
border-color: transparent;
|
|
17
|
-
outline: 0;
|
|
18
|
-
}
|
|
19
|
-
.radio-inner-label {
|
|
20
|
-
color: var(--text-colors--subtext);
|
|
21
|
-
}
|
|
22
|
-
input[type=radio]:checked + .radio-inner-label {
|
|
23
|
-
color: var(--text-colors--title);
|
|
24
|
-
}
|
|
25
|
-
.checkbox-label {
|
|
26
|
-
color: var(--text-colors--subtext);
|
|
27
|
-
}
|
|
28
|
-
input[type=checkbox]:checked + .checkbox-label {
|
|
29
|
-
color: var(--text-colors--title);
|
|
30
|
-
}
|
|
31
|
-
.w-checkbox-input--inputType-custom.w--redirected-checked {
|
|
32
|
-
background-color: #F66025;
|
|
33
|
-
border-color: #F66025;
|
|
34
|
-
}
|
|
35
|
-
input[type=checkbox]:checked + .checkbox-label {
|
|
36
|
-
color: var(--text-colors--title);
|
|
37
|
-
}
|
|
38
|
-
.checkbox-field:has(input[type=checkbox]:checked) {
|
|
39
|
-
border-color: #F66025;
|
|
40
|
-
}
|
|
41
|
-
.radio-inner-label,
|
|
42
|
-
.checkbox-label {
|
|
43
|
-
transition: color 300ms ease;
|
|
44
|
-
}
|
|
45
|
-
.checkbox-field {
|
|
46
|
-
transition: border-color 300ms ease;
|
|
47
|
-
}
|
|
48
|
-
.w-checkbox-input--inputType-custom {
|
|
49
|
-
transition: background-color 300ms ease, border-color 300ms ease;
|
|
50
|
-
}
|
|
51
|
-
span.pulse-form-error {
|
|
52
|
-
color: #e55757;
|
|
53
|
-
font-size: var(--_text-size---body--s);
|
|
54
|
-
line-height: var(--_line-height---line-height-body--s);
|
|
55
|
-
font-weight: var(--_font-weight---font-weight-body--s);
|
|
56
|
-
letter-spacing: var(--_letter-spacing---letter-spacing-body--s);
|
|
57
|
-
}
|
|
58
|
-
.field-error {
|
|
59
|
-
color: #e55757;
|
|
60
|
-
font-size: 12px;
|
|
61
|
-
line-height: var(--_line-height---line-height-body--s);
|
|
62
|
-
font-weight: var(--_font-weight---font-weight-body--s);
|
|
63
|
-
letter-spacing: var(--_letter-spacing---letter-spacing-body--s);
|
|
64
|
-
position: absolute;
|
|
65
|
-
bottom: -22px;
|
|
66
|
-
}
|
|
67
|
-
[data-error-code=legal_required] {
|
|
68
|
-
bottom: -8px;
|
|
69
|
-
left: 28px;
|
|
70
|
-
}
|
|
71
|
-
[data-error-code=ERR_LEGAL_REQUIRED] {
|
|
72
|
-
padding-left: 18px;
|
|
73
|
-
}
|
|
74
|
-
[form-flow-active=false] {
|
|
75
|
-
display: none;
|
|
76
|
-
}
|
|
77
|
-
[form-flow-active=true] {
|
|
78
|
-
display: flex;
|
|
79
|
-
}
|
|
80
|
-
[fullwidth] {
|
|
81
|
-
width: 100%;
|
|
82
|
-
}
|
|
83
|
-
[hs-calender-active=true] {
|
|
84
|
-
display: block;
|
|
85
|
-
width: 100%;
|
|
86
|
-
}
|
|
87
|
-
[hs-calender-active=false] {
|
|
88
|
-
display: none;
|
|
89
|
-
}
|
|
90
|
-
div#iti-0__dropdown-content {
|
|
91
|
-
background-color: #121212;
|
|
92
|
-
border-color: #242424;
|
|
93
|
-
}
|
|
94
|
-
#iti-0__search-input {
|
|
95
|
-
background: #242424;
|
|
96
|
-
}
|
|
97
|
-
.iti__search-input-wrapper {
|
|
98
|
-
border-color: #242424;
|
|
99
|
-
}
|
|
100
|
-
iframe {
|
|
101
|
-
border: 1px solid transparent !important;
|
|
102
|
-
}
|
|
103
|
-
.w-form-done {
|
|
104
|
-
border: 1px solid transparent;
|
|
105
|
-
}
|
|
106
|
-
.hubspot-submitted-form {
|
|
107
|
-
display: none !important;
|
|
108
|
-
}
|
|
109
|
-
[hs-calender-block][hs-calender-block-active=false] {
|
|
110
|
-
display: none;
|
|
111
|
-
}
|
|
112
|
-
.step-2 {
|
|
113
|
-
display: none;
|
|
114
|
-
}
|
|
115
|
-
[data-action=back] {
|
|
116
|
-
display: none;
|
|
117
|
-
}
|
|
118
|
-
.is-iti-input-wrapper {
|
|
119
|
-
position: relative;
|
|
120
|
-
z-index: 2;
|
|
121
|
-
}
|
|
122
|
-
[hs-thankyou-block-active=true] {
|
|
123
|
-
display: flex;
|
|
124
|
-
}
|
|
125
|
-
[hs-thankyou-block-active=false] {
|
|
126
|
-
display: none;
|
|
127
|
-
}
|
|
128
|
-
[data-step-1-terms] {
|
|
129
|
-
display: block;
|
|
130
|
-
}
|
|
131
|
-
select {
|
|
132
|
-
appearance: none;
|
|
133
|
-
-webkit-appearance: none;
|
|
134
|
-
-moz-appearance: none;
|
|
135
|
-
background: none;
|
|
136
|
-
}
|
|
137
|
-
select::-ms-expand {
|
|
138
|
-
display: none;
|
|
139
|
-
}
|
|
140
|
-
/*# sourceMappingURL=styles.css.map */
|
|
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)}.field-error{color:#e55757;font-size:12px;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);position:absolute;bottom:-22px}[data-error-code=legal_required]{bottom:-8px;left:28px}[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}div#iti-0__dropdown-content{background-color:#121212;border-color:#242424}#iti-0__search-input{background:#242424}.iti__search-input-wrapper{border-color:#242424}iframe{border:1px solid transparent!important}.w-form-done{border:1px solid transparent}.hubspot-submitted-form{display:none!important}[hs-calender-block][hs-calender-block-active=false],.step-2,[data-action=back]{display:none}.is-iti-input-wrapper{position:relative;z-index:2}[hs-thankyou-block-active=true]{display:flex}[hs-thankyou-block-active=false]{display:none}[data-step-1-terms]{display:block}select{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:none}select::-ms-expand{display:none}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(()=>{(function(){"use strict";let o={utmKeys:["utm_source","utm_medium","utm_campaign","utm_term","utm_content","utm_id"],linkSelectors:["a[href]","button[onclick*='location']","button[onclick*='window.open']","button[onclick*='href']","[data-href]"],inputSelector:"[data-utm-input]",storageKey:"utm_params",inputKeyMap:{source:"utm_source",medium:"utm_medium",campaign:"utm_campaign",term:"utm_term",content:"utm_content",id:"utm_id",utm_source:"utm_source",utm_medium:"utm_medium",utm_campaign:"utm_campaign",utm_term:"utm_term",utm_content:"utm_content",utm_id:"utm_id"}};function d(){let t=new URLSearchParams(window.location.search),n={};return o.utmKeys.forEach(e=>{let r=t.get(e);r&&(n[e]=r)}),n}function l(t){try{sessionStorage.setItem(o.storageKey,JSON.stringify(t))}catch(n){console.warn("UTM: Could not write to sessionStorage",n)}}function h(){try{let t=sessionStorage.getItem(o.storageKey);return t?JSON.parse(t):{}}catch(t){return console.warn("UTM: Could not read from sessionStorage",t),{}}}function g(){let t=d(),e={...h(),...t};return Object.keys(e).length>0&&l(e),e}function p(t,n){try{return t.startsWith("/")||t.startsWith("./")||t.startsWith("../")?!0:/^[a-z]+:/i.test(t)&&!t.startsWith("http")?!1:t.startsWith("http")?new URL(t).hostname===n:t.startsWith("//")?new URL("https:"+t).hostname===n:!t.includes("://")}catch(e){return console.warn("UTM: Error parsing URL:",t,e),!1}}function T(t,n){try{let e=new URL(t,window.location.origin);return Object.entries(n).forEach(([r,s])=>{e.searchParams.has(r)||e.searchParams.set(r,s)}),e.toString()}catch(e){return console.warn("UTM: Error processing URL:",t,e),t}}function f(t){return t.getAttribute("data-utm-exception")==="true"}function c(t,n){if(f(t))return;let e=window.location.hostname,r=null;if(t instanceof HTMLAnchorElement&&t.href?r=t.href:t instanceof HTMLElement&&t.dataset.href&&(r=t.dataset.href),r&&p(r,e)){let s=T(r,n);t instanceof HTMLAnchorElement?t.href=s:t instanceof HTMLElement&&t.dataset.href&&(t.dataset.href=s)}}function M(t){document.querySelectorAll(o.linkSelectors.join(", ")).forEach(e=>c(e,t))}function u(t,n){if(f(t))return;let e=t.getAttribute("data-utm-input")?.trim().toLowerCase();if(!e)return;let r=o.inputKeyMap[e];if(!r){console.warn(`UTM: Unknown data-utm-input value "${e}"`);return}let s=n[r];s&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)&&(t.value=s,t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0})))}function U(t){document.querySelectorAll(o.inputSelector).forEach(e=>u(e,t))}function E(t){let n=[...o.linkSelectors,o.inputSelector].join(", "),e=null,r=[];function s(){let m=r.slice();r=[],e=null,m.forEach(i=>{i.matches&&i.matches(o.inputSelector)?u(i,t):i.matches&&i.matches(o.linkSelectors.join(", "))&&c(i,t),i.querySelectorAll?.(n).forEach(a=>{a.matches(o.inputSelector)?u(a,t):c(a,t)})})}new MutationObserver(m=>{m.forEach(i=>{i.addedNodes.forEach(a=>{a.nodeType===Node.ELEMENT_NODE&&r.push(a)})}),r.length>0&&!e&&(e=setTimeout(s,50))}).observe(document.body,{childList:!0,subtree:!0})}function S(){let t=g();if(Object.keys(t).length===0)return;let n=()=>{M(t),U(t),E(t),console.log("UTM: Propagated params:",t)};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n):n()}S()})();})();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/form/utm-propagation.ts"],
|
|
4
|
+
"sourcesContent": ["// UTM Parameter Propagation Script (TypeScript)\n// - Propagates UTM params to all internal links\n// - Fills input fields marked with data-utm-input attribute\n// - Stores UTM params in sessionStorage as fallback\n\ninterface UTMParams {\n [key: string]: string;\n}\n\ninterface UTMConfig {\n utmKeys: string[];\n linkSelectors: string[];\n inputSelector: string;\n storageKey: string;\n // Maps shorthand names (used in data-utm-input) to full UTM keys\n inputKeyMap: Record<string, string>;\n}\n\n(function (): void {\n \"use strict\";\n\n const config: UTMConfig = {\n utmKeys: [\n \"utm_source\",\n \"utm_medium\",\n \"utm_campaign\",\n \"utm_term\",\n \"utm_content\",\n \"utm_id\",\n ],\n linkSelectors: [\n \"a[href]\",\n \"button[onclick*='location']\",\n \"button[onclick*='window.open']\",\n \"button[onclick*='href']\",\n \"[data-href]\",\n ],\n inputSelector: \"[data-utm-input]\",\n storageKey: \"utm_params\",\n inputKeyMap: {\n source: \"utm_source\",\n medium: \"utm_medium\",\n campaign: \"utm_campaign\",\n term: \"utm_term\",\n content: \"utm_content\",\n id: \"utm_id\",\n // Also support full key names\n utm_source: \"utm_source\",\n utm_medium: \"utm_medium\",\n utm_campaign: \"utm_campaign\",\n utm_term: \"utm_term\",\n utm_content: \"utm_content\",\n utm_id: \"utm_id\",\n },\n };\n\n // \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 // UTM Param Retrieval (URL \u2192 sessionStorage fallback)\n // \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n function getUTMParamsFromURL(): UTMParams {\n const urlParams = new URLSearchParams(window.location.search);\n const utmParams: UTMParams = {};\n\n config.utmKeys.forEach((key) => {\n const value = urlParams.get(key);\n if (value) {\n utmParams[key] = value;\n }\n });\n\n return utmParams;\n }\n\n function storeUTMParams(params: UTMParams): void {\n try {\n sessionStorage.setItem(config.storageKey, JSON.stringify(params));\n } catch (e) {\n console.warn(\"UTM: Could not write to sessionStorage\", e);\n }\n }\n\n function getStoredUTMParams(): UTMParams {\n try {\n const stored = sessionStorage.getItem(config.storageKey);\n return stored ? JSON.parse(stored) : {};\n } catch (e) {\n console.warn(\"UTM: Could not read from sessionStorage\", e);\n return {};\n }\n }\n\n /**\n * Returns UTM params with priority: URL params > sessionStorage.\n * Merges both so fresh URL params override stale stored ones,\n * but stored ones survive across pages that strip query strings.\n */\n function getUTMParams(): UTMParams {\n const fromURL = getUTMParamsFromURL();\n const fromStorage = getStoredUTMParams();\n\n const merged: UTMParams = { ...fromStorage, ...fromURL };\n\n // Persist merged result so subsequent pages can pick them up\n if (Object.keys(merged).length > 0) {\n storeUTMParams(merged);\n }\n\n return merged;\n }\n\n // \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 // Link Processing\n // \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n function isInternalLink(url: string, currentHost: string): boolean {\n try {\n if (\n url.startsWith(\"/\") ||\n url.startsWith(\"./\") ||\n url.startsWith(\"../\")\n ) {\n return true;\n }\n\n // Skip non-http schemes (mailto:, tel:, javascript:, etc.)\n if (/^[a-z]+:/i.test(url) && !url.startsWith(\"http\")) {\n return false;\n }\n\n if (url.startsWith(\"http\")) {\n return new URL(url).hostname === currentHost;\n }\n\n if (url.startsWith(\"//\")) {\n return new URL(\"https:\" + url).hostname === currentHost;\n }\n\n // Relative paths without scheme\n if (!url.includes(\"://\")) {\n return true;\n }\n\n return false;\n } catch (e) {\n console.warn(\"UTM: Error parsing URL:\", url, e);\n return false; // Safer default \u2014 don't touch broken URLs\n }\n }\n\n function addUTMToURL(url: string, utmParams: UTMParams): string {\n try {\n const urlObj = new URL(url, window.location.origin);\n\n Object.entries(utmParams).forEach(([key, value]) => {\n if (!urlObj.searchParams.has(key)) {\n urlObj.searchParams.set(key, value);\n }\n });\n\n return urlObj.toString();\n } catch (e) {\n console.warn(\"UTM: Error processing URL:\", url, e);\n return url;\n }\n }\n\n function hasUTMException(element: Element): boolean {\n return element.getAttribute(\"data-utm-exception\") === \"true\";\n }\n\n function processLink(element: Element, utmParams: UTMParams): void {\n if (hasUTMException(element)) return;\n\n const currentHost = window.location.hostname;\n let url: string | null = null;\n\n if (element instanceof HTMLAnchorElement && element.href) {\n url = element.href;\n } else if (element instanceof HTMLElement && element.dataset.href) {\n url = element.dataset.href;\n }\n\n if (url && isInternalLink(url, currentHost)) {\n const updatedURL = addUTMToURL(url, utmParams);\n\n if (element instanceof HTMLAnchorElement) {\n element.href = updatedURL;\n } else if (element instanceof HTMLElement && element.dataset.href) {\n element.dataset.href = updatedURL;\n }\n }\n }\n\n function processAllLinks(utmParams: UTMParams): void {\n const links = document.querySelectorAll(config.linkSelectors.join(\", \"));\n links.forEach((el) => processLink(el, utmParams));\n }\n\n // \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 // Input Field Processing\n // \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n /**\n * Fills an input/textarea/select that has data-utm-input=\"<key>\"\n *\n * Usage examples:\n * <input type=\"hidden\" data-utm-input=\"source\" />\n * <input type=\"hidden\" data-utm-input=\"medium\" />\n * <input type=\"hidden\" data-utm-input=\"campaign\" />\n * <input type=\"hidden\" data-utm-input=\"term\" />\n * <input type=\"hidden\" data-utm-input=\"content\" />\n * <input type=\"hidden\" data-utm-input=\"id\" />\n *\n * Also accepts full names: data-utm-input=\"utm_source\"\n */\n function processInput(element: Element, utmParams: UTMParams): void {\n if (hasUTMException(element)) return;\n\n const shortKey = element.getAttribute(\"data-utm-input\")?.trim().toLowerCase();\n if (!shortKey) return;\n\n // Resolve shorthand \u2192 full UTM key\n const fullKey = config.inputKeyMap[shortKey];\n if (!fullKey) {\n console.warn(`UTM: Unknown data-utm-input value \"${shortKey}\"`);\n return;\n }\n\n const value = utmParams[fullKey];\n if (!value) return;\n\n // Support input, textarea, and select elements\n if (\n element instanceof HTMLInputElement ||\n element instanceof HTMLTextAreaElement ||\n element instanceof HTMLSelectElement\n ) {\n element.value = value;\n\n // Dispatch events so frameworks (React, Vue, etc.) pick up the change\n element.dispatchEvent(new Event(\"input\", { bubbles: true }));\n element.dispatchEvent(new Event(\"change\", { bubbles: true }));\n }\n }\n\n function processAllInputs(utmParams: UTMParams): void {\n const inputs = document.querySelectorAll(config.inputSelector);\n inputs.forEach((el) => processInput(el, utmParams));\n }\n\n // \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 // MutationObserver (handles dynamic content)\n // \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n function observeNewContent(utmParams: UTMParams): void {\n const allSelectors = [\n ...config.linkSelectors,\n config.inputSelector,\n ].join(\", \");\n\n let debounceTimer: ReturnType<typeof setTimeout> | null = null;\n let pendingNodes: Element[] = [];\n\n function flushPending(): void {\n const nodes = pendingNodes.slice();\n pendingNodes = [];\n debounceTimer = null;\n\n nodes.forEach((element) => {\n if (element.matches && element.matches(config.inputSelector)) {\n processInput(element, utmParams);\n } else if (\n element.matches &&\n element.matches(config.linkSelectors.join(\", \"))\n ) {\n processLink(element, utmParams);\n }\n\n // Also check children\n element\n .querySelectorAll?.(allSelectors)\n .forEach((child) => {\n if (child.matches(config.inputSelector)) {\n processInput(child, utmParams);\n } else {\n processLink(child, utmParams);\n }\n });\n });\n }\n\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n mutation.addedNodes.forEach((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n pendingNodes.push(node as Element);\n }\n });\n });\n\n // Debounce to batch rapid DOM changes\n if (pendingNodes.length > 0 && !debounceTimer) {\n debounceTimer = setTimeout(flushPending, 50);\n }\n });\n\n observer.observe(document.body, {\n childList: true,\n subtree: true,\n });\n }\n\n // \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 // Init\n // \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n function init(): void {\n const utmParams = getUTMParams();\n\n if (Object.keys(utmParams).length === 0) return;\n\n const run = (): void => {\n processAllLinks(utmParams);\n processAllInputs(utmParams);\n observeNewContent(utmParams);\n console.log(\"UTM: Propagated params:\", utmParams);\n };\n\n if (document.readyState === \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", run);\n } else {\n run();\n }\n }\n\n init();\n})();"],
|
|
5
|
+
"mappings": ";;;AAkBA,GAAC,WAAkB;AACf;AAEA,UAAM,SAAoB;AAAA,MACtB,SAAS;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACJ;AAAA,MACA,eAAe;AAAA,QACX;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACJ;AAAA,MACA,eAAe;AAAA,MACf,YAAY;AAAA,MACZ,aAAa;AAAA,QACT,QAAQ;AAAA,QACR,QAAQ;AAA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A2B,SAAS;AAAA,MACpD;AAEA,UAAI,SAAS,eAAe,WAAW;AACnC,iBAAS,iBAAiB,oBAAoB,GAAG;AAAA,MACrD,OAAO;AACH,YAAI;AAAA,MACR;AAAA,IACJ;AAEA,SAAK;AAAA,EACT,GAAG;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,262 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
(() => {
|
|
3
|
-
// src/global/accordions-v2.ts
|
|
4
|
-
document.addEventListener("DOMContentLoaded", () => {
|
|
5
|
-
const faqWrappers = document.querySelectorAll(
|
|
6
|
-
'[pulse-faq-element="wrapper"]'
|
|
7
|
-
);
|
|
8
|
-
faqWrappers.forEach((wrapper) => {
|
|
9
|
-
const toggle = wrapper.querySelector(
|
|
10
|
-
'[pulse-faq-element="toggle"]'
|
|
11
|
-
);
|
|
12
|
-
const content = wrapper.querySelector(
|
|
13
|
-
'[pulse-faq-element="content"]'
|
|
14
|
-
);
|
|
15
|
-
const contentInner = wrapper.querySelector(
|
|
16
|
-
'[pulse-faq-element="content-inner"]'
|
|
17
|
-
);
|
|
18
|
-
const xLine = wrapper.querySelector(
|
|
19
|
-
'[pulse-faq-element="x-line"]'
|
|
20
|
-
);
|
|
21
|
-
const yLine = wrapper.querySelector(
|
|
22
|
-
'[pulse-faq-element="y-line"]'
|
|
23
|
-
);
|
|
24
|
-
if (xLine) gsap.set(xLine, { rotation: 0 });
|
|
25
|
-
if (yLine) gsap.set(yLine, { rotation: 0 });
|
|
26
|
-
if (!toggle || !content || !contentInner) return;
|
|
27
|
-
const groupContainer = wrapper.closest("[pulse-faq-group]");
|
|
28
|
-
const groupName = groupContainer?.getAttribute("pulse-faq-group") || null;
|
|
29
|
-
const faqType = groupContainer?.getAttribute("pulse-faq-type") || "one-at-a-time";
|
|
30
|
-
if (wrapper.getAttribute("pulse-faq-initialopen") === "true") {
|
|
31
|
-
gsap.set(content, { height: "auto", overflow: "hidden" });
|
|
32
|
-
gsap.set(contentInner, { opacity: 1 });
|
|
33
|
-
toggle.setAttribute("data-state", "open");
|
|
34
|
-
const xLine2 = wrapper.querySelector(
|
|
35
|
-
'[pulse-faq-element="x-line"]'
|
|
36
|
-
);
|
|
37
|
-
const yLine2 = wrapper.querySelector(
|
|
38
|
-
'[pulse-faq-element="y-line"]'
|
|
39
|
-
);
|
|
40
|
-
if (xLine2) gsap.set(xLine2, { rotation: 180 });
|
|
41
|
-
if (yLine2) gsap.set(yLine2, { rotation: 270 });
|
|
42
|
-
updateFaqGroupText(wrapper, groupName);
|
|
43
|
-
updateFaqGroupButton(wrapper, groupName);
|
|
44
|
-
} else {
|
|
45
|
-
gsap.set(content, { height: 0 });
|
|
46
|
-
gsap.set(contentInner, { opacity: 0 });
|
|
47
|
-
toggle.setAttribute("data-state", "closed");
|
|
48
|
-
}
|
|
49
|
-
let isAnimating = false;
|
|
50
|
-
toggle.addEventListener("click", () => {
|
|
51
|
-
if (isAnimating) return;
|
|
52
|
-
isAnimating = true;
|
|
53
|
-
const isOpen = toggle.getAttribute("data-state") === "open";
|
|
54
|
-
if (faqType === "one-at-a-time" && groupContainer) {
|
|
55
|
-
const openFAQs = groupContainer.querySelectorAll(
|
|
56
|
-
'[pulse-faq-element="wrapper"] [data-state="open"]'
|
|
57
|
-
);
|
|
58
|
-
if (isOpen && openFAQs.length === 1) {
|
|
59
|
-
isAnimating = false;
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (isOpen) {
|
|
64
|
-
closeAccordion(wrapper, () => {
|
|
65
|
-
isAnimating = false;
|
|
66
|
-
});
|
|
67
|
-
} else {
|
|
68
|
-
if (faqType === "one-at-a-time" && groupContainer) {
|
|
69
|
-
closeOtherAccordions(groupContainer);
|
|
70
|
-
}
|
|
71
|
-
openAccordion(wrapper, groupName, () => {
|
|
72
|
-
isAnimating = false;
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
handleRatioHeights();
|
|
78
|
-
});
|
|
79
|
-
window.addEventListener("resize", () => {
|
|
80
|
-
handleRatioHeights();
|
|
81
|
-
});
|
|
82
|
-
function handleRatioHeights() {
|
|
83
|
-
if (window.innerWidth < 992) return;
|
|
84
|
-
document.querySelectorAll("[pulse-faq-image-target]").forEach((imageTarget) => {
|
|
85
|
-
const wrapper = imageTarget.parentElement;
|
|
86
|
-
if (!wrapper) return;
|
|
87
|
-
if (wrapper.getAttribute("ratio-height") !== "true") return;
|
|
88
|
-
wrapper.style.height = "auto";
|
|
89
|
-
requestAnimationFrame(() => {
|
|
90
|
-
wrapper.style.height = `${wrapper.offsetHeight}px`;
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
document.querySelectorAll('[pulse-faq-tabgroup][ratio-height="true"]').forEach((tabGroup) => {
|
|
94
|
-
tabGroup.style.height = "auto";
|
|
95
|
-
requestAnimationFrame(() => {
|
|
96
|
-
tabGroup.style.height = `${tabGroup.offsetHeight}px`;
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
function openAccordion(wrapper, groupName, callback) {
|
|
101
|
-
const toggle = wrapper.querySelector(
|
|
102
|
-
'[pulse-faq-element="toggle"]'
|
|
103
|
-
);
|
|
104
|
-
const content = wrapper.querySelector(
|
|
105
|
-
'[pulse-faq-element="content"]'
|
|
106
|
-
);
|
|
107
|
-
const contentInner = wrapper.querySelector(
|
|
108
|
-
'[pulse-faq-element="content-inner"]'
|
|
109
|
-
);
|
|
110
|
-
const xLine = wrapper.querySelector(
|
|
111
|
-
'[pulse-faq-element="x-line"]'
|
|
112
|
-
);
|
|
113
|
-
const yLine = wrapper.querySelector(
|
|
114
|
-
'[pulse-faq-element="y-line"]'
|
|
115
|
-
);
|
|
116
|
-
if (!toggle || !content || !contentInner || !xLine || !yLine) return;
|
|
117
|
-
content.gsapAnimation?.kill();
|
|
118
|
-
const timeline = gsap.timeline({
|
|
119
|
-
onComplete: () => {
|
|
120
|
-
callback?.();
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
gsap.set(content, { height: "auto", visibility: "hidden", opacity: 0 });
|
|
124
|
-
const height = content.offsetHeight;
|
|
125
|
-
gsap.set(content, { height: 0, visibility: "visible", opacity: 1 });
|
|
126
|
-
if (xLine) {
|
|
127
|
-
gsap.to(xLine, {
|
|
128
|
-
rotation: 180,
|
|
129
|
-
duration: 0.4,
|
|
130
|
-
ease: "power2.inOut"
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
if (yLine) {
|
|
134
|
-
gsap.to(yLine, {
|
|
135
|
-
rotation: 270,
|
|
136
|
-
duration: 0.4,
|
|
137
|
-
ease: "power2.inOut"
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
timeline.to(content, {
|
|
141
|
-
height,
|
|
142
|
-
duration: 0.5,
|
|
143
|
-
ease: "power3.inOut",
|
|
144
|
-
clearProps: "height",
|
|
145
|
-
onComplete: () => {
|
|
146
|
-
content.style.height = "auto";
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
timeline.to(
|
|
150
|
-
contentInner,
|
|
151
|
-
{ opacity: 1, duration: 0.4, ease: "power2.out" },
|
|
152
|
-
"-=0.35"
|
|
153
|
-
);
|
|
154
|
-
content.gsapAnimation = timeline;
|
|
155
|
-
toggle.setAttribute("data-state", "open");
|
|
156
|
-
const icon = toggle.querySelector(
|
|
157
|
-
'[pulse-faq-element="chevron"]'
|
|
158
|
-
);
|
|
159
|
-
if (icon) {
|
|
160
|
-
gsap.to(icon, { rotation: 180, duration: 0.4, ease: "back.out(1.7)" });
|
|
161
|
-
}
|
|
162
|
-
updateFaqGroupText(wrapper, groupName);
|
|
163
|
-
updateFaqGroupButton(wrapper, groupName);
|
|
164
|
-
}
|
|
165
|
-
function closeAccordion(wrapper, callback) {
|
|
166
|
-
const toggle = wrapper.querySelector(
|
|
167
|
-
'[pulse-faq-element="toggle"]'
|
|
168
|
-
);
|
|
169
|
-
const content = wrapper.querySelector(
|
|
170
|
-
'[pulse-faq-element="content"]'
|
|
171
|
-
);
|
|
172
|
-
const contentInner = wrapper.querySelector(
|
|
173
|
-
'[pulse-faq-element="content-inner"]'
|
|
174
|
-
);
|
|
175
|
-
const xLine = wrapper.querySelector(
|
|
176
|
-
'[pulse-faq-element="x-line"]'
|
|
177
|
-
);
|
|
178
|
-
const yLine = wrapper.querySelector(
|
|
179
|
-
'[pulse-faq-element="y-line"]'
|
|
180
|
-
);
|
|
181
|
-
if (!toggle || !content || !contentInner || !xLine || !yLine) return;
|
|
182
|
-
if (xLine) {
|
|
183
|
-
gsap.to(xLine, {
|
|
184
|
-
rotation: 0,
|
|
185
|
-
duration: 0.4,
|
|
186
|
-
ease: "power2.inOut"
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
if (yLine) {
|
|
190
|
-
gsap.to(yLine, {
|
|
191
|
-
rotation: 0,
|
|
192
|
-
duration: 0.4,
|
|
193
|
-
ease: "power2.inOut"
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
content.gsapAnimation?.kill();
|
|
197
|
-
const timeline = gsap.timeline({
|
|
198
|
-
onComplete: () => {
|
|
199
|
-
callback?.();
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
timeline.to(contentInner, { opacity: 0, duration: 0.3, ease: "power2.in" });
|
|
203
|
-
timeline.to(
|
|
204
|
-
content,
|
|
205
|
-
{ height: 0, duration: 0.4, ease: "power3.inOut" },
|
|
206
|
-
"-=0.25"
|
|
207
|
-
);
|
|
208
|
-
content.gsapAnimation = timeline;
|
|
209
|
-
toggle.setAttribute("data-state", "closed");
|
|
210
|
-
const icon = toggle.querySelector(
|
|
211
|
-
'[pulse-faq-element="chevron"]'
|
|
212
|
-
);
|
|
213
|
-
if (icon) {
|
|
214
|
-
gsap.to(icon, { rotation: 0, duration: 0.4, ease: "back.out(1.7)" });
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
function closeOtherAccordions(groupContainer) {
|
|
218
|
-
groupContainer.querySelectorAll(
|
|
219
|
-
'[pulse-faq-element="wrapper"] [data-state="open"]'
|
|
220
|
-
).forEach((openToggle) => {
|
|
221
|
-
const wrapper = openToggle.closest(
|
|
222
|
-
'[pulse-faq-element="wrapper"]'
|
|
223
|
-
);
|
|
224
|
-
if (wrapper) closeAccordion(wrapper);
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
function updateFaqGroupText(wrapper, groupName) {
|
|
228
|
-
if (!groupName) return;
|
|
229
|
-
const groupText = document.querySelector(
|
|
230
|
-
`[pulse-faq-text-target="${groupName}"]`
|
|
231
|
-
);
|
|
232
|
-
const textSource = wrapper.querySelector(
|
|
233
|
-
"[pulse-faq-text-source]"
|
|
234
|
-
);
|
|
235
|
-
if (groupText && textSource) {
|
|
236
|
-
groupText.textContent = textSource.textContent;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
function updateFaqGroupButton(wrapper, groupName) {
|
|
240
|
-
if (!groupName) return;
|
|
241
|
-
const buttonTextTarget = document.querySelector(
|
|
242
|
-
`[pulse-faq-button-text-target="${groupName}"]`
|
|
243
|
-
);
|
|
244
|
-
const buttonLinkTarget = document.querySelector(
|
|
245
|
-
`[pulse-faq-button-link-target="${groupName}"]`
|
|
246
|
-
);
|
|
247
|
-
const linkSource = wrapper.querySelector(
|
|
248
|
-
"[pulse-faq-link-source]"
|
|
249
|
-
);
|
|
250
|
-
if (!linkSource) return;
|
|
251
|
-
if (buttonTextTarget) {
|
|
252
|
-
buttonTextTarget.textContent = linkSource.textContent;
|
|
253
|
-
}
|
|
254
|
-
if (buttonLinkTarget) {
|
|
255
|
-
for (let i = 0; i < linkSource.attributes.length; i++) {
|
|
256
|
-
const attr = linkSource.attributes[i];
|
|
257
|
-
buttonLinkTarget.setAttribute(attr.name, attr.value);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
})();
|
|
262
|
-
//# sourceMappingURL=accordions-v2.js.map
|
|
1
|
+
"use strict";(()=>{document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll('[pulse-faq-element="wrapper"]').forEach(e=>{let n=e.querySelector('[pulse-faq-element="toggle"]'),i=e.querySelector('[pulse-faq-element="content"]'),o=e.querySelector('[pulse-faq-element="content-inner"]'),s=e.querySelector('[pulse-faq-element="x-line"]'),a=e.querySelector('[pulse-faq-element="y-line"]');if(s&&gsap.set(s,{rotation:0}),a&&gsap.set(a,{rotation:0}),!n||!i||!o)return;let l=e.closest("[pulse-faq-group]"),u=l?.getAttribute("pulse-faq-group")||null,f=l?.getAttribute("pulse-faq-type")||"one-at-a-time";if(e.getAttribute("pulse-faq-initialopen")==="true"){gsap.set(i,{height:"auto",overflow:"hidden"}),gsap.set(o,{opacity:1}),n.setAttribute("data-state","open");let c=e.querySelector('[pulse-faq-element="x-line"]'),m=e.querySelector('[pulse-faq-element="y-line"]');c&&gsap.set(c,{rotation:180}),m&&gsap.set(m,{rotation:270}),q(e,u),p(e,u)}else gsap.set(i,{height:0}),gsap.set(o,{opacity:0}),n.setAttribute("data-state","closed");let r=!1;n.addEventListener("click",()=>{if(r)return;r=!0;let c=n.getAttribute("data-state")==="open";if(f==="one-at-a-time"&&l){let m=l.querySelectorAll('[pulse-faq-element="wrapper"] [data-state="open"]');if(c&&m.length===1){r=!1;return}}c?d(e,()=>{r=!1}):(f==="one-at-a-time"&&l&&L(l),y(e,u,()=>{r=!1}))})}),g()});window.addEventListener("resize",()=>{g()});function g(){window.innerWidth<992||(document.querySelectorAll("[pulse-faq-image-target]").forEach(t=>{let e=t.parentElement;e&&e.getAttribute("ratio-height")==="true"&&(e.style.height="auto",requestAnimationFrame(()=>{e.style.height=`${e.offsetHeight}px`}))}),document.querySelectorAll('[pulse-faq-tabgroup][ratio-height="true"]').forEach(t=>{t.style.height="auto",requestAnimationFrame(()=>{t.style.height=`${t.offsetHeight}px`})}))}function y(t,e,n){let i=t.querySelector('[pulse-faq-element="toggle"]'),o=t.querySelector('[pulse-faq-element="content"]'),s=t.querySelector('[pulse-faq-element="content-inner"]'),a=t.querySelector('[pulse-faq-element="x-line"]'),l=t.querySelector('[pulse-faq-element="y-line"]');if(!i||!o||!s||!a||!l)return;o.gsapAnimation?.kill();let u=gsap.timeline({onComplete:()=>{n?.()}});gsap.set(o,{height:"auto",visibility:"hidden",opacity:0});let f=o.offsetHeight;gsap.set(o,{height:0,visibility:"visible",opacity:1}),a&&gsap.to(a,{rotation:180,duration:.4,ease:"power2.inOut"}),l&&gsap.to(l,{rotation:270,duration:.4,ease:"power2.inOut"}),u.to(o,{height:f,duration:.5,ease:"power3.inOut",clearProps:"height",onComplete:()=>{o.style.height="auto"}}),u.to(s,{opacity:1,duration:.4,ease:"power2.out"},"-=0.35"),o.gsapAnimation=u,i.setAttribute("data-state","open");let r=i.querySelector('[pulse-faq-element="chevron"]');r&&gsap.to(r,{rotation:180,duration:.4,ease:"back.out(1.7)"}),q(t,e),p(t,e)}function d(t,e){let n=t.querySelector('[pulse-faq-element="toggle"]'),i=t.querySelector('[pulse-faq-element="content"]'),o=t.querySelector('[pulse-faq-element="content-inner"]'),s=t.querySelector('[pulse-faq-element="x-line"]'),a=t.querySelector('[pulse-faq-element="y-line"]');if(!n||!i||!o||!s||!a)return;s&&gsap.to(s,{rotation:0,duration:.4,ease:"power2.inOut"}),a&&gsap.to(a,{rotation:0,duration:.4,ease:"power2.inOut"}),i.gsapAnimation?.kill();let l=gsap.timeline({onComplete:()=>{e?.()}});l.to(o,{opacity:0,duration:.3,ease:"power2.in"}),l.to(i,{height:0,duration:.4,ease:"power3.inOut"},"-=0.25"),i.gsapAnimation=l,n.setAttribute("data-state","closed");let u=n.querySelector('[pulse-faq-element="chevron"]');u&&gsap.to(u,{rotation:0,duration:.4,ease:"back.out(1.7)"})}function L(t){t.querySelectorAll('[pulse-faq-element="wrapper"] [data-state="open"]').forEach(e=>{let n=e.closest('[pulse-faq-element="wrapper"]');n&&d(n)})}function q(t,e){if(!e)return;let n=document.querySelector(`[pulse-faq-text-target="${e}"]`),i=t.querySelector("[pulse-faq-text-source]");n&&i&&(n.textContent=i.textContent)}function p(t,e){if(!e)return;let n=document.querySelector(`[pulse-faq-button-text-target="${e}"]`),i=document.querySelector(`[pulse-faq-button-link-target="${e}"]`),o=t.querySelector("[pulse-faq-link-source]");if(o&&(n&&(n.textContent=o.textContent),i))for(let s=0;s<o.attributes.length;s++){let a=o.attributes[s];i.setAttribute(a.name,a.value)}}})();
|